/*
 * Time0 — website styles.
 *
 * Carries the 1.x site's look (its variables, values, buttons, cards, hero
 * gradient and footer) onto this site's markup. Light/dark is keyed on
 * data-mode, set before first paint by templates/_base.twig from the visitor's
 * choice or their system setting.
 *
 * The second block of variables (--text, --surface, --line, --space-*, …) are
 * the names the shared Preflow components (FAQ, feedback form, language
 * picker) use; they map onto Time0's palette here so those components need no
 * colours of their own.
 */

@font-face { font-family: Inter; src: url('/assets/fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url('/assets/fonts/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url('/assets/fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url('/assets/fonts/Inter-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

[data-theme="time0"] {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-dark: #4f46e5;
  --secondary: #f1f5f9;
  --accent: #10b981;
  --brand-emerald: #1DB584;
  --brand-navy: #1E2B4D;
  --danger: #ef4444;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --surface-primary: #ffffff;
  --surface-primary-alpha: rgba(255, 255, 255, 0.86);
  --surface-secondary: #f8fafc;
  --surface-tertiary: #f1f5f9;
  --background: #f8fafc;

  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --transition-normal: 0.2s ease;
  --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  --footer-bg: #1e293b;
  --footer-text: #94a3b8;

  /* Names the shared components use. */
  --text: var(--text-primary);
  --text-muted: var(--text-tertiary);
  --surface: var(--surface-primary);
  --surface-muted: var(--surface-secondary);
  --surface-sunken: var(--surface-tertiary);
  --line: var(--border);
  --accent-strong: var(--primary);
  --danger-text: #b91c1c;
  --danger-surface: #fef2f2;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-card: var(--shadow);
  --shadow-raised: var(--shadow-md);
  --radius-field: var(--border-radius-sm);
  --radius-pill: 999px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --tap-min: 44px;
}

[data-theme="time0"][data-mode="dark"] {
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --secondary: #334155;
  --accent: #34d399;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border: #334155;
  --surface-primary: #1e293b;
  --surface-primary-alpha: rgba(30, 41, 59, 0.86);
  --surface-secondary: #1a2333;
  --surface-tertiary: #334155;
  --background: #1a202c;
  /* Cards, FAQ entries and the language list sit a step darker than the page. */
  --surface: #131b29;
  --surface-muted: #1a2333;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --gradient-bg: linear-gradient(135deg, #4338ca 0%, #581c87 100%);
  --footer-bg: #0f172a;
  --danger-text: #fca5a5;
  --danger-surface: #3b1d1d;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-primary);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; color: inherit; }
p { margin: 0; }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 28px; height: 28px; }
/* The icon sprite (templates/_icons.twig): symbols only, never drawn itself. */
.icon-sprite { display: none; }

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: var(--secondary); color: var(--text-primary); border: 2px solid var(--border); }

.eyebrow { display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--brand-emerald); margin-bottom: 0.75rem; }

/* ---------- Header ---------- */

/* Preflow wraps every component in its own <div>, so the sticky element has to
   be that wrapper: a sticky header inside it could only stick within itself. */
.page > div:has(> .site-header) { position: sticky; top: 0; z-index: 100; }
.site-header {
  background: var(--surface-primary-alpha);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.nav-bar__inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.wordmark { display: inline-flex; align-items: center; }
.wordmark__logo { height: 32px; width: auto; }
.wordmark__logo--dark { display: none; }
[data-mode="dark"] .wordmark__logo--light { display: none; }
[data-mode="dark"] .wordmark__logo--dark { display: inline; }
.nav-links { display: flex; gap: 24px; margin-right: auto; }
.nav-links a, .nav-panel a { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--primary); }
.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-control {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--border-radius-sm);
  border: 1px solid var(--border); background: var(--surface-primary); color: var(--text-primary); cursor: pointer;
}
.nav-control .icon { width: 18px; height: 18px; }
.icon--moon, [data-mode="dark"] .icon--sun { display: none; }
[data-mode="dark"] .icon--moon { display: inline; }
.nav-cta { padding: 10px 18px; font-size: 15px; }
.nav-burger, .nav-burger-state { display: none; }
.nav-panel { display: none; }

@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: inline-flex; }
  .site-header:has(.nav-burger-state:checked) { background: var(--surface-primary); }
  .site-header:has(.nav-burger-state:checked) .nav-panel {
    display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; border-top: 1px solid var(--border);
  }
  .nav-panel__cta { align-self: flex-start; color: #fff !important; }
}

/* ---------- Language picker (after the 1.x site's) ---------- */

