/* ==========================================================================
   components.css — project detections + dialog, demo stages, skills
   threshold, form states, toast, YOLO layer, boot overlay
   ========================================================================== */

/* ---------- project cards ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.proj {
  --det-inset: -1px;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .55s var(--ease-out), border-color .3s, box-shadow .55s var(--ease-out);
}
.proj:hover { transform: translateY(-6px); border-color: transparent; box-shadow: var(--shadow); }
.proj-body { display: flex; flex-direction: column; gap: 14px; flex: 1; padding: 28px 30px 30px; }
.proj-meta {
  display: flex; align-items: center; gap: 9px;
  margin: 0;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.proj-title { font: 700 clamp(30px, 2.7vw, 40px)/.94 var(--f-display); text-transform: uppercase; }
.proj-sum { margin: 0; font-size: 15.5px; color: var(--ink-2); }
.proj-open {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  margin-top: auto; padding-top: 12px;
  font: 500 12px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text);
}
.proj-open::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.proj-open .ico { width: 16px; height: 16px; transition: transform .4s var(--ease-out); }
.proj:hover .proj-open .ico { transform: translate(3px, -3px); }
.proj-open:focus-visible { outline: none; }
.proj:has(.proj-open:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
html:not(.js) .proj-detail[hidden] { display: block !important; padding: 0 30px 30px; color: var(--ink-2); }

.proj-links { display: flex; flex-wrap: wrap; gap: 10px; }
.proj-links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  font: 500 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
  transition: border-color .25s, color .25s;
}
.proj-links a .ico { width: 15px; height: 15px; }
.proj-links a:hover { border-color: var(--accent); color: var(--accent-text); }

/* ---------- demo stages: always a dark device screen, in both themes ---------- */
.stage {
  --ink: var(--paper);
  --ink-2: var(--mist-1);
  --ink-3: var(--mist-2);
  --line: var(--night-4);
  --line-strong: var(--night-5);
  --accent-text: var(--amber);
  --field-rgb: 244, 244, 242;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--night-0);
  border-bottom: 1px solid var(--night-4);
  color: var(--paper);
}
.stage::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(var(--field-rgb), .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--field-rgb), .05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.stage > canvas, .stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-hud {
  position: absolute; z-index: 2; top: 12px; left: 14px;
  display: flex; align-items: center; gap: 8px;
  font: 500 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  pointer-events: none;
}
.stage-hud-r { left: auto; right: 14px; }
.stage-ctl {
  position: absolute; z-index: 3; left: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--amber); color: var(--navy);
  font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
}
.stage-ctl .ico { width: 15px; height: 15px; }
.stage-ctl:hover { background: var(--amber-hi); }
.stage-tip {
  position: absolute; z-index: 2; right: 14px; bottom: 14px;
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
  pointer-events: none;
}

/* ---------- demo: live AQI bars ---------- */
.aqi { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 42px 18px 14px; }
.aqi-list { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); list-style: none; }
.aqi-row {
  position: relative;
  display: grid; grid-template-columns: 9.2em minmax(0, 1fr) 2.6em;
  align-items: center; gap: 12px;
  font: 500 11.5px/1 var(--f-mono);
  color: var(--mist-1);
}
.aqi-city { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.aqi-row.is-home .aqi-city { color: var(--paper); font-weight: 500; }
.aqi-here { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mist-2); }
.aqi-here i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.aqi-track { position: relative; align-self: stretch; display: flex; align-items: center; }
.aqi-track i {
  display: block; height: 10px; width: 0;
  border-radius: 0 4px 4px 0;
  background: #56627C;
  transition: width 1.1s var(--ease-out);
}
.aqi.is-on .aqi-track i { width: calc(var(--w) * 100%); }
.aqi-row.is-home .aqi-track i { background: var(--amber); }
.aqi-track::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: calc(var(--ref, .5) * 100%);
  border-left: 1px dashed rgba(244, 244, 242, .3);
}
.aqi-val { text-align: right; color: var(--paper); font-variant-numeric: tabular-nums; }
.aqi-foot { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font: 500 10px/1 var(--f-mono); letter-spacing: .05em; color: var(--mist-2); }
.aqi-ref-key { width: 0; height: 12px; border-left: 1px dashed rgba(244, 244, 242, .5); }
.aqi.is-interactive { padding: 48px 26px 20px; }
.aqi.is-interactive .aqi-list { grid-auto-rows: minmax(0, 60px); align-content: center; }
.aqi.is-interactive .aqi-row { font-size: 13px; }
.aqi.is-interactive .aqi-track i { height: 14px; }
.aqi-row:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.aqi-tip {
  position: absolute; left: 9.2em; bottom: calc(100% - 6px); z-index: 3;
  max-width: 300px;
  padding: 8px 10px;
  background: var(--paper); color: var(--navy);
  font: 500 11px/1.4 var(--f-mono);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(4px);
  pointer-events: none;
  transition: opacity .15s, transform .2s var(--ease-out);
}
.aqi-row:hover .aqi-tip, .aqi-row:focus-visible .aqi-tip { opacity: 1; transform: none; }
.aqi-row:first-child .aqi-tip { bottom: auto; top: calc(100% - 6px); }

