/*
  Cruise landing: design system notes (for whoever touches this next).

  Brand: Charcoal #2C2A29 + Amber #E9BA50 (official brand kit, 2026-09-30).
  Source of truth for color is the app itself
  (cruise_flutter/lib/core/theme/app_color_tokens.dart). The values below are
  those tokens verbatim, so real app screenshots blend into the page with no
  seams. One accent only: amber (--primary) for fills, dark amber (--accent)
  for amber text on light. One theme per visitor, no inverted sections: it
  follows prefers-color-scheme until the visitor picks one with the nav's
  theme button, which sets <html data-theme="light|dark"> (see script.js).
  So every dark rule appears twice: under the media query (unless forced
  light) and under [data-theme="dark"]. Keep each pair in sync.

  Logo rules (brand kit): on light, charcoal ink + amber accent; on dark,
  solid amber (--mark-ink / --mark-accent). Clear space around the logo >=
  the gap inside the split-C. Minimum: mark 16px, wordmark 80px wide.

  Shape scale (one rule, used everywhere):
    interactive + chips ........ full pill
    outer shells (bezel) ....... 32px, inner cores 26px (concentric: 32 - 6)
    media inside cores ......... 20px
    small tags ................. 10px

  Type: Vazirmatn for Persian, Montserrat for Latin (both self-hosted, OFL;
  Latin runs are marked lang="en"). Persian script must never get
  letter-spacing (it breaks the joins), so tracking is only applied to the
  Latin CRUISE logotype.

  Motion: transform + opacity only. All of it collapses under
  prefers-reduced-motion. Reveal-on-scroll signals hierarchy; the hero
  entrance signals depth (front phone lands first).

  z-index scale: nav 20, grain 30. Nothing else needs one.

  Blog pages are generated by scripts/build-blog.mjs and reuse the same
  components (bento cells as post cards, tags, the notify card); only the
  long-form article typography (.prose) is blog-specific.
*/

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f8f5f3;
  --bg-2: #efecea;
  --bg-3: #fefdfc;
  --bg-4: #e8e6e3;
  --text: #2c2a29;
  --text-2: #67625f;
  --line: #d9d7d5;
  --line-strong: #8e8c8a;
  --primary: #e9ba50;
  --on-primary: #2c2a29;
  --accent: #7d5e07;
  --tag-bg: #fbe6bb;
  --tag-text: #553e00;
  --mark-ink: #2c2a29;
  --mark-accent: #e9ba50;
  --phone-a: #45423f;
  --phone-b: #1c1b1a;
  --shadow-rgb: 44 42 41;
  --error: #a83630;
  --success: #21763c;

  --r-shell: 32px;
  --r-core: 26px;
  --r-media: 20px;
  --r-tag: 10px;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 40px);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --z-nav: 20;
  --z-grain: 30;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2c2a29;
    --bg-2: #333130;
    --bg-3: #373533;
    --bg-4: #43413f;
    --text: #f3efec;
    --text-2: #b9b3ae;
    --line: #4b4847;
    --line-strong: #767472;
    --primary: #e9ba50;
    --on-primary: #2c2a29;
    --accent: #e9ba50;
    --tag-bg: #594414;
    --tag-text: #fee5b3;
    --mark-ink: #e9ba50;
    --mark-accent: #e9ba50;
    --phone-a: #4a4744;
    --phone-b: #161514;
    --shadow-rgb: 0 0 0;
    --error: #ffa69b;
    --success: #7dd992;
  }
}

:root[data-theme="dark"] {
  --bg: #2c2a29;
  --bg-2: #333130;
  --bg-3: #373533;
  --bg-4: #43413f;
  --text: #f3efec;
  --text-2: #b9b3ae;
  --line: #4b4847;
  --line-strong: #767472;
  --primary: #e9ba50;
  --on-primary: #2c2a29;
  --accent: #e9ba50;
  --tag-bg: #594414;
  --tag-text: #fee5b3;
  --mark-ink: #e9ba50;
  --mark-accent: #e9ba50;
  --phone-a: #4a4744;
  --phone-b: #161514;
  --shadow-rgb: 0 0 0;
  --error: #ffa69b;
  --success: #7dd992;
}

* { box-sizing: border-box; }

html {
  color-scheme: light dark;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Film grain: one fixed, pointer-less layer (never on scrolling content). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::after { opacity: 0.07; }
}
:root[data-theme="dark"] body::after { opacity: 0.07; }

h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: var(--z-nav);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip:focus { transform: translateY(0); }

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

