/* Fieldkit v2 — ink-first one-question stage (design sketch)
   Tokens locked in IMPROVE.md: Void / Paper / Signal / Mist / Soft / Line.
   Shape rule: buttons pill, cards 16px, stage panels 20px, chips pill. */

:root {
  /* Colour tokens (v2) */
  --void: #0C0F0E;
  --paper: #F4F1EA;
  --paper-card: #FBF9F4;
  --mist: #E4DFD4;
  --signal: #FF4D2E;
  --signal-press: #E63F22;
  --soft: #9A958C;          /* muted text on Void, decorative on Paper */
  --ink-soft: #57534A;      /* muted text on Paper (AA) */
  --line: #D4CFC4;
  --line-void: rgba(244, 241, 234, 0.16);
  --shadow-lift: 0 16px 40px rgba(12, 15, 14, 0.09);

  /* Type */
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;

  /* Space & rhythm */
  --wrap: min(1160px, calc(100% - 3rem));
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--void);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--signal); }

:focus { outline: none; }

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

section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--signal);
  color: var(--void);
  font-weight: 600;
  border-radius: 8px;
}
.skip-link:focus-visible { top: 1rem; }

.scroll-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.wrap { width: var(--wrap); margin-inline: auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Buttons (pill) ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.68rem 1.3rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { color: inherit; }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  background: var(--signal);
  color: var(--void);
  border-color: var(--signal);
}
.btn-primary:hover {
  background: var(--signal-press);
  border-color: var(--signal-press);
  color: var(--void);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--void);
}
.btn-ghost:hover { border-color: var(--void); color: var(--void); }

.btn-ghost--void {
  border-color: var(--line-void);
  color: var(--paper);
}
.btn-ghost--void:hover { border-color: var(--paper); color: var(--paper); }

.btn-lg { padding: 0.9rem 1.55rem; font-size: 1rem; }

/* ——— Header (transparent over Void, Paper once scrolled) ——— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  color: var(--paper);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  color: var(--void);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: -0.02em;
  color: currentColor;
}
.wordmark:hover { color: currentColor; }
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 7px;
  background: var(--signal);
  color: var(--void);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.nav {
  display: none;
  gap: 1.5rem;
  margin-left: 0.5rem;
  flex: 1;
}
.nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: color-mix(in srgb, currentColor 78%, transparent);
}
.nav a:hover { color: currentColor; }

.header-actions { display: none; margin-left: auto; }
.header-actions .btn-primary { color: var(--void); }

.nav-toggle {
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-void);
  border-radius: var(--radius-sm);
  background: transparent;
  display: grid;
  place-content: center;
  gap: 5px;
  cursor: pointer;
}
.site-header.is-scrolled .nav-toggle { border-color: var(--line); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem 1.4rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--void);
}
.mobile-nav a { text-decoration: none; font-weight: 500; padding: 0.35rem 0; }
.mobile-nav .btn-primary { margin-top: 0.5rem; color: var(--void); }
.mobile-nav[hidden] { display: none !important; }

@media (min-width: 860px) {
  .nav, .header-actions { display: flex; }
  .nav-toggle, .mobile-nav { display: none !important; }
}

/* ——— Hero: one-question stage (full-bleed Void) ——— */
.hero {
  background: var(--void);
  color: var(--paper);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  border-bottom: 2px solid var(--signal);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--line-void) 0 1px,
    transparent 1px 25vw
  );
  opacity: 0.35;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  padding: 8rem 0 4.5rem;
}

.hero-q {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3rem, 8.5vw, 6.75rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  max-width: 14ch;
}
.hero-line {
  display: block;
  clip-path: inset(-5% 102% -5% 0);
  transition: clip-path 0.85s var(--ease);
}
.hero-line + .hero-line { transition-delay: 0.35s; }
.hero-q.is-in .hero-line { clip-path: inset(-5% -5% -5% 0); }

.caret {
  display: inline-block;
  width: 0.13em;
  height: 0.8em;
  margin-left: 0.12em;
  background: var(--signal);
  vertical-align: -0.06em;
  border-radius: 2px;
}
.hero-q .caret {
  opacity: 0;
  transition: opacity 0.3s var(--ease) 0.95s;
}
.hero-q.is-in .caret {
  opacity: 1;
  animation: blink 1.1s steps(1) 1.3s infinite;
}
.caret--inline { animation: blink 1.1s steps(1) infinite; }

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.lede {
  font-size: 1.15rem;
  color: var(--soft);
  max-width: 32rem;
  margin: 0 0 2rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

/* ——— Sections ——— */
.section-head { max-width: 36rem; margin-bottom: 3rem; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 0.7rem;
}
.section-head p { margin: 0; color: var(--ink-soft); }

/* Pillars: asymmetric 2 + 1 staggered */
.pillars { padding: 6.5rem 0 2rem; }

.pillar-grid {
  display: grid;
  gap: 1.25rem;
}

.pillar {
  border-radius: var(--radius);
  padding: 2rem 1.9rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.pillar h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.pillar--a {
  background: var(--mist);
  border-top: 3px solid var(--signal);
  padding: 2.5rem 2.25rem;
}
.pillar--a h3 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); }
.pillar--a p { font-size: 1.05rem; max-width: 38rem; }

