/* ==========================================================================
   Receipt × Terminal
   ========================================================================== */
:root {
  --bg: #0a0c0a;
  --bg-2: #111511;
  --line: #222a22;
  --fg: #c8d0c2;
  --dim: #6c776a;
  --dir: #6cb6ff;

  --accent: #ffb000;
  --accent-soft: rgba(255, 176, 0, 0.14);
  --glow: rgba(255, 176, 0, 0.35);

  --paper: #f4f0e6;
  --paper-shade: #e9e3d4;
  --ink: #26231d;
  --ink-dim: #736c5c;
  --stamp: #c0392b;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 16px;
  --topbar-h: 58px;
}

[data-theme="green"] {
  --accent: #3dff7f;
  --accent-soft: rgba(61, 255, 127, 0.12);
  --glow: rgba(61, 255, 127, 0.32);
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
  color: var(--fg);
  font: 400 15px/1.6 var(--mono);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
}

/* CRT scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0 1px,
    transparent 1px 3px
  );
}

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

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 8px; top: -60px;
  background: var(--accent);
  color: #000;
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus { top: 8px; }

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

/* ---------- Top bar / POS keys ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: rgba(10, 12, 10, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--topbar-h);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 13px; white-space: nowrap; }
.lights { display: inline-flex; gap: 6px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f3a; display: block; }
.lights i:first-child { background: var(--accent); box-shadow: 0 0 8px var(--glow); }

.keys { display: flex; gap: 8px; }

.key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  background: linear-gradient(#1a1f1a, #131713);
  border: 1px solid #2c342c;
  border-radius: 6px;
  box-shadow: 0 2px 0 #000, inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.06s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.key kbd { font: inherit; font-size: 10px; color: var(--dim); }
.key:hover { color: var(--accent); border-color: var(--accent); }
.key:active { transform: translateY(2px); box-shadow: 0 0 0 #000; }
.key[aria-current="true"] { color: #000; background: var(--accent); border-color: var(--accent); }
.key[aria-current="true"] kbd { color: rgba(0, 0, 0, 0.55); }

/* ---------- Sections & prompts ---------- */
.section {
  padding: 80px 0;
  scroll-margin-top: calc(var(--topbar-h) + env(safe-area-inset-top));
  border-bottom: 1px dashed var(--line);
  /* receipt shadows/tilt must never cause sideways scroll on phones */
  overflow-x: hidden;
  overflow-x: clip;
}

.prompt {
  margin: 0 0 22px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.ps1 { color: var(--accent); text-shadow: 0 0 10px var(--glow); }
.cmd { color: var(--fg); }

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: -0.22em;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.section-h { /* visually hidden headings for structure */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Output waits for its command to finish typing */
.js [data-run] .out { visibility: hidden; }
.js [data-run].ran .out { visibility: visible; }

/* ---------- Hero ---------- */
.hero { padding-top: 64px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: start;
}

.boot { margin: 0 0 28px; color: var(--dim); font-size: 12px; display: grid; gap: 2px; }
.boot span::before { content: "> "; color: var(--accent); }
.boot b { color: var(--accent); font-weight: 500; }

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7.4vw, 84px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  text-shadow: 0 0 24px var(--glow);
}

.pitch {
  margin: 22px 0 0;
  font-size: clamp(18px, 2.3vw, 23px);
  line-height: 1.45;
  color: #e6ece1;
  max-width: 30ch;
}

.hero-meta { margin: 18px 0 0; color: var(--dim); font-size: 13px; }
.hero-meta .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3dff7f; box-shadow: 0 0 8px rgba(61, 255, 127, 0.6); margin-right: 8px; vertical-align: 1px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-cta .key { padding: 12px 16px; font-size: 13px; }
.hero-cta .key.primary { background: var(--accent); color: #000; border-color: var(--accent); }
.hero-cta .key.primary:hover { color: #000; filter: brightness(1.08); }

/* ---------- Paper / receipts ---------- */
.slip {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.55)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}
.slip.wide { max-width: 540px; }

.paper { position: relative; }
.js .paper.pending { clip-path: inset(0 0 100% 0); }
.paper.printing { transition: clip-path 70ms linear; }

.edge {
  height: 9px;
  background: var(--paper);
  -webkit-mask-size: 14px 9px;
  mask-size: 14px 9px;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
}
.edge.top {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M0 9L7 0l7 9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M0 9L7 0l7 9z'/%3E%3C/svg%3E");
}
.edge.bot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M0 0h14L7 9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M0 0h14L7 9z'/%3E%3C/svg%3E");
}

.receipt {
  position: relative;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.035), transparent 6%, transparent 94%, rgba(0, 0, 0, 0.035)),
    var(--paper);
  color: var(--ink);
  padding: 16px 22px 18px;
  font-size: 13px;
  line-height: 1.55;
  text-shadow: 0 0 0.35px rgba(38, 35, 29, 0.6); /* thermal bleed */
}

.ln { position: relative; }
.ln + .ln { margin-top: 1px; }

.c { text-align: center; }
.sm { font-size: 11.5px; color: var(--ink-dim); }
.up { text-transform: uppercase; }
.b { font-weight: 700; }
.big {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.25;
}

