/* SpeakMind — marketing site
   "Editorial Studio" system: warm oat paper + warm ink for color-blocked
   sections + flat vermilion stamp. Print cues: grain, hairline rules,
   numbered sections, deliberate type. No soft gradients/glows.
   Type: Space Grotesk (display/UI) + JetBrains Mono (labels / raw input). */

:root {
  /* brand accent — used as a FLAT stamp, never a glow */
  --accent: #d9481f;
  --accent-deep: #b2360f;
  --accent-ink: #fdf6ec;
  --accent-soft: #f3e0d3;
  --accent-line: rgba(217, 72, 31, 0.55);
  --accent-glow: rgba(217, 72, 31, 0.16);
  --green: #2c8f54;

  /* warm cream paper (MiMo-style) */
  --bg: #f3eee6;
  --bg2: #f8f5ef;
  --surface: #fdfbf7;
  --surface2: #e9e2d7;
  --glass: rgba(250, 247, 241, 0.8);

  /* warm ink (text + dark color-block sections) */
  --ink: #1c1813;
  --ink-2: #25201a;
  --text: #1c1813;
  --text-dim: #544c3e;
  --text-faint: #897f6c;

  /* on dark */
  --on-ink: #f2ead9;
  --on-ink-dim: #b6ab93;
  --on-ink-faint: #7f7563;

  --border: rgba(28, 24, 19, 0.16);
  --border2: rgba(28, 24, 19, 0.09);
  --hair: rgba(28, 24, 19, 0.13);

  /* code */
  --code-bg: #1c1813;
  --code-kw: #ff9d6e;
  --code-fn: #8fd0ff;
  --code-str: #9be8b0;
  --code-ty: #ffd28f;
  --code-text: #f2e8e0;

  /* radii — tighter, more "product/print" */
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --maxw: 1200px;

  --font-ui: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* shadows: low, printed, neutral — not colored glows */
  --sh-1: 0 1px 0 rgba(255,255,255,.5) inset, 0 2px 8px -4px rgba(28,24,19,.18);
  --sh-2: 0 1px 0 rgba(255,255,255,.5) inset, 0 18px 44px -26px rgba(28,24,19,.4);
  --sh-3: 0 30px 70px -38px rgba(28,24,19,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.5;
}

/* paper grain — subtle tactile print cue */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .045; mix-blend-mode: multiply;
  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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.no-motion::before { opacity: .04; }

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

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
/* numbered section kicker: "01 —— Context Aware" */
.eyebrow[data-no]::before {
  content: attr(data-no);
  color: var(--text-faint);
}
.eyebrow[data-no]::after {
  content: ""; width: 26px; height: 1px; background: var(--accent);
  display: inline-block; vertical-align: middle;
}

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; position: relative; z-index: 2; }
section { position: relative; }
.rule { height: 1px; background: var(--border); border: none; }
.wrap > .rule { margin: 0; }

.section-head { max-width: 760px; }
.section-head h2 {
  font-size: clamp(31px, 4.6vw, 56px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.0;
  margin: 16px 0 0;
  text-wrap: balance;
}
.section-head p {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-dim);
  margin-top: 18px;
  max-width: 56ch;
  text-wrap: pretty;
}

/* ---------- color-block dark band ---------- */
.band-ink {
  background: var(--ink);
  color: var(--on-ink);
}
.band-ink .section-head h2, .band-ink h2, .band-ink h3 { color: var(--on-ink); }
.band-ink .section-head p { color: var(--on-ink-dim); }
.band-ink .eyebrow[data-no]::before { color: var(--on-ink-faint); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15px;
  border-radius: 999px; padding: 13px 22px;
  transition: transform .3s var(--ease), background .25s, color .25s, border-color .25s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--ink); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--ink); color: var(--on-ink); }
.band-ink .btn-ghost { color: var(--on-ink); border-color: var(--on-ink); }
.band-ink .btn-ghost:hover { background: var(--on-ink); color: var(--ink); }
.btn .apple { font-size: 17px; line-height: 0; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  transition: background .4s var(--ease), backdrop-filter .4s, border-color .4s, padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  padding-top: 13px; padding-bottom: 13px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); display: grid; place-items: center;
  position: relative;
}
.brand .mark::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-ink);
  box-shadow: 0 0 0 0 rgba(253,246,236,.6);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(253,246,236,.55); }
  50% { box-shadow: 0 0 0 5px rgba(253,246,236,0); }
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 14.5px; color: var(--text-dim); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* EN / 中 example-language toggle */
.lang-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; font-family: var(--font-mono); }
.lang-toggle button { font-size: 12px; font-weight: 600; line-height: 1; color: var(--text-faint); padding: 5px 11px; border-radius: 999px; transition: background .25s var(--ease), color .25s var(--ease); }
.lang-toggle button.on { background: var(--accent); color: var(--accent-ink); }
.lang-toggle button:not(.on):hover { color: var(--text); }
@media (max-width: 420px) { .lang-toggle { display: none; } }
.lang-select { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-dim); background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 6px 28px 6px 11px; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23897f6c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; transition: border-color .2s, color .2s; }
.lang-select:hover { color: var(--text); border-color: var(--accent-line); }

/* ---------- reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .07s; }
.reveal[data-d="2"] { transition-delay: .15s; }
.reveal[data-d="3"] { transition-delay: .23s; }
.reveal[data-d="4"] { transition-delay: .31s; }
.reveal[data-d="5"] { transition-delay: .39s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  * { animation-duration: .001ms !important; }
}

/* ---------- footer ---------- */
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