/* ---------- demo: dog detector ---------- */
.dog-wrap { position: absolute; inset: 0; }
.dog-wrap > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dog-fov { fill: rgba(255, 196, 46, .05); stroke: rgba(255, 196, 46, .25); stroke-width: 1; stroke-dasharray: 4 5; }
.dog-ground { stroke: rgba(244, 244, 242, .18); stroke-width: 1; }
.dog-gate path { fill: none; stroke: rgba(244, 244, 242, .3); stroke-width: 3; stroke-linecap: round; }
.dog-pole { stroke: rgba(244, 244, 242, .35); stroke-width: 3; }
.dog-cam rect { fill: var(--night-3); stroke: rgba(244, 244, 242, .45); stroke-width: 1.5; }
.dog-lens { fill: var(--night-0); stroke: var(--amber); stroke-width: 2; }
.dog-led { fill: var(--amber); animation: blink 1.6s steps(2, jump-none) infinite; }
.dog-speaker path { fill: rgba(244, 244, 242, .55); }
.dog-waves path { fill: none; stroke: var(--amber); stroke-width: 2.5; stroke-linecap: round; opacity: 0; }
.dog.is-alert .dog-waves path { animation: wave .9s ease-out infinite; }
.dog.is-alert .dog-waves path:nth-child(2) { animation-delay: .15s; }
.dog.is-alert .dog-waves path:nth-child(3) { animation-delay: .3s; }
@keyframes wave { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
.dog-body { fill: rgba(244, 244, 242, .9); }
.dog-leg { stroke: rgba(244, 244, 242, .9); stroke-width: 6; stroke-linecap: round; }
.dog-tail { fill: none; stroke: rgba(244, 244, 242, .9); stroke-width: 5; stroke-linecap: round; }
.dog-eye { fill: var(--night-0); }
.dog-det { opacity: 0; }
.dog-box { fill: none; stroke: var(--amber); stroke-width: 2.5; }
.dog-tag-bg { fill: var(--amber); }
.dog-tag { fill: var(--navy); font: 500 11px var(--f-mono); }
.dog-alert { fill: var(--amber); font: 500 11px var(--f-mono); letter-spacing: .06em; opacity: 0; transition: opacity .2s; }
.dog.is-alert .dog-alert { opacity: 1; }

/* ---------- demo: ball tracker ---------- */
.ball-canvas { pointer-events: none; }
.ball-canvas.is-interactive { pointer-events: auto; cursor: grab; touch-action: none; }
.ball-canvas.is-dragging { cursor: grabbing; }

/* ---------- demo: ER schema ---------- */
.stage > svg.schema { top: 30px; left: 10px; width: calc(100% - 20px); height: calc(100% - 64px); }
.tbl-box { fill: var(--night-2); stroke: var(--night-5); stroke-width: 1; transition: stroke .3s; }
.tbl-head { fill: var(--night-3); transition: fill .3s; }
.tbl-name { fill: var(--mist-1); font: 500 10.5px var(--f-mono); letter-spacing: .1em; transition: fill .3s; }
.tbl-col { fill: var(--mist-1); font: 400 10.5px var(--f-mono); }
.tbl-key { fill: var(--mist-2); font: 500 9px var(--f-mono); letter-spacing: .06em; }
.tbl.is-on .tbl-head { fill: var(--amber); }
.tbl.is-on .tbl-name { fill: var(--navy); }
.tbl.is-on .tbl-box { stroke: var(--amber); }
.tbl.is-related .tbl-box { stroke: rgba(255, 196, 46, .55); }
.tbl.is-related .tbl-name { fill: var(--paper); }
.rel-line, .rel-end { fill: none; stroke: var(--night-5); stroke-width: 1.5; transition: stroke .3s; }
.rel.is-on .rel-line { stroke: var(--amber); stroke-dasharray: 5 4; animation: flow 1s linear infinite; }
.rel.is-on .rel-end { stroke: var(--amber); }
@keyframes flow { to { stroke-dashoffset: -18; } }
.schema.is-interactive .tbl { cursor: pointer; outline: none; }
.schema.is-interactive .tbl:focus-visible .tbl-box { stroke: var(--paper); stroke-width: 2; }
.schema-query {
  position: absolute; left: 14px; right: 14px; bottom: 11px;
  margin: 0;
  font: 500 10.5px/1.3 var(--f-mono);
  color: var(--mist-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.schema-query::before { content: "sql> "; color: var(--amber); }

/* ---------- project dialog ---------- */
html { scrollbar-gutter: stable; }
html.is-dialog-open { overflow: hidden; }
.pd-frame > * { transition: opacity .3s ease .1s; }
.pd-frame.is-morphing > * { opacity: 0; transition: opacity .12s ease; }
.pdialog {
  --pd-pad: clamp(0px, 3vw, 36px);
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  margin: 0; padding: var(--pd-pad);
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid; place-items: center;
  overflow: hidden;
}
.pdialog:not([open]) { display: none; }
.pdialog::backdrop { background: rgba(6, 11, 22, .78); opacity: 0; transition: opacity .35s; }
:root[data-theme="light"] .pdialog::backdrop { background: rgba(20, 33, 61, .45); }
.pdialog.is-open::backdrop { opacity: 1; }

.pd-frame {
  position: relative;
  width: min(1280px, calc(100vw - 2 * var(--pd-pad)));
  height: min(860px, calc(100vh - 2 * var(--pd-pad)));
  height: min(860px, calc(100dvh - 2 * var(--pd-pad)));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform-origin: 0 0;
}
.pd-bar { display: flex; align-items: center; gap: 16px; padding: 11px 12px 11px 22px; border-bottom: 1px solid var(--line); }
.pd-count { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.pd-count b { font-weight: 500; color: var(--ink); }
.pd-tag { margin: 0; padding: 5px 8px 4px; background: var(--amber); color: var(--navy); font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
.pd-nav { display: flex; gap: 8px; margin-left: auto; }

.pd-scroll { overflow-y: auto; overscroll-behavior: contain; perspective: 2000px; }
.pd-page {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  min-height: 100%;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}
.pd-stage { aspect-ratio: auto; min-height: 420px; border-bottom: 0; border-right: 1px solid var(--line); }
.pd-info { display: flex; flex-direction: column; gap: 18px; padding: clamp(24px, 3vw, 44px); }
.pd-info .proj-meta { font-size: 11.5px; }
.pd-title { font: 700 clamp(42px, 4.6vw, 72px)/.88 var(--f-display); text-transform: uppercase; text-wrap: balance; }
.pd-desc p { margin-bottom: 1em; font-size: 16px; color: var(--ink-2); }
.pd-desc .proj-links { margin: 6px 0 0; }
.pd-hint { margin: 0; padding: 10px 22px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: .08em; color: var(--ink-3); }
.pd-hint kbd { font-size: 10px; }

.pd-page.is-out-next { animation: pdOutNext .24s var(--ease-in-out) forwards; }
.pd-page.is-in-next { animation: pdInNext .42s var(--ease-out) both; }
.pd-page.is-out-prev { animation: pdOutPrev .24s var(--ease-in-out) forwards; }
.pd-page.is-in-prev { animation: pdInPrev .42s var(--ease-out) both; }
@keyframes pdOutNext { to { transform: rotateY(-72deg) translateX(-6%); opacity: 0; } }
@keyframes pdInNext { from { transform: rotateY(72deg) translateX(6%); opacity: 0; } }
@keyframes pdOutPrev { to { transform: rotateY(72deg) translateX(6%); opacity: 0; } }
@keyframes pdInPrev { from { transform: rotateY(-72deg) translateX(-6%); opacity: 0; } }

/* ---------- skills threshold ---------- */
.threshold { margin-top: 40px; padding: 22px 22px 18px; background: var(--surface); border: 1px solid var(--line); }
.threshold-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.threshold-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.threshold-out { font: 700 36px/1 var(--f-display); color: var(--accent-text); font-variant-numeric: tabular-nums; }
.threshold-range {
  --fill: 0%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 32px; margin: 0;
  background: transparent; cursor: pointer;
}
.threshold-range::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(to right, var(--amber) var(--fill), var(--line-strong) var(--fill));
}
.threshold-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; margin-top: -9.5px;
  border-radius: 50%;
  background: var(--amber);
  border: 5px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--amber);
  transition: transform .2s var(--ease-out);
}
.threshold-range:active::-webkit-slider-thumb { transform: scale(1.18); }
.threshold-range::-moz-range-track { height: 3px; background: var(--line-strong); }
.threshold-range::-moz-range-progress { height: 3px; background: var(--amber); }
.threshold-range::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--amber);
  border: 5px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--amber);
}
.threshold-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.threshold-read { margin: 12px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-2); }
.threshold-read code { color: var(--ink); }
.threshold-read b { font-weight: 500; color: var(--accent-text); }