.nav-tools .lang-picker__current {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 12px; border-radius: var(--border-radius-sm);
  border: 1px solid var(--border); background: var(--surface-primary); color: var(--text-primary);
  font: 600 14px var(--font-sans); letter-spacing: 0.04em;
}
.nav-tools .lang-picker__current .icon { width: 16px; height: 16px; }
.nav-tools .lang-picker__caret { width: 12px; height: 12px; transition: transform var(--transition-normal); }
.lang-picker--open .lang-picker__caret { transform: rotate(180deg); }
.nav-tools .lang-picker__list {
  min-width: 220px; padding: 6px; border-radius: var(--border-radius);
  background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-xl);
}
.nav-tools .lang-picker__list a {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 11px 14px; border-radius: var(--border-radius-sm);
  color: var(--text-primary); text-decoration: none; font-weight: 500;
}
.nav-tools .lang-picker__list a:hover { background: var(--surface-tertiary); }
.nav-tools .lang-picker__list a[aria-current] { background: rgba(99, 102, 241, 0.22); color: var(--brand-emerald); font-weight: 600; }
.nav-tools .lang-picker__list .lang-picker__code { color: var(--text-tertiary); font-size: 13px; letter-spacing: 0.18em; }
.nav-tools .lang-picker__list a[aria-current] .lang-picker__code { color: var(--brand-emerald); }

/* ---------- Sections ---------- */

.section { padding: 80px 0; }
.section--muted { background: var(--surface-secondary); }
.section__title { font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 700; text-align: center; margin-bottom: 1rem; }
.section__subtitle { font-size: 1.2rem; color: var(--text-secondary); max-width: 640px; margin: 0 auto 3rem; text-align: center; }

