:root {
  --bg: #0B0C0B;
  --bg-alt: #111211;
  --card: #101110;
  --text: #E9E7DA;
  --text-bright: #EFEDE0;
  --text-soft: #D6D3C4;
  --text-muted: #A5A399;
  --text-dim: #7E7D74;
  --text-faint: #6E6D65;
  --accent: #D9A063;
  --hairline: rgba(233, 231, 218, 0.10);
  --hairline-strong: rgba(233, 231, 218, 0.14);
  --pad-x: clamp(20px, 4vw, 44px);
  --section-pad-y: clamp(64px, 10vw, 140px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: "Hanken Grotesk", "IBM Plex Sans Thai", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover { color: var(--accent); }

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

img, video { display: block; }

/* Announced by screen readers, invisible on screen. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--pad-x);
}

.wordmark {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.accent { color: var(--accent); }

.nav-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(12, 13, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 10px;
}

.nav-pill a {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 15px;
}

.header-email {
  font-size: 15px;
  color: #9B9A90;
}

.menu-button {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(12, 13, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 14px 16px;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
}

/* ---------- Mobile menu overlay ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.mobile-menu[hidden] { display: none; }

.mobile-menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-close {
  background: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 20px;
  width: 46px;
  height: 46px;
  cursor: pointer;
  font-family: inherit;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  margin-bottom: 32px;
}

.mobile-nav a {
  font-size: clamp(34px, 11vw, 52px);
  font-weight: 400;
  letter-spacing: -0.03em;
  padding: 6px 0;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: min(100vh, 860px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(11, 12, 11, 0.55) 0%,
    rgba(11, 12, 11, 0.05) 35%,
    rgba(11, 12, 11, 0.75) 100%
  );
}

.hero-content {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(80px, 12vh, 140px) var(--pad-x) clamp(28px, 4vw, 44px);
}

.hero-title {
  flex: 1 1 420px;
  margin: 0;
  font-size: clamp(76px, 17vw, 300px);
  line-height: 0.82;
  font-weight: 400;
  letter-spacing: -0.045em;
  color: var(--text-bright);
}

.hero-star {
  color: var(--text-bright);
  font-size: 0.36em;
  vertical-align: super;
  line-height: 1;
}

.hero-intro {
  flex: 0 1 400px;
  min-width: 260px;
  padding-bottom: clamp(8px, 2vw, 28px);
}

.hero-intro p {
  margin: 0 0 22px;
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.5;
  color: var(--text-soft);
  text-wrap: pretty;
}

/* ---------- Shared pill CTA ---------- */

.pill-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--text-bright);
  color: var(--bg);
  border-radius: 999px;
  padding: 13px 13px 13px 26px;
  font-size: 16px;
  font-weight: 500;
}

.pill-cta:hover {
  background: var(--accent);
  color: var(--bg);
}

.pill-cta-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-bright);
  font-size: 15px;
}

/* ---------- Sections ---------- */

.section {
  padding: var(--section-pad-y) var(--pad-x);
  border-top: 1px solid var(--hairline);
}

