/* ===========================================================
   Settlefi — Design tokens & base styles
   Tokens lifted exactly from landing_spec_design.md
   =========================================================== */

:root {
  /* Backgrounds — cool fintech neutrals (Stripe / Mercury / Linear family) */
  --bg-primary: #FAFBFC;
  --bg-secondary: #F2F4F7;
  --bg-elevated: #FFFFFF;

  /* Text — cool slate, slight ink-navy tint */
  --text-primary: #0B0E14;
  --text-secondary: #424A57;
  --text-muted: #6B7280;

  /* Borders — cool gray */
  --border-subtle: #E5E8EC;
  --border-strong: #CDD3DB;

  /* Accent — locked indigo (fintech-friendly: Linear / Mercury family) */
  --accent: #4338CA;
  --accent-hover: #3730A3;
  --accent-subtle: #EEF0FE;

  /* Technical */
  --code-bg: #0B0E14;
  --code-text: #E5E8EC;
  --code-accent: #818CF8;

  /* Status */
  --success: #16A34A;
  --warning: #CA8A04;
  --error: #DC2626;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-pill: 9999px;

  /* Shadows — cool ink for fintech crispness */
  --shadow-sm: 0 1px 2px rgba(11,14,20,0.04);
  --shadow-md: 0 2px 8px rgba(11,14,20,0.06);
  --shadow-lg: 0 8px 24px rgba(11,14,20,0.08);

  /* Easings */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  /* Layout */
  --container: 1200px;
  --pad-x: 72px;
}

@media (max-width: 1023px) { :root { --pad-x: 48px; } }
@media (max-width: 767px)  { :root { --pad-x: 24px; } }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', 'PingFang SC', 'PingFang TC', 'Microsoft YaHei',
               'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: 0; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: 'Inter Tight', 'PingFang SC', 'PingFang TC', 'Microsoft YaHei',
               'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--text-primary);
}
.h-display { font-size: 64px; letter-spacing: -0.025em; line-height: 1.05; }
.h2        { font-size: 40px; letter-spacing: -0.015em; }
.h3        { font-size: 26px; letter-spacing: -0.01em; }
.h4        { font-size: 20px; letter-spacing: -0.005em; }
.eyebrow   {
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}
.mono { font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace; font-feature-settings: 'tnum' 1; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

@media (max-width: 1023px) {
  .h-display { font-size: 48px; }
  .h2 { font-size: 32px; }
  .h3 { font-size: 22px; }
}
@media (max-width: 767px) {
  .h-display { font-size: 36px; }
  .h2 { font-size: 28px; }
  .h3 { font-size: 20px; }
  body { font-size: 16px; }
}

/* CJK adjustments */
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) h4 { letter-spacing: 0; line-height: 1.4; }
:lang(zh) body { line-height: 1.75; }
:lang(zh) .eyebrow { letter-spacing: 0.08em; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
.section { padding-top: 128px; padding-bottom: 0; }
@media (max-width: 1023px) { .section { padding-top: 96px; } }
@media (max-width: 767px)  { .section { padding-top: 64px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--r-md);
  transition: background-color 150ms var(--ease-out), transform 150ms var(--ease-out), color 150ms var(--ease-out);
  white-space: nowrap;
}
.btn-primary,
a.btn-primary,
button.btn-primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.01); color: #ffffff; }
.btn-primary:active { background: var(--accent-hover); transform: scale(0.99); color: #ffffff; }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary:visited { color: #ffffff; }
.btn-primary:link { color: #ffffff; }

/* CJK button weight: at 500, white Chinese text on indigo reads thin.
   Bump to 600 specifically when page is :lang(zh) so EN buttons aren't
   visually heavier than design intent. */
:lang(zh) .btn { font-weight: 600; }

.btn-lg {
  font-size: 15px; padding: 13px 24px;
}

.btn-secondary {
  background: transparent; color: var(--accent);
}
.btn-secondary:hover { background: var(--accent-subtle); }

.btn-ghost {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-secondary); border-color: var(--text-primary); }

/* Text link with growing underline */
.tlink {
  position: relative; color: var(--accent); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.tlink::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: currentColor;
  transition: width 200ms var(--ease-out);
}
.tlink:hover::after { width: 100%; }
.tlink .arr { transition: transform 200ms var(--ease-out); }
.tlink:hover .arr { transform: translateX(3px); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* ---------- Form ---------- */
.label {
  display: block; font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.label .req { color: var(--error); margin-left: 2px; }
.input, .textarea, .select {
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  font: 400 16px/1.4 inherit;
  color: var(--text-primary);
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .textarea:focus, .select:focus {
  outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent);
}
.textarea { height: auto; min-height: 120px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%236B7280' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
}

/* ---------- Utility ---------- */
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.divider { height: 1px; background: var(--border-subtle); width: 100%; }
.grid { display: grid; }
.flex { display: flex; }
.gap-sm { gap: 8px; } .gap-md { gap: 16px; } .gap-lg { gap: 24px; } .gap-xl { gap: 32px; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }

/* Subtle dot grid for background accents */
.dotgrid {
  background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Section reveal */
.reveal {
  opacity: 0; transform: translateY(8px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Selection */
::selection { background: var(--accent); color: #fff; }