.mark { display: block; flex: none; }

/* ---------- Nav: floating glass island ---------- */

.nav {
  position: fixed;
  inset-block-start: 14px;
  inset-inline: 0;
  z-index: var(--z-nav);
  display: flex;
  justify-content: center;
  padding-inline: 12px;
  pointer-events: none;
}

.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding-inline: 8px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 45%, transparent),
    0 14px 34px -18px rgb(var(--shadow-rgb) / 0.4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-inline: 12px 16px;
  height: 40px;
}

.brand .mark { width: 25px; height: 26px; }
.brand .wordmark { width: 80px; height: 30px; }

/* Index nav: the island carries the mark alone (the hero shows the full
   lockup right below it). */
.brand--mark { padding-inline: 10px; }

:lang(en) { font-family: "Montserrat", "Vazirmatn", sans-serif; }

/* ---------- Primary logo lockup (hero introduction) ---------- */

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.lockup__mark { width: 60px; height: 62px; flex: none; }

.lockup__type { display: grid; gap: 8px; justify-items: stretch; }
.lockup__fa { width: 138px; height: 51px; display: block; }

.lockup__en {
  /* Letters spread edge to edge under the Farsi wordmark, as in the
     designer's lockup. Uses the text-safe amber (dark amber on light,
     amber on dark); the logo shapes keep the true brand amber. */
  display: flex;
  justify-content: space-between;
  direction: ltr;
  font: 700 12px/1 "Montserrat", sans-serif;
  color: var(--accent);
}


.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--text-2);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.nav-links a:hover,
.nav-links a[aria-current] {
  background: var(--bg-4);
  color: var(--text);
}

/* Theme button: shows the moon in light (press for dark), the sun in dark.
   Hidden without JS, since only script.js can act on it. */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.theme-toggle:hover {
  background: var(--bg-4);
  color: var(--text);
}

.theme-toggle svg { width: 20px; height: 20px; fill: currentColor; }
.theme-toggle__sun { display: none; }
:root:not(.js) .theme-toggle { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }

/* Phones keep page links (the blog) and drop the in-page section anchors. */
@media (max-width: 520px) {
  .nav-links a[href^="#"],
  .nav-links a[href^="/#"] { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  padding-inline-start: 26px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 1.02rem;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent),
    0 16px 30px -14px rgb(var(--shadow-rgb) / 0.55);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.btn__ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--on-primary) 14%, transparent);
  transition: transform 0.5s var(--ease), background-color 0.5s var(--ease);
}

.btn__ico svg { fill: currentColor; }

.btn:hover { transform: translateY(-2px); }
.btn:hover .btn__ico {
  transform: translateX(-3px) scale(1.06);
  background: color-mix(in srgb, var(--on-primary) 22%, transparent);
}
.btn:active { transform: translateY(0) scale(0.98); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn--ghost .btn__ico,
.btn--ghost:hover .btn__ico { background: color-mix(in srgb, var(--text) 10%, transparent); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-top: 36px; }

/* ---------- Tag ---------- */

.tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--r-tag);
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.85rem;
  font-weight: 700;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- Section rhythm ---------- */

.section { padding-block: clamp(64px, 8vw, 112px); position: relative; }

.section-title {
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.7rem);
  line-height: 1.4;
  font-weight: 800;
  max-width: 22ch;
}

.lead {
  margin-top: 16px;
  max-width: 56ch;
  color: var(--text-2);
  font-size: 1.08rem;
}

/* ---------- Reveal (progressive: content is visible without JS) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease),
    filter 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js .reveal.in-view {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: 104px clamp(56px, 8vw, 96px);
  min-height: min(100dvh, 900px);
  display: grid;
  align-items: center;
  background:
    radial-gradient(52% 46% at 22% 38%, color-mix(in srgb, var(--primary) 26%, transparent), transparent 72%),
    radial-gradient(38% 34% at 88% 8%, color-mix(in srgb, var(--tag-bg) 55%, transparent), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(40px, 7vw, 104px);
  align-items: center;
}

.hero-copy h1 {
  margin-top: 30px;
  font-size: clamp(2.05rem, 1rem + 3.1vw, 3.35rem);
  line-height: 1.34;
  font-weight: 800;
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-copy .lede {
  margin-top: 22px;
  max-width: 44ch;
  color: var(--text-2);
  font-size: 1.16rem;
}

/* ---------- Phone frame (double bezel: shell + screen) ---------- */

