/* ============================================================
   Things Network Vietnam landing page
   Shares the design language with the Rust course app:
   warm paper light theme, dim mode, serif prose, mono code.
   ============================================================ */

:root {
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --bg: #f7f4ee;
  --bg-soft: #f1ede3;
  --surface: #fffdf9;
  --ink: #28241f;
  --muted: #6d675e;
  --faint: #9b958a;
  --border: #e6e0d3;
  --border-strong: #d3cab8;

  --accent: #b8451f;
  --accent-strong: #97351a;
  --accent-soft: #f6e3da;
  --accent-ink: #8a3418;

  --ok: #3c7a3f;
  --ok-soft: #e4efe2;

  --code-bg: #f3efe5;
  --code-border: #e0d9c8;
  --code-ink: #33302a;
  --syn-kw: #a1451c;
  --syn-str: #55763c;
  --syn-fn: #8a5a1f;

  --shadow: 0 1px 2px rgb(35 28 16 / 0.05), 0 10px 28px rgb(35 28 16 / 0.08);
  --shadow-soft: 0 1px 2px rgb(35 28 16 / 0.04), 0 4px 14px rgb(35 28 16 / 0.05);
  --radius: 14px;
}

[data-theme="dim"] {
  --bg: #171512;
  --bg-soft: #1e1b17;
  --surface: #221f1a;
  --ink: #ece7de;
  --muted: #a69f92;
  --faint: #7d766a;
  --border: #343029;
  --border-strong: #4a443a;

  --accent: #e06b3e;
  --accent-strong: #ea7d51;
  --accent-soft: #3a261d;
  --accent-ink: #f0926a;

  --ok: #85c089;
  --ok-soft: #22301f;

  --code-bg: #12110e;
  --code-border: #2c2823;
  --code-ink: #ddd6c9;
  --syn-kw: #ef8354;
  --syn-str: #a3c47c;
  --syn-fn: #d9b36a;

  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 30px rgb(0 0 0 / 0.45);
  --shadow-soft: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 14px rgb(0 0 0 / 0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection { background: var(--accent-soft); color: var(--accent-ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner { display: flex; align-items: center; gap: 28px; height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--sans); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-name em { font-style: normal; color: var(--accent); }

.site-nav { display: flex; gap: 4px; font-family: var(--sans); font-size: 14px; margin-right: auto; }
.site-nav a { color: var(--muted); padding: 7px 12px; border-radius: 999px; font-weight: 500; }
.site-nav a:hover { color: var(--ink); background: var(--bg-soft); }

.header-controls { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 19px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn svg { width: 14px; height: 14px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 8px 15px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 15px; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 48px;
}

.kicker {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); }

.hero h1 { font-size: clamp(32px, 4.4vw, 50px); line-height: 1.1; letter-spacing: -0.015em; font-weight: 700; margin: 0 0 18px; }
.hero h1 em { font-style: italic; color: var(--accent); }

.lede { font-size: 18.5px; color: var(--muted); max-width: 56ch; margin: 0 0 26px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }

.hero-stats { display: flex; gap: 34px; font-family: var(--sans); flex-wrap: wrap; }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat span { font-size: 12.5px; color: var(--muted); }

.hero-side { display: flex; flex-direction: column; gap: 18px; }

.code-card {
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.code-head { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--code-border); background: color-mix(in srgb, var(--code-bg) 55%, var(--surface)); }
.dot { width: 10px; height: 10px; border-radius: 999px; background: var(--border-strong); }
.dot:first-child { background: var(--accent); opacity: 0.75; }
.code-title { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-left: 8px; }
.code-card pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--code-ink);
}
.kw { color: var(--syn-kw); font-weight: 500; }
.str { color: var(--syn-str); }
.fn { color: var(--syn-fn); }

.quote-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-soft); }
.quote-card p { margin: 0 0 10px; font-style: italic; font-size: 15.5px; }
.quote-by { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }

/* ---------- sections ---------- */

.section { padding: 44px 0 8px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
.section-head .sub { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }

.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 44px; }
.about-grid h2 { margin-top: 0; font-size: 26px; letter-spacing: -0.01em; }
.about-grid p { color: var(--muted); font-size: 17px; }

.principles { list-style: none; margin: 6px 0 0; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); font-family: var(--sans); font-size: 14px; display: flex; flex-direction: column; gap: 13px; }
.principles li { padding-left: 26px; position: relative; color: var(--muted); }
.principles li::before { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 8px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.principles b { color: var(--ink); }

/* ---------- courses ---------- */

.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; padding-bottom: 20px; }

.course-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); color: var(--ink); }

.course-card.featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, var(--surface)), var(--surface) 45%); }

.course-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.course-badge { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ok); background: var(--ok-soft); padding: 4px 10px; border-radius: 999px; }
.course-badge.muted { color: var(--muted); background: var(--bg-soft); border: 1px solid var(--border); }
.course-lang { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }

.course-card h3 { font-size: 20px; margin: 0 0 8px; }
.course-card p { font-size: 14.5px; color: var(--muted); line-height: 1.55; margin: 0 0 16px; flex: 1; }

.course-meta { list-style: none; padding: 0; margin: 0 0 16px; font-family: var(--sans); font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.course-meta li { padding-left: 18px; position: relative; }
.course-meta li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); opacity: 0.7; }

.course-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--border); padding-top: 14px; }
.progress-note { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.course-cta { font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.course-cta svg { width: 14px; height: 14px; transition: transform 0.15s; }
a.course-card:hover .course-cta svg { transform: translateX(3px); }

.course-card.soon { opacity: 0.85; }

/* ---------- CTA band ---------- */

.cta-band { margin-top: 60px; background: var(--accent-soft); border-top: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 42px 0; flex-wrap: wrap; }
.cta-inner h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: -0.01em; }
.cta-inner p { margin: 0; color: var(--muted); font-size: 16.5px; max-width: 52ch; }

/* ---------- footer ---------- */

.site-footer { margin-top: 90px; border-top: 1px solid var(--border); background: var(--bg-soft); font-family: var(--sans); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 36px; padding: 40px 0 26px; }
.footer-brand { font-family: var(--serif); font-weight: 700; font-size: 19px; }
.footer-h { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.footer-note { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin: 0; }
.footer-base { padding: 16px 0 22px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--faint); }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 30px; }
  .about-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .site-nav { display: none; }
  .header-inner { gap: 12px; }
  .hero h1 { font-size: 32px; }
  .cta-inner { padding: 30px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
