/* ==========================================================================
   FAROIUM — Design tokens (from Design System deck, section 14)
   ========================================================================== */
:root {
  /* color */
  --ink-950: #111318;
  --paper-100: #F5F3EE;
  --signal-600: #FF5A36;
  --mint-500: #A8D8C8;
  --green-900: #193B36;
  --muted-500: #687078;

  /* color derived (borders / hovers only — no new hues) */
  --ink-border: rgba(17, 19, 24, 0.12);
  --ink-border-strong: rgba(17, 19, 24, 0.22);
  --paper-border: rgba(245, 243, 238, 0.16);
  --paper-border-strong: rgba(245, 243, 238, 0.28);

  /* type */
  --font-head: "DM Sans", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* layout */
  --container: 1240px;
  --radius-xs: 2px;
  --gutter: 24px;

  /* motion */
  --transition-fast: 150ms ease-out;
  --transition: 250ms ease-out;
  --transition-slow: 400ms ease-out;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, p, ul, ol, li, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
svg { display: block; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--paper-100);
  color: var(--ink-950);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--signal-600);
  outline-offset: 2px;
}

.mono { font-family: var(--font-mono); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ==========================================================================
   Type scale — DM Sans for headings/body, JetBrains Mono for labels only
   ========================================================================== */
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--signal-600);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.eyebrow--on-dark { color: var(--signal-600); }

.section-title {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  line-height: 1.12;
  max-width: 18ch;
  margin-bottom: 20px;
}
.section-title.on-dark { color: var(--paper-100); }

.section-lead {
  font-size: 1.0625rem;
  color: var(--muted-500);
  max-width: 56ch;
  margin-bottom: 8px;
}
.section-lead.on-dark-muted { color: rgba(245, 243, 238, 0.72); }
.on-dark-muted { color: rgba(245, 243, 238, 0.72); }

.section { padding: 96px 0; }

.arrow { display: inline-block; transition: transform var(--transition-fast); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  font-weight: 500;
  border-bottom: 1px solid var(--ink-border-strong);
  padding-bottom: 2px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.text-link:hover { border-color: var(--ink-950); }
.text-link:hover .arrow { transform: translateX(3px); }

/* ==========================================================================
   Buttons — one primary (coral) action per screen; everything else ghost
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:hover .arrow { transform: translateX(3px); }

.btn--primary {
  background: var(--signal-600);
  color: var(--paper-100);
}
.btn--primary:hover { background: #E64C2C; }

.btn--ghost {
  background: transparent;
  color: var(--ink-950);
  border-color: var(--ink-border-strong);
}
.btn--ghost:hover { border-color: var(--ink-950); }

.btn--ghost.btn--on-dark {
  color: var(--paper-100);
  border-color: var(--paper-border-strong);
}
.btn--ghost.btn--on-dark:hover { border-color: var(--paper-100); }

.btn--sm { padding: 9px 16px; font-size: 0.875rem; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 243, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-border);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.nav__logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.nav__links {
  display: flex;
  gap: 28px;
  margin-right: auto;
  font-size: 0.9rem;
  color: var(--muted-500);
}
.nav__links a { transition: color var(--transition-fast); }
.nav__links a:hover { color: var(--ink-950); }
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}
.nav__toggle span { display: block; height: 1.25px; background: var(--ink-950); width: 100%; }
.nav__mobile {
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 8px var(--gutter) 24px;
  border-top: 1px solid var(--ink-border);
}
.nav__mobile a { font-size: 0.95rem; }
.nav__mobile.is-open { display: flex; }

/* ==========================================================================
   Hero — headline cols 1–5, diagram cols 7–12 (12-col offset grid)
   ========================================================================== */
.hero { padding: 88px 0 80px; overflow: hidden; }
.hero__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  align-items: center;
}
.hero__copy { grid-column: 1 / 7; }
.hero__diagram { grid-column: 7 / 13; }

.hero__headline {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  line-height: 1.08;
  margin-bottom: 24px;
}
.hero__sub {
  font-size: 1.0625rem;
  color: var(--muted-500);
  max-width: 46ch;
  margin-bottom: 32px;
}
.hero__ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero__labels {
  font-size: 0.8rem;
  color: var(--muted-500);
}

/* Single orchestrated load sequence — the one non-user-triggered motion moment.
   Runs as pure CSS (animation-fill-mode: both) so the hero copy is never
   dependent on JavaScript executing: it starts hidden, animates in on its own,
   and ends fully visible even if the script never runs. */
