/* ==========================================================================
   aaronmoradi.com: "Rev." design, the build log
   An engineer's computation pad: green paper, blue 5 mm grid, graphite,
   red pencil for corrections. Square corners, ruled lines, real data.
   ========================================================================== */

@font-face { font-family: "Young Serif"; src: url("fonts/young-serif.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("fonts/atkinson-wght.woff2") format("woff2-variations"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("fonts/atkinson-wght-i.woff2") format("woff2-variations"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courier-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courier-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --pad: #eaf0e1;
  --pad-2: #dfe7d3;
  --grid: rgba(110, 160, 210, .22);
  --grid-major: rgba(110, 160, 210, .38);
  --ink: #2a2a28;
  --ink-2: #4a4a45;
  --muted: #6f7468;
  --rule: #2a2a28;
  --red: #c42b1c;
  --orange: #f76900;
  --hl: rgba(247, 105, 0, .28);
  --accent: #2a2a28;     /* map.js route colour */
  --serif: "Young Serif", Georgia, serif;
  --sans: "Atkinson Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --max: 1160px;
  --gut: clamp(16px, 3vw, 36px);
  color-scheme: light;
}
/* After hours: cyanotype blueprint, chalk lines (auto from 12–4am PT) */
:root[data-theme="dark"] { --pad: #173a5e; --pad-2: #1d4670; --grid: rgba(255, 255, 255, .07); --grid-major: rgba(255, 255, 255, .13); --ink: #eef3f8; --ink-2: #cfdae6; --muted: #9db3c9; --rule: #eef3f8; --red: #ff8a7a; --hl: rgba(247, 105, 0, .45); --accent: #eef3f8; color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pad: #173a5e; --pad-2: #1d4670; --grid: rgba(255, 255, 255, .07); --grid-major: rgba(255, 255, 255, .13); --ink: #eef3f8; --ink-2: #cfdae6; --muted: #9db3c9; --rule: #eef3f8; --red: #ff8a7a; --hl: rgba(247, 105, 0, .45); --accent: #eef3f8; color-scheme: dark; } }
/* Showtime (Konami): the page becomes a Lakers box-score sheet */
:root.showtime { --pad: #552583; --pad-2: #5f2d91; --grid: rgba(253, 185, 39, .12); --grid-major: rgba(253, 185, 39, .22); --ink: #fdb927; --ink-2: #fde3a0; --muted: #d7c2f2; --rule: #fdb927; --red: #ffffff; --accent: #fdb927; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 17px/1.6 var(--sans); overflow-x: hidden;
  background-color: var(--pad);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 95px 95px, 95px 95px, 19px 19px, 19px 19px;
  background-position: -1px -1px;
  transition: background-color .4s, color .4s;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
::selection { background: var(--hl); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.mono { font-family: var(--mono); }
.red { color: var(--red); }
.hl { background: linear-gradient(var(--hl), var(--hl)) 0 70% / 100% 50% no-repeat; }
s.edit { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2.5px; color: var(--muted); }
.pencil { font: italic 15px/1.35 var(--mono); color: var(--red); }

/* ---------- header ---------- */
.bar { position: sticky; top: 0; z-index: 50; background: var(--pad); border-bottom: 2px solid var(--rule); }
.bar .in { display: flex; align-items: center; gap: 16px; height: 58px; }
.sig { text-decoration: none; font: 22px/1 var(--serif); white-space: nowrap; position: relative; user-select: none; }
.sig::after { content: ""; position: absolute; left: 0; right: -6px; bottom: -6px; height: 6px; background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4 C 30 1, 60 6, 99 2' fill='none' stroke='%23c42b1c' stroke-width='1.6'/%3E%3C/svg%3E"); }
.nav { display: flex; margin-left: auto; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 13px; border-left: 1px solid var(--grid-major); text-decoration: none; font: 700 13px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.nav a:hover, .nav a[aria-current] { background: var(--ink); color: var(--pad); }
.tools { display: flex; gap: 6px; }
.tool { height: 32px; padding: 0 10px; border: 1.5px solid var(--rule); background: transparent; color: var(--ink); font: 700 12px var(--mono); cursor: pointer; }
.tool:hover { background: var(--ink); color: var(--pad); }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .menu-btn { display: inline-block; }
  .nav { position: fixed; inset: 60px 0 auto 0; height: auto; flex-direction: column; background: var(--pad); border-bottom: 2px solid var(--rule); transform: translateY(-140%); transition: transform .25s; }
  .nav.open { transform: none; }
  .nav a { border-left: 0; border-top: 1px solid var(--grid-major); padding: 14px var(--gut); font-size: 15px; }
  .tools { margin-left: auto; }
}

/* ---------- sheets ---------- */
.sheet { padding: clamp(36px, 6vw, 72px) 0; border-bottom: 1px dashed var(--grid-major); }
.sheet-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; border-bottom: 2px solid var(--rule); padding-bottom: 10px; margin-bottom: 26px; }
.sheet-head h2 { margin: 0; font: clamp(32px, 4.6vw, 54px)/1 var(--serif); }
.sheet-head .no { font: 700 13px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: right; }
.lead { font-size: clamp(19px, 2vw, 22px); line-height: 1.5; max-width: 52ch; }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(26px, 5vw, 60px); align-items: start; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }

.hero { padding: clamp(40px, 7vw, 90px) 0 clamp(30px, 5vw, 56px); }
.hero .rev { font: 700 14px var(--mono); letter-spacing: .1em; color: var(--red); text-transform: uppercase; }
.hero h1 { margin: 6px 0 16px; font: clamp(64px, 11vw, 150px)/.9 var(--serif); letter-spacing: -.01em; }
.hero .bio { font-size: clamp(19px, 2vw, 23px); line-height: 1.5; max-width: 50ch; margin: 0 0 12px; }
.hero .edit-line { font-size: clamp(19px, 2vw, 23px); margin: 0 0 22px; }
.hero .edit-line .ins { font: italic 700 0.95em var(--mono); color: var(--red); margin-left: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 2px solid var(--rule); margin-top: 26px; background: var(--pad); }
.stats div { padding: 12px 14px; border-left: 1px solid var(--rule); }
.stats div:first-child { border-left: 0; }
.stats b { display: block; font: 34px/1 var(--serif); }
.stats span { display: block; margin-top: 6px; font: 12px/1.35 var(--mono); color: var(--muted); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stats div:nth-child(3) { border-left: 0; } .stats div:nth-child(n+3) { border-top: 1px solid var(--rule); } }

/* the 24-hour commit clock */
.ring { width: 100%; max-width: 440px; margin: 0 auto; display: block; }
.ring text { font-family: var(--mono); fill: var(--ink); }
.ring .hr { font-size: 11px; fill: var(--muted); }
.ring .bar-h { fill: var(--ink); }
.ring .bar-h.late { fill: var(--red); }
.ring .face { fill: none; stroke: var(--rule); stroke-width: 1.5; }
.ring .tick { stroke: var(--grid-major); }
.ring .center { font-family: var(--serif); font-size: 44px; fill: var(--ink); }

/* timesheet */
.timesheet { width: 100%; border-collapse: collapse; border: 2px solid var(--rule); background: var(--pad); font-size: 15.5px; }
.timesheet th, .timesheet td { padding: 10px 12px; border-bottom: 1px solid var(--grid-major); text-align: left; vertical-align: top; }
.timesheet thead th { border-bottom: 2px solid var(--rule); font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.timesheet td:first-child { font: 14px var(--mono); white-space: nowrap; }
.timesheet .punch { font: 700 12px var(--mono); color: var(--red); border: 1.5px solid var(--red); padding: 1px 6px; display: inline-block; transform: rotate(-3deg); }

/* case studies */
.case { border: 2px solid var(--rule); background: var(--pad); margin-bottom: 26px; }
.case > header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 12px 16px; border-bottom: 2px solid var(--rule); }
.case h3 { margin: 0; font: 26px/1.1 var(--serif); }
.case header span { font: 12px var(--mono); color: var(--muted); }
.case .body { display: grid; grid-template-columns: 150px 1fr; }
.case .body > b { padding: 10px 16px; font: 700 12px/1.6 var(--mono); text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--grid-major); border-right: 1px solid var(--grid-major); }
.case .body > div { padding: 10px 16px; border-bottom: 1px solid var(--grid-major); }
.case .body > :nth-last-child(-n+2) { border-bottom: 0; }
.case ol { margin: 0; padding-left: 18px; }
.case li { margin: 2px 0 6px; }
.case li s { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
@media (max-width: 640px) { .case .body { grid-template-columns: 1fr; } .case .body > b { border-right: 0; padding-bottom: 0; border-bottom: 0; } }

.btn { display: inline-flex; gap: 10px; align-items: center; padding: 11px 16px; border: 2px solid var(--rule); background: var(--ink); color: var(--pad); text-decoration: none; font: 700 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--pad); }

/* contact */
.note-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; border: 2px solid var(--rule); padding: 18px; background: var(--pad); }
.note-form label { display: block; font: 700 12px var(--mono); text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.note-form input, .note-form textarea { width: 100%; border: 0; border-bottom: 1.5px solid var(--rule); background: transparent; color: var(--ink); font: 17px var(--sans); padding: 6px 0; }
.note-form textarea { min-height: 120px; resize: vertical; border: 1.5px solid var(--rule); padding: 8px; background: repeating-linear-gradient(transparent 0 27px, var(--grid-major) 27px 28px); line-height: 28px; }
.note-form .full { grid-column: 1 / -1; }
.note-form input:focus, .note-form textarea:focus { outline: none; border-color: var(--red); }
@media (max-width: 640px) { .note-form { grid-template-columns: 1fr; } }

/* engineering title block */
.titleblock { display: grid; grid-template-columns: repeat(4, 1fr) 1.6fr; border: 2px solid var(--rule); margin: 36px 0 18px; background: var(--pad); font: 12px var(--mono); }
.titleblock div { padding: 8px 10px; border-left: 1.5px solid var(--rule); }
.titleblock div:first-child { border-left: 0; }
.titleblock span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; margin-bottom: 3px; }
.titleblock strong { font: 18px/1 var(--serif); font-weight: 400; }
@media (max-width: 760px) { .titleblock { grid-template-columns: 1fr 1fr; } .titleblock div:nth-child(n+3) { border-top: 1.5px solid var(--rule); } .titleblock div:nth-child(3) { border-left: 0; } .titleblock div:last-child { grid-column: 1 / -1; border-left: 0; } }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; padding-bottom: 40px; font: 13px var(--mono); }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.team-btns { display: flex; gap: 6px; }
.team-btn { border: 1.5px solid var(--rule); background: transparent; color: var(--ink); padding: 7px 10px; font: 700 12px var(--mono); cursor: pointer; }
.team-btn:hover { background: var(--ink); color: var(--pad); }
.egg-meter { font: 700 13px var(--mono); color: var(--red); text-decoration: none; }

