/* Hallmark · genre: modern-minimal · macrostructure: Feature Stack · F2 knobs: pinned=left, pane=screenshot, steps=3–4
 * theme: custom · vibe: "night-shift security desk, calm, exact" · paper: oklch(16% 0.020 250) · accent: oklch(74% 0.130 232)
 * display: IBM Plex Sans Thai · body: Noto Sans Thai · axes: dark / grotesk-sans / cool
 * enrichment: real app captures (no re-drawn chrome) · nav: N5 (content-sized, blur, top-centred) · footer: Ft1
 * context: inferred (enterprise / Thai government IT + DPO + staff; drive download + adoption; tone: technical, austere)
 * pre-emit critique: P4 H5 E4 S5 R5 V5
 */

@import url("tokens.css");

html, body { overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--space-xl)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}
@media (min-width: 48rem) { .wrap { padding-inline: var(--space-xl); } }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-style: normal;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-width: 0;
}
h2 { font-size: var(--text-xl); font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
h3 { font-size: var(--text-md); font-weight: 600; line-height: 1.4; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
code, .mono { font-family: var(--font-mono); font-size: 0.88em; }
a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
a:hover { color: var(--color-accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: var(--radius-sm); }
.skip { position: absolute; left: var(--space-md); top: -4rem; z-index: var(--z-nav); padding: var(--space-xs) var(--space-md); background: var(--color-paper-3); color: var(--color-ink); border-radius: var(--radius-sm); }
.skip:focus-visible { top: var(--space-md); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 46px;
  padding: 0 var(--space-lg);
  border-radius: var(--radius-btn);
  border: var(--rule-hair) solid transparent;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-accent-hover); color: var(--color-accent-ink); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--ghost { background: transparent; color: var(--color-ink); border-color: var(--color-rule-2); }
.btn--ghost:hover { background: var(--color-paper-3); color: var(--color-ink); }
.btn--sm { min-height: 36px; padding: 0 var(--space-md); font-size: var(--text-sm); }
@media (pointer: coarse) { .btn--sm { min-height: 44px; } }

/* ── N5 floating pill ── */
.nav {
  position: fixed;
  top: max(var(--space-md), env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: max-content;
  max-width: calc(100% - 32px);
  height: var(--nav-h);
  padding: 0 var(--space-xs) 0 var(--space-md);
  background: var(--color-nav);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border: var(--rule-hair) solid var(--color-rule-2);
  border-radius: var(--radius-btn);
}
.nav__brand { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--color-ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; white-space: nowrap; letter-spacing: 0.02em; }
.nav__brand:hover { color: var(--color-ink); }
.nav__brand img { width: 24px; height: 24px; }
.nav__links { display: none; list-style: none; gap: var(--space-3xs); }
.nav__links a {
  display: block;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-btn);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.nav__links a:hover { background: var(--color-paper-3); color: var(--color-ink); }
.nav__links a[aria-current="true"] { color: var(--color-ink); background: var(--color-paper-3); }
@media (min-width: 52rem) { .nav__links { display: flex; } }

/* ── Hero: title left, lede right, the real app beneath ── */
.hero { padding-top: calc(var(--nav-h) + var(--space-3xl)); padding-bottom: var(--space-2xl); }
.hero__top { display: grid; gap: var(--space-xl); align-items: end; }
@media (min-width: 62rem) { .hero__top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-2xl); } }
.product {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  color: var(--color-ink-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}
.product img { width: 20px; height: 20px; }
.hero h1 { font-size: var(--text-display); font-weight: 700; line-height: 1.32; letter-spacing: -0.02em; }
.hero h1 .hl { color: var(--color-accent); }
.nb { white-space: nowrap; }
@media (max-width: 26rem) { .nb { white-space: normal; } }
.hero__side { display: grid; gap: var(--space-lg); }
.lede { font-size: var(--text-md); line-height: 1.65; color: var(--color-ink-2); max-width: var(--measure); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-md); }
.meta { font-size: var(--text-sm); color: var(--color-muted); }
.hero__shot { margin: var(--space-3xl) 0 0; }

.shot {
  margin: 0;
  min-width: 0;
}
.shot img {
  width: 100%;
  border: var(--rule-hair) solid var(--color-rule-2);
  border-radius: var(--radius-card);
  background: var(--color-paper-2);
}
.shot figcaption { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-muted); max-width: var(--measure); }

/* ── Facts: real properties of the product, not metrics ── */
.facts { border-block: var(--rule-hair) solid var(--color-rule); }
.facts ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.facts li { padding: var(--space-lg) var(--space-md) var(--space-lg) 0; display: grid; gap: var(--space-3xs); }
.facts b { color: var(--color-ink); font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); }
.facts span { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.55; }
@media (min-width: 62rem) {
  .facts li + li { padding-left: var(--space-md); border-left: var(--rule-hair) solid var(--color-rule); }
}

