:root {
  --ink: #e8e4dc;
  --muted: #8a8790;
  --bg: #0c0e12;
  --bg-soft: #14171d;
  --panel: #1a1e26;
  --line: rgba(232, 228, 220, 0.12);
  --amber: #e8b44c;
  --amber-deep: #c4922e;
  --safelight: #c43c2e;
  --cyan: #6ec8d4;
  --font: 'Anuphan', sans-serif;
  --heading: 'Prompt', 'Anuphan', sans-serif;
  --mono: 'IBM Plex Mono', 'Anuphan', monospace;
  --max: 1120px;
  --demo-h: 48px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  font-synthesis: none;
  background:
    radial-gradient(ellipse 50% 35% at 70% 0%, rgba(196, 60, 46, 0.12), transparent 50%),
    radial-gradient(ellipse 40% 30% at 0% 60%, rgba(232, 180, 76, 0.06), transparent 45%),
    var(--bg);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; font-size: 16px; color: inherit; }
ul, ol { list-style: none; }
.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.demo-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; padding: 0.55rem 1.25rem;
  background: #07080a; color: #fff; font-size: 0.82rem;
}
.demo-bar strong {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
  color: var(--amber); font-weight: 500;
}
.demo-bar__actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.demo-bar a {
  padding: 0.35rem 0.7rem; border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius); font-size: 0.78rem; font-weight: 500;
}
.demo-bar a.is-primary { background: var(--amber); border-color: var(--amber); color: #0c0e12; }

.site-header {
  position: sticky; top: var(--demo-h); z-index: 50;
  background: rgba(12, 14, 18, 0.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); position: relative;
}
.brand {
  font-family: var(--heading); font-weight: 700; font-size: 1.28rem;
  display: inline-flex; align-items: baseline; gap: 0.45rem;
}
.brand small {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--amber); font-weight: 500;
}
.menu-toggle {
  display: none; background: none; border: 1px solid var(--line);
  padding: 0.45rem 0.8rem; cursor: pointer; border-radius: var(--radius); color: var(--ink);
}
.nav { display: flex; align-items: center; gap: 1.15rem; }
.nav a { font-size: 0.92rem; font-weight: 500; color: var(--muted); }
.nav-cta {
  background: var(--amber); color: #0c0e12 !important;
  padding: 0.55rem 1.05rem; border-radius: var(--radius); font-weight: 700;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.9rem 1.4rem; font-weight: 700; border-radius: var(--radius);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--amber { background: var(--amber); color: #0c0e12; }
.btn--ghost { color: #fff; border-color: rgba(255,255,255,0.45); background: transparent; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero {
  position: relative; min-height: min(90dvh, 820px);
  display: flex; align-items: flex-end; color: #fff; overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.72) saturate(0.85);
  animation: ken 22s var(--ease) both;
}
.hero__media::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(115deg, rgba(7, 8, 10, 0.92) 0%, rgba(12, 14, 18, 0.62) 48%, rgba(12, 14, 18, 0.3) 100%),
    linear-gradient(0deg, rgba(7, 8, 10, 0.8) 0%, transparent 42%);
}
.hero__fx { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.safelight {
  position: absolute; top: -10%; right: 8%; width: 42%; height: 50%;
  background: radial-gradient(ellipse at center, rgba(196, 60, 46, 0.28), transparent 70%);
  animation: pulse-safe 7s var(--ease) infinite alternate;
}
.haze {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 40% at 30% 70%, rgba(232, 180, 76, 0.08), transparent 60%);
}
.hero__inner {
  position: relative; z-index: 2;
  width: min(100% - 2.5rem, var(--max));
  margin: 0 auto; padding: 0 0 3.5rem;
  animation: rise 0.9s var(--ease) both;
}
.hero__brand {
  font-family: var(--heading); font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.75rem;
}
.hero__brand span {
  display: block; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500;
  color: var(--amber); margin-top: 0.35rem;
}
.hero h1 {
  font-family: var(--heading); font-size: clamp(1.65rem, 3.8vw, 2.45rem);
  font-weight: 600; line-height: 1.25; max-width: 18ch; margin-bottom: 0.85rem;
}
.hero h1 em { font-style: normal; color: var(--amber); }
.hero__lead { max-width: 34ch; color: rgba(255,255,255,0.82); margin-bottom: 1.4rem; }

.section { padding: 4.5rem 0; }
.section--panel { background: var(--bg-soft); }
.section--book {
  background: #07080a;
  background-image: radial-gradient(ellipse 40% 50% at 0% 100%, rgba(196, 60, 46, 0.18), transparent 55%);
}
.section__head { max-width: 40rem; margin-bottom: 2rem; }
.eyebrow {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 0.55rem;
}
.eyebrow.light { color: var(--amber); }
.section__head h2, .section h2, .dock h2 {
  font-family: var(--heading); font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 0.55rem;
}
.section__head p, .section p, .lede { color: var(--muted); }

.dev-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem;
  padding: 1.25rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 0 60px rgba(196, 60, 46, 0.06);
}
.tray {
  position: relative; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: #10131a;
  padding: 1.15rem 1rem 2.4rem; border-radius: var(--radius); overflow: hidden;
  min-height: 160px; transition: border-color 0.2s ease, transform 0.2s var(--ease);
}
.tray:hover, .tray.is-active {
  border-color: var(--amber); transform: translateY(-3px);
}
.tray__code {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  color: var(--amber); display: block; margin-bottom: 0.55rem;
}
.tray strong {
  font-family: var(--heading); font-size: 1.15rem; display: block; margin-bottom: 0.35rem;
}
.tray p { font-size: 0.88rem; color: var(--muted); }
.tray__fluid {
  position: absolute; left: 0; right: 0; bottom: 0; height: 28%;
  opacity: 0.55; transition: height 0.35s var(--ease), opacity 0.35s ease;
}
.tray--dev .tray__fluid { background: linear-gradient(180deg, transparent, rgba(232, 180, 76, 0.45)); }
.tray--stop .tray__fluid { background: linear-gradient(180deg, transparent, rgba(110, 200, 212, 0.35)); }
.tray--fix .tray__fluid { background: linear-gradient(180deg, transparent, rgba(196, 60, 46, 0.4)); }
.tray--wash .tray__fluid { background: linear-gradient(180deg, transparent, rgba(232, 228, 220, 0.2)); }
.tray.is-active .tray__fluid { height: 42%; opacity: 0.85; }