/* ---------- contact form ---------- */
.form { position: relative; display: grid; gap: 18px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label {
  display: block; margin-bottom: 8px;
  font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--mist-1);
}
.field input, .field textarea {
  display: block; width: 100%;
  padding: 14px 16px;
  background: var(--night-1);
  border: 1px solid var(--night-4); border-radius: 0;
  color: var(--paper); font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 196, 46, .2); }
.field input::placeholder, .field textarea::placeholder { color: var(--mist-2); opacity: 1; }
.field input:user-invalid, .field textarea:user-invalid { border-color: #FF7A7F; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-foot { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.submit[disabled] { opacity: .65; cursor: progress; }
.formnote { margin: 0; font-size: 12px; letter-spacing: .03em; color: var(--mist-1); }
.formnote.is-ok { color: var(--amber); }
.formnote.is-err { color: #FF7A7F; }
.formnote a { color: var(--amber); overflow-wrap: anywhere; }
.rings { position: absolute; left: 96px; bottom: 25px; width: 0; height: 0; pointer-events: none; }
.rings i {
  position: absolute; left: -20px; top: -20px;
  width: 40px; height: 40px;
  border: 2px solid var(--amber); border-radius: 50%;
  opacity: 0;
}
.form.is-sent .rings i { animation: ring 1.8s var(--ease-out) forwards; }
.form.is-sent .rings i:nth-child(2) { animation-delay: .22s; }
.form.is-sent .rings i:nth-child(3) { animation-delay: .44s; }
@keyframes ring {
  0% { transform: scale(.5); opacity: .95; }
  100% { transform: scale(9); opacity: 0; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--hudbar-h) + 22px);
  z-index: var(--z-toast);
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  background: var(--navy); color: var(--paper);
  border: 1px solid var(--amber);
  font-size: 12px; letter-spacing: .05em;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .55);
  transform: translate(-50%, 18px); opacity: 0;
  transition: opacity .3s, transform .45s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast button { font: inherit; letter-spacing: inherit; text-decoration: underline; text-underline-offset: 3px; color: var(--amber); }

/* ---------- YOLO mode ---------- */
.yolo { position: fixed; inset: 0; z-index: var(--z-yolo); pointer-events: none; overflow: hidden; }
.ybox {
  position: absolute; left: 0; top: 0;
  border: 1.5px solid var(--amber);
  box-shadow: 0 0 0 1px rgba(6, 11, 22, .25);
  opacity: 0;
  transition: opacity .18s;
  will-change: transform;
}
.ybox.is-on { opacity: 1; }
.ybox b {
  position: absolute; left: -1.5px; bottom: 100%;
  padding: 2px 5px 1px;
  background: var(--amber); color: var(--navy);
  font: 500 10px/1.25 var(--f-mono); letter-spacing: .02em; white-space: nowrap;
}
.ybox.is-top b { bottom: auto; top: 0; }
.ybox.on-amber { border-color: var(--navy); }
.ybox.on-amber b { background: var(--navy); color: var(--amber); }

/* ---------- boot: power on the edge device ---------- */
html.boot-pending { overflow: hidden; }
html.boot-pending #boot[hidden] { display: grid !important; }
.boot {
  --ink: var(--paper);
  --ink-2: var(--mist-1);
  --ink-3: var(--mist-2);
  --line: var(--night-4);
  --line-strong: var(--night-5);
  --accent: var(--amber);
  --accent-text: var(--amber);
  position: fixed; inset: 0;
  z-index: var(--z-boot);
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(ellipse 60% 55% at 64% 56%, rgba(20, 33, 61, .6), transparent 72%),
    linear-gradient(rgba(244, 244, 242, .025) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(244, 244, 242, .025) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--night-0);
  color: var(--paper);
  overflow: hidden;
}
.boot ::selection { background: var(--amber); color: var(--navy); }
.boot-top { display: flex; align-items: center; gap: 18px; padding: 22px var(--gutter); }
.boot-mark { width: 42px; height: 34px; color: var(--paper); }
.boot-id { margin: 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--mist-2); }
.boot-skip {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: auto; padding: 11px 15px;
  border: 1px solid var(--night-5);
  font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--mist-1);
  transition: border-color .2s, color .2s;
}
.boot-skip .ico { width: 15px; height: 15px; }
.boot-skip:hover { border-color: var(--amber); color: var(--amber); }

