/* Stiq marketing site — shared foundation (LIGHT).
 * Light palette derived from the Stiq light theme; the app screens stay dark.
 * Authored RTL-ready: logical properties + text-align:start/end throughout, so
 * setting dir="rtl" (future Arabic) flips the layout without rewrites.
 */
:root {
  /* This design is light-only — the app screens inside the mockups supply their own dark. Declaring
   * it stops Chrome Android / Samsung Internet from force-darkening the page: their auto-dark
   * recolours the content but not the canvas behind it, which left a bright band under the footer. */
  color-scheme: only light;

  /* Light surfaces — cool, near-white, premium */
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-alt: #f3f3f6;
  --surface-sunken: #eeeef2;

  --border: #e4e4ea;       /* hairline — the primary separator */
  --border-strong: #d3d3da;
  --line-on-dark: #2c2c2e;

  /* Cornflower accent (light-theme value) */
  --accent: #2d72d3;
  --accent-pressed: #215db3;
  --accent-soft: rgba(45, 114, 211, 0.10);
  --accent-tint: #eaf1fc;
  --on-accent: #ffffff;

  --text: #16161a;
  --text-2: #5b5b63;
  --text-3: #8b8b93;

  --link: #2d72d3;

  /* Identity gradients (same stops as the app) */
  --grad-blue: linear-gradient(135deg, #7cb2ff, #b89aff);
  --grad-teal: linear-gradient(135deg, #22d3ee, #0ea5b7);
  --grad-pink: linear-gradient(135deg, #f0a8d0, #c77ff0);
  --grad-amber: linear-gradient(135deg, #ffd27c, #f0a85c);
  --grad-green: linear-gradient(135deg, #86e3b8, #3fb98a);

  /* Dark band (the one dark element — nods to the dark-first product) */
  --dark-bg: #0e0e10;
  --dark-surface: #161618;
  --dark-border: #2a2a2c;
  --dark-text: #f5f5f7;
  --dark-text-2: #98989e;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;   /* wordmark only */
  --mono: ui-monospace, "SF Mono", "Courier New", Menlo, monospace;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 16px;
  --radius-lg: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* The canvas — everything a phone browser paints OUTSIDE the document: the strip uncovered when the
 * URL bar retracts at the end of a page, the overscroll rubber-band, the area behind the gesture
 * bar. With no background here, body's --bg propagates up and that strip lands near-white directly
 * under a --surface-alt footer, reading as a white bar that comes and goes with the toolbar. Match
 * the footer instead and the strip is invisible; the top overscroll shifts by 1% lightness. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--surface-alt); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

/* ── Wordmark ───────────────────────────────── */
.wordmark { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.wordmark .stop { color: var(--accent); }

/* ── Layout ─────────────────────────────────── */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.mono { font-family: var(--mono); }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 15px/1 var(--font); padding: 14px 22px; border-radius: 999px;
  border: 1px solid transparent; transition: transform .15s, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-pressed); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--text-3); background: var(--surface-alt); }
.btn-lg { font-size: 16px; padding: 16px 26px; }

/* ── Identity shapes (for use outside the phone, e.g. feature glyphs) ── */
.idn { display: inline-block; flex: none; }
.idn.circle { border-radius: 50%; }
.idn.square { border-radius: 26%; }
.idn.hex { clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); border-radius: 6px; }
.idn.diamond { border-radius: 14%; transform: rotate(45deg); }
.g-blue { background: var(--grad-blue); }
.g-teal { background: var(--grad-teal); }
.g-pink { background: var(--grad-pink); }
.g-amber { background: var(--grad-amber); }
.g-green { background: var(--grad-green); }

/* ── Phone framing helpers ──────────────────── */
.phone-clip { overflow: hidden; }       /* clip a phone peeking from a panel */

/* ── Language toggle (nav chip) ─────────────── */
.lang-toggle {
  display: inline-flex; align-items: center; font: 600 13.5px/1 var(--font); color: var(--text-2);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 10px 15px;
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.lang-toggle:hover { color: var(--text); border-color: var(--text-3); }

/* ── Arabic (RTL) page overrides ────────────────
   The layout is logical-property clean, so dir="rtl" flips it structurally. What Arabic script
   additionally needs: NO letter-spacing anywhere — it is a connected script, and tracking pulls
   the joined glyphs apart (the Latin tracking on headings/eyebrows is a Latin-only device). The
   "Stiq." wordmark stays Latin and keeps its brand tracking. Terminals and code stay LTR. */
html[lang="ar"] * { letter-spacing: 0 !important; }
html[lang="ar"] .wordmark { letter-spacing: -0.01em !important; }
html[lang="ar"] body { line-height: 1.6; }
html[lang="ar"] .term pre { direction: ltr; text-align: left; }
/* Arabic display type cannot take the Latin-tuned leading (1.04–1.2): alef/lam ascenders and any
   marks live in the space Latin caps leave empty, so lines and the eyebrow above them collide.
   !important because page-level styles (.hero h1 etc.) tie on specificity and load later. */
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.4 !important; }
html[lang="ar"] .cta-final .eyebrow { margin-block-end: 10px; }

/* ── Tor status chip ────────────────────────── */
.tor-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12px/1 var(--mono); color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 7px 12px; border-radius: 999px;
}
.tor-chip .dotlive { width: 7px; height: 7px; border-radius: 50%; background: #3fb98a; box-shadow: 0 0 0 3px rgba(63,185,138,.18); }

/* ── Reduced motion ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}


/* ── Carousel (mobile-first: swipe on phones, controls everywhere) ── */
.carousel { position: relative; }
.rail {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding-inline: var(--gutter); margin-inline: calc(var(--gutter) * -1); scroll-padding-inline: var(--gutter);
  padding-block-end: 4px;
}
.rail::-webkit-scrollbar { display: none; }
/* snap-stop: one flick advances one slide — momentum was sailing past two or three at a time. */
.rail > * { flex: none; scroll-snap-align: center; scroll-snap-stop: always; }
.cnav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.carr {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 19px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center; transition: border-color .15s, opacity .15s;
}
.carr:hover { border-color: var(--text-3); }
.carr:disabled { opacity: .32; cursor: default; }
.cdots { display: flex; align-items: center; gap: 8px; }
.cdots button {
  width: 7px; height: 7px; padding: 0; border: none; cursor: pointer; border-radius: 999px;
  background: var(--border-strong); transition: width .2s, background .2s;
}
.cdots button.on { width: 24px; background: var(--accent); }
@media (min-width: 720px) { .carr { display: flex; } }
/* dark-band variant — tuned for the aurora wash, not flat black: the old #2a2a2c hairlines
   vanished once the gradient lit the ground under the controls, so the chrome is translucent
   white and the active dot carries its own glow. */
.preview .carr { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.32); color: #fff; }
.preview .carr:hover { border-color: rgba(255,255,255,.62); background: rgba(255,255,255,.14); }
.preview .cdots button { background: rgba(255,255,255,.40); }
.preview .cdots button:hover { background: rgba(255,255,255,.62); }
.preview .cdots button.on { background: #7cb2ff; box-shadow: 0 0 10px rgba(124,178,255,.45); }


/* ── Shared page chrome (both pages: header, sections, footer, reveal) ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 64px; }
.nav .wordmark { font-size: 23px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { font-size: 14.5px; color: var(--text-2); transition: color .15s; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-links a.on, .mlinks a.on { color: var(--text); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 12px; }
/* The header is sticky, so an anchor jump would otherwise land its heading underneath it. */
html { scroll-padding-block-start: 78px; }

/* Mobile menu: below the breakpoint the horizontal link row is replaced by a button and a drop
   panel; without one, a phone visitor had no route to any section but the one they scrolled to. */
.nav-toggle {
  display: none; flex: none; width: 42px; height: 42px; border-radius: 11px; padding: 0;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--text-3); }
.nav-toggle .bars { display: block; position: relative; width: 17px; height: 12px; }
.nav-toggle .bars i {
  position: absolute; inset-inline: 0; height: 1.6px; background: currentColor; border-radius: 2px;
  transition: transform .22s cubic-bezier(.2,0,0,1), opacity .14s;
}
.nav-toggle .bars i:nth-child(1) { top: 0; }
.nav-toggle .bars i:nth-child(2) { top: 5.2px; }
.nav-toggle .bars i:nth-child(3) { top: 10.4px; }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(1) { transform: translateY(5.2px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(3) { transform: translateY(-5.2px) rotate(-45deg); }

/* Height-animated rather than display-toggled, so it slides open. `visibility:hidden` while shut
   keeps its links out of tab order and off the accessibility tree. */
.nav-panel {
  display: none; overflow: hidden; visibility: hidden; max-height: 0;
  background: var(--bg); border-block-start: 1px solid transparent;
  transition: max-height .3s cubic-bezier(.2,0,0,1), visibility .3s;
}
.nav-panel.open { max-height: min(78vh, 560px); visibility: visible; overflow-y: auto; border-block-start-color: var(--border); }
.nav-panel .wrap { padding-block: 4px 20px; }
.nav-panel .mlinks a {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 15px; font-size: 17px; letter-spacing: -0.01em; color: var(--text);
  border-block-end: 1px solid var(--border);
}
.nav-panel .mlinks a:last-child { border-block-end: none; }
.nav-panel .btn { display: flex; width: 100%; margin-block-start: 18px; }
/* Five links plus the toggle and CTA — below this the row can't hold them, so the panel takes over. */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-panel { display: block; }
}
/* Two competing CTAs in a 360px header crowd out the wordmark — the panel carries the button. */
@media (max-width: 560px) { .nav-right > .btn { display: none; } }

/* Section scaffold */
section.band { padding-block: clamp(72px, 10vw, 132px); }
.sec-head { max-width: 38em; }
.sec-head h2 { font-size: clamp(30px, 4.2vw, 47px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; margin-top: 14px; text-wrap: balance; }
.sec-head p { font-size: 18px; color: var(--text-2); margin-top: 18px; line-height: 1.55; }

/* Inline link to the source repo — underlined so it reads as a link inside body copy. */
.src-link { color: var(--link); text-decoration: underline; text-underline-offset: 2px;
  text-decoration-thickness: 1px; word-break: break-word; }
.src-link:hover { text-decoration-thickness: 2px; }

/* Final CTA */
.cta-final { text-align: center; padding-block: clamp(80px, 11vw, 150px); }
.cta-final h2 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; }
.cta-final h2 em { font-style: normal; color: var(--accent); }
.cta-final .row { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.cta-final .fine { margin-top: 26px; color: var(--text-3); font-size: 13.5px; }
.cta-final .fine a { white-space: nowrap; }

/* Footer */
footer { background: var(--surface-alt); border-block-start: 1px solid var(--border); padding-block: 60px 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.foot-brand .wordmark { font-size: 26px; }
.foot-brand p { color: var(--text-2); font-size: 14.5px; margin-top: 14px; max-width: 24em; line-height: 1.55; }
.foot-contact { font-size: 13.5px; }
.foot-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); font-weight: 700; }
.foot-col a { display: block; color: var(--text-2); font-size: 14.5px; margin-top: 13px; transition: color .15s; }
.foot-col a:hover { color: var(--text); }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-top: 50px; padding-block-start: 26px; border-block-start: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--e, cubic-bezier(.2,0,0,1)), transform .7s var(--e, cubic-bezier(.2,0,0,1)); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
