/* ==========================================================================
   自造工坊 · JUSTBUILD
   A workbench at night: unlit room, one warm desk lamp, teal for live signal.

   Type discipline: Fusion Pixel is designed on a 12px grid, so every size that
   uses it is an exact multiple of 12 (12 / 24 / 36 / 48 / 60). Non-integer or
   off-grid sizes are what make pixel fonts look blurry.
   ========================================================================== */

:root {
  /* surfaces, from the room outwards */
  --room:   #070B14;
  --wall:   #0E1626;
  --bench:  #18243A;
  --edge:   #24344F;
  --edge-2: #31456A;

  /* light */
  --lamp:   #FFC64B;
  --lamp-2: #FFE7A3;
  --joint:  #5FE3C0;
  --alert:  #FF8A4C;

  /* ink */
  --paper:  #DDE7F4;
  --muted:  #8FA3BF;

  --pixel: "Fusion Pixel 12px Proportional Simplified Chinese";
  --ui: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --gut: 24px;
  --shadow: 4px 4px 0 #050810;
}

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

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

body {
  margin: 0;
  background-color: var(--room);
  /* the page itself sits on a 24px blueprint grid = 2 pixel cells */
  background-image:
    linear-gradient(to right, rgba(36, 52, 79, .30) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 52, 79, .30) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--paper);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.wrap { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: var(--gut); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 12px 16px; background: var(--lamp); color: var(--room);
  font-family: var(--pixel); font-size: 12px;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--lamp);
  outline-offset: 3px;
}

/* ───────────────────────────────────────────────────────── type helpers ── */
.px { font-family: var(--pixel); font-weight: 400; }

.eyebrow {
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 1.6;
  color: var(--joint);
  margin: 0 0 24px;
  letter-spacing: 0;
}
.eyebrow span { color: var(--muted); }

/* ─────────────────────────────────────────────────────────────── topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14, 22, 38, .96);
  border-bottom: 1px solid var(--edge);
}
.topbar__in {
  display: flex; align-items: center; gap: 24px;
  min-height: 72px;
}

.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand__mark {
  width: 16px; height: 16px;
  align-self: center;
  image-rendering: pixelated;
}
.brand__name { font-family: var(--pixel); font-size: 24px; line-height: 1.2; }
.brand__en {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em;
  color: var(--muted);
}

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  font-family: var(--pixel);
  font-size: 12px; line-height: 1;
  padding: 12px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}
.nav a:hover { color: var(--lamp-2); background: var(--bench); border-color: var(--edge); }

.status {
  display: flex; align-items: center; gap: 8px;
  margin: 0;
  font-family: var(--pixel); font-size: 12px; line-height: 1;
  color: var(--joint);
  white-space: nowrap;
}

.led {
  width: 8px; height: 8px; flex: none;
  background: var(--joint);
  box-shadow: 0 0 0 2px rgba(95, 227, 192, .18);
}
.led--idle { background: var(--lamp); box-shadow: 0 0 0 2px rgba(255, 198, 75, .16); animation: blink 1.6s steps(1) infinite; }
.led--live { background: var(--joint); }

@keyframes blink { 0%, 60% { opacity: 1 } 61%, 100% { opacity: .25 } }

/* ────────────────────────────────────────────────────────────────  hero ── */
.hero { position: relative; padding: 72px 0 84px; overflow: hidden; }

