/* ==========================================================================
   tanpham-apps — hand-written stylesheet. No framework, no build, no fonts
   fetched from anywhere. One file, one request.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --paper:      #faf9f6;
  --paper-2:    #f2f0ea;
  --surface:    #ffffff;
  --ink:        #15171a;
  --ink-2:      #3d434b;
  --muted:      #6d747e;
  --faint:      #949aa3;
  --rule:       #e3e1d9;
  --rule-2:     #cfccc1;
  --accent:     #0c6f63;
  --accent-2:   #0a5b51;
  --accent-bg:  #e6f1ef;
  --warn-bg:    #fbf3e4;
  --shadow:     0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px -12px rgba(20, 22, 26, .10);

  --w-wide:  1080px;
  --w-prose: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #0d0f11;
    --paper-2:   #131619;
    --surface:   #16191d;
    --ink:       #eceef0;
    --ink-2:     #c2c7cd;
    --muted:     #939aa3;
    --faint:     #6f767f;
    --rule:      #24282d;
    --rule-2:    #343a41;
    --accent:    #4ecdbd;
    --accent-2:  #7ee0d2;
    --accent-bg: #10231f;
    --warn-bg:   #221c10;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- layout primitives ---------- */

.wrap  { max-width: var(--w-wide);  margin-inline: auto; padding-inline: 24px; }
.prose { max-width: var(--w-prose); margin-inline: auto; padding-inline: 24px; }

.band        { padding-block: 84px; border-top: 1px solid var(--rule); }
.band--tint  { background: var(--paper-2); }
.band--first { border-top: 0; }

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

/* ---------- type ---------- */

h1, h2, h3, h4 { font-weight: 660; letter-spacing: -0.021em; margin: 0; }

h1 { font-size: clamp(34px, 6.4vw, 54px); line-height: 1.08; letter-spacing: -0.03em; }
h2 { font-size: clamp(25px, 3.8vw, 33px); line-height: 1.18; }
h3 { font-size: 19px; line-height: 1.35; letter-spacing: -0.014em; }
h4 { font-size: 16px; line-height: 1.4; }

p { margin: 0 0 17px; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(18px, 2.3vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: -0.011em;
}

.dim   { color: var(--muted); }
strong { font-weight: 640; }
em     { font-style: italic; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

ul, ol { margin: 0 0 17px; padding-left: 21px; }
li { margin-bottom: 9px; }
li:last-child { margin-bottom: 0; }

/* the mono voice: eyebrows, numerals, tags, chips */
.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  margin: 0 0 18px;
  font-weight: 600;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule-2);
  max-width: 200px;
}
.eyebrow--solo::after { display: none; }

.sectionhead { max-width: 680px; margin-bottom: 44px; }
.sectionhead p { color: var(--muted); margin-top: 14px; margin-bottom: 0; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  border: 1px solid var(--rule-2);
  border-radius: 0 0 8px 0;
  z-index: 20;
}
.skip:focus { left: 0; }

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--rule);
}

@supports not (backdrop-filter: blur(1px)) {
  header.site { background: var(--paper); }
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-block: 15px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  color: var(--ink);
  font-weight: 660;
  font-size: 16px;
  letter-spacing: -0.015em;
}
.brand:hover { text-decoration: none; }
.brand .role {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
}

nav.site { display: flex; gap: 6px; flex-wrap: wrap; }

nav.site a {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 7px;
  white-space: nowrap;
}
nav.site a:hover { color: var(--ink); background: var(--paper-2); text-decoration: none; }
nav.site a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}

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

