/* FocusChain Labs — brand story page. Calm, one idea per screen. */

:root {
  color-scheme: light;

  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --ink: #15223B;
  --ink-soft: #4A5468;
  --ink-mute: #858B99;
  --line: #E3E1D9;
  --line-soft: #ECEAE3;

  --green: #1F9D55;         /* the logo's green */
  --green-ink: #177A43;     /* green that holds contrast on --bg for small text */
  --link-rest: #A7AEBC;
  --slip: #D9A55B;
  --slip-soft: #F3E7D3;

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --ease-out: cubic-bezier(.2, .7, .2, 1);

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --measure: 38rem;
  --header-h: 72px;
  --space-block: clamp(72px, 11vh, 120px);
  --gap-split: clamp(40px, 6vw, 88px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

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

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 246, 242, 0.88);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }

/* The original FocusChain Labs logo image. */
.brand-logo { display: block; height: 46px; width: auto; }

.header-link {
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 2px;
  transition: color .2s ease;
}
.header-link:hover { color: var(--ink); }

/* ── Type ── */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 9.6vw, 124px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
}
.display em,
.heading em { font-style: italic; color: var(--green); }
.display-sm { font-size: clamp(40px, 6vw, 76px); }

/* Keep "at a time." on one line, and never leave a single word on the last line. */
.display em { white-space: nowrap; }
.display,
.heading { text-wrap: balance; }
.lede,
.prose p,
.principle p,
.steps-figure figcaption { text-wrap: pretty; }

/* Headline words pull into focus, one after another. */
.js .display .w {
  display: inline-block;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(8px);
  animation: resolve 1s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 90ms + 120ms);
}

.heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
  max-width: 14ch;
}

.lede {
  font-size: clamp(18px, 1.7vw, 20px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 20px 0 0;
}

.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 14px;
}

.prose { max-width: var(--measure); color: var(--ink-soft); }
.prose p { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }

/* ── Hero ── */

.hero {
  position: relative;
  padding: clamp(48px, 9vh, 104px) 0 clamp(56px, 10vh, 112px);
  overflow: hidden;
}

/* A faint instrument grid, sharp around the chain and gone at the edges. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(21, 34, 59, 0.13) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 45% 70% at 72% 70%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 45% 70% at 72% 70%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero-inner { position: relative; }

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap-split);
  align-items: center;
  margin-top: clamp(28px, 4.5vh, 48px);
}
.hero-row .lede { margin: 0; }

/* The hero plays on load, not on scroll: it is always the first thing in view. */
.js .hero-lede {
  opacity: 0;
  transform: translateY(10px);
  animation: rise .9s var(--ease-out) .6s forwards;
}

.chain {
  display: block;
  width: min(100%, 460px);
  height: auto;
  overflow: visible;
}

.link {
  fill: none;
  stroke: var(--link-rest);
  stroke-width: 8;
  stroke-linejoin: round;
  transition: stroke 1s ease, opacity 1.1s ease, filter 1.1s ease;
}

/* Focused is the resting state, so the page reads right without JavaScript. */
.link-dim { opacity: 0.3; filter: blur(1.8px); }
.link-focus { stroke: var(--green); }

.js .chain:not(.is-focused) .link-dim { opacity: 1; filter: none; }
.js .chain:not(.is-focused) .link-focus { stroke: var(--link-rest); }

.beam { opacity: 0; }
.js .chain.is-scanning .beam { animation: scan 1.8s cubic-bezier(.45, 0, .25, 1) forwards; }

.reticle {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: square;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .45s ease, transform .8s var(--ease-out);
}
.js .chain:not(.is-focused) .reticle { opacity: 0; transform: scale(1.3); }

.readout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  transition: opacity .5s ease;
}
.js .readout { opacity: 0; }
.js .readout.is-on { opacity: 1; }

.readout-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
  transition: background-color .3s ease;
}
.readout.is-scanning .readout-dot { background: var(--link-rest); animation: blink 1s steps(2, start) infinite; }
.readout.is-scanning #readoutText::after { content: "_"; margin-left: 2px; animation: blink 1s steps(2, start) infinite; }

/* ── Blocks ── */

.block {
  padding: var(--space-block) 0;
  border-top: 1px solid var(--line-soft);
}

/* Heading on the left, content on the right; wide pieces span both. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  column-gap: var(--gap-split);
  row-gap: clamp(36px, 5vh, 56px);
  align-items: start;
}
.split-head .heading { margin-bottom: 0; }
.split-wide { grid-column: 1 / -1; }

/* The real-estate chain, with the link that slipped. The final look is the
   default; before the figure scrolls into view it is held "intact", then the
   chain draws link by link and breaks at the call back. */

