/* Romei.ai — site styles */

/* ---------- Tokens ---------- */
:root {
  --paper: #F4F0E7;
  --paper-2: #ECE7DB;
  --card: #FBF9F4;
  --ink: #111916;
  --ink-2: #414B46;
  --ink-3: #5F6964;
  --line: rgba(17, 25, 22, .14);
  --line-strong: rgba(17, 25, 22, .8);
  --green: #1D4B3D;
  --signal: #D4532A;
  --sage: #DCE6D4;
  --blush: #F3DED0;
  --mist: #D6E3E8;

  --on-dark: #F4F0E7;
  --on-dark-2: rgba(244, 240, 231, .78);
  --on-dark-3: rgba(244, 240, 231, .58);
  --line-dark: rgba(244, 240, 231, .18);

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  text-decoration: none;
  transition: top .15s;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 240, 231, .86);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -.01em;
}
.brand-tld { color: var(--ink-3); }

.nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
}
.nav a {
  position: relative;
  padding: 6px 0;
  font-size: .95rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s;
}
.nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
.nav .nav-cta { display: none; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 10px 14px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
}
.menu-toggle-icon {
  position: relative;
  width: 14px;
  height: 8px;
}
.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform .25s var(--ease), top .25s var(--ease);
}
.menu-toggle-icon::before { top: 0; }
.menu-toggle-icon::after { top: 6.5px; }
.menu-toggle.is-open .menu-toggle-icon::before { top: 3.25px; transform: rotate(45deg); }
.menu-toggle.is-open .menu-toggle-icon::after { top: 3.25px; transform: rotate(-45deg); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 500 .98rem/1 var(--sans);
  text-decoration: none;
  transition: background .2s, color .2s, transform .15s;
}
.btn:hover { background: var(--green); }
.btn:active { transform: translateY(1px); }
.btn--small { padding: 12px 18px; font-size: .9rem; }

.link-arrow {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 500;
  text-decoration: none;
}
.link-arrow span {
  display: inline-block;
  transition: transform .25s var(--ease);
}
.link-arrow:hover span { transform: translateX(4px); }

/* ---------- Shared type ---------- */
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font: 500 .76rem/1 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.kicker span {
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
}