.boot-stage {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center; gap: clamp(28px, 5vw, 84px);
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: 0 var(--gutter) 40px;
  overflow-y: auto;
  transition: opacity .4s ease, transform .6s var(--ease-out);
}
.boot.is-assembling .boot-stage { opacity: 0; transform: scale(.97); pointer-events: none; }
.boot-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--mist-2); }
.boot-led-mini { width: 8px; height: 8px; border-radius: 50%; background: var(--night-5); transition: background-color .2s, box-shadow .2s; }
.boot.is-on .boot-led-mini { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.boot-title { margin: 0 0 18px; font: 700 clamp(46px, 5.8vw, 92px)/.86 var(--f-display); text-transform: uppercase; }
.boot-text { max-width: 36ch; margin: 0 0 26px; font-size: 18px; color: var(--mist-1); }
.term {
  min-height: 196px;
  padding: 16px 18px;
  background: rgba(10, 17, 32, .85);
  border: 1px solid var(--night-4);
  font: 400 12.5px/1.8 var(--f-mono);
  color: var(--mist-1);
}
.term-line { display: flex; justify-content: space-between; gap: 14px; margin: 0; white-space: pre-wrap; }
.term-line .st { flex: none; }
.term-line .st-ok { color: var(--amber); }
.term-line .st-warn { color: #FF7A7F; }
.term-line.is-prompt { color: var(--paper); justify-content: flex-start; gap: 0; }
.term-caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 3px; vertical-align: -2px; background: var(--amber); animation: blink 1s steps(2, jump-none) infinite; }

.board-wrap { position: relative; }
.board { display: block; width: 100%; height: auto; max-height: 66vh; overflow: visible; touch-action: none; -webkit-user-select: none; user-select: none; }
.boot-hint { margin: 12px 0 0; text-align: center; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--mist-2); transition: color .3s, opacity .3s; }
.boot-hint kbd { color: var(--paper); border-color: var(--night-5); }
.boot.is-hinting .boot-hint { color: var(--amber); }