.hero .eyebrow { animation: rise var(--transition-slow) ease-out both; }
.hero__headline { animation: rise var(--transition-slow) ease-out 80ms both; }
.hero__sub { animation: rise var(--transition-slow) ease-out 160ms both; }
.hero__ctas { animation: rise var(--transition-slow) ease-out 240ms both; }
.hero__labels { animation: rise var(--transition-slow) ease-out 320ms both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.diagram-svg { width: 100%; height: auto; }
.d-line { stroke: var(--ink-border-strong); stroke-width: 1; fill: none; }
.d-node rect { fill: var(--paper-100); stroke: var(--ink-border-strong); stroke-width: 1; }
.d-node text {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--ink-950);
  text-anchor: middle;
}
.d-node--accent rect { stroke: var(--signal-600); stroke-width: 1.25; }
.d-dot { fill: var(--signal-600); }
.diagram-caption { text-align: center; color: var(--muted-500); font-size: 0.75rem; margin-top: 12px; }

/* ==========================================================================
   01 / Problem rows
   ========================================================================== */
.problem-list { margin-top: 48px; border-top: 1px solid var(--ink-border); }
.problem-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--ink-border);
  transition: padding-left var(--transition-fast), background-color var(--transition-fast);
}
.problem-row:hover { padding-left: 14px; background: rgba(255, 90, 54, 0.04); }
.problem-row__num { color: var(--signal-600); width: 32px; flex-shrink: 0; font-size: 0.85rem; }
.problem-row__label { font-size: 1.15rem; font-weight: 500; flex-grow: 1; }
.problem-row .arrow { color: var(--muted-500); }
.problem-row:hover .arrow { color: var(--signal-600); }

/* ==========================================================================
   02 / Build — frame motif cards (▭)
   ========================================================================== */
.frame-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ink-border);
  border: 1px solid var(--ink-border);
}
.frame-card {
  position: relative;
  background: var(--paper-100);
  padding: 32px 24px;
}
.frame-card__corner {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 14px;
  height: 14px;
  border-top: 1.25px solid var(--signal-600);
  border-right: 1.25px solid var(--signal-600);
}
.frame-card__num { color: var(--muted-500); font-size: 0.7rem; margin-bottom: 20px; }
.frame-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.frame-card p { color: var(--muted-500); font-size: 0.9375rem; }

/* ==========================================================================
   03 / Automate — dark ink section, connection motif (●–●)
   ========================================================================== */
.automate { background: var(--ink-950); color: var(--paper-100); }
.automate__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 64px;
  align-items: start;
}
.automate__copy > * + * { margin-top: 18px; }
.automate__copy .btn { margin-top: 8px; }

.flow { border-left: 1.25px solid var(--paper-border-strong); padding-left: 28px; }
.flow__step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 26px;
  position: relative;
}
.flow__step:not(.flow__step--last)::after {
  content: "";
  position: absolute;
  left: -34px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--paper-border);
}
.flow__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.25px solid var(--paper-100);
  background: var(--ink-950);
  flex-shrink: 0;
  margin-top: 3px;
  margin-left: -33px;
}
.flow__step--accent .flow__dot { background: var(--signal-600); border-color: var(--signal-600); }
.flow__label { font-size: 0.8rem; color: var(--mint-500); margin-bottom: 4px; }
.flow__desc { font-size: 1rem; color: var(--paper-100); }

/* ==========================================================================
   04 / Operate — dark green section, loop motif (↻)
   ========================================================================== */
.operate { background: var(--green-900); color: var(--paper-100); }
.operate__grid {
  display: grid;
  grid-template-columns: 6fr 6fr;
  gap: 48px;
  align-items: center;
}
.operate .section-title { max-width: 14ch; }
.loop { text-align: center; }
.loop-svg { width: 100%; max-width: 320px; margin: 0 auto; }
.loop-ring { fill: none; stroke: var(--paper-border-strong); stroke-width: 1; }
.loop-arrow { fill: none; stroke: var(--mint-500); stroke-width: 1.25; }
.loop-arrowhead { fill: var(--mint-500); }
.loop-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  fill: var(--paper-100);
}
.loop-caption { color: rgba(245, 243, 238, 0.6); margin-top: 16px; font-size: 0.8rem; }

/* ==========================================================================
   05 / How we work — numbered sequence
   ========================================================================== */
.steps {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 28px;
}
.steps__item > span { color: var(--signal-600); display: block; margin-bottom: 14px; font-size: 0.85rem; }
.steps__item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.steps__item p { color: var(--muted-500); font-size: 0.9375rem; }

/* ==========================================================================
   06 / Services — structured cards, no shadow
   ========================================================================== */
.services-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ink-border);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.service-card { background: var(--paper-100); padding: 28px 22px; }
.icon { width: 24px; height: 24px; color: var(--signal-600); margin-bottom: 20px; }
.service-card h3 { font-size: 1rem; margin-bottom: 8px; }
.service-card p { color: var(--muted-500); font-size: 0.875rem; }

/* ==========================================================================
   07 / Selected work — cards with image placeholders
   ========================================================================== */
