/* ============================================================
   Narumol "Kop" Thammapruksa — plain-pages.com/demo_3/
   base.css — structure shared by all three skins.
   Skins (stillness / stagelight / ink) restyle everything via
   html[data-skin="…"] scoping in their own stylesheets.
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  padding-top: 40px; /* room for the fixed skin bar */
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
p, h1, h2, h3, h4 { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -48px; left: 8px;
  z-index: 1200;
  padding: 10px 16px;
  background: #17161a; color: #fff;
  font: 600 14px/1 system-ui, sans-serif;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 46px; }

:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 3px; }

/* ---------------- Skin switcher bar ----------------
   Deliberately neutral: system font, near-black, identical in
   every skin so it never competes with the design below it. */
.skinbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1100;
  height: 40px;
  background: #141317;
  border-bottom: 1px solid #26242b;
}
.skinbar-in {
  max-width: 720px;
  height: 100%;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.skinbar-in::-webkit-scrollbar { display: none; }
.skinbar button {
  flex: 0 0 auto;
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 13px;
  color: #96939d;
  font: 400 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.skinbar button:hover { color: #d5d3da; }
.skinbar button[aria-pressed="true"] {
  color: #f2f1f4;
  border-color: #4a4753;
  background: #211f27;
}
.skinbar button:focus-visible { outline: 2px solid #b9b6c3; outline-offset: 2px; }

/* ---------------- Layout scaffolding ---------------- */
.wrap {
  max-width: var(--wrap, 1080px);
  margin-inline: auto;
  padding-inline: clamp(18px, 4.5vw, 36px);
}

.site-nav { display: flex; flex-wrap: wrap; }
.site-nav a { text-decoration: none; }

/* ---------------- Hero: one figure per skin ---------------- */
.hero-fig { display: none; }
html[data-skin="stillness"]  .hero-fig[data-hero="stillness"],
html[data-skin="stagelight"] .hero-fig[data-hero="stagelight"],
html[data-skin="ink"]        .hero-fig[data-hero="ink"] { display: block; }

/* ---------------- Placeholders ----------------
   Unconfirmed facts are typeset as intentional gaps, not errors. */
.ph {
  display: inline-block;
  padding: 0 .35em;
  border: 1px dashed;
  border-radius: 3px;
  opacity: .68;
  font-size: .88em;
  font-style: normal;
  line-height: 1.5;
}

.ph-fig {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  min-width: min(100%, 420px);
  border: 1px dashed;
  opacity: .55;
}

/* ---------------- Video facades ---------------- */
.yt { position: relative; }
.yt-lite {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: pointer;
  background: #0a0908;
}
.yt-lite img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.yt-play {
  position: absolute;
  left: 50%; top: 50%;
  width: 62px; height: 62px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid; place-items: center;
  pointer-events: none;
}
.yt-play::after {
  content: "";
  width: 0; height: 0;
  border-style: solid;
  border-width: 11px 0 11px 19px;
  margin-left: 4px;
}
.yt-cta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  text-align: left;
}
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* ---------------- Reveal-on-scroll hooks ----------------
   Motion character (duration, transform, wipes) lives in the skins. */
html.js .reveal { opacity: 0; }
html.js .reveal.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.credits-line {
  margin-top: 14px !important;
  font-size: .8em;
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: .8;
}

/* ---------------- Small shared bits ---------------- */
.credit { display: block; }
.meta { display: block; }
