/* src/styles/tokens.css */
/* FlowState website: shared design tokens. Taken from the 2.0 app design. */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #f5f1e8;          /* page cream (matches the App Store screenshots) */
  --bg-2: #efe9dd;        /* deeper cream for alternating sections */
  --card: #fefdf9;        /* cards, same as in-app cards */

  /* Ink */
  --ink: #1a1714;
  --ink-2: #2d2a25;       /* dark pills and buttons */
  --muted: #6b655b;
  --muted-2: #8e877b;
  --line: #e4dccf;
  --line-strong: #d3c9b8;

  /* Brand */
  --green: #2e5d4f;
  --green-deep: #244a3f;
  --green-soft: #dfe9e4;
  --sage: #9fb8ad;
  --sage-soft: #cfdcd5;
  --sage-light: #c9dbd2;  /* sage for small text and icons on the green band (5.2:1) */
  --terracotta: #af5530;
  --terracotta-soft: #f3ddc5;
  --gold: #b18441;
  --gold-soft: #f1e4cf;
  --on-dark: #f5f1e8;

  /* Type */
  --font-display: "Playfair Display", "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --h-tracking: -0.02em;  /* display headings */
  --h-leading: 1.05;

  /* Shape */
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* Elevation (warm, soft) */
  --shadow-sm: 0 1px 2px rgba(45, 42, 37, 0.06), 0 2px 8px rgba(45, 42, 37, 0.06);
  --shadow: 0 12px 32px rgba(45, 42, 37, 0.10);
  --shadow-lg: 0 30px 60px rgba(45, 42, 37, 0.18);

  /* Layout */
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Script-specific font stacks. The Latin fonts stay first so "FlowState" and
   digits keep the brand look; the script font catches everything else. */
html[data-fonts="arabic"] {
  --font-display: "Playfair Display", "Noto Naskh Arabic", "Geeza Pro", serif;
  --font-body: "Inter", "Noto Sans Arabic", -apple-system, "Segoe UI", sans-serif;
  --h-tracking: 0;
  --h-leading: 1.3;
}
html[data-fonts="devanagari"] {
  --font-display: "Playfair Display", "Noto Serif Devanagari", "Kohinoor Devanagari", serif;
  --font-body: "Inter", "Noto Sans Devanagari", -apple-system, "Segoe UI", sans-serif;
  --h-tracking: 0;
  --h-leading: 1.3;
}
html[data-fonts="ja"] {
  --font-display: "Playfair Display", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", -apple-system, sans-serif;
  --h-tracking: 0;
  --h-leading: 1.25;
}
html[data-fonts="ko"] {
  --font-display: "Playfair Display", "Noto Serif KR", "Apple SD Gothic Neo", serif;
  --font-body: "Inter", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, sans-serif;
  --h-tracking: 0;
  --h-leading: 1.25;
  word-break: keep-all;
}
html[data-fonts="zh"] {
  --font-display: "Playfair Display", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  --h-tracking: 0;
  --h-leading: 1.25;
}

/* src/styles/site.css */
/* FlowState website: site styles (header, footer, home page, dialog).
   Depends on tokens.css. Logical properties throughout so RTL just works.
   Breakpoints: 480, 720, 900, 1100. */

/* ==========================================================================
   1. Reset and base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img,
video,
svg {
  max-width: 100%;
}

img,
video {
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--h-tracking);
  line-height: var(--h-leading);
  text-wrap: balance;
  font-variant-numeric: lining-nums;
  color: inherit;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--green);
  text-underline-offset: 3px;
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus {
  outline: none;
}

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

::selection {
  background: var(--green-soft);
  color: var(--ink);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--ink-2);
  color: var(--on-dark);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
}

/* Eyebrow: small caps label with the short green dash from the App Store screenshots. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--green);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

html:not([data-fonts="latin"]) .eyebrow {
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  text-transform: none; /* only the Latin words would change ("IPHONE"); keep the brand spelling */
}