h2 {
  font-size: clamp(2.2rem, 4.6vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.section { padding: clamp(72px, 10vw, 136px) 0; }
.section--rule { border-top: 1px solid var(--line); }

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-intro {
  margin-top: 20px;
  max-width: 36em;
  font-size: 1.1rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(44px, 7.5vw, 104px) 0 clamp(60px, 8vw, 108px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font: 500 .78rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
}

h1 {
  font-size: clamp(2.85rem, 6.3vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.022em;
  text-wrap: balance;
}
h1 em { font-style: italic; color: var(--green); }

.lede {
  margin-top: 28px;
  max-width: 34em;
  font-size: clamp(1.06rem, 1.3vw, 1.2rem);
  color: var(--ink-2);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 36px;
}

/* Brand facts panel */
.facts {
  justify-self: end;
  width: 100%;
  max-width: 420px;
  rotate: 1.4deg;
}
.facts-inner {
  padding: 18px 20px 20px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 10px 10px 0 rgba(17, 25, 22, .09);
}
.facts-title {
  padding-bottom: 10px;
  border-bottom: 7px solid var(--ink);
  font: 400 2.7rem/1 var(--serif);
  letter-spacing: -.01em;
}
.facts-sub {
  padding: 11px 0;
  border-bottom: 1.5px solid var(--ink);
  font: 500 .72rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.facts-rows li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.facts-rows li:last-child { border-bottom: 4px solid var(--ink); }
.facts-n { font: 500 .72rem/1 var(--mono); color: var(--ink-3); }
.facts-t { font-size: .98rem; font-weight: 600; line-height: 1.3; }
.facts-r { font: 400 .72rem/1 var(--mono); color: var(--ink-2); white-space: nowrap; }

.facts-meta div {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
  line-height: 1.45;
}
.facts-meta div:last-child { padding-bottom: 0; border-bottom: 0; }
.facts-meta dt { font-weight: 600; }
.facts-meta dd { color: var(--ink-2); }

/* Hero entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.hero-copy > * { animation: rise .9s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .14s; }
.hero-copy > :nth-child(4) { animation-delay: .22s; }
.facts { animation: rise 1s var(--ease) .28s both; }

/* ---------- Ticker ---------- */
.ticker {
  display: flex;
  align-items: stretch;
  border-block: 1px solid var(--line);
  overflow: hidden;
}
.ticker-label {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  border-right: 1px solid var(--line);
  font: 500 .72rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ticker-viewport {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.ticker-track {
  display: flex;
  flex: none;
  animation: ticker 52s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track li {
  position: relative;
  padding: 19px 28px;
  font: 400 .82rem/1 var(--mono);
  color: var(--ink-2);
  white-space: nowrap;
}
.ticker-track li::after {
  content: "";
  position: absolute;
  right: -2.5px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--signal);
}
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- Thesis ---------- */
.thesis { padding: clamp(72px, 11vw, 150px) 0 clamp(40px, 6vw, 72px); }
.thesis-text {
  max-width: 21em;
  font: 400 clamp(1.9rem, 4.1vw, 3.5rem)/1.12 var(--serif);
  letter-spacing: -.015em;
  text-wrap: balance;
}
.thesis-text em { color: var(--green); }

/* ---------- Sectors ---------- */
.sectors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.sector {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 14px;
  border-radius: 20px;
}
.sector--chem { background: var(--sage); }
.sector--baby { background: var(--blush); }
.sector--med { background: var(--mist); }

.sector-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tag {
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 500 .7rem/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.sector-n { font: 400 .8rem/1 var(--mono); color: var(--ink-2); }

.glyph {
  width: 76px;
  height: 76px;
  margin: 44px 0 28px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .5s var(--ease);
}
.sector:hover .glyph { transform: translateY(-4px) rotate(-4deg); }

.sector h3 {
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: -.012em;
}
.sector p {
  margin-top: 14px;
  padding-bottom: 28px;
  font-size: .98rem;
  color: var(--ink-2);
  text-wrap: pretty;
}
.sector-list { margin-top: auto; }
.sector-list li {
  padding: 12px 0;
  border-top: 1px solid rgba(17, 25, 22, .2);
  font-size: .92rem;
  font-weight: 500;
}

/* ---------- Approach ---------- */
.approach {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 7vw, 110px);
  align-items: start;
}
.section-head--sticky {
  position: sticky;
  top: 112px;
  margin-bottom: 0;
}
.step {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step-n {
  font: 400 3.3rem/.9 var(--serif);
  color: var(--green);
}
.step h3 { font-size: 1.75rem; line-height: 1.1; }
.step p { margin-top: 8px; color: var(--ink-2); text-wrap: pretty; }

/* ---------- Founders ---------- */
.founders { background: var(--green); color: var(--on-dark); }
.founders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.founders .section-intro { color: var(--on-dark-2); }
.founders .btn {
  margin-top: 34px;
  background: var(--paper);
  color: var(--ink);
}
.founders .btn:hover { background: #fff; }

.criteria {
  padding: 28px 28px 10px;
  border: 1px solid rgba(244, 240, 231, .26);
  border-radius: 20px;
  background: rgba(244, 240, 231, .05);
}
.criteria-title {
  margin-bottom: 8px;
  font: 500 .76rem/1 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--on-dark-2);
}
.criteria-list li {
  position: relative;
  padding: 18px 0 18px 38px;
  border-top: 1px solid var(--line-dark);
  font-size: 1.02rem;
  line-height: 1.45;
}
.criteria-list li:first-child { border-top: 0; }
.criteria-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(244, 240, 231, .6);
  border-radius: 50%;
  background: no-repeat center / 11px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.3l2.7 2.7L10 3.5' fill='none' stroke='%23F4F0E7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Kickers and focus on dark surfaces */
.founders .kicker,
.contact .kicker { color: var(--on-dark-2); }
.founders .kicker span,
.contact .kicker span { border-color: rgba(244, 240, 231, .5); color: var(--on-dark); }
.founders :focus-visible,
.contact :focus-visible,
.site-footer :focus-visible { outline-color: var(--on-dark); }

/* ---------- Principles ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  counter-reset: principle;
}
.principle {
  padding: 34px 40px 40px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: principle;
}
.principle:nth-child(odd) { border-right: 1px solid var(--line); }
.principle:nth-child(even) { padding-left: 40px; padding-right: 0; }
.principle::before {
  content: counter(principle, lower-roman) ".";
  display: block;
  margin-bottom: 20px;
  font: 500 .8rem/1 var(--mono);
  color: var(--ink-3);
}
.principle h3 { font-size: 1.95rem; line-height: 1.08; letter-spacing: -.01em; }
.principle p { margin-top: 12px; max-width: 30em; color: var(--ink-2); text-wrap: pretty; }

/* ---------- Contact ---------- */
.contact {
  padding: clamp(80px, 12vw, 160px) 0 clamp(64px, 9vw, 120px);
  background: var(--ink);
  color: var(--on-dark);
}
.contact h2 {
  font-size: clamp(3rem, 8.5vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.025em;
}
.contact-intro {
  margin-top: 26px;
  max-width: 32em;
  font-size: 1.15rem;
  color: var(--on-dark-2);
}
.contact-email {
  display: inline-flex;
  align-items: baseline;
  gap: .3em;
  margin-top: 44px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(244, 240, 231, .45);
  font: 400 clamp(1.7rem, 4.4vw, 3.4rem)/1.1 var(--serif);
  color: var(--on-dark);
  text-decoration: none;
  transition: border-color .2s;
}
.contact-email:hover { border-bottom-color: var(--on-dark); }
.contact-email span {
  display: inline-block;
  font-size: .7em;
  transition: transform .25s var(--ease);
}
.contact-email:hover span { transform: translate(3px, -3px); }

/* ---------- Footer ---------- */
.site-footer {
  padding-bottom: 40px;
  background: var(--ink);
  color: var(--on-dark-2);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 48px;
  align-items: start;
  padding-top: 36px;
  border-top: 1px solid var(--line-dark);
}
.footer-brand .brand-name { color: var(--on-dark); }
.footer-brand .brand-tld { color: var(--on-dark-3); }
.footer-brand p { margin-top: 10px; font-size: .92rem; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding-top: 6px;
}
.footer-nav a {
  font-size: .92rem;
  text-decoration: none;
  transition: color .2s;
}
.footer-nav a:hover { color: var(--on-dark); }
.legal {
  grid-column: 1 / -1;
  max-width: 62em;
  margin-top: 16px;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--on-dark-3);
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].pre-reveal {
  opacity: 0;
  transform: translateY(20px);
}
.sectors > :nth-child(2),
.principles > :nth-child(2) { transition-delay: .08s; }
.sectors > :nth-child(3) { transition-delay: .16s; }

/* ---------- Error page ---------- */
.error-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
  padding: 64px 0;
}
.error-page .wrap { max-width: 720px; }
.error-page h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); }
.error-page p { margin-top: 22px; color: var(--ink-2); font-size: 1.1rem; }
.error-page .btn { margin-top: 34px; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .facts { justify-self: start; max-width: 440px; rotate: .8deg; }
}

@media (max-width: 920px) {
  .sectors { grid-template-columns: 1fr; }
  .glyph { width: 64px; height: 64px; margin: 32px 0 22px; }
  .approach { grid-template-columns: 1fr; }
  .section-head--sticky { position: static; margin-bottom: 28px; }
  .founders-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 4px var(--gutter) 22px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(17, 25, 22, .25);
  }
  .nav.is-open { display: flex; }
  .nav a {
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--serif);
    font-size: 1.7rem;
    line-height: 1.1;
    color: var(--ink);
  }
  .nav a::after { display: none; }
  .nav .nav-cta { display: block; border-bottom: 0; color: var(--green); }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .header-inner { height: 64px; }
  html { scroll-padding-top: 76px; }

  .ticker { flex-direction: column; }
  .ticker-label {
    padding: 14px var(--gutter) 0;
    border-right: 0;
  }
  .ticker-track li { padding: 14px 22px 18px; }

  .facts { rotate: none; }
  .facts-inner { box-shadow: 6px 6px 0 rgba(17, 25, 22, .09); }
  .facts-title { font-size: 2.3rem; }
  .facts-meta div { grid-template-columns: 8.5em 1fr; }

  .step { grid-template-columns: 48px 1fr; gap: 14px; padding: 26px 0; }
  .step-n { font-size: 2.6rem; }

  .principles { grid-template-columns: 1fr; }
  .principle,
  .principle:nth-child(even) { padding: 28px 0 32px; }
  .principle:nth-child(odd) { border-right: 0; }

  .criteria { padding: 24px 22px 8px; }

  .footer-inner { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *,
  .facts { animation: none; }
  .ticker-track { animation: none; }
  .ticker-track[aria-hidden="true"] { display: none; }
  .ticker-viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  [data-reveal] { transition: none; }
  [data-reveal].pre-reveal { opacity: 1; transform: none; }
  .glyph,
  .link-arrow span,
  .contact-email span { transition: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .ticker, .menu-toggle { display: none; }
  [data-reveal].pre-reveal { opacity: 1; transform: none; }
  .founders, .contact, .site-footer { background: none; color: var(--ink); }
}