.phone {
  position: relative;
  padding: 7px;
  border-radius: 44px;
  background: linear-gradient(160deg, var(--phone-a), var(--phone-b));
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.1),
    0 46px 80px -34px rgb(var(--shadow-rgb) / 0.62),
    0 14px 26px -14px rgb(var(--shadow-rgb) / 0.4);
}

.phone picture,
.phone img { display: block; }

.phone img {
  width: 100%;
  height: auto;
  border-radius: 37px;
  background: var(--bg);
}

.stack {
  position: relative;
  justify-self: center;
  width: min(100%, 300px);
}

.stack .phone--back {
  position: absolute;
  z-index: 0;
  left: 44%;
  top: 46px;
  width: 86%;
  transform: rotate(6deg);
  transform-origin: 30% 100%;
}

.stack .phone--front { position: relative; z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .stack .phone--front {
    animation: rise 1.1s var(--ease) 0.1s both;
  }
  .stack .phone--back {
    animation: rise-back 1.3s var(--ease) 0.3s both;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(56px); }
  to { opacity: 1; transform: none; }
}

@keyframes rise-back {
  from { opacity: 0; transform: translateY(72px) rotate(10deg); }
  to { opacity: 1; transform: rotate(6deg); }
}

@media (max-width: 900px) {
  .hero { min-height: 0; padding-block-start: 112px; }
  .hero-grid { grid-template-columns: 1fr; }
  .stack { width: min(100%, 270px); margin-block-start: 8px; }
  .stack .phone--back { display: none; }
}

/* ---------- Statement (editorial, asymmetric) ---------- */

.statement { overflow: hidden; }

/* Sits on the open side (the text is right-aligned in RTL) and fully inside
   the section vertically, so nothing reads as a hard crop. */
.statement-mark {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: -6%;
  width: min(38vw, 440px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  opacity: 0.1;
  pointer-events: none;
}

.statement h2 {
  font-size: clamp(2rem, 1rem + 4.4vw, 4rem);
  line-height: 1.38;
  font-weight: 800;
  max-width: 20ch;
}

.statement p {
  margin-top: 32px;
  margin-inline-start: clamp(0px, 14vw, 200px);
  max-width: 54ch;
  color: var(--text-2);
  font-size: 1.16rem;
}

/* ---------- Bento (features) ---------- */

.bento {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.cell {
  padding: 6px;
  border-radius: var(--r-shell);
  background: var(--bg-2);
  box-shadow:
    0 0 0 1px var(--line),
    0 26px 44px -30px rgb(var(--shadow-rgb) / 0.45);
  transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}

.cell:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 34px 50px -30px rgb(var(--shadow-rgb) / 0.55);
}

.cell--wide { grid-column: span 2; }

.cell__core {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 30px 30px 0;
  border-radius: var(--r-core);
  background: var(--bg);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 60%, transparent);
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cell__core { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06); }
}
:root[data-theme="dark"] .cell__core { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06); }

.cell h3 { font-size: 1.25rem; font-weight: 700; }
.cell p { color: var(--text-2); font-size: 1rem; max-width: 46ch; }

.cell__vis {
  margin-top: auto;
  padding-top: 22px;
  max-height: 300px;
  overflow: hidden;
  display: grid;
  gap: 10px;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}

.cell__vis img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-media);
  transition: transform 0.8s var(--ease);
}

.cell:hover .cell__vis img { transform: translateY(-6px); }

/* Tinted cell: brand color block with the Orbit mark as watermark. */
.cell--tint { background: color-mix(in srgb, var(--primary) 55%, var(--bg-2)); }
.cell--tint .cell__core {
  background: color-mix(in srgb, var(--primary) 30%, var(--bg));
  padding-bottom: 30px;
  justify-content: flex-end;
  min-height: 250px;
}
.cell--tint .cell__ico {
  width: 46px;
  height: 46px;
  fill: var(--accent);
  margin-bottom: 10px;
}
.cell--tint p { color: color-mix(in srgb, var(--text) 78%, transparent); }
.cell__watermark {
  /* Tone-on-tone emboss: the split-C in the page color over the amber tint
     (charcoal on amber reads as a grey smudge). */
  --mark-ink: var(--bg);
  --mark-accent: var(--bg);
  position: absolute;
  inset-block-start: -30px;
  inset-inline-end: -40px;
  width: 210px;
  height: 217px;
  opacity: 0.55;
}

@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .cell--wide { grid-column: auto; }
  .cell__vis { max-height: 260px; }
}