/* ==========================================================================
   2. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--green);
  color: var(--on-dark);
}

.btn-primary:hover {
  background: var(--green-deep);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--card);
  border-color: var(--muted-2);
}

.btn-ghost .icon {
  color: var(--green);
}

.btn-outline-light {
  background: transparent;
  border-color: rgba(245, 241, 232, 0.55);
  color: var(--on-dark);
}

.btn-outline-light:hover {
  background: var(--on-dark);
  border-color: var(--on-dark);
  color: var(--green);
}

/* Arrows point the reading direction. */
[dir="rtl"] .icon-flip .icon {
  transform: scaleX(-1);
}

.icon-flip {
  display: inline-flex;
}

/* App Store button (emitted by layout.storeButton) */
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding-block: 6px;
  padding-inline: 14px 18px;
  border-radius: var(--radius-pill);
  background: var(--ink-2);
  color: var(--on-dark);
  text-decoration: none;
  white-space: nowrap;
}

.store-btn:hover {
  background: #1f1c18;
  box-shadow: var(--shadow);
}

.store-btn .icon-apple {
  width: 22px;
  height: 22px;
  margin-block-start: -2px;
}

.store-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
}

.store-small {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.05;
  opacity: 0.85;
}

.store-big {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.store-btn--sm {
  min-height: 40px;
  padding-block: 4px;
  padding-inline: 12px 15px;
  gap: 7px;
}

.store-btn--sm .icon-apple {
  width: 17px;
  height: 17px;
}

.store-btn--sm .store-small {
  font-size: 0.56rem;
}

.store-btn--sm .store-big {
  font-size: 0.86rem;
}

.store-btn--lg {
  min-height: 52px;
  padding-inline: 18px 24px;
  gap: 11px;
}

.store-btn--lg .icon-apple {
  width: 26px;
  height: 26px;
}

.store-btn--lg .store-small {
  font-size: 0.68rem;
}

.store-btn--lg .store-big {
  font-size: 1.22rem;
}

/* ==========================================================================
   3. Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 241, 232, 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.site-header.is-scrolled {
  box-shadow: 0 6px 24px rgba(45, 42, 37, 0.06);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--green);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.site-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.2vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-block;
  padding-block: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

.nav-list a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.nav-list a[aria-current="page"] {
  color: var(--ink);
}

.nav-mobile-extra {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-end: -8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.nav-toggle:hover {
  background: rgba(45, 42, 37, 0.06);
}

.nav-toggle .icon {
  width: 24px;
  height: 24px;
}

.nav-toggle-open,
.nav-toggle-close {
  display: grid;
  place-items: center;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-open,
.nav-toggle[aria-expanded="false"] .nav-toggle-close,
.nav-toggle:not([aria-expanded]) .nav-toggle-close {
  display: none;
}

/* Language menu */
.lang {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding-inline: 11px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.lang-btn:hover {
  background: var(--card);
}

.lang-btn .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.lang-btn .icon:last-child {
  width: 15px;
  height: 15px;
}

.lang-btn[aria-expanded="true"] .icon:last-child {
  transform: rotate(180deg);
}

.lang-pop {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 60;
  width: max-content;
  min-width: 220px;
  max-width: min(92vw, 400px);
  max-height: 70vh;
  overflow: auto;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.lang-pop[hidden] {
  display: none;
}

.lang-title {
  margin: 0 0 6px;
  padding: 4px 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lang-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
}

.lang-list a:hover,
.lang-list a:focus-visible {
  background: var(--bg);
}

.lang-list a:focus-visible {
  outline-offset: -2px;
}

.lang-list a[aria-current] {
  color: var(--green);
  font-weight: 600;
}

.lang-list a[aria-current]::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (min-width: 480px) {
  .lang-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 4px;
  }
}

/* Tight desktop widths: keep everything on one line. */
@media (min-width: 900px) and (max-width: 1099px) {
  .header-row {
    gap: 16px;
  }

  .nav-list {
    gap: 14px;
  }

  .nav-list a {
    font-size: 0.88rem;
  }

  .lang-current {
    display: none;
  }
}

/* Mobile header */
@media (max-width: 899px) {
  .brand {
    margin-inline-end: auto;
  }

  .site-nav,
  .header-store {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  body.nav-open .site-nav {
    display: block;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow: auto;
    padding: 8px var(--gutter) 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px rgba(45, 42, 37, 0.12);
  }

  body.nav-open .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  body.nav-open .nav-list li + li {
    border-top: 1px solid var(--line);
  }

  body.nav-open .nav-list a {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding-block: 10px;
    color: var(--ink);
    font-size: 1.15rem;
    white-space: normal;
  }

  body.nav-open .nav-mobile-extra {
    display: block;
    margin-top: 16px;
  }

  body.nav-open .nav-mobile-extra .store-btn {
    min-height: 48px;
    padding-inline: 16px 22px;
  }

  body.nav-open .nav-mobile-extra .store-big {
    font-size: 1.05rem;
  }
}

@media (max-width: 479px) {
  .lang-pop {
    position: fixed;
    top: calc(var(--header-h) + 4px);
    inset-inline: 12px;
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 399px) {
  .lang-current {
    display: none;
  }

  .lang-btn {
    padding-inline: 9px 7px;
  }

  .brand-name {
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   4. Sections (shared)
   ========================================================================== */
.section {
  padding-block: clamp(64px, 10vw, 128px);
}

main section[id] {
  scroll-margin-top: var(--header-h);
}

.section-head {
  max-width: 46rem;
  margin-inline: auto;
  margin-bottom: clamp(40px, 6vw, 72px);
  text-align: center;
}

.section-head h2,
.cta h2 {
  margin-top: 16px;
  font-size: clamp(2.1rem, 4.2vw, 3.3rem);
}

.section-head .lead {
  max-width: 40rem;
  margin-top: 18px;
  margin-inline: auto;
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
}

/* Check lists (features and plans) */
.points {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.points .icon {
  width: 22px;
  height: 22px;
  margin-top: 0.12em;
  color: var(--green);
}

/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(40px, 7vw, 96px) clamp(56px, 8vw, 104px);
}

.hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}

.hero-copy {
  text-align: center;
}

.hero-title {
  margin-top: 20px;
  font-size: clamp(2.75rem, 6.5vw, 4.9rem);
  font-weight: 600;
  line-height: var(--h-leading);
  letter-spacing: var(--h-tracking);
}

html[data-fonts="arabic"] .hero-title,
html[data-fonts="devanagari"] .hero-title,
html[data-fonts="ja"] .hero-title,
html[data-fonts="ko"] .hero-title,
html[data-fonts="zh"] .hero-title {
  font-size: clamp(2.4rem, 5.6vw, 4.2rem);
}

/* Japanese: break headings between phrases, not mid-word (Chrome 119+). */
html[data-fonts="ja"] h1,
html[data-fonts="ja"] h2,
html[data-fonts="ja"] h3 {
  word-break: auto-phrase;
}

.hero-sub {
  max-width: 34ch;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.hero-actions .btn {
  min-height: 52px;
  padding-inline: 20px 24px;
}

.hero-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  isolation: isolate;
}

/* Soft cream-to-white glow and the brand ring, centred behind the phone.
   left/translate centring is symmetric, so it is direction-safe. */
.hero-visual::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: 50%;
  left: 50%;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fffdf8 0%, rgba(254, 253, 249, 0.7) 40%, rgba(245, 241, 232, 0) 100%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-ring {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  max-width: none;
  color: var(--sage);
  opacity: 0.35;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-phone {
  width: min(72vw, 300px);
  filter: drop-shadow(var(--shadow-lg));
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  }

  .hero-copy {
    text-align: start;
  }

  .hero-sub {
    margin-inline: 0;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-phone {
    width: clamp(250px, 30vw, 380px);
  }

  .hero-ring {
    width: clamp(760px, 66vw, 900px);
    height: clamp(760px, 66vw, 900px);
  }
}

/* ==========================================================================
   6. Band (header video)
   ========================================================================== */
.band {
  background: #f8f5ee;
  border-block: 1px solid var(--line);
  overflow: hidden;
}

.band-video {
  width: 100%;
  height: auto;
  aspect-ratio: 1920 / 823;
  object-fit: cover;
  object-position: center;
  background: #f8f5ee;
}

@media (max-width: 719px) {
  .band-video {
    aspect-ratio: 4 / 3;
  }
}

/* ==========================================================================
   7. Features
   ========================================================================== */
.feature-list {
  display: grid;
  gap: clamp(56px, 8vw, 112px);
}

.feature {
  --tint: var(--green-soft);
  display: grid;
  gap: 32px clamp(40px, 6vw, 88px);
  align-items: center;
}

.feature-rules {
  --tint: var(--terracotta-soft);
}

.feature-schedule {
  --tint: var(--gold-soft);
}

.feature-progress {
  --tint: var(--sage-soft);
}

.feature-media {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: clamp(420px, 46vw, 580px);
  padding: clamp(32px, 4.5vw, 56px) 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 55% at 50% 38%, var(--tint) 0%, rgba(245, 241, 232, 0) 100%),
    linear-gradient(180deg, var(--card) 0%, var(--bg-2) 100%);
}

.feature-phone {
  width: clamp(240px, 26vw, 340px);
  filter: drop-shadow(0 22px 40px rgba(45, 42, 37, 0.16));
}

/* Headline first on small screens, like the App Store screenshots. */
.feature-copy {
  order: -1;
  max-width: 32rem;
}

.feature-copy h3 {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
}

.feature-lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
}

.feature-copy .points {
  margin-top: 28px;
}

@media (min-width: 900px) {
  .feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .feature-copy {
    order: 0;
  }

  .feature:nth-child(even) .feature-media {
    order: 2;
  }
}

/* Three smaller cards */
.feature-grid {
  display: grid;
  gap: 20px;
  max-width: 480px;
  margin-top: clamp(64px, 9vw, 120px);
  margin-inline: auto;
}

@media (min-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }
}

.feature-card {
  --tint: var(--green-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.feature-card-limit {
  --tint: var(--terracotta-soft);
}

.feature-card-complete {
  --tint: var(--gold-soft);
}

.feature-card-copy {
  padding: 28px 28px 0;
}

.feature-card h3 {
  font-size: 1.55rem;
  line-height: 1.15;
}

html:not([data-fonts="latin"]) .feature-card h3 {
  line-height: var(--h-leading);
}

.feature-card-copy p {
  margin-top: 10px;
  color: var(--muted);
}

.feature-card-media {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 300px;
  margin-top: auto;
  padding-top: 28px;
  overflow: hidden;
  background: radial-gradient(70% 80% at 50% 100%, var(--tint) 0%, rgba(254, 253, 249, 0) 100%);
}

.feature-card-phone {
  width: min(78%, 240px);
  object-fit: cover;
  object-position: top;
  filter: drop-shadow(0 16px 30px rgba(45, 42, 37, 0.14));
}

/* ==========================================================================
   8. iPad
   ========================================================================== */
.ipad {
  padding-top: clamp(64px, 10vw, 128px);
  padding-bottom: 0;
  background: var(--bg-2);
  overflow: hidden;
}

/* The iPad cut-out has a flat bottom edge; show its top and let it sit flush on
   the section edge. The lower half of the screenshot is empty, so crop to 3:2. */
.ipad-frame {
  max-width: 1100px;
  margin-inline: auto;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.ipad-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

@media (max-width: 719px) {
  .ipad-frame {
    aspect-ratio: 5 / 4;
  }
}

/* ==========================================================================
   9. Privacy band
   ========================================================================== */
.privacy-band {
  background: var(--green);
  color: var(--on-dark);
}

.privacy-band .eyebrow {
  color: var(--sage-light);
}

.privacy-band .lead {
  color: rgba(245, 241, 232, 0.78);
}

.privacy-band :focus-visible {
  outline-color: var(--on-dark);
}

.privacy-cards {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .privacy-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

.privacy-card {
  padding: clamp(24px, 3vw, 32px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
}

.privacy-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--sage-light);
}

.privacy-icon .icon {
  width: 24px;
  height: 24px;
}

.privacy-card h3 {
  margin-top: 20px;
  font-size: 1.4rem;
  line-height: 1.2;
}

html:not([data-fonts="latin"]) .privacy-card h3 {
  line-height: var(--h-leading);
}

.privacy-card p {
  margin-top: 10px;
  color: rgba(245, 241, 232, 0.88);
}

.privacy-more {
  margin-top: clamp(36px, 5vw, 56px);
  text-align: center;
}

/* ==========================================================================
   10. Pro
   ========================================================================== */
.plans {
  display: grid;
  gap: 20px;
  max-width: 880px;
  margin-inline: auto;
}

@media (min-width: 720px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

.plan {
  padding: clamp(28px, 4vw, 40px);
  border-radius: var(--radius-lg);
}

.plan-free {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.plan-pro {
  background: var(--ink-2);
  border: 1px solid var(--ink-2);
  color: var(--on-dark);
  box-shadow: var(--shadow);
}

.plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.plan-pro .plan-head {
  border-bottom-color: rgba(245, 241, 232, 0.14);
}

.plan-name {
  font-size: 2.1rem;
}

.plan-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.plan-pro .points .icon {
  color: var(--sage);
}

.plan-pro :focus-visible {
  outline-color: var(--on-dark);
}

.pro-note {
  max-width: 40rem;
  margin: 32px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ==========================================================================
   11. FAQ
   ========================================================================== */
.faq {
  background: var(--bg-2);
}

.faq-list {
  max-width: 760px;
  margin-inline: auto;
  border-top: 1px solid var(--line-strong);
}

.faq-item {
  border-bottom: 1px solid var(--line-strong);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 22px;
  cursor: pointer;
  list-style: none;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.4;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::marker {
  content: "";
}

.faq-item summary:hover .faq-q {
  color: var(--green);
}

.faq-item summary .icon {
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.faq-item[open] summary .icon {
  transform: rotate(180deg);
  color: var(--green);
}

.faq-a {
  max-width: 65ch;
  padding-bottom: 24px;
  color: var(--muted);
}

/* ==========================================================================
   12. CTA
   ========================================================================== */
.cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.cta-ring {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 820px;
  height: 820px;
  max-width: none;
  color: var(--sage);
  opacity: 0.22;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cta-inner {
  max-width: 44rem;
}

.cta h2 {
  margin-top: 0;
  font-size: clamp(2.5rem, 5.6vw, 4.2rem);
}

.cta .lead {
  margin-top: 18px;
}

.cta-actions {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.cta-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   13. Footer
   ========================================================================== */
.site-footer {
  padding-block: 56px 32px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.footer-top {
  display: grid;
  gap: 28px;
  align-items: center;
}

@media (min-width: 900px) {
  .footer-top {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 40px;
  }
}

.footer-tagline {
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
}

html:not([data-fonts="latin"]) .footer-tagline {
  font-style: normal;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  /* Wider hit area for short labels, without moving the text. */
  padding-inline: 8px;
  margin-inline: -8px;
  color: var(--ink);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--green);
  text-decoration: underline;
}

.lang-select {
  position: relative;
  display: inline-block;
  justify-self: start;
  max-width: 100%;
}

.lang-select select {
  -webkit-appearance: none;
  appearance: none;
  max-width: 100%;
  min-height: 42px;
  padding-block: 6px;
  padding-inline: 40px 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.lang-select select:hover {
  border-color: var(--muted-2);
}

.lang-select > .icon {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.lang-select > .icon:first-child {
  inset-inline-start: 14px;
}

.lang-select > .icon:last-child {
  inset-inline-end: 13px;
  width: 15px;
  height: 15px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-apple {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ==========================================================================
   14. Preview dialog
   ========================================================================== */
dialog.preview {
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

dialog.preview::backdrop {
  background: rgba(26, 23, 20, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.preview-inner {
  position: relative;
}

.preview-video {
  width: auto;
  height: min(86vh, 820px);
  max-width: calc(100vw - 32px);
  aspect-ratio: 9 / 19.5;
  object-fit: contain;
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow-lg);
}

.preview-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  inset-inline-end: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--on-dark);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.preview-close:hover {
  background: #fff;
}

.preview-close .icon {
  width: 20px;
  height: 20px;
}

@media (min-width: 480px) {
  .preview-close {
    top: -14px;
    inset-inline-end: -14px;
  }
}

body.preview-open {
  overflow: hidden;
}

/* ==========================================================================
   15. 404
   ========================================================================== */
.page-404 {
  min-height: 60vh;
  padding-block: clamp(64px, 10vw, 128px);
  text-align: center;
}

.page-404 h1 {
  margin-top: 16px;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.page-404 p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--muted);
}

.page-404 p:last-child {
  margin-top: 32px;
}

/* ==========================================================================
   16. Small screens
   ========================================================================== */
@media (max-width: 479px) {
  body {
    font-size: 16px;
  }

  .lead,
  .feature-lead {
    font-size: 1.08rem;
  }

  .hero-sub {
    font-size: 1.1rem;
  }

  .feature-card-copy {
    padding: 24px 22px 0;
  }

  .faq-item summary {
    font-size: 1.05rem;
  }
}

/* ==========================================================================
   17. Motion (only when the visitor hasn't asked for less)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .store-btn,
  .btn,
  .lang-btn,
  .nav-list a {
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  }

  .store-btn:hover,
  .btn:hover {
    transform: translateY(-1px);
  }

  .lang-btn .icon:last-child,
  .faq-item summary .icon {
    transition: transform 0.25s var(--ease), color 0.2s var(--ease);
  }

  .feature-card {
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  }

  .feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }

  [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }

  [data-reveal].in {
    opacity: 1;
    transform: none;
  }

  .feature-card[data-reveal] {
    transition: opacity 0.6s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  }

  .feature-card[data-reveal].in:hover {
    transform: translateY(-2px);
  }
}

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

/* ==========================================================================
   18. Print
   ========================================================================== */
@media print {
  .site-header {
    position: static;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: none;
  }

  .header-actions,
  .site-nav,
  .skip-link,
  .band,
  dialog.preview,
  .hero-actions,
  .cta-actions,
  .lang-select {
    display: none !important;
  }

  .privacy-band,
  .plan-pro {
    background: none;
    color: var(--ink);
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* src/styles/legal.css */
/* FlowState website: Privacy Policy and Terms of Use.
   Base styles (.container, .eyebrow, .btn, header, footer) live in site.css.
   Logical properties only, so the Arabic (RTL) pages mirror correctly. */

.legal {
  padding-block: clamp(48px, 8vw, 96px);
}

.legal-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px);
}

/* ---------- Table of contents ---------- */

.legal-aside {
  min-width: 0;
}

.toc-title {
  margin: 0 0 0.9rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li + li {
  margin-block-start: 0.15rem;
}

.toc-list a {
  display: flex;
  gap: 0.35em;
  padding-block: 0.35rem;
  padding-inline: 0.75rem 0;
  border-inline-start: 2px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.toc-list a:hover,
.toc-list a:focus-visible {
  color: var(--ink);
  border-inline-start-color: var(--green);
}

.toc-list .num {
  color: var(--green);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* Wide screens: static sticky list; the <details> copy is not rendered. */
.toc-details {
  display: none;
}

/* Small screens: the collapsible <details> card; the static list is not rendered. */
@media (max-width: 999.98px) {
  .legal-aside > .toc {
    display: none;
  }

  .toc-details {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
  }

  .toc-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.15rem;
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    border-radius: 16px;
  }

  .toc-details > summary::-webkit-details-marker {
    display: none;
  }

  .toc-details > summary:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
  }

  .toc-details > summary .icon {
    width: 20px;
    height: 20px;
    flex: none;
    color: var(--muted);
    transition: transform 0.25s var(--ease);
  }

  .toc-details[open] > summary .icon {
    transform: rotate(180deg);
  }

  .toc-details[open] > summary {
    border-end-start-radius: 0;
    border-end-end-radius: 0;
    border-block-end: 1px solid var(--line);
  }

  .toc--compact {
    padding: 0.75rem 1.15rem 1rem;
  }

  /* Touch-sized rows in the collapsible list. */
  .toc--compact .toc-list a {
    align-items: center;
    min-height: 40px;
  }
}

@media (min-width: 1000px) {
  .legal-wrap {
    grid-template-columns: 240px minmax(0, 720px);
    justify-content: center;
  }

  .legal-aside {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    padding-block-end: 1rem;
  }
}

/* ---------- Article ---------- */

.legal-body {
  min-width: 0;
  color: var(--ink);
}

.legal-head {
  padding-block-end: 1.75rem;
  margin-block-end: 2rem;
  border-block-end: 1px solid var(--line);
}

.legal-head .eyebrow {
  margin-block-end: 0.75rem;
}

.legal-head h1 {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: var(--h-leading);
  letter-spacing: var(--h-tracking);
  color: var(--ink);
  overflow-wrap: break-word;
}

.legal-updated {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.legal-intro p {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.legal-section {
  margin-block: 2.5rem;
}

.legal-section[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.legal-section h2 {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.25;
  letter-spacing: var(--h-tracking);
  color: var(--ink);
}

.legal-section h2 .num {
  color: var(--green);
  margin-inline-end: 0.4em;
  font-variant-numeric: lining-nums tabular-nums;
}

.legal-section p,
.legal-section li {
  font-size: 1.05rem;
  line-height: 1.7;
}

.legal-section p {
  margin: 0 0 1rem;
}

.legal-section ul {
  margin: 0 0 1rem;
  padding-inline-start: 1.25rem;
}

.legal-section li::marker {
  color: var(--green);
}

.legal-section li + li {
  margin-block-start: 0.5rem;
}

.legal-section > :last-child {
  margin-block-end: 0;
}

.legal-intro a,
.legal-section a,
.legal-foot p a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.legal-intro a:hover,
.legal-section a:hover,
.legal-foot p a:hover {
  color: var(--green-deep);
  text-decoration-thickness: 2px;
}

/* Contact */
.legal-contact p {
  font-size: 1.15rem;
}

.legal-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  margin-block-start: 0.25rem;
  font-weight: 500;
  color: var(--green);
}

.legal-contact a .icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

/* Footer of the article */
.legal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-block-start: 3rem;
  padding-block-start: 1.75rem;
  border-block-start: 1px solid var(--line);
}

.legal-foot p {
  margin: 0;
  color: var(--muted);
}

.legal-back .icon {
  width: 18px;
  height: 18px;
  transform: scaleX(-1); /* the arrow points back (towards the start) */
}

[dir="rtl"] .legal-back .icon {
  transform: none;
}

/* Developer placeholders that must be replaced before launch. */
mark.placeholder {
  unicode-bidi: isolate; /* English placeholder inside RTL text stays in one piece */
  white-space: nowrap;
  background: var(--gold-soft);
  color: var(--ink);
  padding: 0 0.3em;
  border-radius: 6px;
  outline: 1px dashed var(--gold);
}

/* ---------- Print ---------- */

@media print {
  .legal-aside,
  .legal-back {
    display: none !important;
  }

  .legal {
    padding-block: 0;
  }

  .legal-wrap {
    display: block;
  }

  .legal-body,
  .legal-body h1,
  .legal-body h2,
  .legal-body .num,
  .legal-body p,
  .legal-body li,
  .legal-body a,
  .legal-updated {
    color: #000 !important;
    background: #fff;
  }

  body.page-legal {
    background: #fff;
    color: #000;
  }

  .legal-section h2 {
    break-after: avoid;
  }

  .legal-body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    overflow-wrap: anywhere;
  }

  mark.placeholder {
    outline: 1px dashed #000;
    background: #fff;
  }
}