.steps-figure { margin: 0; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 14px;
}

.step {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  margin-right: 44px;
  transition: color .6s ease, background-color .6s ease, border-color .6s ease, box-shadow .6s ease;
}
.step:last-child { margin-right: 0; }

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 44px;
  border-top: 1.5px solid var(--ink-mute);
  transform-origin: left center;
  transition: transform .5s var(--ease-out);
}

.step.step-slip { border-color: var(--slip); box-shadow: 0 0 0 4px var(--slip-soft); }
.step.step-slip::after { border-top-style: dashed; border-top-color: #C9CCD3; }
.step.step-lost { color: var(--ink-mute); background: transparent; border-color: var(--line); }
.step.step-lost::after { border-top-color: #D5D7DD; }

.steps-figure figcaption {
  margin-top: 16px;
  font-size: 15px;
  color: var(--ink-mute);
  max-width: var(--measure);
  transition: opacity .6s ease;
}

.js .steps-figure:not(.is-in) .step::after { transform: scaleX(0); }
.js .steps-figure:not(.is-in) .step.step-slip { border-color: var(--line); box-shadow: 0 0 0 0 var(--slip-soft); }
.js .steps-figure:not(.is-in) .step.step-lost { color: var(--ink); background: var(--surface); }
.js .steps-figure:not(.is-in) figcaption { opacity: 0; }

.js .steps-figure.is-in .step:nth-child(1)::after { transition-delay: .35s; }
.js .steps-figure.is-in .step.step-slip { transition-delay: .85s; }
.js .steps-figure.is-in .step.step-slip::after { transition-delay: 1.15s; }
.js .steps-figure.is-in .step:nth-child(3) { transition-delay: 1.35s; }
.js .steps-figure.is-in .step:nth-child(3)::after { transition-delay: 1.45s; }
.js .steps-figure.is-in .step:nth-child(4) { transition-delay: 1.5s; }
.js .steps-figure.is-in .step:nth-child(4)::after { transition-delay: 1.6s; }
.js .steps-figure.is-in .step:nth-child(5) { transition-delay: 1.65s; }
.js .steps-figure.is-in figcaption { transition-delay: 1.9s; }

.js .steps-figure.is-in .step.step-slip::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1.5px solid var(--slip);
  opacity: 0;
  pointer-events: none;
  animation: ping 1.3s ease-out .85s 2;
}

/* Principles */

.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px clamp(28px, 4vw, 56px);
}

.principle { position: relative; padding-top: 20px; }

.principle::before,
.principle::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: left center;
  transition: transform 1.1s var(--ease-out) .2s;
}
.principle::before { right: 0; height: 1px; background: var(--line); }
.principle::after { width: 28px; height: 2px; top: -0.5px; background: var(--green); transition-delay: .9s; }

.js .principle.reveal:not(.is-in)::before,
.js .principle.reveal:not(.is-in)::after { transform: scaleX(0); }

.principle-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--green-ink);
  margin-bottom: 10px;
}

.principle h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 8px;
}

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

.pull { margin: clamp(48px, 7vh, 72px) 0 0; padding: 0; }
.pull p {
  max-width: 22ch;
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.15;
  color: var(--ink);
}

/* Chain one */

.chain-one {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--gap-split);
  align-items: center;
}

.product-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(28px, 3vw, 36px);
  transition: border-color .25s ease, box-shadow .25s ease, opacity .9s ease, transform .9s var(--ease-out);
}
.product-card:hover {
  border-color: #CFCCC2;
  box-shadow: 0 18px 40px -24px rgba(21, 34, 59, 0.25);
}

.product-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.product-name {
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-top: 4px;
}

.product-for { color: var(--ink-soft); }

.product-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--green-ink);
  margin: 12px 0 22px;
}
.product-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: live 2.4s ease-out infinite;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 24px;
  transition: background-color .2s ease, opacity .9s ease, transform .9s var(--ease-out);
}

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover,
.product-card:hover .btn-primary { background: #0B1426; }

.btn-arrow { display: inline-block; transition: transform .2s ease; }
.btn:hover .btn-arrow,
.product-card:hover .btn-arrow { transform: translateX(3px); }

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

/* Close */

.close {
  padding: var(--space-block) 0;
  border-top: 1px solid var(--line-soft);
}
.close-inner { display: flex; flex-direction: column; align-items: flex-start; }
.close .lede { margin: 16px 0 28px; }

/* Footer */

.site-footer { border-top: 1px solid var(--line-soft); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 24px;
  padding-bottom: 24px;
  font-size: 14px;
  color: var(--ink-mute);
}

.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-links a { text-decoration: none; transition: color .2s ease; }
.footer-links a:hover { color: var(--ink); }
.footer-links a[aria-current="page"] { color: var(--ink); }

/* ── Legal page ── */

.legal-head {
  padding: clamp(48px, 8vh, 88px) 0 clamp(36px, 6vh, 56px);
  border-bottom: 1px solid var(--line-soft);
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-mute);
  margin: 18px 0 0;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: var(--gap-split);
  align-items: start;
  padding-top: clamp(40px, 6vh, 64px);
  padding-bottom: var(--space-block);
}