/* ---------- Screens (staggered phones; scroll-snap row on small screens) ---------- */

.screens-head { margin-bottom: clamp(36px, 5vw, 64px); }

.screens {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
  align-items: start;
}

.shot { margin: 0; }
.shot:nth-child(even) { margin-top: 56px; }

.shot .phone { border-radius: 34px; padding: 6px; }
.shot .phone img { border-radius: 28px; }

.shot figcaption {
  margin-top: 20px;
  padding-inline: 6px;
}

.shot strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.shot span {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .screens {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    padding-block-end: 20px;
    scrollbar-width: thin;
  }
  .shot { flex: 0 0 min(68vw, 260px); scroll-snap-align: center; }
  .shot:nth-child(even) { margin-top: 0; }
}

/* ---------- Trust ---------- */

.trust {
  margin-inline: var(--gutter);
  border-radius: var(--r-shell);
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line);
  padding-block: clamp(56px, 8vw, 104px);
}

.trust-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.trust .section-title { max-width: 14ch; }

.trust-list { display: grid; }

.trust-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  padding-block: 28px;
}

.trust-item + .trust-item { border-top: 1px solid var(--line); }
.trust-item:first-child { padding-top: 4px; }

.trust-item__ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}

.trust-item__ico svg { fill: var(--accent); }
.trust-item h3 { font-size: 1.15rem; }
.trust-item p { margin-top: 6px; color: var(--text-2); }

@media (max-width: 900px) {
  .trust-grid { grid-template-columns: 1fr; }
  .trust .section-title { max-width: 20ch; }
}

/* ---------- Steps (a route with three stops) ---------- */

.steps-row {
  position: relative;
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.steps-row::before {
  content: "";
  position: absolute;
  inset-inline: 12%;
  inset-block-start: 35px;
  border-top: 2px dashed var(--line-strong);
}

.step { position: relative; text-align: center; }

.step__node {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 18px 28px -18px rgb(var(--shadow-rgb) / 0.5);
}

.step__node::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0.55;
}

.step__node svg { fill: var(--accent); }
.step h3 { font-size: 1.1rem; font-weight: 700; }

@media (max-width: 720px) {
  .steps-row { grid-template-columns: 1fr; gap: 36px; }
  .steps-row::before {
    inset-inline: auto;
    inset-inline-start: 50%;
    inset-block: 36px 36px;
    border-top: 0;
    border-inline-start: 2px dashed var(--line-strong);
  }
  /* mask the route line behind the label so it never crosses the text */
  .step h3 {
    display: inline-block;
    padding-inline: 12px;
    background: var(--bg);
  }
}

/* ---------- Launch signup ("notify me") ---------- */

.notify-card {
  padding: 6px;
  border-radius: var(--r-shell);
  background: color-mix(in srgb, var(--primary) 45%, var(--bg-2));
  box-shadow: 0 30px 60px -36px rgb(var(--shadow-rgb) / 0.5);
}

.notify-card__core {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  border-radius: var(--r-core);
  background: var(--bg-3);
}

.notify-mark {
  position: absolute;
  inset-block-end: -90px;
  inset-inline-end: -70px;
  width: 300px;
  height: 310px;
  opacity: 0.07;
  pointer-events: none;
}

.notify-copy .section-title { max-width: 16ch; }
.notify-copy, .notify-body { position: relative; }

.notify-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.98rem;
}

.notify-row { display: flex; gap: 10px; }

.notify-input {
  flex: 1;
  min-width: 0;
  height: 58px;
  padding-inline: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: 500 1.05rem/1 "Montserrat", "Vazirmatn", sans-serif;
  letter-spacing: 0.02em;
  text-align: left;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.notify-input::placeholder { color: var(--text-2); opacity: 1; }

.notify-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 32%, transparent);
}

.notify-input[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--error) 18%, transparent);
}

.notify-btn { flex: none; border: 0; cursor: pointer; font-family: inherit; }
.notify-btn[disabled] { cursor: progress; opacity: 0.75; transform: none; }

.notify-msg {
  min-height: 1.8em;
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.notify-msg.is-error { color: var(--error); }

.notify-done {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--success) 12%, var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent);
  outline: none;
}

.notify-done[hidden] { display: none; }
.notify-done svg { fill: var(--success); flex: none; }
.notify-done__title { font-weight: 800; font-size: 1.1rem; }
.notify-done__body { color: var(--text-2); }

.notify-privacy {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 0.9rem;
  max-width: 52ch;
}