.board-note {
  margin-top: 1.25rem; padding: 1rem 1.15rem;
  border-left: 3px solid var(--safelight); background: rgba(196, 60, 46, 0.08);
}
.board-note__label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #e07060; margin-bottom: 0.35rem;
}
.board-note p:last-child { color: var(--muted); }

.chem-split {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 2.5rem; align-items: center;
}
.chem-ticks { margin-top: 1.4rem; display: grid; gap: 0.75rem; }
.chem-ticks li {
  padding-left: 1.25rem; position: relative; font-weight: 500;
}
.chem-ticks li::before {
  content: ''; position: absolute; left: 0; top: 0.5rem;
  width: 0.55rem; height: 0.55rem; background: var(--amber); border-radius: 1px;
}
.chem-photos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.chem-photos img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius);
  filter: saturate(0.85) brightness(0.9);
}

.print-dock {
  padding: 4.5rem 0;
  background:
    linear-gradient(180deg, var(--bg-soft), #0a0c10);
  border-top: 1px solid var(--line);
}
.dock {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2rem; align-items: start;
}
.prints { display: grid; gap: 0.55rem; margin-top: 1.25rem; }
.print {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0.85rem; align-items: center;
  padding: 0.9rem 1rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); transition: border-color 0.2s ease, background 0.2s ease;
}
.print.is-on, .print:hover { border-color: rgba(232, 180, 76, 0.55); background: #1e232c; }
.print__num {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--amber);
}
.print strong { font-family: var(--heading); font-size: 1.02rem; display: block; }
.print p { font-size: 0.85rem; color: var(--muted); }
.print-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 0.45rem 0.75rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; font-size: 0.82rem;
}
.print.is-on .print-btn, .print-btn:hover {
  background: var(--amber); color: #0c0e12; border-color: var(--amber);
}

.dock__preview {
  background: var(--panel); border: 1px solid var(--line);
  padding: 0.85rem; border-radius: var(--radius);
}
.dock__preview-label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.65rem;
}
.dock__preview img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  filter: contrast(1.05) saturate(0.8);
}
.dock__preview figcaption {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-top: 0.65rem;
}

.book {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2.5rem; align-items: start;
}
.form { display: grid; gap: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(232, 228, 220, 0.55);
}
.field input, .field select, .field textarea {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius); padding: 0.85rem 0.95rem; color: #fff;
}
.field input::placeholder { color: rgba(255,255,255,0.3); }
.field select option { color: #0c0e12; background: #fff; }

.site-footer {
  padding: 1.5rem 0; border-top: 1px solid var(--line); background: #07080a;
}
.site-footer__inner {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.88rem; color: var(--muted);
}
.mono { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@keyframes ken {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-safe {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .dev-board { grid-template-columns: repeat(2, 1fr); }
  .chem-split, .dock, .book { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--panel); border: 1px solid var(--line); padding: 0.5rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
  .nav-cta { text-align: center; margin-top: 0.35rem; }
  .field-row, .chem-photos { grid-template-columns: 1fr; }
  .dev-board { grid-template-columns: 1fr; }
  .hero__inner { padding-bottom: 2.5rem; }
}
