/* ══════════════════════════════════════════════════
   FlowsPomo Marketing Site — Shared Stylesheet
   Matches the iOS app's design system exactly
   ══════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Montserrat', 'Montserrat-Fallback', system-ui, sans-serif;
  background: var(--bg-deeper);
  color: var(--text-1);
  font-size: 1rem;
  line-height: 1.7; /* +0.1 for light-on-dark readability */
  font-kerning: normal;
  overflow-x: hidden;
}
/* Metric-matched fallback to reduce FOUT layout shift */
@font-face {
  font-family: 'Montserrat-Fallback';
  src: local('Arial');
  size-adjust: 112%;
  ascent-override: 87%;
  descent-override: 23%;
  line-gap-override: 0%;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; cursor: pointer; background: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ── Skip-to-content (keyboard a11y) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  box-shadow: var(--clay-accent);
  transition: top 0.15s var(--ease-out);
}
.skip-link:focus {
  top: 12px;
}

/* ── Focus-visible (keyboard accessibility) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Suppress outline on mouse click for clean visuals */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Design Tokens (matching app) ── */
:root {
  --bg-deeper: #05060a;
  --bg-0: #0a0b10;
  --bg-1: #10121a;
  --bg-2: #171923;
  --bg-3: #1e2030;
  --bg-card: #12141e;
  --border: rgba(235,225,200,0.08);
  --border-md: rgba(235,225,200,0.13);
  --border-strong: rgba(235,225,200,0.22);
  --text-1: #ede8dc;
  --text-2: #8a8278;
  --text-3: #736d66;
  --accent: #5c8054;
  --accent-2: #7ea276;
  --accent-dim: rgba(92,128,84,0.14);
  --accent-glow: rgba(92,128,84,0.32);
  --green: #6aab5e;
  --yellow: #c9a84c;
  --red: #c95c5c;
  --font-serif: 'Instrument Serif', serif;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 12px 40px rgba(0,0,0,0.7);
  --shadow-sm: 0 3px 14px rgba(0,0,0,0.5);
  /* Easing */
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-micro: cubic-bezier(0.4, 0, 0.2, 1);
  /* Clay effects */
  --clay-btn: inset 0 1px 1px rgba(255,255,255,0.28), inset 0 0 0 1px rgba(255,255,255,0.08), inset 0 -1px 2px rgba(0,0,0,0.10), 0 3px 10px rgba(0,0,0,0.16), 0 1px 3px rgba(0,0,0,0.10);
  --clay-btn-hover: inset 0 1px 1px rgba(255,255,255,0.38), inset 0 0 0 1px rgba(255,255,255,0.14), inset 0 -1px 2px rgba(0,0,0,0.10), 0 6px 18px rgba(0,0,0,0.22), 0 2px 5px rgba(0,0,0,0.12);
  --clay-accent: inset 0 1px 1px rgba(255,255,255,0.32), inset 0 0 0 1px rgba(255,255,255,0.12), inset 0 0 10px rgba(255,255,255,0.05), 0 3px 10px rgba(0,0,0,0.16), 0 1px 3px rgba(0,0,0,0.10);
  --clay-accent-hover: inset 0 1px 1px rgba(255,255,255,0.42), inset 0 0 0 1px rgba(255,255,255,0.18), inset 0 0 14px rgba(255,255,255,0.07), 0 6px 20px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.12);
  --clay-icon: drop-shadow(0 1px 1.5px rgba(0,12,35,0.22)) drop-shadow(0.3px 0.6px 0.3px rgba(60,90,140,0.12)) drop-shadow(0 0.3px 0.6px rgba(0,10,30,0.1));
  /* Layout */
  --site-max: 1200px;
  --site-gutter: clamp(24px, 4vw, 48px);
  /* ── Typography Tokens ──
     Modular scale: 1.25 ratio (major third)
     Base: 1rem (16px). Steps: ×0.75, ×0.875, ×1, ×1.125, ×1.25
     Only headings use fluid clamp(); body/UI sizes are fixed rem. */
  --text-xs: 0.75rem;    /* 12px — captions, legal, badges */
  --text-sm: 0.875rem;   /* 14px — secondary UI, metadata, footer */
  --text-base: 1rem;     /* 16px — body text */
  --text-md: 1.125rem;   /* 18px — lead body, card text */
  --text-lg: 1.25rem;    /* 20px — subheadings, nav wordmark */
  /* Line-heights: bumped +0.05-0.1 for light-on-dark */
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.7;
  --lh-loose: 1.75;
  /* Weight roles */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semi: 600;
  --weight-bold: 700;
  /* Measure: max characters per line */
  --measure: 65ch;
  --measure-narrow: 50ch;
}

/* ── Typography Scale ──
   Display & headings: fluid clamp() for marketing hero sizing.
   Body & UI text: fixed rem from tokens for spatial predictability. */
.t-display {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(2.8rem, 5vw + 1rem, 5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.t-h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(2rem, 3vw + 0.8rem, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.t-h2 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(1.5rem, 2vw + 0.5rem, 2.2rem);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.t-h3 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--text-lg); /* fixed 1.25rem */
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
}
.t-body {
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--text-2);
  max-width: var(--measure);
}
.t-body-lg {
  font-size: var(--text-md); /* fixed 1.125rem */
  line-height: var(--lh-body);
  color: var(--text-2);
  max-width: var(--measure);
}
.t-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.t-small {
  font-size: var(--text-sm);
  line-height: var(--lh-body);
  color: var(--text-2);
}
/* Serif accent — use sparingly on 1-2 words in headlines */
.t-serif {
  font-family: var(--font-serif);
  font-style: italic;
}
/* OpenType features for tabular data */
.t-tabular { font-variant-numeric: tabular-nums; }