/* ── Sections ── */
.section { padding-block: var(--space-4xl) var(--space-2xl); }
.section--tight { padding-block: var(--space-3xl); }
.head { display: grid; gap: var(--space-sm); max-width: 46rem; margin-bottom: var(--space-2xl); }
.head p { font-size: var(--text-md); line-height: 1.65; }

/* ── Feature Stack: sticky pane left, captures scroll right ── */
.stack { display: grid; gap: var(--space-xl); }
.stack + .stack { margin-top: var(--space-4xl); }
@media (min-width: 62rem) {
  .stack { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-2xl); align-items: start; }
  .pane { position: sticky; top: calc(var(--nav-h) + var(--space-2xl)); z-index: var(--z-raised); }
}
.pane { display: grid; gap: var(--space-lg); align-content: start; }
.pane > p { max-width: 46ch; }
.steps { list-style: none; display: grid; border-top: var(--rule-hair) solid var(--color-rule); }
.steps li {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: var(--space-md);
  padding-block: var(--space-sm);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  color: var(--color-muted);
  transition: color var(--dur-short) var(--ease-out);
}
.steps li::before { content: ""; background: var(--color-rule-2); border-radius: 2px; transition: background-color var(--dur-short) var(--ease-out); }
.steps li b { display: block; color: var(--color-ink-2); font-weight: 500; transition: color var(--dur-short) var(--ease-out); }
.steps li span { font-size: var(--text-sm); line-height: 1.55; }
.steps li.is-active { color: var(--color-ink-2); }
.steps li.is-active b { color: var(--color-ink); }
.steps li.is-active::before { background: var(--color-accent); }
.reel { display: grid; gap: var(--space-3xl); }
@media (min-width: 62rem) { .reel { gap: var(--space-4xl); padding-bottom: var(--space-2xl); } }
.reel .shot figcaption b { color: var(--color-ink-2); font-weight: 500; }

/* ── How it works: the data path ── */
.flow { list-style: none; display: grid; gap: var(--space-xs); counter-reset: f; }
@media (min-width: 62rem) { .flow { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; } }
.flow li {
  counter-increment: f;
  position: relative;
  display: grid;
  gap: var(--space-xs);
  align-content: start;
  padding: var(--space-lg);
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
}
.flow li::before { content: counter(f); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); }
.flow b { color: var(--color-ink); font-family: var(--font-display); font-weight: 600; }
.flow span { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.55; }
.flow li:first-child { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.flow li:last-child { border-radius: 0 0 var(--radius-card) var(--radius-card); background: var(--color-paper-3); }
@media (min-width: 62rem) {
  .flow li + li { border-left: 0; }
  .flow li:first-child { border-radius: var(--radius-card) 0 0 var(--radius-card); }
  .flow li:last-child { border-radius: 0 var(--radius-card) var(--radius-card) 0; }
}

.principles { margin-top: var(--space-3xl); display: grid; gap: var(--space-xl); }
@media (min-width: 62rem) { .principles { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-2xl); } }
.principles dl { margin: 0; display: grid; border-top: var(--rule-hair) solid var(--color-ink-2); }
.principles dl div { display: grid; gap: var(--space-2xs) var(--space-xl); padding-block: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
@media (min-width: 40rem) { .principles dl div { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); } }
.principles dt { color: var(--color-ink); font-family: var(--font-display); font-weight: 600; }
.principles dd { margin: 0; color: var(--color-ink-2); }