.notify-privacy .inline-link,
.legal a.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .notify-card__core { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .notify-row { flex-direction: column; }
  /* In a column, flex: 1 would size the input's height from 0. */
  .notify-input { flex: none; }
  .notify-btn { justify-content: space-between; }
}

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

.footer {
  margin-top: clamp(40px, 6vw, 80px);
  padding-block: 56px 48px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  align-items: center;
  justify-content: space-between;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.footer .brand { padding-inline: 0; height: auto; }
.brand--footer .mark { width: 34px; height: 35px; }
.brand--footer .wordmark { width: 96px; height: 36px; }
.footer-tag { color: var(--text-2); }

.footer-links {
  display: flex;
  gap: 8px;
  font-size: 0.95rem;
}

.footer-links a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--text-2);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.footer-links a:hover { background: var(--bg-4); color: var(--text); }

.copyright {
  width: 100%;
  color: var(--text-2);
  font-size: 0.88rem;
}

/* ---------- Legal pages (policy / terms) ---------- */

.legal { padding-block: 128px 96px; }
.legal .wrap { max-width: 760px; }

.legal-updated {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.legal h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.legal h2 { font-size: 1.2rem; margin: 40px 0 14px; }

.legal p, .legal li {
  color: var(--text-2);
  font-size: 1rem;
  margin-bottom: 14px;
}

.legal ul { padding-inline-start: 22px; margin: 0 0 20px; }

.legal a.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.legal-back svg { fill: currentColor; transform: scaleX(-1); }

/* ---------- Blog (pages generated by scripts/build-blog.mjs) ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: flex-end;
  justify-content: space-between;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 6px;
  color: var(--accent);
  font-weight: 700;
}

.text-link svg { fill: currentColor; transition: transform 0.4s var(--ease); }
.text-link:hover svg { transform: translateX(-4px); }

.post-grid {
  margin-top: clamp(32px, 5vw, 56px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.post-grid--list { margin-top: 0; }

@media (max-width: 1000px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .post-grid { grid-template-columns: 1fr; }
}

/* Image panel: a cover (an app screenshot) on the amber tint, top-aligned
   and fading out at the bottom; without a cover, the mark in tone-on-tone. */
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: color-mix(in srgb, var(--primary) 30%, var(--bg));
}

.media img {
  position: absolute;
  inset-block-start: 11%;
  inset-inline: 9%;
  width: 82%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 18px 40px -22px rgb(var(--shadow-rgb) / 0.6);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
  transition: transform 0.8s var(--ease);
}

.media__mark {
  --mark-ink: var(--bg);
  --mark-accent: var(--bg);
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34%;
  height: auto;
  aspect-ratio: 997 / 1030;
  opacity: 0.6;
  transition: transform 0.8s var(--ease);
}

/* A post card is a bento cell, image on top; the title link stretches over
   the whole card. */
.post-card .cell__core { padding: 0; gap: 0; }
.post-card:hover .media img { transform: translateY(-6px); }
.post-card:hover .media__mark { transform: scale(1.06) rotate(-4deg); }

.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 22px 26px 26px;
}

.post-card .tag { align-self: flex-start; }
.post-card__title { font-size: 1.18rem; line-height: 1.65; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.cell p.post-card__excerpt { max-width: 52ch; }

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--text-2);
  font-size: 0.88rem;
}

/* Lead: the first card of a listing, full width, image beside the text. */
.post-card--lead { grid-column: 1 / -1; }

@media (min-width: 821px) {
  .post-card--lead .cell__core {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }
  .post-card--lead .media { aspect-ratio: auto; min-height: 340px; }
  .post-card--lead .post-card__body { justify-content: center; gap: 14px; padding: 40px 44px; }
  .post-card--lead .post-card__title { font-size: clamp(1.4rem, 0.9rem + 1.2vw, 1.85rem); line-height: 1.5; font-weight: 800; }
  .post-card--lead .post-card__meta { margin-top: 6px; }
}

@supports selector(:has(a)) {
  .post-card__title a:focus-visible { outline: none; }
  .post-card:has(.post-card__title a:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
  }
}

.blog-hero {
  padding-block: 136px 0;
  background:
    radial-gradient(46% 70% at 82% 0%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 72%),
    radial-gradient(34% 50% at 8% 10%, color-mix(in srgb, var(--tag-bg) 50%, transparent), transparent 70%);
}

.blog-hero h1 {
  font-size: clamp(2rem, 1rem + 3vw, 3.2rem);
  line-height: 1.36;
  font-weight: 800;
}