.hero { background: var(--gradient-bg); color: #fff; padding: 80px 0; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero__title { font-size: clamp(2.4rem, 5.5vw, 3.5rem); font-weight: 700; line-height: 1.1; margin-bottom: 1.5rem; }
.hero__lead { font-size: 1.2rem; opacity: 0.92; margin-bottom: 2rem; max-width: 34em; }
.hero__more { display: inline-block; margin-top: 1rem; color: #fff; font-weight: 600; }
.hero__shot {
  width: 100%; border-radius: 22px;
  filter: drop-shadow(0 25px 60px rgba(0, 0, 0, 0.3));
  /* The 1.x site's tilt: turned slightly away, straightening on hover. */
  transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
  transition: transform 0.3s ease;
}
.hero__shot:hover { transform: perspective(1000px) rotateY(-2deg) rotateX(1deg) scale(1.02); }
/* The logo's emerald for "Zero", in both modes. */
.brand-zero { color: var(--brand-emerald); }
.hero .btn-primary, .page-header .btn-primary { background: #fff; color: var(--primary-dark); }
.hero .btn-primary:hover, .page-header .btn-primary:hover { background: #eef2ff; }
.hero .btn-secondary, .page-header .btn-secondary { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.price-line { margin-top: 12px; font-size: 0.95rem; opacity: 0.9; }

.steps { list-style: none; padding: 0; margin: 3rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--border-radius); padding: 2rem; }
.step__number {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-emerald); color: #fff; font-weight: 700; margin-bottom: 1rem;
}
.step h3, .card h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.step p, .card p { color: var(--text-secondary); }

.cards { display: grid; gap: 24px; }
.cards--four { grid-template-columns: repeat(4, 1fr); }
.cards--two { grid-template-columns: repeat(2, 1fr); max-width: 900px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--border-radius); padding: 2rem; transition: all var(--transition-normal); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card > .icon {
  width: 48px; height: 48px; padding: 12px; margin-bottom: 1.25rem;
  border-radius: var(--border-radius); background: var(--gradient-primary); color: #fff;
}
.card--compact { padding: 1.5rem; }
.card--compact > .icon { width: 44px; height: 44px; padding: 10px; }

.highlight {
  max-width: 900px; margin: 2rem auto 0;
  background: var(--surface); border-left: 4px solid var(--brand-emerald);
  padding: 1.5rem; border-radius: var(--border-radius-sm);
}
.highlight h3 { margin-bottom: 0.5rem; }
.highlight p { color: var(--text-secondary); }

.screens { display: flex; gap: 20px; overflow-x: auto; padding: 8px 4px 20px; scroll-snap-type: x mandatory; }
.screen { margin: 0; flex: 0 0 220px; scroll-snap-align: start; }
.screen--wide { flex-basis: 420px; }
.screen--mac { flex-basis: 520px; }
.screen--mac img { border-radius: 12px; }
.screens__title { margin: 2.5rem 0 1rem; font-size: 1.35rem; text-align: center; }
.screen img { border-radius: 18px; box-shadow: var(--shadow-lg); }

.cta { background: var(--gradient-primary); color: #fff; text-align: center; }
.cta h2 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
.cta .store-buttons { justify-content: center; }
.page-header .store-buttons { justify-content: center; margin-top: 28px; }
.cta .btn-primary { background: #fff; color: var(--primary-dark); }
.cta .btn-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.cta__mac { margin-top: 0.75rem; opacity: 0.9; }
.cta__mac a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Sub-pages ---------- */

.page-header { background: var(--gradient-primary); color: #fff; padding: 72px 0 56px; text-align: center; }
.page-header .eyebrow { color: #d1fae5; }
.page-header h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin-bottom: 0.75rem; }
.page-header .lead { max-width: 640px; margin: 0 auto; opacity: 0.92; font-size: 1.1rem; }

.page-header + .container { padding-top: 40px; padding-bottom: 56px; }
.legal { max-width: 800px; padding-top: 48px; padding-bottom: 72px; }
.legal__section { margin-bottom: 2.25rem; }
.legal__section h2 { font-size: 1.35rem; margin-bottom: 0.75rem; }
.legal__section p { color: var(--text-secondary); margin-bottom: 0.75rem; }
.legal__updated { color: var(--text-tertiary); font-size: 0.9rem; }

.feedback { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; align-items: start; }
.feedback__intro { display: flex; flex-direction: column; gap: 14px; }
.feedback__intro h2 { font-size: 1.8rem; }
.feedback__intro p { color: var(--text-secondary); }
.feedback__warn { background: var(--surface-primary); border-left: 4px solid var(--brand-emerald); border-radius: var(--border-radius-sm); padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 60px 0 30px; }
.site-footer__cols { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.site-footer__brand .wordmark__logo--light { display: none; }
.site-footer__brand .wordmark__logo--dark { display: inline; }
.site-footer__tagline { margin-top: 12px; max-width: 24em; }
.site-footer__col { display: flex; flex-direction: column; gap: 8px; }
.site-footer__heading { color: #fff; font-weight: 600; margin-bottom: 4px; }
.site-footer a { color: var(--footer-text); text-decoration: none; }
.site-footer a:hover { color: #fff; }
/* The sister apps: icon and name. The icon is decoration — the name beside it is the link's text. */
.site-footer__app { display: inline-flex; align-items: center; gap: 10px; }
.site-footer__app img { border-radius: 22%; box-shadow: 0 0 0 1px #334155; }
.site-footer__bar { max-width: 1200px; margin: 40px auto 0; padding: 20px 20px 0; border-top: 1px solid #334155; font-size: 0.9rem; }

/* ---------- Narrow screens ---------- */

@media (max-width: 1000px) {
  .cards--four { grid-template-columns: repeat(2, 1fr); }
  .site-footer__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 56px; }
  .hero__grid, .steps, .cards--four, .cards--two { grid-template-columns: 1fr; }
  .hero__shot, .hero__shot:hover { transform: none; }
  .site-footer__cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
  .card:hover, .btn-primary:hover { transform: none; }
  .hero__shot { transition: none; }
}

/* ---------- Teaser video (SP5) ---------- */
.teaser__frame { position: relative; max-width: 1100px; margin: 0 auto; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); background: #0d1723; box-shadow: var(--shadow-lg, 0 20px 50px rgba(0, 0, 0, 0.25)); }
.teaser__video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #0d1723; }
.teaser__toggle { position: absolute; right: 16px; bottom: 16px; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(13, 23, 35, 0.72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.teaser__toggle .icon { width: 22px; height: 22px; fill: currentColor; }
.teaser__toggle .icon--pause, .teaser__toggle.is-playing .icon--play { display: none; }
.teaser__toggle.is-playing .icon--pause { display: block; }
.teaser__toggle:focus-visible { outline: 3px solid #1DB584; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .teaser__toggle:not(.is-playing) { width: 84px; height: 84px; right: calc(50% - 42px); bottom: calc(50% - 42px); } .teaser__toggle:not(.is-playing) .icon { width: 36px; height: 36px; } }
/* Phones: the tall cut's tab strip leaves ~55px free at each side; the button fits into the right one */
@media (max-width: 699px) { .teaser__video { aspect-ratio: 4 / 5; } .teaser__frame { border-radius: 16px; } .teaser__toggle { width: 40px; height: 40px; right: 8px; bottom: 8px; } .teaser__toggle .icon { width: 18px; height: 18px; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
