/* napons. — Editorial design system (Dark theme · loopless Thai)
   Type: IBM Plex Sans Thai (loopless) — display + body
*/

:root {
  /* Dark palette */
  --bg: #0d0d0f;
  --bg-warm: #16161a;
  --bg-card: #1a1a1e;
  --ink: #f4f2ec;
  --ink-2: #b8b5ac;
  --muted: #6e6c63;
  --warm-gray: #4a4842;
  --rule: #2a2925;
  --rule-strong: #3a3934;
  --accent: #2563eb;
  --accent-ink: #1d4ed8;

  /* Inverse (for cream contrast sections) */
  --inv-bg: #f5f3ec;
  --inv-bg-2: #ecead9;
  --inv-ink: #14140f;
  --inv-ink-2: #3a3a30;
  --inv-muted: #7a786e;
  --inv-rule: #d4d0c2;

  /* Type — single loopless family */
  --display: "IBM Plex Sans Thai", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: "IBM Plex Sans Thai", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: "IBM Plex Sans Thai", "Inter", -apple-system, BlinkMacSystemFont, sans-serif; /* alias: editorial → loopless */
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Spacing */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: 144px;
  --space-8: 200px;
  --density: 1;

  /* Container */
  --max: 1280px;
  --gutter: 64px;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* Typography — loopless display */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
  color: var(--ink);
}

h1 { font-size: clamp(56px, 8.4vw, 132px); font-weight: 500; letter-spacing: -0.035em; }
h2 { font-size: clamp(40px, 4.8vw, 72px); font-weight: 500; letter-spacing: -0.025em; }
h3 { font-size: clamp(28px, 2.8vw, 40px); font-weight: 500; letter-spacing: -0.02em; }
h4 { font-size: clamp(22px, 1.8vw, 28px); font-weight: 500; letter-spacing: -0.015em; }

/* Italic accent — used for emphasis words */
em, .it {
  font-style: italic;
  font-weight: 500;
}

p { text-wrap: pretty; max-width: 62ch; }

.lead {
  font-family: var(--sans);
  font-size: clamp(20px, 1.9vw, 26px);
  font-weight: 300;
  line-height: 1.45;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--warm-gray);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}
a:hover { text-decoration-color: var(--accent); }

/* Layout */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section {
  padding: calc(var(--space-7) * var(--density)) 0;
  position: relative;
}
section.tight { padding: calc(var(--space-6) * var(--density)) 0; }

hr.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--ink);
}
.brand .dot { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}
.nav-links a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  color: var(--ink-2);
  letter-spacing: 0;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 4px; }
.nav-cta {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  color: var(--ink) !important;
  text-decoration: none !important;
  background: transparent;
  transition: all 0.2s ease;
}
.nav-cta:hover { background: var(--ink); color: var(--bg) !important; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 18px 28px;
  text-decoration: none !important;
  border: 1px solid var(--ink);
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--bg) !important; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--ink) !important; }
.btn-ghost { background: transparent; color: var(--ink) !important; }
.btn-ghost:hover { background: var(--ink); color: var(--bg) !important; }
.btn .arrow { display: inline-block; transform: translateY(-1px); }

/* Number tag */
.num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
}

/* Pull-quote */
.pullquote {
  font-family: var(--display);
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

/* ============================
   INVERSE (cream sections)
   ============================ */
.inv {
  background: var(--inv-bg);
  color: var(--inv-ink);
}
.inv h1, .inv h2, .inv h3, .inv h4 { color: var(--inv-ink); }
.inv .lead { color: var(--inv-ink-2); }
.inv .muted { color: var(--inv-muted); }
.inv .eyebrow { color: var(--accent); }
.inv a { color: var(--inv-ink); text-decoration-color: rgba(0,0,0,0.25); }
.inv a:hover { text-decoration-color: var(--accent); }
.inv hr.rule { border-top-color: var(--inv-rule); }
.inv .btn { border-color: var(--inv-ink); }
.inv .btn-primary { background: var(--inv-ink); color: var(--inv-bg) !important; }
.inv .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--inv-bg) !important; }
.inv .btn-ghost { color: var(--inv-ink) !important; }
.inv .btn-ghost:hover { background: var(--inv-ink); color: var(--inv-bg) !important; }

/* Footer (now cream) */
footer.foot {
  background: var(--inv-bg);
  color: var(--inv-ink);
  padding: 96px 0 48px;
}
footer.foot h2 {
  color: var(--inv-ink);
  font-size: clamp(48px, 6vw, 96px);
  font-weight: 500;
}
footer.foot a {
  color: var(--inv-ink);
  text-decoration-color: rgba(20,20,15,0.3);
}
footer.foot a:hover { text-decoration-color: var(--accent); }
footer.foot .foot-bottom {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--inv-rule);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--inv-muted);
}

/* Utilities */
.flex { display: flex; }
.grid { display: grid; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.center { text-align: center; }

/* Article meta */
.meta {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