.legal { max-width: 44rem; color: var(--ink-soft); }

.legal h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.15;
  color: var(--ink);
  margin: 48px 0 14px;
  scroll-margin-top: calc(var(--header-h) + 24px);
  text-wrap: balance;
}
.legal h2:first-child { margin-top: 0; }

.legal h2 .n {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--green-ink);
  margin-bottom: 8px;
}

.legal h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 8px;
}

.legal p { margin: 0 0 14px; text-wrap: pretty; }
.legal ul { margin: 0 0 14px; padding-left: 20px; }
.legal li { margin: 0 0 8px; padding-left: 4px; text-wrap: pretty; }
.legal li::marker { color: var(--ink-mute); }
.legal strong { color: var(--ink); font-weight: 600; }

.legal a {
  color: var(--green-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal a:hover { color: var(--ink); }

.legal-contact {
  margin-top: 48px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.legal-contact h2 { margin-top: 0; }
.legal-contact p:last-child { margin-bottom: 0; }

.legal-toc { position: sticky; top: calc(var(--header-h) + 32px); font-size: 14px; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.legal-toc a {
  display: block;
  padding: 5px 0 5px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease;
}
.legal-toc a:hover { color: var(--ink); border-left-color: var(--green); }

/* ── Settle-in on scroll ── */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .9s ease, transform .9s var(--ease-out);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Keep the hover easing on the elements that also settle in. */
.js .product-card.reveal { transition: border-color .25s ease, box-shadow .25s ease, opacity .9s ease, transform .9s var(--ease-out); }
.js .btn.reveal { transition: background-color .2s ease, opacity .9s ease, transform .9s var(--ease-out); }

/* ── Keyframes ── */

@keyframes rise { to { opacity: 1; transform: none; } }

@keyframes resolve { to { opacity: 1; filter: blur(0); transform: none; } }

@keyframes scan {
  0%   { transform: translateX(0);     opacity: 0; }
  12%  { opacity: 1; }
  62%  { transform: translateX(364px); opacity: 1; }
  100% { transform: translateX(182px); opacity: 0; }
}

@keyframes blink { to { visibility: hidden; } }

@keyframes ping {
  0%   { opacity: .9; transform: scale(1); }
  100% { opacity: 0;  transform: scale(1.35); }
}

@keyframes live {
  0%   { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(31, 157, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); }
}

/* ── Reduced motion: the finished page, nothing moving ── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .display .w,
  .js .hero-lede { opacity: 1; filter: none; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ── Tablet ── */

@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .split-head .heading { max-width: 16ch; }
  .split-wide { margin-top: 16px; }
  .pull { margin-top: 48px; }

  .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .legal-toc { display: none; }
}

@media (max-width: 860px) {
  .hero-row { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero::before {
    -webkit-mask-image: radial-gradient(ellipse 70% 45% at 40% 80%, #000 0%, transparent 72%);
    mask-image: radial-gradient(ellipse 70% 45% at 40% 80%, #000 0%, transparent 72%);
  }
  .chain-one { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

/* ── Phone ── */

@media (max-width: 560px) {
  :root {
    --header-h: 64px;
    --space-block: 64px;
  }
  body { font-size: 16px; }
  .brand-logo { height: 40px; }
  .hero { padding: 40px 0 56px; }
  .principles { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .principle h3 { font-size: 28px; }

  .steps { flex-direction: column; align-items: flex-start; row-gap: 20px; }
  .step { margin-right: 0; }
  .step:not(:last-child)::after {
    left: 28px;
    top: 100%;
    width: 0;
    height: 20px;
    border-top: 0;
    border-left: 1.5px solid var(--ink-mute);
    transform-origin: center top;
  }
  .step.step-slip::after { border-left-style: dashed; border-left-color: #C9CCD3; }
  .step.step-lost::after { border-left-color: #D5D7DD; }
  .js .steps-figure:not(.is-in) .step::after { transform: scaleY(0); }
}