.work-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;
}
.work-card__image {
  display: block;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--paper-100);
}
.work-card__image img { width: 100%; height: 100%; object-fit: cover; }
.work-card__tag { color: var(--signal-600); font-size: 0.7rem; margin-bottom: 8px; }
.work-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.work-card__desc { color: var(--muted-500); font-size: 0.9375rem; margin-bottom: 14px; }
.work-card .text-link { margin-top: 0; }

/* ==========================================================================
   08 / Who we build for
   ========================================================================== */
.audience-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--ink-border);
  border: 1px solid var(--ink-border);
}
.audience-card { background: var(--paper-100); padding: 28px 20px; }
.audience-card h3 { font-size: 1rem; margin-bottom: 10px; }
.audience-card p { color: var(--muted-500); font-size: 0.875rem; }

/* ==========================================================================
   09 / Why Faroium — signal motif (↑)
   ========================================================================== */
.why-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 44px 48px;
}
.why-card__signal {
  display: block;
  width: 22px;
  height: 1.25px;
  background: var(--signal-600);
  margin-bottom: 18px;
}
.why-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.why-card p { color: var(--muted-500); max-width: 42ch; }

/* ==========================================================================
   10 / Insights
   ========================================================================== */
.insights-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.insight-card {
  border-top: 1.25px solid var(--ink-950);
  padding-top: 20px;
}
.insight-card__tag { color: var(--muted-500); font-size: 0.7rem; margin-bottom: 14px; }
.insight-card h3 { font-size: 1.1rem; margin-bottom: 10px; line-height: 1.3; }
.insight-card p { color: var(--muted-500); font-size: 0.9375rem; margin-bottom: 18px; }
.insight-card .text-link { margin-top: 0; }

/* ==========================================================================
   11 / FAQ — accordion (user-triggered motion only)
   ========================================================================== */
.faq-list { margin-top: 48px; border-top: 1px solid var(--ink-border); }
.faq-item { border-bottom: 1px solid var(--ink-border); }
.faq-item__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 500;
}
.faq-item__icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.faq-item__icon::before, .faq-item__icon::after {
  content: "";
  position: absolute;
  background: var(--ink-950);
  transition: transform var(--transition-fast);
}
.faq-item__icon::before { top: 50%; left: 0; width: 100%; height: 1.25px; transform: translateY(-50%); }
.faq-item__icon::after { left: 50%; top: 0; height: 100%; width: 1.25px; transform: translateX(-50%); }
.faq-item__q[aria-expanded="true"] .faq-item__icon::after { transform: translateX(-50%) scaleY(0); }
.faq-item__q[aria-expanded="true"] .faq-item__icon::before { background: var(--signal-600); }

.faq-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition) ease-out;
}
.faq-item__a p { color: var(--muted-500); padding: 0 4px 22px; max-width: 62ch; }

/* ==========================================================================
   12 / Start a project — dark CTA band
   ========================================================================== */
.start { background: var(--ink-950); color: var(--paper-100); text-align: center; }
.start__inner { display: flex; flex-direction: column; align-items: center; }
.start__headline {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  color: var(--paper-100);
  max-width: 16ch;
  margin-bottom: 20px;
  line-height: 1.1;
}
.start__sub { max-width: 52ch; margin-bottom: 36px; }
.start__contact {
  margin-top: 36px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.85rem;
  color: rgba(245, 243, 238, 0.72);
}
.start__contact a { transition: color var(--transition-fast); }
.start__contact a:hover { color: var(--paper-100); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { padding: 72px 0 0; border-top: 1px solid var(--ink-border); }
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 56px;
}
.footer__logo { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; margin-bottom: 14px; }
.footer__brand p:last-child { color: var(--muted-500); max-width: 26ch; }
.footer__col { display: flex; flex-direction: column; gap: 12px; }
.footer__heading { color: var(--signal-600); font-size: 0.7rem; margin-bottom: 8px; }
.footer__col a { color: var(--muted-500); font-size: 0.9375rem; transition: color var(--transition-fast); }
.footer__col a:hover { color: var(--ink-950); }
.footer__bottom {
  padding: 22px var(--gutter);
  border-top: 1px solid var(--ink-border);
}
.footer__bottom .mono { color: var(--muted-500); font-size: 0.75rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .frame-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .audience-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .insights-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy, .hero__diagram { grid-column: 1 / -1; }
  .hero__diagram { max-width: 360px; margin: 40px auto 0; }
  .automate__grid, .operate__grid { grid-template-columns: 1fr; }
  .operate__grid { gap: 48px; }
  .flow { margin-top: 8px; }
  .nav__links { display: none; }
  .nav .btn--primary.btn--sm { display: none; }
  .nav__toggle { display: flex; }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .frame-grid, .services-grid, .audience-grid, .steps, .work-grid, .insights-grid, .why-grid {
    grid-template-columns: 1fr;
  }
  .footer__grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 56px; }
  .problem-row__label { font-size: 1rem; }
}
