@font-face {
  font-family: "CozetteVector";
  src: url("fonts/Cozette.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/PixelifySans.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0c0d10;
  --panel: #14161c;
  --card: #14161c;
  --text: #e8eae6;
  --muted: #6b7068;
  --border: #3a3e46;
  --accent: #5b8cff;
  --accent-fill: #1e2c4a;
  --hover: #1c1f26;
  --danger: #e05a4a;
  --ok: #5fd06a;
  --brand: #f4f6f0;
  --title: #8a8f86;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "CozetteVector", "Consolas", "Segoe UI", monospace;
  font-size: 14px;
  line-height: 1.45;
  image-rendering: pixelated;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 16px 16px;
  animation: grid-drift 18s steps(18) infinite;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 2px,
    rgba(0, 0, 0, 0.07) 2px 4px
  );
  animation: scan 7s linear infinite;
  z-index: 8;
  mix-blend-mode: multiply;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #8eb4ff; }
code {
  font-family: inherit;
  color: var(--brand);
  background: #0c0d10;
  border: 1px solid var(--border);
  padding: 0 4px;
}

.desk {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 18px 96px;
}

.win {
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: 6px 6px 0 #050608;
  transition: border-color 0s, box-shadow 0s;
}
.win:hover {
  border-color: #4a5160;
  box-shadow: 6px 6px 0 #050608, 0 0 0 1px #5b8cff22;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 12px;
  height: 36px;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  user-select: none;
}
.titlebar .caption {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  flex: 1;
}
.winbtns { display: flex; }
.winbtns span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  margin-left: -2px;
  display: grid;
  place-items: center;
  color: var(--title);
  font-size: 11px;
}
.winbtns span {
  cursor: default;
  pointer-events: auto;
}
.winbtns span:hover {
  background: var(--hover);
  color: var(--brand);
  transform: translate(1px, 1px);
}
.winbtns span.close:hover {
  background: #c42b2b;
  border-color: #e04a4a;
  color: #fff;
}

.hero {
  padding: 28px 28px 22px;
}
h1, .logo {
  font-family: "Pixelify Sans", "CozetteVector", sans-serif;
  font-size: 42px;
  letter-spacing: 8px;
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 700;
}
.logo span {
  display: inline-block;
  animation: glyph 0.45s steps(4) calc(var(--i) * 70ms) both;
}
.lead { color: var(--muted); max-width: 720px; margin: 0; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 32px; letter-spacing: 4px; }
}

.card { display: flex; flex-direction: column; min-height: 100%; }
.card .body { padding: 18px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.product {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.product img {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  background: #0c0d10;
  object-fit: cover;
  image-rendering: pixelated;
}
.product h2 {
  font-family: "Pixelify Sans", sans-serif;
  letter-spacing: 3px;
  font-size: 22px;
  margin: 0;
  color: var(--brand);
}
.chip {
  display: inline-block;
  border: 2px solid var(--accent);
  background: var(--accent-fill);
  color: #d4e4ff;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 2px 8px;
  margin-top: 4px;
}
.blurb { color: var(--text); margin: 8px 0 14px; min-height: 3.2em; }

.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.btn {
  display: inline-block;
  border: 2px solid var(--accent);
  background: var(--accent-fill);
  color: #e8f0ff;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  box-shadow: 4px 4px 0 #050608;
}
.btn:hover { background: #2a3d66; color: #fff; transform: translate(2px, 2px); box-shadow: 2px 2px 0 #050608; }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 #050608; }
.btn.ghost {
  border-color: var(--border);
  background: #14161c;
  color: var(--text);
  box-shadow: 4px 4px 0 #050608;
}
.btn.ghost:hover { background: var(--hover); color: var(--brand); }
button.btn {
  cursor: pointer;
}
.meta { color: var(--muted); font-size: 12px; margin: 4px 0 12px; }

.sileo-block { margin-top: 4px; }
.sileo-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
}
.sileo-tag {
  border: 2px solid var(--accent);
  background: var(--accent-fill);
  color: #d4e4ff;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 2px 8px;
  flex: 0 0 auto;
}
.sileo-line .path {
  flex: 1 1 180px;
  margin: 0;
}

.section {
  border-top: 2px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}
.section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 700;
}
.section p, .section li { color: var(--text); }
.section ul { margin: 0 0 10px; padding-left: 18px; }
.section li { margin: 4px 0; }

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 8, 0.78);
}
.modal-win {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(86vh, 640px);
  overflow: auto;
  box-shadow: 8px 8px 0 #050608;
}
.modal-body { padding: 18px; }
.winbtns .close-btn {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--title);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.winbtns .close-btn:hover {
  background: #c42b2b;
  border-color: #e04a4a;
  color: #fff;
}
body.modal-open { overflow: hidden; }