.pillar--b {
  background: transparent;
  border: 1px solid var(--line);
}
.pillar--b h3 { font-size: 1.45rem; }

.pillar--c {
  background: var(--paper-card);
  border: 1px solid var(--line);
}
.pillar--c h3 { font-size: 1.45rem; }

.pillar p { margin: 0; color: var(--ink-soft); }

@media (min-width: 900px) {
  .pillar-grid { grid-template-columns: repeat(12, 1fr); }
  .pillar--a { grid-column: 1 / 8; }
  .pillar--b { grid-column: 8 / 13; margin-top: 4.5rem; }
  .pillar--c { grid-column: 3 / 10; }
}

/* Features */
.features { padding: 4rem 0 2rem; }

.feature-band { margin: 0 0 5.5rem; }
.feature-band:last-child { margin-bottom: 0; }

.feature-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 0.8rem;
}
.feature-copy p {
  color: var(--ink-soft);
  margin: 0;
  max-width: 32rem;
}

/* Band 1: split */
@media (min-width: 900px) {
  .feature-band--split {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 3rem;
    align-items: center;
  }
}

.stage-form {
  background: var(--mist);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2rem;
  display: grid;
  place-items: center;
  min-height: 320px;
}

.void-card {
  background: var(--void);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 1.75rem 1.6rem 1.35rem;
  width: min(100%, 400px);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.void-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--soft);
}
.void-card-q {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.7rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}
.void-card-opts { display: flex; flex-direction: column; gap: 0.55rem; }
.chip {
  padding: 0.68rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-void);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--paper);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.chip.is-active {
  border-left: 3px solid var(--signal);
  background: rgba(244, 241, 234, 0.08);
}
.void-card-hint { font-size: 0.8rem; color: var(--soft); }

/* Band 2: full-width logic stage */
.stage-branch {
  background: var(--mist);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}
.feature-copy--inset { margin-bottom: 2.25rem; }

.flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.flow-node {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  background: var(--void);
  color: var(--paper);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}
.flow-node--branch {
  background: var(--paper-card);
  border: 1.5px solid var(--signal);
  color: var(--void);
}
.flow-node--soft {
  background: var(--paper-card);
  border: 1.5px solid var(--line);
  color: var(--void);
}
.flow-node--end {
  background: transparent;
  border: 1.5px dashed var(--line);
  color: var(--ink-soft);
}
.flow-line {
  height: 1.5px;
  background: var(--line);
  flex: 1;
  min-width: 20px;
}
.flow-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.flow-stack .flow-node { align-self: flex-start; }

/* Band 3: stacked copy + chart stage */
.feature-band--stack .feature-copy { margin-bottom: 2rem; }

.stage-bars {
  background: var(--mist);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.5rem 2.25rem;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  height: 200px;
}
.bar {
  flex: 1;
  height: var(--h);
  background: var(--void);
  border-radius: 6px 6px 0 0;
  opacity: 0.85;
  transform-origin: bottom;
}
.bar--signal { background: var(--signal); opacity: 1; }
.stage-bars.is-in .bar {
  animation: grow-bar 0.8s var(--ease) both;
}
.stage-bars.is-in .bar:nth-child(2) { animation-delay: 0.08s; }
.stage-bars.is-in .bar:nth-child(3) { animation-delay: 0.16s; }
.stage-bars.is-in .bar:nth-child(4) { animation-delay: 0.24s; }
.stage-bars.is-in .bar:nth-child(5) { animation-delay: 0.32s; }
.stage-bars.is-in .bar:nth-child(6) { animation-delay: 0.4s; }
.stage-bars.is-in .bar:nth-child(7) { animation-delay: 0.48s; }
@keyframes grow-bar {
  from { transform: scaleY(0.15); }
}

@media (max-width: 640px) {
  .stage-form, .stage-branch, .stage-bars { padding: 1.5rem; }
  .flow { gap: 0.6rem; }
  .bars { gap: 0.5rem; height: 150px; }
}