.section-title {
  margin: 0;
  font-size: clamp(38px, 7vw, 86px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.eyebrow {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Work ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.section-meta {
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
}

.work-card {
  display: block;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
}

a.work-card:hover {
  border-color: rgba(217, 160, 99, 0.55);
  color: var(--text);
}

.work-card-media {
  aspect-ratio: 4 / 3;
  background: rgba(233, 231, 218, 0.04);
}

.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Kin.d has no destination yet, so it stays a plain card rather than
   advertising a click that goes nowhere. */
.work-card--static { cursor: default; }

.work-card-body { padding: 20px 22px 24px; }

.work-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-card-title {
  margin: 10px 0 8px;
  font-size: clamp(21px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.work-card-status {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-dim);
  white-space: nowrap;
}

.work-card-blurb {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* Only on cards that lead somewhere richer than an external link. */
.work-card-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--accent);
}

/* Placeholder standing in for artwork that has not been supplied yet. */
.image-slot {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: rgba(233, 231, 218, 0.04);
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* ---------- MCP ---------- */

.mcp { background: var(--bg-alt); }

.mcp-layout {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 5vw, 80px);
}

.mcp-intro {
  flex: 1 1 320px;
  min-width: 280px;
}

.mcp-intro .section-title { margin-bottom: 18px; }

.mcp-intro p {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
}

.mcp-list {
  flex: 2 1 420px;
  display: flex;
  flex-direction: column;
}

.mcp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 24px 4px;
  border-top: 1px solid rgba(233, 231, 218, 0.12);
}

.mcp-row:hover {
  background: rgba(233, 231, 218, 0.03);
  color: var(--text);
}

.mcp-no {
  font-size: 13px;
  color: var(--text-dim);
  min-width: 36px;
}

.mcp-name {
  flex: 1 1 200px;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.mcp-desc {
  flex: 2 1 240px;
  font-size: 15px;
  color: var(--text-muted);
  text-wrap: pretty;
}

.mcp-tag {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

/* ---------- About ---------- */

.about {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 5vw, 80px);
}

.about-portrait {
  flex: 1 1 240px;
  min-width: 220px;
  max-width: 360px;
}

.about-portrait-frame {
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(233, 231, 218, 0.04);
}

/* Portrait is square, frame is 3:4 — cover crops the sides evenly. */
.about-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-body {
  flex: 2 1 380px;
  min-width: 280px;
}

.about-lead {
  margin: 18px 0 0;
  font-size: clamp(20px, 2.4vw, 34px);
  line-height: 1.35;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: pretty;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  margin-top: clamp(32px, 4vw, 56px);
}

.about-label {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.about-value {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
}

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

.contact {
  padding: var(--section-pad-y) var(--pad-x) 40px;
  background: var(--bg-alt);
}

.contact-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 60px);
}

.contact-heading { flex: 1 1 380px; }

.contact-title {
  margin: 0;
  font-size: clamp(34px, 6vw, 74px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--text-bright);
}

.contact-actions {
  flex: 0 1 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 15px;
  color: var(--text-muted);
}

.contact-social a { color: var(--text-muted); }

.contact-social a:hover { color: var(--accent); }

.contact-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(48px, 8vw, 110px);
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- Responsive: design switches at 900px ---------- */

@media (max-width: 899px) {
  .nav-pill,
  .header-email { display: none; }
}

@media (min-width: 900px) {
  .menu-button { display: none; }
  .mobile-menu { display: none; }
}

/* ---------- Motion preference ---------- */

/* main.js withholds the video source here, so the element keeps showing its
   poster rather than being hidden. */
@media (prefers-reduced-motion: reduce) {
  .hero-video { object-fit: cover; }
}

/* ==========================================================
   Project detail pages (e.g. /econ-news-mcp/)
   ========================================================== */

.doc {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(96px, 14vh, 150px) var(--pad-x) 0;
}

.back-link,
.text-link {
  display: inline-block;
  font-size: 15px;
  color: var(--text-muted);
}

.back-link {
  display: block;
  margin-bottom: 28px;
}

.doc-hero .eyebrow { display: block; }

/* Keep anchor targets clear of the fixed header. */
.doc-section,
.doc [id] { scroll-margin-top: 88px; }

.back-link:hover,
.text-link:hover { color: var(--accent); }

.doc-title {
  margin: 12px 0 0;
  font-size: clamp(40px, 7vw, 78px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: var(--text-bright);
}

.doc-lead {
  margin: 22px 0 0;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.55;
  font-weight: 300;
  color: var(--text-soft);
  text-wrap: pretty;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}

.doc-actions--end { margin-top: 40px; }

/* Key numbers, read at a glance under the intro. */
.doc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  margin: 44px 0 0;
  padding: 26px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.doc-facts dt {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.doc-facts dd {
  margin: 0;
  font-size: 17px;
  color: var(--text-soft);
}

.doc-toc {
  margin: 40px 0 0;
  padding: 24px 26px;
  background: var(--bg-alt);
  border: 1px solid var(--hairline);
  border-radius: 18px;
}

.doc-toc-label {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.doc-toc ol {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--text-dim);
}

.doc-toc li { margin: 8px 0; }

.doc-toc a {
  font-size: 16px;
  color: var(--text-soft);
}

.doc-toc a:hover { color: var(--accent); }

.doc-section {
  padding: clamp(56px, 8vw, 88px) 0 0;
}

.doc-h2 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-bright);
}

.doc-h3 {
  margin: 44px 0 14px;
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.doc-section p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
  text-wrap: pretty;
}

.doc-note { color: var(--text-muted); }

.doc-section strong { color: var(--text); font-weight: 500; }

.doc-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: rgba(233, 231, 218, 0.07);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--text-bright);
}

.code-block {
  display: block;
  margin: 14px 0 18px;
  padding: 16px 18px;
  background: #0E0F0E;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-soft);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.callout {
  margin: 24px 0;
  padding: 22px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
  border-radius: 14px;
}

/* Only the callout's leading label is a block heading; emphasis inside
   paragraphs must stay inline. */
.callout > strong:first-child {
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--text-bright);
}

.callout p, .callout li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}

.callout ul { margin: 0 0 12px; padding-left: 20px; }

.callout li { margin: 6px 0; }

.callout p:last-child, .callout-foot { margin-bottom: 0; }

.callout--warn { border-left-color: #D9A063; background: rgba(217, 160, 99, 0.06); }

/* Numbered walkthrough. The counter keeps step numbers correct even though
   each step carries its own heading. */
.steps {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 8px 52px;
  margin-bottom: 40px;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--text-bright);
  color: var(--bg);
  font-size: 15px;
  font-weight: 500;
}

.step-title {
  margin: 4px 0 12px;
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}

.tip {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(233, 231, 218, 0.035);
  border-radius: 10px;
  font-size: 15px !important;
  color: var(--text-muted) !important;
}

.shot {
  margin: 20px 0;
}

.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 14px;
}

.shot figcaption {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  text-wrap: pretty;
}

/* Tables scroll inside their own box so the page never scrolls sideways. */
.table-scroll {
  overflow-x: auto;
  margin: 18px 0 22px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 420px;
}

.doc-table th {
  text-align: left;
  padding: 14px 18px;
  background: var(--bg-alt);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.doc-table td {
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
  color: var(--text-soft);
  line-height: 1.6;
  vertical-align: top;
}

.flow {
  margin: 18px 0 22px;
  padding: 22px 24px;
  background: #0E0F0E;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-muted);
  overflow-x: auto;
}

.problems, .limits {
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--text-soft);
}

.problems li, .limits li {
  margin: 14px 0;
  font-size: 16px;
  line-height: 1.7;
  text-wrap: pretty;
}

.limits { list-style: none; padding-left: 0; }

.limits li {
  padding-left: 20px;
  position: relative;
}

.limits li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

@media (max-width: 599px) {
  .step {
    padding-left: 0;
    padding-top: 46px;
  }
}
