:root {
  --bg: #08070a;
  --panel: #111014;
  --line: rgba(255, 255, 255, .11);
  --text: #f6f3ea;
  --muted: #918d84;
  --paper: #f4f0e4;
  --accent: #ff5a4f;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(55% 45% at 75% 10%, rgba(255, 90, 79, .13), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 30px);
}
.cursor-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), rgba(255, 240, 210, .07), transparent 70%);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: Consolas, "Courier New", monospace; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }

.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 20px;
  background: rgba(8, 7, 10, .75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.nav-links { display: flex; gap: 22px; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 19px;
  border: 1px solid transparent; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 650; line-height: 1.2; white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-paper { background: var(--paper); color: #14110c; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .34); }
.btn-block { width: 100%; }
.is-connected { background: transparent; color: var(--paper); border-color: rgba(244, 240, 228, .4); }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; padding: 56px 0 40px; }
.hero > * { min-width: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
h1 { margin: 18px 0; font-size: clamp(44px, 6vw, 74px); line-height: 1.02; font-weight: 750; letter-spacing: -.035em; }
.accent { color: var(--accent); }
.lead { max-width: 500px; color: var(--muted); font-size: 18px; }
.word, .rise {
  display: inline-block;
  opacity: 0; transform: translateY(.45em); filter: blur(6px);
  animation: rise .7s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc(var(--d) * 70ms + 100ms);
}
.rise { display: block; }
.pill.rise { display: inline-flex; }

.form { display: grid; gap: 12px; max-width: 520px; margin-top: 26px; }
.form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.form input, .field input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text);
  font: 14px Consolas, "Courier New", monospace;
}
.form input:focus { outline: 0; border-color: var(--paper); }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.status { min-height: 22px; color: var(--muted); font-size: 14px; }
.status.is-error { color: var(--accent); }

/* Printer */
.machine { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.printer {
  position: relative; z-index: 3;
  width: min(100%, 430px); height: 86px;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, #2a282e, #151418);
  box-shadow: 0 18px 30px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.printer.is-busy { animation: buzz .09s linear infinite; }
.printer.is-hit { animation: hit .26s ease; }
.printer-name { position: absolute; top: 16px; left: 20px; color: var(--muted); font: 12px Consolas, monospace; letter-spacing: .12em; }
.led { position: absolute; top: 20px; right: 20px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.is-busy .led { animation: pulse .3s infinite; }
.slot { position: absolute; left: 22px; right: 22px; bottom: 13px; height: 9px; border-radius: 5px; background: #000; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .9); }
.paper-window { position: relative; z-index: 2; width: 380px; max-width: 100%; margin-top: -19px; overflow: hidden; min-height: 40px; }
.paper {
  transform: translateY(-101%) rotate(var(--sway, 0deg));
  transform-origin: top center;
  transition: rotate .3s ease;
}
.paper.is-out { animation: feed 1.9s steps(34) forwards; }
.paper canvas { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .55)); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; animation: fade .4s ease; }

section { padding: 72px 0; }
h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; font-weight: 720; letter-spacing: -.03em; }
.section-lead { max-width: 580px; margin-top: 12px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.card {
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px) rotate(-.3deg); border-color: rgba(255, 255, 255, .24); }
.card span { color: var(--accent); font: 13px Consolas, monospace; }
.card h3 { margin: 8px 0 6px; font-size: 18px; font-weight: 650; }
.card p { color: var(--muted); font-size: 14px; }

.panel { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-scroll + .table-scroll { border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 11px 16px; color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
td { padding: 10px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
td b { font-weight: 650; }
td a:hover { color: var(--accent); }
.tone-green { color: #4fd39a; }
.tone-blue { color: #8fb0ff; }
.tone-amber { color: #ffb454; }
.tone-red { color: var(--accent); }
.remove { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.remove:hover { color: var(--accent); }
.empty { padding: 30px 16px; color: var(--muted); text-align: center; }
.note { margin-top: 10px; color: var(--muted); font-size: 12px; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer nav { display: flex; gap: 18px; }
footer a:hover { color: var(--text); }

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

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); animation: fade .2s ease; }
.modal-card { position: relative; width: min(400px, 100%); padding: 26px; display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 16px; background: #151418; }
.modal-card h3 { padding-right: 24px; font-size: 20px; font-weight: 650; }
.modal-x { position: absolute; top: 14px; right: 14px; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
@keyframes feed {
  from { transform: translateY(-101%) rotate(var(--sway, 0deg)); }
  to { transform: translateY(0) rotate(var(--sway, 0deg)); }
}
@keyframes buzz { 50% { transform: translateX(1px); } }
@keyframes hit { 30% { transform: translateY(4px) scale(.995); } }

@media (max-width: 860px) {
  .hero, .cards { grid-template-columns: 1fr; }
  .hero { padding-top: 34px; }
  .nav-links { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .word, .rise { animation: none; opacity: 1; transform: none; filter: none; }
  .pill i, .printer.is-busy, .printer.is-hit, .is-busy .led { animation: none; }
  .paper.is-out { animation: none; transform: none; }
  .card:hover { transform: none; }
}