.path {
  display: block;
  margin: 4px 0 8px;
  padding: 6px 8px;
  background: #0c0d10;
  border: 1px solid var(--border);
  color: #c8ccd0;
  font-size: 12px;
  word-break: break-all;
}

.flow {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
}
.flow .step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
}
.n {
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent);
  background: var(--accent-fill);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #d4e4ff;
}
.reveal.in .step:nth-child(1) .n,
body.ready .reveal .step:nth-child(1) .n { animation: n-pop 0.35s steps(3) 0.05s both; }
.reveal.in .step:nth-child(2) .n,
body.ready .reveal .step:nth-child(2) .n { animation: n-pop 0.35s steps(3) 0.18s both; }
.reveal.in .step:nth-child(3) .n,
body.ready .reveal .step:nth-child(3) .n { animation: n-pop 0.35s steps(3) 0.31s both; }

.taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  height: 36px;
  background: var(--bg);
  border-top: 2px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}
.taskbar .dot {
  width: 8px;
  height: 8px;
  background: var(--ok);
  box-shadow: 0 0 0 1px #1a3a1e;
}
.taskbar a { color: var(--muted); }
.taskbar a:hover { color: var(--accent); }
.spacer { flex: 1; }
.clock { color: var(--brand); min-width: 7.5ch; text-align: right; }
.ticker {
  max-width: 280px;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker b {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 14s linear infinite;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #050608;
  display: grid;
  place-items: center;
  transition: opacity 0.2s steps(4);
}
.boot-inner { width: min(420px, 86vw); text-align: left; }
.boot-title {
  font-family: "Pixelify Sans", sans-serif;
  font-size: 48px;
  letter-spacing: 10px;
  color: var(--brand);
  margin-bottom: 16px;
  animation: glyph 0.5s steps(4) both;
}
.boot-bar {
  height: 14px;
  border: 2px solid var(--accent);
  background: #0c0d10;
  overflow: hidden;
}
.boot-bar i {
  display: block;
  height: 100%;
  width: 0;
  background:
    repeating-linear-gradient(90deg, var(--accent) 0 10px, #3a5ca8 10px 12px);
  animation: loadbar 0.85s steps(12) forwards;
}
.boot-log {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}
body.booting { overflow: hidden; }
body.booting .desk,
body.booting .taskbar { visibility: hidden; }
body.ready .boot { opacity: 0; pointer-events: none; }
body.ready .boot { animation: boot-out 0.28s steps(4) forwards; }

.reveal {
  opacity: 0;
  transform: translate(10px, 10px);
  clip-path: inset(0 0 100% 0);
}
body.ready .reveal {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  animation: win-snap 0.42s steps(6) calc(var(--d, 0) * 70ms) both;
}

@keyframes grid-drift {
  to { background-position: 16px 16px; }
}
@keyframes scan {
  to { background-position: 0 16px; }
}
@keyframes glyph {
  from { opacity: 0; transform: translateY(10px); color: var(--accent); }
  to { opacity: 1; transform: none; color: var(--brand); }
}
@keyframes win-snap {
  0% { opacity: 0; transform: translate(12px, 12px); clip-path: inset(0 0 100% 0); }
  40% { opacity: 1; transform: translate(4px, 4px); clip-path: inset(0 0 35% 0); }
  100% { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
@keyframes loadbar {
  to { width: 100%; }
}
@keyframes boot-out {
  to { opacity: 0; visibility: hidden; }
}
@keyframes n-pop {
  from { transform: scale(0); background: var(--accent); }
  to { transform: none; }
}
@keyframes ticker {
  to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal, body.booting .desk, body.booting .taskbar {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    clip-path: none !important;
  }
  .boot { display: none !important; }
}