/* the desk lamp, cast on the wall behind the hero */
.hero::before {
  content: "";
  position: absolute; top: -220px; right: -160px;
  width: 720px; height: 720px;
  background: radial-gradient(circle at 50% 50%, rgba(255,198,75,.16), rgba(255,198,75,.05) 42%, transparent 68%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}

.hero__title {
  font-family: var(--pixel);
  font-size: 60px;
  line-height: 1.1;
  margin: 0 0 24px;
  color: var(--paper);
  text-shadow: 4px 4px 0 rgba(255, 198, 75, .22);
}

.hero__lede {
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1.6;
  margin: 0 0 12px;
  color: var(--lamp-2);
}

.hero__sub { margin: 0 0 32px; color: var(--muted); max-width: 34em; }
.hero__sub strong { color: var(--paper); font-weight: 600; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }

.btn {
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1;
  padding: 14px 20px;
  text-decoration: none;
  color: var(--paper);
  background: var(--bench);
  border: 1px solid var(--edge-2);
  box-shadow: var(--shadow);
  transition: transform .12s steps(2), box-shadow .12s steps(2);
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #050810; }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 #050810; }
.btn--primary { color: var(--room); background: var(--lamp); border-color: var(--lamp-2); }
.btn--primary:hover { background: var(--lamp-2); }

.specs {
  display: grid; gap: 1px;
  margin: 0;
  background: var(--edge);
  border: 1px solid var(--edge);
}
.specs > div {
  display: flex; gap: 16px; align-items: baseline;
  padding: 10px 14px; background: var(--wall);
}
.specs dt {
  font-family: var(--pixel); font-size: 12px; line-height: 1.6;
  color: var(--joint); flex: none; width: 3em;
}
.specs dd { margin: 0; font-size: 14px; color: var(--muted); }

/* art panel */
.hero__art { margin: 0; }
.frame {
  position: relative;
  padding: 12px;
  background: var(--wall);
  border: 1px solid var(--edge-2);
  box-shadow: var(--shadow);
}
/* rivets, because everything in this workshop is screwed together */
.frame::before, .frame::after {
  content: ""; position: absolute; width: 6px; height: 6px;
  background: var(--edge-2);
}
.frame::before { top: 4px; left: 4px; }
.frame::after  { bottom: 4px; right: 4px; }

.frame img { width: 100%; height: auto; }

.frame__tag {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .12em;
  color: var(--lamp-2);
  background: rgba(7, 11, 20, .85);
  padding: 4px 8px;
  border: 1px solid var(--edge);
}

.hero__art figcaption {
  margin-top: 12px;
  font-size: 13px; line-height: 1.7;
  color: var(--muted);
}

/* ───────────────────────────────────────────────────────────── sections ── */
.section { padding: 84px 0; border-top: 1px solid var(--edge); }
.section--alt { background: rgba(14, 22, 38, .55); }

.section__head { margin-bottom: 40px; }
.section__head--stack { margin-bottom: 0; }

.section__title {
  font-family: var(--pixel);
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 12px;
}
.section__title::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 16px;
  background: var(--lamp);
  vertical-align: 6px;
}
.section__note { margin: 0; color: var(--muted); font-size: 15px; }

/* ─────────────────────────────────────────────────────────────── slots ── */
.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 0 40px; padding: 0; list-style: none;
}

.slot {
  padding: 20px;
  background: var(--wall);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  transition: transform .12s steps(2), box-shadow .12s steps(2), border-color .12s steps(2);
}
.slot:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #050810;
  border-color: var(--edge-2);
}

/* the empty state carries the meaning, so the art stays typographic:
   a fine CSS dash reads as "nothing here yet" far more cleanly than
   pixel-sized dashes, which turn to noise at this scale. */
.slot__window {
  margin: 0 0 16px;
  padding: 22px 0 26px;
  border: 1px dashed var(--edge-2);
  text-align: center;
  background:
    repeating-linear-gradient(to bottom, rgba(36, 52, 79, .18) 0 1px, transparent 1px 12px);
}
.slot__index {
  font-family: var(--pixel);
  font-size: 48px;
  line-height: 1;
  color: #2A3D5C;
}