.blog-hero h1 em { font-style: normal; color: var(--accent); }
.blog-hero .lead { max-width: 60ch; }
.blog-hero--category .crumbs { margin-bottom: 20px; }

.blog-list { padding-block: clamp(40px, 5vw, 64px) 0; }

/* Category links: pills, the current one filled. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 8px;
  padding-inline: 18px 10px;
  border-radius: 999px;
  background: var(--bg-3);
  box-shadow: 0 0 0 1px var(--line);
  font-weight: 700;
  font-size: 0.95rem;
  transition: box-shadow 0.3s var(--ease), background-color 0.3s var(--ease);
}

.chip:hover { box-shadow: 0 0 0 1px var(--line-strong); }

.chip__count {
  min-width: 26px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 0.8rem;
  text-align: center;
}

.chip[aria-current="page"] { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.chip[aria-current="page"] .chip__count { background: color-mix(in srgb, var(--on-primary) 14%, transparent); color: inherit; }

/* Breadcrumb trail: "خانه › وبلاگ › ..." */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.9rem;
}

.crumbs li + li::before { content: "›"; margin-inline: 10px; color: var(--line-strong); }
.crumbs a:hover { color: var(--text); }

/* ---------- Blog post ---------- */

.post .wrap { max-width: 820px; }

.post-head {
  position: relative;
  overflow: hidden;
  padding-block: 128px 8px;
  background: radial-gradient(48% 80% at 80% 0%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 72%);
}

.post-head .wrap { position: relative; }

.post-head__mark {
  position: absolute;
  inset-block-start: 70px;
  inset-inline-end: -90px;
  width: 340px;
  height: 351px;
  opacity: 0.07;
  pointer-events: none;
}

.post-head h1 {
  margin-top: 20px;
  font-size: clamp(1.85rem, 1rem + 2.6vw, 2.8rem);
  line-height: 1.42;
  font-weight: 800;
}

.post-lede {
  margin-top: 18px;
  color: var(--text-2);
  font-size: 1.14rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 22px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.92rem;
}

.post-cover {
  aspect-ratio: 2 / 1;
  margin-top: 32px;
  border-radius: var(--r-shell);
  box-shadow: 0 0 0 1px var(--line);
}

/* Long-form reading: full-contrast text, roomier leading. */
.prose {
  padding-block: 36px 8px;
  font-size: 1.08rem;
  line-height: 2;
}

.prose ul,
.prose ol,
.prose blockquote,
.prose figure { margin: 0; }

.prose > * + * { margin-block-start: 1.15em; }

.prose h2 {
  margin-block-start: 2.1em;
  font-size: clamp(1.32rem, 1.05rem + 0.9vw, 1.62rem);
  line-height: 1.5;
  font-weight: 800;
}

.prose h3 { margin-block-start: 1.7em; font-size: 1.2rem; line-height: 1.6; }
.prose h2 + *,
.prose h3 + * { margin-block-start: 0.6em; }

.prose ul,
.prose ol { padding-inline-start: 1.4em; }
.prose ol { list-style-type: persian; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose strong { font-weight: 750; }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.prose a:hover { text-decoration-thickness: 2px; }

.prose blockquote {
  padding: 18px 24px;
  border-radius: var(--r-media);
  background: color-mix(in srgb, var(--primary) 14%, var(--bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent);
}

.prose blockquote > * + * { margin-top: 0.6em; }

.prose hr {
  margin-block: 2.4em;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose code {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 0.9em;
  direction: ltr;
  unicode-bidi: isolate;
}

.prose img {
  display: block;
  height: auto;
  border-radius: var(--r-media);
}

.prose figcaption {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-media);
  background: var(--bg-3);
  box-shadow: 0 0 0 1px var(--line);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  line-height: 1.8;
}

.prose th,
.prose td {
  padding: 12px 18px;
  text-align: start;
  vertical-align: top;
}

.prose th { background: var(--bg-2); font-weight: 700; white-space: nowrap; }
.prose td { border-top: 1px solid var(--line); }
.prose td:first-child { font-weight: 600; }

.post-more { padding-block-end: 0; }

@media (max-width: 520px) {
  .post-head__mark { inset-inline-end: -70px; width: 220px; height: 227px; }
  .prose { font-size: 1.04rem; }
  .prose th, .prose td { padding: 10px 14px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .cell, .cell:hover, .cell:hover .cell__vis img, .btn, .btn:hover,
  .post-card:hover .media img, .post-card:hover .media__mark { transition: none; transform: none; }
}
