/* ==========================================================================
   Thanm AI Labs — Shared Design System (WEB-0)
   --------------------------------------------------------------------------
   The single design language for every surface: the public website, the
   content dashboard, and any future page. One file, plain CSS, no framework.

   Brand source of truth: docs/brand/README.md
     Gold  #D4A72C  (quality)   Indigo #1E2A5A  (depth/trust)   White #FFFFFF
     Typeface: Montserrat (SemiBold display / Regular body) — same as the logo.

   Usage:  <link rel="stylesheet" href="/assets/css/thanm.css">
   Theme:  light by default; dark via [data-theme="dark"] or prefers-color-scheme.
   ========================================================================== */

/* ---- Font (Montserrat — same family as the logo wordmark) -------------- */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  /* brand */
  --gold: #D4A72C;
  --gold-soft: #E4C25A;
  --gold-ink: #8A6D14;
  --indigo: #1E2A5A;
  --indigo-soft: #2C3B73;
  --indigo-deep: #141C3D;

  /* surfaces (light) */
  --bg: #FFFFFF;
  --bg-alt: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #EEF0F6;
  --border: #E2E5EE;
  --border-strong: #C9CEE0;

  /* text (light) */
  --text: #1A1F33;
  --text-muted: #5B6178;
  --text-faint: #8A90A6;
  --on-brand: #FFFFFF;

  /* status */
  --ok: #2E9E5B;
  --warn: #D4A72C;
  --err: #D64545;
  --info: #3B6FE0;

  /* geometry */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 28, 61, .06), 0 1px 3px rgba(20, 28, 61, .08);
  --shadow: 0 4px 14px rgba(20, 28, 61, .10);
  --shadow-lg: 0 12px 40px rgba(20, 28, 61, .16);

  /* type scale */
  --fs-xs: .78rem;
  --fs-sm: .9rem;
  --fs-md: 1rem;
  --fs-lg: 1.15rem;
  --fs-xl: 1.4rem;
  --fs-2xl: 1.9rem;
  --fs-3xl: 2.6rem;
  --fs-4xl: 3.4rem;

  /* layout */
  --container: 1120px;
  --gutter: 24px;
  --space: 16px;
}

[data-theme="dark"] {
  --bg: #0E1326;
  --bg-alt: #131A33;
  --surface: #182042;
  --surface-2: #1F2951;
  --border: #2A3560;
  --border-strong: #3A4778;
  --text: #ECEEF6;
  --text-muted: #A6ADC6;
  --text-faint: #7C84A3;
  --on-brand: #FFFFFF;
  --indigo: #2C3B73;
  --indigo-deep: #0A0E1E;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
}

/* ---- Base --------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--text);
  margin: 0 0 .5em;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { margin: 0 0 1em; }
a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--gold-ink); }
[data-theme="dark"] a { color: var(--gold-soft); }
[data-theme="dark"] a:hover { color: var(--gold); }
img, svg { max-width: 100%; height: auto; display: block; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}
code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
pre { background: var(--surface-2); padding: var(--space); border-radius: var(--radius-sm); overflow: auto; }

/* ---- Layout ------------------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 64px 0; }
.section--alt { background: var(--bg-alt); }
.grid { display: grid; gap: var(--space); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.stack > * + * { margin-top: var(--space); }
.flex { display: flex; gap: var(--space); align-items: center; }
.flex--between { justify-content: space-between; }
.flex--wrap { flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.center { text-align: center; }
.gold { color: var(--gold); }
.indigo { color: var(--indigo); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font: inherit; font-weight: 600; font-size: var(--fs-sm);
  padding: .62em 1.25em; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gold); color: #20180A; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--gold-soft); color: #20180A; }
.btn--indigo { background: var(--indigo); color: var(--on-brand); }
.btn--indigo:hover { background: var(--indigo-soft); color: var(--on-brand); }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn--sm { padding: .4em .9em; font-size: var(--fs-xs); }
.btn--lg { padding: .8em 1.6em; font-size: var(--fs-md); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Cards -------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space); box-shadow: var(--shadow-sm);
}
.card--pad { padding: 28px; }
.card--hover { transition: transform .12s ease, box-shadow .15s ease; }
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__title { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 .35em; }
.card__body { color: var(--text-muted); font-size: var(--fs-sm); }

/* ---- Nav ---------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav__brand { display: flex; align-items: center; gap: .6em; font-weight: 600; font-size: var(--fs-lg); color: var(--text); }
.nav__brand img, .nav__brand svg { width: 30px; height: 30px; }
.nav__links { display: flex; gap: 22px; align-items: center; }
.nav__links a { color: var(--text-muted); font-weight: 500; font-size: var(--fs-sm); }
.nav__links a:hover, .nav__links a.active { color: var(--text); }
@media (max-width: 720px) { .nav__links { display: none; } }

/* ---- Status pills ------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em;
  padding: .3em .8em; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill--warn { color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold) 50%, transparent); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.pill--err { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: color-mix(in srgb, var(--err) 12%, transparent); }
.pill--info { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); background: color-mix(in srgb, var(--info) 12%, transparent); }
[data-theme="dark"] .pill--warn { color: var(--gold-soft); }

/* ---- Tables ------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--bg-alt); }

/* ---- Forms -------------------------------------------------------------- */
.field { display: block; margin-bottom: var(--space); }
.field label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: .4em; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: .6em .8em;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent);
}
.textarea { min-height: 120px; resize: vertical; }

/* ---- Video embed frame -------------------------------------------------- */
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--indigo-deep); box-shadow: var(--shadow); }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Hero --------------------------------------------------------------- */
.hero { padding: 96px 0 72px; }
.hero h1 { font-size: var(--fs-4xl); max-width: 16ch; }
.hero p { font-size: var(--fs-lg); color: var(--text-muted); max-width: 52ch; }
.hero--indigo { background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%); color: #fff; }
.hero--indigo h1 { color: #fff; }
.hero--indigo p { color: #C7CCE0; }
.hero--indigo a { color: var(--gold-soft); }

/* ---- Footer ------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--text-faint); font-size: var(--fs-sm); }
.footer a { color: var(--text-muted); }

/* ---- Utility ------------------------------------------------------------ */
.divider { height: 1px; background: var(--border); border: 0; margin: var(--space) 0; }
.badge-mark { width: 44px; height: 44px; border-radius: 10px; background: var(--indigo); display: grid; place-items: center; }
.badge-mark svg, .badge-mark img { width: 28px; height: 28px; }