.slot__no {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .16em;
  color: var(--muted);
  margin: 0 0 8px;
}
.slot__state {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--pixel); font-size: 24px; line-height: 1.2;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────── about ── */
.about__grid { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }
.prose p { margin: 0 0 20px; color: var(--muted); max-width: 38em; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--paper); font-weight: 600; }
.mark {
  color: var(--paper);
  border-bottom: 2px solid var(--lamp);
  padding-bottom: 1px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.chips li {
  font-family: var(--pixel); font-size: 12px; line-height: 1;
  padding: 10px 12px;
  color: var(--joint);
  background: var(--bench);
  border: 1px solid var(--edge);
}

/* ───────────────────────────────────────────────────────────────── log ── */
.log { margin: 0; padding: 0; list-style: none; display: grid; gap: 24px; }
.entry {
  display: grid; grid-template-columns: 140px 1fr; gap: 32px;
  padding: 24px;
  background: var(--wall);
  border: 1px solid var(--edge);
  border-left: 3px solid var(--lamp);
}
.entry__date { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.entry__body p { margin: 12px 0 0; color: var(--muted); max-width: 40em; }
.entry__body p:first-of-type { margin-top: 8px; }
.entry__title {
  font-family: var(--pixel); font-size: 24px; line-height: 1.3;
  margin: 0; color: var(--paper);
}
.entry__body strong { color: var(--lamp-2); font-weight: 400; }
code {
  font-family: var(--mono); font-size: .92em;
  color: var(--joint);
  background: var(--bench);
  padding: 2px 6px;
  border: 1px solid var(--edge);
}

/* ─────────────────────────────────────────────────────────────── footer ── */
.footer { padding: 40px 0 48px; border-top: 1px solid var(--edge); background: rgba(7, 11, 20, .7); }
.footer__in { display: grid; gap: 8px; }
.footer p { margin: 0; font-size: 13px; color: var(--muted); }
.footer__copy { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.footer__dim { color: #5D7191; }
.footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--edge-2); }
.footer a:hover { color: var(--lamp-2); border-bottom-color: var(--lamp); }
.footer__beian { display: flex; gap: 16px; flex-wrap: wrap; }

/* ─────────────────────────────────────────── hero load choreography ── */
/* One orchestrated pass, in reading order. steps() keeps the motion on the
   pixel grid instead of easing between pixels. The hidden start state is
   scoped to .js, so a no-JS visitor still gets the whole hero. */
.js .hero .eyebrow,
.js .hero__title,
.js .hero__lede,
.js .hero__sub,
.js .hero__cta,
.js .hero .specs,
.js .hero__art { opacity: 0; }

.is-ready .hero .eyebrow,
.is-ready .hero__title,
.is-ready .hero__lede,
.is-ready .hero__sub,
.is-ready .hero__cta,
.is-ready .hero .specs,
.is-ready .hero__art {
  animation: rise 420ms steps(4, end) forwards;
}
.is-ready .hero .eyebrow  { animation-delay:  0ms; }
.is-ready .hero__title   { animation-delay: 60ms; }
.is-ready .hero__art     { animation-delay:120ms; }
.is-ready .hero__lede    { animation-delay:200ms; }
.is-ready .hero__sub     { animation-delay:260ms; }
.is-ready .hero__cta     { animation-delay:320ms; }
.is-ready .hero .specs   { animation-delay:380ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ─────────────────────────────────────────────────────────── responsive ── */
@media (max-width: 900px) {
  .hero { padding: 56px 0 64px; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__title { font-size: 48px; }
  .about__grid { grid-template-columns: 1fr; gap: 24px; }
  .slots { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 640px) {
  :root { --gut: 16px; }
  body { font-size: 15px; }
  .topbar__in { flex-wrap: wrap; gap: 12px; padding-block: 12px; }
  .nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; }
  .nav a { padding: 10px 8px; }
  .status { margin-left: auto; }
  .section { padding: 56px 0; }
  .section__title { font-size: 24px; }
  .section__title::before { vertical-align: 4px; }
  .hero__title { font-size: 36px; }
  .hero__lede { font-size: 12px; }
  .btn { font-size: 12px; padding: 14px 16px; }
}

/* ─────────────────────────────────────────────── motion & contrast ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (prefers-contrast: more) {
  :root { --muted: #C3D2E6; --edge: #3F5A82; }
  .section--alt { background: var(--wall); }
}

@media print {
  .topbar, .hero__cta, .frame__tag { display: none; }
  body { background: #fff; color: #000; }
}