.hero { padding-block: 92px 72px; }
.hero h1 { max-width: 15ch; }
.hero .lead { margin-top: 26px; max-width: 60ch; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 21px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.008em;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn--solid { background: var(--accent); color: #fff; }
.btn--solid:hover { background: var(--accent-2); }
.btn--ghost { border-color: var(--rule-2); color: var(--ink); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

@media (prefers-color-scheme: dark) {
  .btn--solid { color: #06211d; }
}

.btn .arrow { font-size: 15px; line-height: 1; }

/* ---------- stat strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-top: 56px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}

.stat {
  background: var(--surface);
  padding: 22px 20px;
}
.stat .n {
  font-size: 33px;
  font-weight: 660;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stat .k { color: var(--muted); margin-top: 7px; font-weight: 500; }

/* hero strip carrying short claims instead of figures */
.stats--claims .stat .n {
  font-size: 20px;
  letter-spacing: -0.022em;
  line-height: 1.25;
}
.stats--claims .stat .k { font-size: 14.5px; margin-top: 6px; }

/* ---------- section footnote ---------- */

.note {
  margin-top: 22px;
  font-size: 14px;
  color: var(--faint);
  max-width: 60ch;
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 24px;
}
.card > :last-child { margin-bottom: 0; }
.card p { color: var(--muted); font-size: 15.5px; margin-top: 11px; }
.card h3 + p { margin-top: 9px; }

.card .num {
  display: block;
  color: var(--faint);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
#responsibility .card .num { color: var(--accent); font-weight: 600; }

a.card {
  display: block;
  color: var(--ink);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
a.card:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
a.card .go {
  display: inline-block;
  margin-top: 15px;
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 600;
}

.card--flag {
  background: var(--accent-bg);
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.card--flag p { color: var(--ink-2); }

/* ---------- "not in them" chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.chips li {
  margin: 0;
  padding: 7px 13px;
  border: 1px dashed var(--rule-2);
  border-radius: 999px;
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-color: var(--rule-2);
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-decoration-thickness: 1.5px;
  background: var(--surface);
}

/* ---------- key/value fact rows ---------- */

.facts { margin: 0; }
.facts > div {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}
.facts > div:first-child { border-top: 1px solid var(--rule); }
.facts dt {
  flex: 0 0 172px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 3px;
}
.facts dd { margin: 0; flex: 1 1 260px; color: var(--ink-2); font-size: 15.5px; }

/* ---------- contact block ---------- */

.contactbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 30px;
}
.contactbox .who { min-width: 240px; flex: 1 1 300px; }
.contactbox h2 { margin-bottom: 10px; }
.contactbox p { color: var(--muted); margin: 0; }

.mail {
  display: inline-block;
  font-size: clamp(16px, 3.4vw, 21px);
  font-weight: 640;
  letter-spacing: -0.02em;
  word-break: break-word;
}

/* ---------- legal pages ---------- */

.doc-head { padding-block: 60px 0; }

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  padding: 5px 13px;
  color: var(--muted);
  margin-bottom: 20px;
  background: var(--surface);
}
.stamp .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.toc {
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--surface);
  padding: 20px 24px;
  margin: 38px 0 8px;
}
.toc h2 {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 14px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 30px;
  counter-reset: toc;
}
.toc li {
  margin: 0 0 7px;
  break-inside: avoid;
  counter-increment: toc;
  font-size: 14.5px;
  display: flex;
  gap: 9px;
}
.toc li::before {
  content: counter(toc);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--faint);
  flex: none;
  padding-top: 3px;
  min-width: 15px;
  text-align: right;
}
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--accent); }

.doc { padding-block: 8px 80px; }

.doc section { padding-top: 40px; scroll-margin-top: 76px; }
.doc section h2 {
  font-size: 21px;
  letter-spacing: -0.015em;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.doc section h2 .n {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  flex: none;
}
.doc h3 { margin: 26px 0 8px; font-size: 17px; }
.doc p, .doc li { color: var(--ink-2); }

.summary {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px 14px 14px 4px;
  padding: 24px 26px;
  margin: 32px 0 0;
}
.summary h2 {
  font-size: 15px;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
}
.summary ul { margin-bottom: 0; }
.summary li { color: var(--ink-2); font-size: 15.5px; }

.callout {
  background: var(--warn-bg);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 22px 0;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.callout > :last-child { margin-bottom: 0; }
.callout p, .callout li { color: var(--ink-2); }

/* ---------- FAQ accordion (no JS) ---------- */

.faq { border-top: 1px solid var(--rule); margin-top: 30px; }

.faq details { border-bottom: 1px solid var(--rule); }

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 17px 40px 17px 2px;
  position: relative;
  font-weight: 590;
  font-size: 17px;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }

.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 1.6px solid var(--faint);
  border-bottom: 1.6px solid var(--faint);
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq .answer { padding: 0 8px 20px 2px; max-width: 68ch; }
.faq .answer p, .faq .answer li { color: var(--ink-2); font-size: 16px; }
.faq .answer > :last-child { margin-bottom: 0; }

/* ---------- checklist ---------- */

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative;
  padding-left: 27px;
  margin-bottom: 11px;
  color: var(--ink-2);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

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

footer.site {
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  padding-block: 46px 40px;
  font-size: 14.5px;
  color: var(--muted);
}

.footcols {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(auto-fit, minmax(130px, 1fr));
  gap: 32px;
  padding-bottom: 34px;
}

.footcols h2 {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 13px;
}
.footcols ul { list-style: none; margin: 0; padding: 0; }
.footcols li { margin-bottom: 8px; }
.footcols a { color: var(--ink-2); }
.footcols a:hover { color: var(--accent); }
.footcols .about { color: var(--muted); max-width: 42ch; margin: 0; font-size: 14.5px; }
.footcols .about .name {
  display: block;
  color: var(--ink);
  font-weight: 640;
  font-size: 16px;
  letter-spacing: -0.015em;
  margin-bottom: 9px;
}

.footbar {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  color: var(--faint);
  font-size: 13.5px;
}

/* ---------- 404 ---------- */

.notfound { padding-block: 90px 100px; }
.notfound .code {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 16px;
}

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

@media (max-width: 720px) {
  .toc ol { columns: 1; }
  .facts dt { flex-basis: 100%; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap, .prose { padding-inline: 18px; }
  .band { padding-block: 58px; }
  .hero { padding-block: 60px 48px; }
  .sectionhead { margin-bottom: 32px; }
  .stats { margin-top: 40px; }
  .stat { padding: 18px 17px; }
  .stat .n { font-size: 28px; }
  .stats--claims .stat .n { font-size: 18px; }
  .card { padding: 20px; }
  .contactbox { padding: 24px 20px; }
  .doc section { padding-top: 32px; }
  .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 400px) {
  .wrap, .prose { padding-inline: 16px; }
  .brand .role { display: none; }
  nav.site a { padding: 5px 8px; font-size: 14px; }
}

@media print {
  header.site, footer.site, .toc, .hero-actions { display: none; }
  body { font-size: 11pt; background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
