/* Fonts: self-hosted, SIL OFL 1.1 (license: OFL.txt next to each font file) */
@font-face {
  font-family: "Noto Sans Thai";
  src: url("../fonts/noto-sans-thai/NotoSansThai-VF.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono/JetBrainsMono-VF.ttf") format("truetype");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Anuphan";
  src: url("../fonts/anuphan/Anuphan-VF.ttf") format("truetype");
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --ink: #0e0e0e;
  --steel: #1c1c1c;
  --paper: #f2eee8;
  --muted: #a8a29a;          /* 7.63:1 on --ink */
  --accent: #ff6a13;         /* 6.73:1 on --ink; text ON accent must be --ink (white fails: 2.87:1) */
  --rule: rgba(242, 238, 232, 0.22);

  --head-wdth: 62.5;         /* condensed width for headings (Noto Sans Thai wdth axis) */
  --font-head: "Noto Sans Thai", sans-serif;
  --font-body: "Anuphan", "Noto Sans Thai", sans-serif;
  --font-mono: "JetBrains Mono", "Anuphan", monospace; /* Latin digits in mono, Thai falls back to Anuphan */

  --gutter: 1.25rem;
  --bar-h: 4.5rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.icon { width: 1rem; height: 1rem; flex: none; }
.icon--accent { color: var(--accent); }

/* ---------- Sticky action bar (mobile) ---------- */
.actionbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.625rem var(--gutter) calc(0.625rem + env(safe-area-inset-bottom));
  background: rgba(14, 14, 14, 0.94);
  border-top: 1px solid var(--rule);
}
.actionbar.is-single { grid-template-columns: 1fr; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0 1rem;
  font-family: var(--font-head);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  border-radius: 2px;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.btn--primary { background: var(--accent); color: var(--ink); }
.btn--primary:hover { background: #ff8136; }
.btn--ghost { color: var(--paper); border: 1px solid var(--paper); }
.btn--ghost:hover { background: var(--paper); color: var(--ink); }
.btn .icon { width: 1.25rem; height: 1.25rem; }

@media (min-width: 900px) {
  .actionbar { inset: 1rem 1.5rem auto auto; padding: 0; background: none; border: 0; display: flex; gap: 0.5rem; }
  .btn--ghost { background: var(--ink); }
}