.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s, transform .6s; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ==========================================================================
   Shared machinery, re-skinned: teletype terminal, chad confetti, slips
   ========================================================================== */
#confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 9990; overflow: hidden; }
.confetti { position: absolute; top: -20px; animation: fall linear forwards; border-radius: 50% !important; }
@keyframes fall { to { transform: translateY(110vh) rotate(var(--spin, 720deg)); } }
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 9995; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: calc(100% - 32px); }
.toast { pointer-events: auto; max-width: 380px; background: var(--pad); color: var(--ink); border: 2px solid var(--rule); padding: 10px 14px; font: 13px/1.45 var(--mono); box-shadow: 4px 4px 0 var(--rule); animation: tin .3s ease; }
.toast b { color: var(--red); }
.toast .stampd { display: inline-block; border: 2px solid var(--red); color: var(--red); padding: 0 6px; transform: rotate(-4deg); font-weight: 700; margin-right: 6px; }
.toast.out { animation: tout .25s ease forwards; }
@keyframes tin { from { transform: translateY(20px); opacity: 0; } }
@keyframes tout { to { transform: translateY(20px); opacity: 0; } }
.term-backdrop { position: fixed; inset: 0; background: rgba(20, 30, 20, .45); z-index: 9980; display: none; }
.term-backdrop.open { display: block; }
.term { position: fixed; z-index: 9985; left: 50%; top: 9vh; transform: translateX(-50%); width: min(780px, calc(100% - 24px)); height: min(500px, 76vh); display: none; flex-direction: column; background: #fbfaf2; color: #2a2a28; border: 2px solid #2a2a28; box-shadow: 8px 8px 0 #2a2a28; font: 14px/1.55 var(--mono); }
.term.open { display: flex; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-bottom: 2px solid #2a2a28; background: #e9ecd9; }
.term-bar i { width: 13px; height: 13px; border: 1.5px solid #2a2a28; display: inline-block; cursor: pointer; }
.term-bar i:first-child { background: #c42b1c; }
.term-bar span { margin-left: auto; font: 700 12px var(--mono); letter-spacing: .14em; }
.term-out { flex: 1; overflow-y: auto; padding: 12px 16px; white-space: pre-wrap; word-break: break-word; background: repeating-linear-gradient(transparent 0 21px, rgba(110, 160, 210, .18) 21px 22px); }
.term-out .c-accent, .term-out .c-gold { font-weight: 700; }
.term-out .c-dim { color: #6f7468; }
.term-out .c-ok { font-weight: 700; }
.term-out .c-err { color: #c42b1c; font-weight: 700; }
.term-out a { color: #1f4f8a; }
.term-in { display: flex; gap: 8px; padding: 9px 16px; border-top: 2px solid #2a2a28; }
.term-in label { font-weight: 700; white-space: nowrap; }
.term-in input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; outline: none; }
#matrix { position: fixed; inset: 0; z-index: 9970; pointer-events: none; opacity: 0; transition: opacity .6s; }
#matrix.on { opacity: .85; }
.barrel-roll { animation: roll 1.1s cubic-bezier(.4, 0, .2, 1); }
@keyframes roll { to { transform: rotate(360deg); } }
.gravity-fall { transition: transform 1.4s cubic-bezier(.55, 0, 1, .45); }
.otto-pop { position: fixed; right: 16px; bottom: 16px; z-index: 9992; width: min(280px, calc(100% - 32px)); background: var(--pad); border: 2px solid var(--rule); box-shadow: 4px 4px 0 var(--orange); }
.otto-pop img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.otto-pop div { padding: 8px 10px; font: 700 13px var(--mono); color: var(--orange); }
.otto-pop.out { display: none; }
.revert-flash { position: fixed; inset: 0; z-index: 9996; background: #fff center top / contain no-repeat; display: grid; place-items: end center; padding-bottom: 30px; }
.revert-flash span { font: 700 14px var(--mono); background: #c42b1c; color: #fff; padding: 8px 14px; }

@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }
@media (max-width: 640px) {
  .timesheet { display: block; overflow-x: auto; font-size: 14px; }
  .timesheet th:nth-child(4), .timesheet td:nth-child(4) { display: none; }
  .timesheet td:first-child { white-space: normal; min-width: 100px; }
}
