/* Tatami Flow marketing site stylesheet. Self-hosted (CSP style-src 'self'). Tokens live in :root. */

:root {
  /* Brand accent: Mat blue. The only accent, and the CTA color. */
  --primary: oklch(48% 0.16 252);
  --primary-strong: oklch(42% 0.18 252);
  --primary-soft: oklch(94% 0.04 252);
  --primary-ring: oklch(48% 0.16 252 / 0.20);
  --on-primary: #ffffff;
  --primary-on-dark: oklch(74% 0.13 252);

  /* Dark chrome */
  --ink-0: #07090d;
  --ink-1: #0d1117;
  --ink-2: #161b22;
  --ink-3: #1f2630;
  --ink-line: #232a35;

  /* Light content */
  --background: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e6e8ec;
  --line-2: #eef0f3;

  /* Text on light */
  --on-surface: #0f1218;
  --on-surface-2: #4b5462;
  --on-surface-3: #79828f;

  /* Text on dark */
  --on-dark: #e7ebf1;
  --on-dark-2: #99a3b0;
  --on-dark-3: #5e6772;

  /* Fonts (vendored under /fonts/) */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Typography scale */
  --display-size: 36px;
  --display-weight: 600;
  --display-leading: 1;
  --display-tracking: -0.025em;

  --heading-lg-size: 24px;
  --heading-lg-weight: 600;
  --heading-lg-leading: 1.2;
  --heading-lg-tracking: -0.02em;

  --heading-size: 22px;
  --heading-weight: 600;
  --heading-leading: 1.25;
  --heading-tracking: -0.018em;

  --title-size: 18px;
  --title-weight: 600;
  --title-leading: 1.3;
  --title-tracking: -0.012em;

  --body-lg-size: 16.5px;
  --body-lg-weight: 400;
  --body-lg-leading: 1.55;
  --body-lg-tracking: -0.005em;

  --body-size: 14px;
  --body-weight: 400;
  --body-leading: 1.5;
  --body-tracking: normal;

  --body-sm-size: 13px;
  --body-sm-weight: 400;
  --body-sm-leading: 1.5;
  --body-sm-tracking: -0.005em;

  --label-size: 13px;
  --label-weight: 500;
  --label-leading: 1;
  --label-tracking: -0.005em;

  --caption-size: 12.5px;
  --caption-weight: 400;
  --caption-leading: 1.4;
  --caption-tracking: normal;

  --eyebrow-size: 10.5px;
  --eyebrow-weight: 600;
  --eyebrow-leading: 1.2;
  --eyebrow-tracking: 0.06em;

  /* Spacing (8px rhythm) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 18px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radius */
  --radius-sm: 7px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Layout */
  --hairline: 1px;
  --content-max: 1240px;
  --mark-size: 32px;
  --content-x: 16px;
  --control-min-height: 44px;
  --screenshot-max: 1440px;
  --measure: 40rem;
  --section-y: 4rem;
  --card-min: 15rem;
  --marker-size: 2rem;
  --spine-w: 2px;

  /* Shadows */
  --shadow-1: 0 1px 0 rgba(15, 18, 24, 0.04), 0 1px 2px rgba(15, 18, 24, 0.04);
  --shadow-2: 0 1px 0 rgba(15, 18, 24, 0.04), 0 4px 16px rgba(15, 18, 24, 0.08);
  --shadow-3: 0 12px 40px rgba(15, 18, 24, 0.14);

  /* Motion */
  --motion-fast: 120ms;
  --motion-base: 150ms;
}

/* Geist, latin subset, variable weight. SIL OFL, see fonts/OFL.txt. */
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Base (360px and up) */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--background);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  font-size: var(--body-lg-size);
  font-weight: var(--body-lg-weight);
  line-height: var(--body-lg-leading);
  letter-spacing: var(--body-lg-tracking);
  overflow-wrap: break-word;
}

h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
a:focus-visible { outline: var(--spine-w) solid var(--primary); outline-offset: var(--space-1); }

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-x);
}

h1 {
  font-size: var(--display-size);
  font-weight: var(--display-weight);
  line-height: 1.05;
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}

h2 {
  font-size: var(--heading-lg-size);
  font-weight: var(--heading-lg-weight);
  line-height: var(--heading-lg-leading);
  letter-spacing: var(--heading-lg-tracking);
  max-width: var(--measure);
  text-wrap: balance;
}

h3 {
  font-size: var(--title-size);
  font-weight: var(--title-weight);
  line-height: var(--title-leading);
  letter-spacing: var(--title-tracking);
}

.lead {
  max-width: var(--measure);
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-leading);
}

/* Hero: dark ink band */
.hero {
  background: var(--ink-1);
  color: var(--on-dark);
  border-bottom: var(--hairline) solid var(--ink-line);
  padding: var(--space-6) 0 var(--space-12);
}

.hero .lead { color: var(--on-dark-2); margin-top: var(--space-6); }

