/* Isaac's Print. Same HUD look as the rest of shayanisaac.cc: cyan on black, blueprint
   grid, Orbitron headings, Rajdhani text. Tokens copied from the Gym page's style.css. */

:root {
  --bg: #05080b;
  --surface: #071219;
  --panel-2: #040b10;
  --line: rgba(63, 216, 255, 0.28);
  --line-strong: rgba(63, 216, 255, 0.55);
  --ink: #d6f3ff;
  --muted: #6f97ab;
  --cyan: #3fd8ff;
  --cyan-glow: rgba(63, 216, 255, 0.45);
  --cyan-faint: rgba(63, 216, 255, 0.06);
  --red: #ff3b5c;
  --amber: #ffc53d;
  --green: #4ade80;
  --display: "Orbitron", system-ui, sans-serif;
  --body: "Rajdhani", system-ui, sans-serif;
  --glow: 0 0 28px rgba(63, 216, 255, 0.22), inset 0 0 28px rgba(63, 216, 255, 0.08);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 500 17px/1.4 var(--body);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(63, 216, 255, 0.10), transparent 60%),
    linear-gradient(var(--cyan-faint) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--cyan-faint) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
}
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

/* ---------- Header ---------- */

header { display: grid; justify-items: center; gap: 6px; text-align: center; }
.kicker {
  font: 600 11px var(--display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.kicker:hover { color: var(--cyan); }
h1 {
  margin: 0;
  font: 900 clamp(34px, 9vw, 64px)/1.05 var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(63, 216, 255, 0.35);
}
h1 span { color: var(--cyan); }
@media (max-width: 420px) { h1 { letter-spacing: 0.06em; } .sub { letter-spacing: 0.14em; } }
.sub {
  margin: 0;
  font: 500 11px var(--display);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.stripe {
  width: min(520px, 100%);
  height: 2px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), #9eeaff, var(--cyan), transparent);
  background-size: 200% 100%;
  box-shadow: 0 0 12px var(--cyan-glow);
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Shared bits ---------- */

.label, .group-label, .field-label {
  font: 600 11px var(--display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-label i { font-style: normal; letter-spacing: 0.08em; opacity: 0.7; }
.value {
  margin: 4px 0 2px;
  font: 700 clamp(24px, 6vw, 36px)/1.15 var(--display);
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(63, 216, 255, 0.4);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.small { font-size: 15px; color: var(--muted); }
.hint { margin: 6px 0 0; font-size: 15px; color: var(--muted); }

/* ---------- The printer, live ---------- */

.printer {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.printer[data-state="printing"] { border-color: rgba(74, 222, 128, 0.6); box-shadow: 0 0 28px rgba(74, 222, 128, 0.14); }
.printer-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
}
.printer-title { min-width: 0; }
.printer-state { margin: 2px 0 0; font-size: clamp(20px, 5vw, 28px); text-transform: capitalize; }
.printer-meta {
  grid-column: 1 / -1;
  font: 600 11px var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (min-width: 640px) {
  .printer-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .printer-meta { grid-column: auto; text-align: right; }
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.printer[data-state="connecting"] .dot { animation: pulse 1.4s ease-in-out infinite; }
.printer[data-state="printing"] .dot { background: var(--green); box-shadow: 0 0 14px rgba(74, 222, 128, 0.8); animation: pulse 1.6s ease-in-out infinite; }
.printer[data-state="printing"] .printer-state { color: var(--green); text-shadow: 0 0 18px rgba(74, 222, 128, 0.45); }
.printer[data-state="idle"] .dot, .printer[data-state="done"] .dot { background: var(--cyan); box-shadow: 0 0 12px var(--cyan-glow); }
.printer[data-state="paused"] .dot, .printer[data-state="starting"] .dot, .printer[data-state="stale"] .dot { background: var(--amber); box-shadow: 0 0 12px rgba(255, 197, 61, 0.6); }
.printer[data-state="paused"] .printer-state, .printer[data-state="stale"] .printer-state, .printer[data-state="starting"] .printer-state { color: var(--amber); text-shadow: 0 0 18px rgba(255, 197, 61, 0.4); }
.printer[data-state="failed"] .dot, .printer[data-state="offline"] .dot { background: var(--red); box-shadow: 0 0 12px rgba(255, 59, 92, 0.6); }
.printer[data-state="failed"] .printer-state, .printer[data-state="offline"] .printer-state { color: var(--red); text-shadow: 0 0 18px rgba(255, 59, 92, 0.4); }
@keyframes pulse { 50% { opacity: 0.45; } }

.printer-body { display: grid; gap: 12px; }
.printer-body[hidden] { display: none; }
.printer-main { display: grid; gap: 12px; min-width: 0; }
/* Wide screens: camera on the left, the numbers on the right. */
@media (min-width: 900px) {
  .printer-body { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .printer-body .printer-grid, .printer-body .ams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The camera. The picture is a <video-stream> element (go2rtc's player, web/video-rtc.js)
   that app.js puts into .cam-frame while the printer is online and its camera is on. */
.printer-cam {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cam-frame, .cam-frame video-stream, .cam-frame video { position: absolute; inset: 0; width: 100%; height: 100%; }
.cam-frame video { display: block; object-fit: contain; background: #000; }
.cam-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
  background: var(--panel-2);
}
.printer-cam[data-cam="live"] .cam-overlay { display: none; }
.cam-title { font: 700 12px var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); }
.cam-text { max-width: 38ch; font-size: 15px; color: var(--muted); }
.printer-cam[data-cam="connecting"] .cam-title { animation: pulse 1.4s ease-in-out infinite; }
.printer-cam[data-cam="error"] .cam-title { color: var(--amber); }
.cam-live, .cam-note {
  position: absolute;
  left: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
}
.cam-live {
  top: 10px;
  display: none;
  align-items: center;
  gap: 6px;
  font: 700 11px var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}
.cam-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse 1.6s ease-in-out infinite; }
.printer-cam[data-cam="live"] .cam-live { display: inline-flex; }
.cam-note { bottom: 10px; font-size: 13px; font-weight: 700; color: var(--amber); }
.cam-note[hidden] { display: none; }
.cam-full {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  cursor: pointer;
}
.cam-full[hidden] { display: none; }
.cam-full svg { width: 18px; height: 18px; }
.cam-full:hover { border-color: var(--cyan); box-shadow: 0 0 14px var(--cyan-glow); }
.printer-cam:fullscreen { border: 0; border-radius: 0; }
.printer-job { padding: 12px 14px; background: var(--panel-2); border: 1px dashed var(--line); border-radius: 10px; }
.job-name { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.job-none { color: var(--muted); }
.bar { height: 8px; margin: 8px 0 6px; background: rgba(63, 216, 255, 0.08); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), #9eeaff); box-shadow: 0 0 12px var(--cyan-glow); transition: width 0.6s; }
.job-meta { font-size: 15px; color: var(--muted); }
.job-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.job-err { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255, 197, 61, 0.5); font-weight: 700; color: var(--amber); overflow-wrap: anywhere; }
.printer[data-state="paused"], .printer[data-state="failed"] { border-color: rgba(255, 197, 61, 0.6); }

.printer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .printer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.temp { display: grid; gap: 2px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.temp b { font: 700 18px var(--display); color: var(--cyan); font-variant-numeric: tabular-nums; white-space: nowrap; }
.temp b small { font-size: 12px; font-weight: 600; color: var(--muted); }
.temp.hot b { color: var(--amber); }

.ams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .ams { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.slot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: default;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.slot.pick { cursor: pointer; }
.slot.pick:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.slot.loaded { border-color: var(--cyan); background: rgba(63, 216, 255, 0.06); }
.slot.empty { opacity: 0.55; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.18); box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.45); }
.swatch.none { background: transparent; border-style: dashed; }
.slot-text { display: grid; min-width: 0; }
.slot-text b { font: 700 11px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.slot.loaded .slot-text b { color: var(--cyan); }
.slot-text span { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Summary ---------- */

.hud { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stat {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.stat.status { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat.status { grid-column: auto; }
}
.status.ready { border-color: var(--green); box-shadow: 0 0 28px rgba(74, 222, 128, 0.18); }
.status.ready .value { color: var(--green); text-shadow: 0 0 18px rgba(74, 222, 128, 0.45); }

/* ---------- Panels ---------- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.side { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (min-width: 960px) { .layout { grid-template-columns: 400px minmax(0, 1fr); } }
.panel {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.panel h2 {
  margin: 0;
  font: 700 14px var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Drop a sliced file ---------- */

.drop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.drop:hover, .drop:focus-visible, body.dragging .drop { border-color: var(--cyan); box-shadow: var(--glow); background: rgba(63, 216, 255, 0.06); }
.drop-icon { width: 28px; height: 28px; color: var(--cyan); }
.drop-text { font-size: 15px; line-height: 1.35; }
.drop-text b { font-size: 16px; }
.drop-text small { font-size: 14px; color: var(--muted); }
body.dragging::after {
  content: "Drop it";
  position: fixed;
  inset: 12px;
  z-index: 30;
  display: grid;
  place-items: center;
  font: 900 clamp(28px, 8vw, 64px) var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 24px var(--cyan-glow);
  background: rgba(5, 8, 11, 0.78);
  border: 3px dashed var(--cyan);
  border-radius: 18px;
  pointer-events: none;
}
.from-file {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  font-size: 15px;
  background: rgba(63, 216, 255, 0.06);
  border: 1px solid var(--cyan);
  border-radius: 10px;
}
.from-file[hidden] { display: none; }
.from-file.bad { color: var(--amber); background: rgba(255, 197, 61, 0.06); border-color: var(--amber); }
.from-file .btn { justify-self: start; }
.from-file .warn { color: var(--amber); }
.from-file-text { overflow-wrap: anywhere; }

/* ---------- Inputs ---------- */

.fields { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.pair, .stepper { display: flex; align-items: center; gap: 8px; }
.pair input, .stepper input {
  width: 0;
  flex: 1 1 0;
  min-width: 64px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pair input[type="text"] { font-weight: 600; }
.stepper input { text-align: center; }
.pair input:focus, .stepper input:focus { border-color: var(--cyan); box-shadow: var(--glow); outline: none; }
.pair input::-webkit-outer-spin-button, .pair input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pair input[type="number"], .stepper input { -moz-appearance: textfield; appearance: textfield; }
.pair i { font-style: normal; font-size: 15px; color: var(--muted); white-space: nowrap; }
.step {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font: 700 20px var(--display);
  color: var(--cyan);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.step:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.step:active { transform: scale(0.95); }

.group { display: grid; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chip:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.chip.on { color: var(--cyan); border-color: var(--cyan); background: rgba(63, 216, 255, 0.08); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font: 700 12px var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  color: var(--bg);
  background: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.btn:hover { box-shadow: 0 0 18px var(--cyan-glow); }
.btn:active { transform: translateY(1px); }
.btn.ghost { color: var(--cyan); background: transparent; }
.btn.small { padding: 7px 10px; font-size: 11px; }
/* Fingers, not mouse pointers: Apple asks for 44px tap targets, so the small things grow. */
@media (pointer: coarse) {
  .btn.small, .chip { min-height: 44px; }
}

/* ---------- The price ---------- */

.markup {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.markup-head { display: flex; justify-content: space-between; align-items: baseline; }
.markup-head b { font: 700 22px var(--display); color: var(--cyan); font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  margin: 10px 0;
  background: linear-gradient(90deg, var(--cyan) var(--fill, 37%), rgba(63, 216, 255, 0.18) var(--fill, 37%));
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cyan);
  border: 3px solid var(--bg);
  box-shadow: 0 0 14px var(--cyan-glow);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan);
  border: 3px solid var(--bg);
  box-shadow: 0 0 14px var(--cyan-glow);
  cursor: pointer;
}
.markup-scale { display: flex; justify-content: space-between; font: 600 11px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.breakdown { width: 100%; margin-top: 16px; border-collapse: collapse; }
.breakdown td { padding: 10px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.breakdown td:last-child { padding-left: 12px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.breakdown .what { font-weight: 700; }
.breakdown .how { display: block; font-size: 15px; color: var(--muted); }
.breakdown tr.sum td { border-bottom: 1px solid var(--line-strong); }
.breakdown tr.sum td:last-child { font: 700 20px var(--display); color: var(--cyan); }
.breakdown tr.total td { border-bottom: 1px solid var(--line-strong); }
.breakdown tr.total td:last-child { font: 700 clamp(22px, 5vw, 28px) var(--display); color: var(--cyan); text-shadow: 0 0 18px rgba(63, 216, 255, 0.4); }
.breakdown tr.profit td:last-child { color: var(--green); }
.breakdown tr:last-child td { border-bottom: 0; }

.quote-box { margin-top: 16px; padding: 16px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; }
.quote-box pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 600 16px/1.5 var(--body); color: var(--ink); }

.coach { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.coach h3 { margin: 0 0 8px; font: 700 12px var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); }
.coach ul { margin: 0; padding-left: 20px; }
.coach li { margin: 4px 0; }

/* ---------- Toast, footer ---------- */

.toast {
  position: fixed;
  left: 50%;
  top: 16px;
  z-index: 20;
  transform: translate(-50%, -40px);
  padding: 9px 16px;
  font: 700 12px var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--cyan);
  border-radius: 8px;
  box-shadow: 0 0 18px var(--cyan-glow);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

footer {
  padding-top: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
footer a { color: var(--cyan); text-decoration: none; }
footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .stripe, .dot, .cam-title, .cam-live::before { animation: none; }
  * { transition: none !important; }
}