.hr {
  height: 0;
  margin: 10px 0;
  border-top: 1.5px dashed var(--ink);
  opacity: 0.55;
}
.hr.double { border-top: 4px double var(--ink); opacity: 0.7; }

.split { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.row { display: flex; align-items: baseline; gap: 8px; }
.row .q { flex: 0 0 2.2em; }
.row .l { min-width: 0; }
.row .dots {
  flex: 1 1 12px;
  min-width: 12px;
  border-bottom: 1.5px dotted var(--ink-dim);
  transform: translateY(-4px);
}
.row .v { white-space: nowrap; font-weight: 600; }
.row.head { font-size: 11px; color: var(--ink-dim); }
.row.head .dots { visibility: hidden; }
.row.total { font-size: 16px; font-weight: 700; }

.mod { padding-left: 1.6em; text-indent: -1.1em; }
.mod::before { content: "+ "; font-weight: 700; }

.role-h { font-weight: 700; letter-spacing: 0.04em; }

.barcode { display: block; width: 78%; height: 42px; margin: 6px auto 2px; fill: var(--ink); }

.stamp {
  position: absolute;
  right: 10px;
  bottom: 34px;
  padding: 4px 10px;
  border: 3px solid var(--stamp);
  border-radius: 4px;
  color: var(--stamp);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  transform: rotate(-12deg);
  opacity: 0;
  text-shadow: none;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.paper.done .stamp { opacity: 0.85; animation: stamp 0.28s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-12deg) scale(1.9); }
  to { opacity: 0.85; transform: rotate(-12deg) scale(1); }
}

/* Paper "tear" settle */
.slip.torn { animation: tear 0.35s ease-out; }
@keyframes tear {
  30% { transform: translateY(3px) rotate(-0.5deg); }
  70% { transform: translateY(-1px) rotate(0.2deg); }
}

/* Buttons printed on paper */
.btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: 600 12px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn:hover, .btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: transparent; color: var(--ink); }
.btn:focus-visible { outline-color: var(--ink); }

/* ---------- Experience ---------- */
.role { padding: 2px 0; }
.role .split .sm { color: var(--ink-dim); white-space: nowrap; }
.role-title { font-style: italic; }

/* ---------- Projects ---------- */
.ls {
  margin: -8px 0 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.ls a { color: var(--dir); text-decoration: none; }
.ls a:hover { text-decoration: underline; }

.tickets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 34px 28px;
  align-items: start;
}
.tickets > li { scroll-margin-top: calc(var(--topbar-h) + 24px); }
.tickets .slip { max-width: none; transition: transform 0.25s; }
.tickets > li:nth-child(odd) .slip { transform: rotate(-0.6deg); }
.tickets > li:nth-child(even) .slip { transform: rotate(0.5deg); }
.tickets > li .slip:hover { transform: rotate(0) translateY(-3px); }

.tk-title { margin: 2px 0 0; font-size: 19px; line-height: 1.25; letter-spacing: 0.02em; text-transform: uppercase; }
.lbl { font-weight: 700; }

.shot {
  margin: 4px 0 2px;
  aspect-ratio: 16 / 10;
  border: 1.5px solid var(--ink);
  overflow: hidden;
  background: var(--paper-shade);
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) sepia(0.15);
  transition: filter 0.3s;
}
.slip:hover .shot img, .slip:focus-within .shot img { filter: none; }
@media (hover: none) { .shot img { filter: none; } }

.shot-ph {
  height: 100%;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(45deg, transparent 0 7px, rgba(38, 35, 29, 0.08) 7px 8px);
  color: var(--ink-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ---------- Contact ---------- */
.field { display: grid; gap: 2px; margin-top: 10px; }
.field label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--ink-dim); }
.field input,
.field textarea {
  width: 100%;
  font: 400 16px/1.5 var(--mono); /* 16px stops iOS zoom-on-focus */
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px dashed var(--ink-dim);
  border-radius: 0;
  padding: 6px 2px;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom: 1.5px solid var(--ink);
  background: rgba(38, 35, 29, 0.05);
}
.hp { position: absolute; left: -9999px; }

.send { width: 100%; margin-top: 16px; min-height: 48px; font-size: 13px; }
.send[disabled] { opacity: 0.5; cursor: progress; }
.form-status { min-height: 1.5em; margin-top: 8px; font-size: 12px; font-weight: 600; text-align: center; }

/* ---------- Footer ---------- */
.footer { padding: 48px 0 calc(56px + env(safe-area-inset-bottom)); color: var(--dim); font-size: 13px; }
.footer .prompt { margin-bottom: 6px; }

.noscript { padding: 40px var(--gutter); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .pitch { max-width: 34ch; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 50px; }
  body { font-size: 14px; }
  .section { padding: 56px 0; }
  .hero { padding-top: 36px; }
  .brand { display: none; }
  .topbar-inner { justify-content: center; }
  .keys { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .key { justify-content: center; padding: 9px 4px; font-size: 11px; letter-spacing: 0.02em; }
  .key kbd { display: none; }
  .prompt { font-size: 14px; }
  .receipt { padding: 14px 16px 16px; font-size: 12.5px; }
  .big { font-size: 18px; }
  .row.total { font-size: 14.5px; }
  .tickets > li .slip { transform: none; }
  .stamp { bottom: 32px; font-size: 13px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .cursor { animation: none; }
}