/* ── Layout Utilities ── */
.site-w { max-width: var(--site-max); margin: 0 auto; padding: 0 var(--site-gutter); }
.site-w-narrow { max-width: 800px; margin: 0 auto; padding: 0 var(--site-gutter); }
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section + .section { border-top: 1px solid var(--border); }

/* ── Navigation ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(5,6,10,0.82);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease-out);
}
.nav-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--site-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.15s;
}
.nav-brand:hover { opacity: 0.8; }
.nav-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: var(--clay-accent);
  display: flex; align-items: center; justify-content: center;
}
.nav-logo svg { width: 18px; height: 18px; color: #fff; filter: var(--clay-icon); }
.nav-wordmark {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-1);
  -webkit-text-stroke: 0.4px currentColor;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-2);
  transition: color 0.15s;
  position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--text-1); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.nav-cta {
  font-size: var(--text-sm); font-weight: var(--weight-semi);
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--clay-accent);
  transition: box-shadow 0.2s, transform 0.15s var(--ease-micro);
}
.nav-cta:hover { box-shadow: var(--clay-accent-hover); transform: translateY(-1px); }
.nav-cta:active { transform: scale(0.97); }
.nav-cta:focus-visible { outline-offset: 4px; }

/* Mobile nav toggle */
.nav-hamburger {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}
.nav-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  position: relative;
  transition: background 0.2s;
}
.nav-hamburger span::before,
.nav-hamburger span::after {
  content: ''; position: absolute; left: 0;
  width: 18px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform 0.25s var(--ease-out);
}
.nav-hamburger span::before { top: -6px; }
.nav-hamburger span::after { top: 6px; }
.nav-hamburger.open span { background: transparent; }
.nav-hamburger.open span::before { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  background: rgba(5,6,10,0.95);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  z-index: 99;
  padding: 32px var(--site-gutter);
  flex-direction: column;
  gap: 8px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: block;
  padding: 14px 16px;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.mobile-nav a:hover, .mobile-nav a.active { color: var(--text-1); background: rgba(255,255,255,0.05); }
.mobile-nav .nav-cta {
  display: inline-block;
  margin-top: 16px;
  text-align: center;
  font-size: var(--text-base);
  padding: 14px 24px;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  transition: all 0.2s var(--ease-micro);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--clay-accent);
}
.btn-primary:hover {
  box-shadow: var(--clay-accent-hover);
  transform: translateY(-2px);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-1);
  border: 1px solid var(--border-md);
  box-shadow: var(--clay-btn);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  box-shadow: var(--clay-btn-hover);
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}
.btn-secondary:active { transform: scale(0.97); }

.btn-ghost {
  color: var(--text-2);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text-1); }

.btn:focus-visible { outline-offset: 4px; border-radius: 999px; }
.btn svg { width: 18px; height: 18px; filter: var(--clay-icon); }

/* ── Cards ── */
.glass-card {
  background: rgba(18,18,22,0.82);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--clay-btn);
  transition: box-shadow 0.25s, transform 0.25s var(--ease-out);
}
.glass-card:hover {
  box-shadow: var(--clay-btn-hover);
  transform: translateY(-4px);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 40px;
  background: var(--bg-0);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand-col .nav-brand { margin-bottom: 16px; }
.footer-brand-col p { font-size: var(--text-sm); color: var(--text-3); max-width: 32ch; line-height: var(--lh-body); }
.footer-col h4 {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-2);
  padding: 6px 0;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--text-1); }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy { font-size: var(--text-xs); color: var(--text-3); }
.footer-socials { display: flex; gap: 16px; }
.footer-socials a {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-3);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.footer-socials a:hover { background: rgba(255,255,255,0.08); color: var(--text-1); border-color: var(--border-md); }
.footer-socials a svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
  .footer-col a { padding: 10px 0; } /* 44px+ touch targets */
  .footer-socials a { width: 44px; height: 44px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── Entrance Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.anim-up {
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-out) both;
}
.anim-up-d1 { animation-delay: 0.08s; }
.anim-up-d2 { animation-delay: 0.16s; }
.anim-up-d3 { animation-delay: 0.24s; }
.anim-up-d4 { animation-delay: 0.32s; }
.anim-up-d5 { animation-delay: 0.4s; }
.anim-up-d6 { animation-delay: 0.48s; }

/* Scroll-triggered reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Ambient Background ── */
.ambient-glow {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: -1;
  overflow: hidden;
}
.ambient-glow::before {
  content: '';
  position: absolute;
  top: -30%; left: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(ellipse, rgba(92,128,84,0.06) 0%, transparent 70%);
  filter: blur(80px);
}
.ambient-glow::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 50%; height: 50%;
  background: radial-gradient(ellipse, rgba(201,168,76,0.03) 0%, transparent 70%);
  filter: blur(80px);
}

/* ── Divider Accents ── */
.accent-line {
  width: 48px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.6;
}

/* ── Tag / Badge ── */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent-2);
  border: 1px solid rgba(92,128,84,0.2);
}
.tag-new { background: rgba(201,168,76,0.12); color: var(--yellow); border-color: rgba(201,168,76,0.2); }

/* ── Scroll-triggered observer ── */
/* Applied via shared.js IntersectionObserver */

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