/* Lockup: the TF mark (from src/brand/tf-mark.svg) beside the name in Geist */
.wordmark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--title-size);
  font-weight: var(--title-weight);
  line-height: var(--title-leading);
  letter-spacing: var(--title-tracking);
  color: var(--on-dark);
  margin-bottom: var(--space-16);
}
.wordmark .mark { width: var(--mark-size); height: var(--mark-size); flex: none; }
.mark-t { fill: var(--primary-on-dark); }
.mark-f { fill: var(--on-dark); }

.hero-grid { display: grid; gap: var(--space-10); }

/* Light sections */
.section { padding: var(--section-y) 0; }
.section-alt {
  background: var(--surface);
  border-top: var(--hairline) solid var(--line);
  border-bottom: var(--hairline) solid var(--line);
}

.section h2 + * { margin-top: var(--space-10); }
.section p { color: var(--on-surface-2); }
.section h3 + p { margin-top: var(--space-2); font-size: var(--body-size); line-height: var(--body-leading); }

/* The problem: a timeline, because the beats happen in order */
.beats { position: relative; display: grid; gap: var(--space-8); }

.beats::before {
  content: "";
  position: absolute;
  top: var(--space-2);
  bottom: var(--space-2);
  left: calc(var(--space-2) - var(--spine-w) / 2);
  width: var(--spine-w);
  background: var(--line);
}

.beats li { position: relative; padding-left: var(--space-10); }

.beats li::before {
  content: "";
  position: absolute;
  top: var(--space-1);
  left: 0;
  width: var(--space-4);
  height: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--surface);
  border: var(--spine-w) solid var(--on-surface-3);
}

.beats li:last-child h3 { color: var(--on-surface-2); }
.beats li:last-child::before { background: var(--on-surface-3); }

/* How it works: numbered, because these are steps */
.steps { display: grid; gap: var(--space-6); counter-reset: step; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: calc(var(--marker-size) + var(--space-4));
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: var(--marker-size);
  height: var(--marker-size);
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: var(--label-size);
  font-weight: var(--title-weight);
  line-height: 1;
}

/* Features grid */
.features { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-min)), 1fr)); }

.features li {
  background: var(--surface);
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-1);
}

/* Book a demo: the primary CTA button */
.cta-row { margin-top: var(--space-8); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-min-height);
  padding: 0 var(--space-6);
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--body-lg-size);
  font-weight: var(--title-weight);
  text-decoration: none;
  transition: background var(--motion-base);
}

.btn:hover { background: var(--primary-strong); }
.btn:focus-visible { outline: var(--spine-w) solid var(--primary); outline-offset: var(--space-1); box-shadow: 0 0 0 var(--space-1) var(--primary-ring); }

/* Final CTA */
.cta { background: var(--surface); border-top: var(--hairline) solid var(--line); }
.cta .lead { color: var(--on-surface-2); }

/* Footer */
.footer {
  background: var(--ink-0);
  color: var(--on-dark-2);
  padding: var(--space-8) 0;
  font-size: var(--body-size);
}

.footer .wrap { display: grid; gap: var(--space-3); }

.footer p { margin: 0; }

.footer a { color: var(--on-dark); }

.footer a:focus-visible { outline: var(--space-1) solid var(--primary); outline-offset: var(--space-1); }

.footer-legal { color: var(--on-dark-3); }

/* Larger screens */
@media (min-width: 768px) {
  :root { --content-x: 32px; --section-y: 6rem; }
  h1 { font-size: clamp(var(--display-size), 6vw, 4.5rem); }
  h2 { font-size: clamp(var(--heading-lg-size), 3.4vw, 2.25rem); }
  .hero { padding-bottom: var(--space-24); }
  .wordmark { margin-bottom: var(--space-24); }
  .hero .lead { font-size: 1.25rem; }
  .beats { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
  .beats::before { top: calc(var(--space-2) - var(--spine-w) / 2); bottom: auto; left: var(--space-2); right: 0; width: auto; height: var(--spine-w); }
  .beats li { padding-left: 0; padding-top: var(--space-10); }
  .beats li::before { top: 0; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
  .features { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: var(--space-12); }
}

@media (min-width: 768px) {
  .footer .wrap { grid-template-columns: 1fr auto auto; gap: var(--space-8); align-items: baseline; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}

/* Screenshots: the 1440x900 attributes hold the aspect box, max-width keeps them inside the viewport */
.shot { margin: 0; min-width: 0; }

.shot img {
  display: block;
  width: 100%;
  max-width: var(--screenshot-max);
  height: auto;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  background: var(--background);
}

.shot figcaption {
  margin-top: var(--space-3);
  font-size: var(--caption-size);
  line-height: var(--caption-leading);
  color: var(--on-surface-3);
}

.hero .shot img { border-color: var(--ink-line); }
.hero .shot figcaption { color: var(--on-dark-3); }
.section .shot { margin-top: var(--space-12); }
