/* FlowStack one-pager (src/flow.mjs). Brand: docs/flowstack-brand.html in globatics-ticket.
 * Ink background; Sora headings set tight; Inter body; the three layer colours only in the logo, the hero stack
 * and small accents. Hero: headline left, the stack of product layers right. */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --measure: 34rem;
  --nav-h: 76px;
  --text-hero: clamp(2.9rem, 6vw + 0.5rem, 6.2rem);
  --text-statement: clamp(2.1rem, 3.8vw + 0.5rem, 4.2rem);
  --radius-control: 999px;
}

html { background: var(--color-paper); scroll-padding-top: var(--space-xl); scroll-behavior: smooth; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

h1, h2, .statement { font-family: var(--font-display); font-weight: 800; letter-spacing: var(--tracking-display); line-height: 1.02; color: var(--color-ink); }
h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-title); line-height: 1.2; letter-spacing: -0.02em; color: var(--color-ink); }

/* nav */
.skip { position: absolute; left: var(--space-md); top: -100px; z-index: var(--z-modal); background: var(--color-accent); color: var(--color-accent-ink); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-control); }
.skip:focus-visible { top: var(--space-md); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-ink); border-radius: var(--radius-card); }
.brand img { width: 34px; height: 34px; }
.brand span { font: 800 1.45rem/1 var(--font-display); letter-spacing: -0.04em; }
.brand b { font-weight: 600; color: var(--color-ink-2); }
.nav__links { display: flex; align-items: center; gap: var(--space-xs); list-style: none; margin: 0; padding: 0; }
.nav__links a:not(.button) { display: inline-block; padding: var(--space-xs) var(--space-sm); color: var(--color-ink); text-decoration: none; border-radius: var(--radius-control); transition: background-color var(--dur-short) var(--ease-out); }
.nav__links a:not(.button):hover { background: var(--color-paper-3); }
@media (max-width: 40rem) { .nav__links li:not(:last-child) { display: none; } }

/* buttons and links */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 var(--space-lg);
  background: var(--color-accent); color: var(--color-accent-ink); font-weight: 600; text-decoration: none; border: 0; border-radius: var(--radius-control); cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.button--small { min-height: 40px; padding: 0 var(--space-md); }
.button:hover { background: #5eead4; }
.button:active { transform: scale(0.97); }
.button:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.link { color: var(--color-ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; text-decoration-color: var(--color-accent); transition: color var(--dur-short) var(--ease-out); }
.link:hover { color: var(--color-accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md) var(--space-xl); }
.lead { font-size: var(--text-lead); line-height: 1.5; color: var(--color-ink-2); max-width: var(--measure); }

/* hero: the headline, and the stack of product layers */
.hero { min-height: calc(100svh - var(--nav-h)); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-2xl); align-items: center; padding-block: var(--space-2xl); }
.hero__body { display: grid; gap: var(--space-xl); }
.hero h1 { font-size: var(--text-hero); max-width: 11ch; }
.hero .lead { max-width: 30rem; }
.stack { display: grid; gap: 18px; padding: var(--space-lg) 0; }
.stack__layer { display: flex; align-items: center; gap: 18px; padding: 20px 26px; border-radius: 22px; background: var(--color-paper-2);
  border: 1px solid var(--color-rule); box-shadow: 0 24px 40px -28px rgb(0 0 0 / 0.8); }
.stack__layer img { width: 56px; height: 56px; flex: none; }
.stack__layer b { display: block; font: 700 1.35rem/1.2 var(--font-display); letter-spacing: -0.02em; }
.stack__layer small { color: var(--color-muted); font-size: var(--text-sm); }
.stack__layer--1 { margin-left: 18%; border-left: 6px solid var(--layer-1); }
.stack__layer--2 { margin-left: 9%; margin-right: 9%; border-left: 6px solid var(--layer-2); }
.stack__layer--3 { margin-right: 18%; border-left: 6px solid var(--layer-3); }
@media (max-width: 52rem) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: auto; padding-top: var(--space-xl); }
  .stack__layer--1, .stack__layer--2, .stack__layer--3 { margin-inline: 0; }
}

/* sections */
.beat { padding-block: var(--section-gap); display: grid; gap: var(--space-2xl); border-top: 1px solid var(--color-rule); }
.section-head { font-size: var(--text-section); }
.beat--center { justify-items: center; text-align: center; gap: var(--space-xl); }
.beat--center .lead { margin-inline: auto; }
.beat__mark { width: 72px; height: 72px; }
.statement { font-size: var(--text-statement); max-width: 16ch; }

/* products */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--gap-columns); }
.product { display: grid; gap: var(--space-md); align-content: start; padding: var(--space-xl); background: var(--color-paper-2); border-radius: 20px; border: 1px solid var(--color-rule); }
.product__icon { width: 56px; height: 56px; }
.product__name { font-size: var(--text-2xl); }
.product p:not(.lead) { color: var(--color-muted); }

/* next on the stack */
.upcoming { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--space-xl) var(--gap-columns); }
.upcoming li { display: grid; gap: var(--space-sm); align-content: start; padding-top: var(--space-lg); border-top: 2px solid var(--color-rule); }
.upcoming img { width: 40px; height: 40px; opacity: 0.85; }
.upcoming p { color: var(--color-ink-2); }

/* getting started */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xl) var(--gap-columns); }
.steps li { counter-increment: step; display: grid; gap: var(--space-sm); align-content: start; padding: var(--space-xl); background: var(--color-paper-2); border-radius: 20px; border: 1px solid var(--color-rule); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--color-paper); font-weight: 700; margin-bottom: var(--space-xs); }
.steps li:nth-child(1)::before { background: var(--layer-1); }
.steps li:nth-child(2)::before { background: var(--layer-2); }
.steps li:nth-child(3)::before { background: var(--layer-3); }
.steps p { color: var(--color-ink-2); }
.steps b { color: var(--color-ink); }
@media (max-width: 56rem) { .steps { grid-template-columns: minmax(0, 1fr); } }

.lost { min-height: 60vh; align-content: center; border-top: 0; }

/* footer */
.footer { border-top: 1px solid var(--color-rule); padding-block: var(--space-xl); color: var(--color-ink-2); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-md) var(--space-xl); }
.footer a { color: var(--color-ink); text-decoration-color: var(--color-accent); transition: color var(--dur-short) var(--ease-out); }
.footer a:hover { color: var(--color-accent); }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); list-style: none; margin: 0; padding: 0; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.footer small { color: var(--color-muted); font-size: var(--text-sm); }

/* the one reveal: the stack settles into place on load */
@media (prefers-reduced-motion: no-preference) {
  .hero__body > * { animation: rise var(--dur-long) var(--ease-out) both; }
  .hero__body > :nth-child(2) { animation-delay: 90ms; }
  .hero__body > :nth-child(3) { animation-delay: 180ms; }
  .stack__layer { animation: drop 640ms var(--ease-out) both; }
  .stack__layer--1 { animation-delay: 380ms; }
  .stack__layer--2 { animation-delay: 240ms; }
  .stack__layer--3 { animation-delay: 100ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes drop { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
}