/* Quote */
.proof { padding: 6.5rem 0; }

.quote {
  margin: 0;
  max-width: 56rem;
  position: relative;
  padding-left: 3.5rem;
}
.quote-mark {
  position: absolute;
  left: 0;
  top: -0.15em;
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 1;
  color: var(--signal);
}
.quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
}
.quote footer {
  font-size: 0.95rem;
  color: var(--ink-soft);
}
@media (max-width: 640px) {
  .quote { padding-left: 0; padding-top: 3rem; }
  .quote-mark { top: -0.35em; }
}

/* Integrations */
.integrations { padding: 0 0 7rem; }
.integrations h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 0.8rem;
  max-width: 26ch;
}
.integrations > .wrap > p {
  margin: 0 0 2.5rem;
  color: var(--ink-soft);
  max-width: 36rem;
}

.connect-strip {
  list-style: none;
  margin: 0;
  padding: 1.3rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.connect-strip li {
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink-soft);
}
.connect-strip li + li::before {
  content: "/";
  color: var(--signal);
  font-weight: 600;
  margin: 0 0.95rem;
}

/* Closing chapter + footer: one continuous Void block */
.closing {
  background: var(--void);
  color: var(--paper);
  padding: 7.5rem 0 4.5rem;
}
.closing-inner { max-width: 44rem; }
.closing h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 1.1rem;
}
.closing p {
  margin: 0 0 2rem;
  color: var(--soft);
  max-width: 30rem;
}

.mail-link {
  color: var(--paper);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
}
.mail-link:hover { color: var(--signal); }

.site-footer {
  background: var(--void);
  color: var(--soft);
  border-top: 1px solid var(--line-void);
  padding: 3rem 0 2rem;
  font-size: 0.95rem;
}
.footer-inner {
  display: grid;
  gap: 2.25rem;
  padding-bottom: 2.25rem;
}
.footer-brand p {
  margin: 0.85rem 0 0;
  max-width: 18rem;
}
.wordmark--footer { color: var(--paper); }
.wordmark--footer:hover { color: var(--paper); }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.footer-cols h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: color-mix(in srgb, var(--paper) 55%, transparent);
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.footer-cols a {
  display: block;
  text-decoration: none;
  margin-bottom: 0.5rem;
  color: var(--soft);
}
.footer-cols a:hover { color: var(--paper); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-void);
}
.footer-bottom p { margin: 0; }
.footer-bottom a {
  text-decoration: none;
  color: var(--paper);
}
.footer-bottom a:hover { color: var(--signal); }
@media (min-width: 800px) {
  .footer-inner { grid-template-columns: 1.2fr 1.5fr; }
}

/* ——— Motion entrance states ——— */
[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-animate="fade-up"].is-in {
  opacity: 1;
  transform: none;
}
[data-animate="fade-up"][data-delay="1"].is-in { transition-delay: 0.1s; }
[data-animate="fade-up"][data-delay="2"].is-in { transition-delay: 0.2s; }

[data-animate="hero-q"] .hero-line { clip-path: inset(-5% 102% -5% 0); }
[data-animate="hero-q"].is-in .hero-line { clip-path: inset(-5% -5% -5% 0); }

/* ——— Reduced motion: instant finals, no blink, no type ——— */

/* Contextual photo band (Pixabay self-host) */
.stage-branch--photo {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1.5rem;
}
.stage-photo {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--mist);
}
.stage-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
}
.stage-branch--photo .feature-copy--inset {
  position: relative;
  z-index: 1;
}
.stage-branch--photo .flow {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-line,
  [data-animate="hero-q"] .hero-line {
    clip-path: none !important;
    transition: none !important;
  }
  .hero-q .caret,
  .caret--inline {
    opacity: 1 !important;
    animation: none !important;
    transition: none !important;
  }
  [data-animate="fade-up"] {
    opacity: 1;
    transform: none;
  }
  .stage-bars.is-in .bar { animation: none; }
  .pillar:hover, .btn-primary:hover, .btn:active { transform: none; }
}

/* Mobile density tweaks */
@media (max-width: 480px) {
  :root { --wrap: min(1160px, calc(100% - 2rem)); }
  .hero-inner { padding: 6.5rem 0 3.5rem; }
  .pillars { padding-top: 4.5rem; }
  .pillar { padding: 1.6rem 1.4rem; }
  .pillar--a { padding: 2rem 1.6rem; }
  .proof { padding: 4.5rem 0; }
  .closing { padding: 5rem 0 3.5rem; }
  .hero-ctas .btn { width: 100%; }
}