/* ── PDPA mapping table ── */
.table-wrap { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); overflow: hidden; background: var(--color-paper-2); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; vertical-align: top; padding: var(--space-md) var(--space-lg); }
thead th { font-family: var(--font-display); font-weight: 600; color: var(--color-muted); background: var(--color-paper-3); font-size: var(--text-xs); letter-spacing: 0.04em; }
tbody tr + tr td { border-top: var(--rule-hair) solid var(--color-rule); }
td:first-child { color: var(--color-ink); font-family: var(--font-display); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
td:nth-child(2) { color: var(--color-ink-2); }
td:last-child { color: var(--color-ink-2); }
@media (max-width: 47.99rem) {
  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tbody tr { padding-block: var(--space-sm); }
  tbody tr + tr { border-top: var(--rule-hair) solid var(--color-rule); }
  tbody tr + tr td { border-top: 0; }
  td { padding: var(--space-2xs) var(--space-md); }
  td::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--color-muted); }
  td:first-child::before { display: none; }
}
.note { margin-top: var(--space-md); font-size: var(--text-sm); color: var(--color-muted); max-width: var(--measure); }

/* ── For IT: deployment notes beside real config ── */
.it { display: grid; gap: var(--space-2xl); }
@media (min-width: 62rem) { .it { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.it__list { list-style: none; display: grid; gap: var(--space-lg); align-content: start; }
.it__list li { display: grid; gap: var(--space-2xs); }
.it__list b { color: var(--color-ink); font-family: var(--font-display); font-weight: 600; }
.it__list span { color: var(--color-ink-2); }
.code { display: grid; gap: var(--space-lg); min-width: 0; }
.code figure { margin: 0; min-width: 0; }
.code figcaption { display: flex; justify-content: space-between; gap: var(--space-md); padding-block: var(--space-xs); border-bottom: var(--rule-hair) solid var(--color-rule); font-size: var(--text-sm); color: var(--color-muted); }
.code figcaption code { color: var(--color-ink-2); overflow-wrap: anywhere; }
.code pre {
  margin: 0;
  padding: var(--space-md) 0 var(--space-md);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.8;
  color: var(--color-ink-2);
}
.code pre .c { color: var(--color-muted); }
.code pre .k { color: var(--color-accent); }

/* ── FAQ ── */
.faq { max-width: 52rem; border-top: var(--rule-hair) solid var(--color-rule); }
.faq details { border-bottom: var(--rule-hair) solid var(--color-rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-md);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--color-muted); transition: transform var(--dur-short) var(--ease-in-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--color-accent-hover); }
.faq details p { padding-bottom: var(--space-lg); max-width: var(--measure); }

/* ── Download ── */
.get { background: var(--color-paper-2); border-block: var(--rule-hair) solid var(--color-rule); }
.get .wrap { padding-block: var(--space-3xl); display: grid; gap: var(--space-2xl); }
@media (min-width: 62rem) { .get .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.get__intro { display: grid; gap: var(--space-lg); }
.get__intro p { font-size: var(--text-md); }
.hash { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); overflow-wrap: anywhere; line-height: 1.7; }
.specs { margin: 0; display: grid; }
.specs div { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); gap: var(--space-md); padding-block: var(--space-sm); border-top: var(--rule-hair) solid var(--color-rule-2); font-size: var(--text-sm); }
.specs div:last-child { border-bottom: var(--rule-hair) solid var(--color-rule-2); }
.specs dt { color: var(--color-muted); }
.specs dd { margin: 0; color: var(--color-ink); }

/* ── Ft1 mast-headed ── */
.foot .wrap { padding-block: var(--space-2xl) var(--space-xl); display: grid; gap: var(--space-md); }
@media (min-width: 62rem) { .foot .wrap { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.foot__mark { display: flex; align-items: center; gap: var(--space-sm); color: var(--color-ink); font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.foot__mark img { width: 34px; height: 34px; }
.foot__tag { color: var(--color-muted); font-size: var(--text-sm); }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); font-size: var(--text-sm); }
.foot__links a { color: var(--color-ink-2); text-decoration: none; white-space: nowrap; }
.foot__links a:hover { color: var(--color-ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 150ms !important; animation-duration: 150ms !important; }
  .btn:active { transform: none; }
}