.b-pcb { fill: var(--night-2); stroke: rgba(244, 244, 242, .3); stroke-width: 1.5; }
.b-pcb-dots { pointer-events: none; color: var(--paper); }
.b-hole { fill: var(--night-0); stroke: rgba(244, 244, 242, .25); }
.b-pin { fill: var(--night-4); stroke: rgba(244, 244, 242, .22); }
.b-chip { fill: var(--night-3); stroke: rgba(244, 244, 242, .3); stroke-width: 1.2; }
.b-chip-mark { color: rgba(244, 244, 242, .7); --mark-dot: rgba(255, 196, 46, .45); }
.boot.is-on .b-chip-mark { --mark-dot: #FFC42E; }
.b-port { fill: var(--night-1); stroke: rgba(244, 244, 242, .38); stroke-width: 1.2; }
.b-port-slot { fill: var(--night-0); stroke: rgba(244, 244, 242, .3); }
.b-csi { fill: var(--night-3); stroke: rgba(244, 244, 242, .35); }
.b-ribbon { fill: none; stroke: rgba(244, 244, 242, .18); stroke-width: 12; }
.b-cam rect { fill: var(--night-3); stroke: rgba(244, 244, 242, .38); stroke-width: 1.2; }
.b-lens-ring { fill: var(--night-1); stroke: rgba(244, 244, 242, .42); stroke-width: 2; }
.b-lens { fill: var(--night-0); stroke: rgba(244, 244, 242, .25); stroke-width: 2; transition: stroke .4s; }
.boot.is-on .b-lens { stroke: var(--amber); }
.b-lens-glint { fill: rgba(244, 244, 242, .55); }
.b-silk { fill: rgba(244, 244, 242, .38); font: 500 10px var(--f-mono); letter-spacing: .12em; }
.b-led { fill: var(--night-4); stroke: rgba(244, 244, 242, .22); }
.boot.is-on .b-led-pwr { fill: var(--amber); filter: drop-shadow(0 0 5px rgba(255, 196, 46, .9)); }
.boot.is-on .b-led-act { animation: act .24s steps(2, jump-none) infinite; }
@keyframes act { 50% { fill: #FFC42E; } }
.b-port-ring { fill: none; stroke: var(--amber); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: portPulse 1.8s var(--ease-out) infinite; }
@keyframes portPulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.boot.is-on .b-port-ring { display: none; }
.b-guide { fill: none; stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 5 6; opacity: 0; transition: opacity .4s; }
.boot.is-hinting .b-guide { opacity: .75; animation: flow 1s linear infinite; }
.boot.is-on .b-guide { opacity: 0; animation: none; }
.b-cable { fill: none; stroke: #D8DDE6; stroke-width: 9; stroke-linecap: round; }
.b-plug { cursor: grab; outline: none; }
.b-plug.is-dragging { cursor: grabbing; }
.b-plug-hit { fill: transparent; }
.b-plug-body { fill: var(--paper); }
.b-plug-tip { fill: var(--mist-1); }
.b-plug-grip { fill: none; stroke: var(--night-5); stroke-width: 2; stroke-linecap: round; }
.b-plug:focus-visible .b-plug-body { stroke: var(--amber); stroke-width: 3; }

.boot-mark-big {
  position: absolute; left: 50%; top: 50%;
  width: clamp(150px, 20vw, 260px); aspect-ratio: 256 / 208;
  transform: translate(-50%, -50%) scale(.9);
  opacity: 0; pointer-events: none;
  transition: opacity .45s var(--ease-out), transform .7s var(--ease-out);
}
.boot.is-assembling .boot-mark-big { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.boot.is-opening .boot-mark-big { opacity: 0; transition: opacity .5s ease .1s; }
.bmb-glyph { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--paper); }
.bmb-dot { position: absolute; left: 83.8%; top: 49.5%; width: 16.2%; aspect-ratio: 1; border-radius: 50%; background: var(--amber); opacity: 0; }
.boot.is-dot-landed .bmb-dot { opacity: 1; }
.boot-flydot { position: fixed; left: 0; top: 0; border-radius: 50%; background: var(--amber); box-shadow: 0 0 18px rgba(255, 196, 46, .85); pointer-events: none; will-change: transform; }
.boot-ring { position: fixed; left: 0; top: 0; z-index: calc(var(--z-boot) + 1); border: 2px solid var(--amber); border-radius: 50%; pointer-events: none; }

@media (max-width: 960px) {
  .boot-top { padding-block: 16px; }
  .boot-id { display: none; }
  .boot-stage { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; padding-bottom: 24px; }
  .board-wrap { order: -1; }
  .board { max-height: 36vh; }
  .boot-title { font-size: clamp(40px, 11vw, 64px); margin-bottom: 12px; }
  .boot-text { font-size: 16px; margin-bottom: 14px; }
  .term { min-height: 158px; padding: 12px 14px; font-size: 11.5px; }
}
@media (max-height: 760px) and (min-width: 961px) {
  .boot-text { display: none; }
  .term { min-height: 170px; }
}

/* ---------- responsive ---------- */
@media (min-width: 961px) {
  .pd-scroll { overflow: hidden; }
  .pd-page { height: 100%; }
  .pd-info { overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 960px) {
  .proj-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .pdialog { --pd-pad: 0px; }
  .pd-frame { border: 0; }
  .pd-page { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pd-stage { min-height: 0; aspect-ratio: 4 / 3; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .proj-body { padding: 24px 22px 26px; }
  .frow { grid-template-columns: minmax(0, 1fr); }
  .pd-bar { padding-left: 16px; gap: 10px; }
  .pd-tag { display: none; }
  .pd-hint { display: none; }
}
