/* ══════════════════════════════════════════════════════════════
   AM.TERMINAL — monochrome CRT theme
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #000;
  --fg: #ffffff;          /* primary text          */
  --dim: #8a8a8a;         /* labels, secondary     */
  --dimmer: #5a5a5a;      /* leaders, hints        */
  --line: #2e2e2e;        /* borders               */
  --accent: #ffb000;      /* amber phosphor        */
  --accent-dim: #7a5400;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  --glow: 0 0 6px rgba(255, 255, 255, 0.28);
  --glow-a: 0 0 8px rgba(255, 176, 0, 0.55);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --bar-h: 30px;          /* command bar height    */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  overflow-x: hidden;
  text-shadow: var(--glow);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #000; text-shadow: none; }

a { color: inherit; text-decoration: none; }

/* ── background: matrix rain ──────────────────────────────────── */
#rain { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5; }

/* ── CRT overlays ─────────────────────────────────────────────── */
.scanlines {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.045) 0px,
    rgba(255, 255, 255, 0.045) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
.flicker {
  position: fixed; inset: 0; z-index: 91; pointer-events: none;
  background: rgba(255, 176, 0, 0.022);
  animation: flick 5.5s steps(1) infinite;
}
@keyframes flick {
  0%, 96%, 100% { opacity: 0; }
  97% { opacity: 1; }
  98% { opacity: 0.35; }
  99% { opacity: 0.85; }
}

/* ── top status bar ───────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px;
  font-size: 11px; letter-spacing: 0.5px; color: var(--dim);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.tb-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--accent); text-shadow: var(--glow-a);
  transition: opacity 0.15s;
}
.tb-btn:hover { opacity: 0.7; }
.tb-btn.muted { color: var(--dimmer); text-shadow: none; }

/* ── section tabs ─────────────────────────────────────────────── */
.tabs {
  position: fixed; top: 29px; left: 0; right: 0; z-index: 39;
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.tabs button {
  background: none; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: 11px; letter-spacing: 0.6px;
  color: var(--dim); padding: 2px 9px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tabs button:hover { color: var(--fg); border-color: var(--line); }
.tabs button.active {
  color: #000; background: var(--accent); border-color: var(--accent);
  text-shadow: none;
}

/* ── page / section layout ────────────────────────────────────── */
#pages {
  position: relative; z-index: 2;
  height: 100svh; overflow-y: scroll; overflow-x: hidden;
  scrollbar-width: none;
}
#pages::-webkit-scrollbar { display: none; }

.section {
  position: relative;
  min-height: 100svh; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 88px 20px calc(var(--bar-h) + 72px);
}
.section-inner { width: 100%; max-width: 780px; }

[data-reveal] { opacity: 0; }

/* ── ASCII banner ─────────────────────────────────────────────── */
.ascii {
  font-family: var(--mono);
  font-size: clamp(5px, 1.55vw, 11px);
  line-height: 1.06;
  color: var(--accent);
  text-shadow: var(--glow-a);
  white-space: pre;
  margin-bottom: 22px;
  opacity: 0;
}
.ascii.in { animation: asciiIn 0.5s var(--ease-smooth) forwards; }
@keyframes asciiIn { from { opacity: 0; } to { opacity: 0.95; } }

/* ── hero ─────────────────────────────────────────────────────── */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; }

.hero-id { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar {
  width: 46px; height: 46px; flex-shrink: 0; display: block;
  border: 1px solid var(--line); overflow: hidden;
  filter: grayscale(1) contrast(1.15);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-name {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 26px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
}
.verified { font-size: 13px; color: var(--accent); text-shadow: var(--glow-a); letter-spacing: 0; }

.desc { min-height: 20px; color: var(--fg); font-size: 13px; margin-bottom: 22px; }
.prompt-sym { color: var(--accent); text-shadow: var(--glow-a); }
.cursor { color: var(--accent); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-rows { width: 100%; max-width: 400px; margin-bottom: 22px; text-align: left; }

.socials { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ── buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-block; cursor: pointer;
  font: inherit; font-size: 12px; letter-spacing: 0.6px;
  color: var(--accent); text-shadow: var(--glow-a);
  padding: 4px 10px; border: 1px solid var(--accent-dim); background: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #000; text-shadow: none; }

/* ── dotted-leader rows ───────────────────────────────────────── */
.rows { width: 100%; }
.row {
  display: flex; align-items: baseline; gap: 0;
  width: 100%; padding: 2px 0; font-size: 12px;
  color: var(--fg);
}
.row-k { color: var(--dim); letter-spacing: 0.6px; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.lead {
  flex: 1 1 auto; min-width: 12px; margin: 0 5px;
  border-bottom: 1px dotted var(--dimmer);
  transform: translateY(-3px);
}
.row-v { color: var(--fg); white-space: nowrap; flex-shrink: 0; }
.row-v.ok { color: var(--accent); text-shadow: var(--glow-a); }
.row-tag { color: var(--accent); text-shadow: var(--glow-a); white-space: nowrap; margin-left: 8px; flex-shrink: 0; }
.dot {
  display: inline-block; width: 6px; height: 6px; margin-right: 6px;
  background: var(--accent); box-shadow: var(--glow-a);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* clickable rows */
.row-btn {
  background: none; border: none; font: inherit; text-align: left;
  cursor: pointer; width: 100%; color: var(--fg);
  transition: background 0.15s;
}
.row-btn:hover { background: rgba(255, 176, 0, 0.07); }
.row-btn:hover .row-tag { background: var(--accent); color: #000; text-shadow: none; }

.lbl-copied { display: none; }
#email-widget.copied .lbl-default { display: none; }
#email-widget.copied .lbl-copied { display: inline; }

/* ── headings ─────────────────────────────────────────────────── */
.heading {
  font-size: 15px; font-weight: 700; letter-spacing: 2.5px;
  margin-bottom: 14px; color: var(--fg);
}
.hd-mark { color: var(--accent); text-shadow: var(--glow-a); margin-right: 6px; }

/* ── panels (boxed regions) ───────────────────────────────────── */
.panel {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.55);
  margin-bottom: 14px;
  transition: border-color 0.2s;
}
.panel:hover { border-color: #454545; }
.panel-title {
  position: absolute; top: -7px; left: 12px;
  padding: 0 6px; background: #000;
  font-size: 10px; letter-spacing: 1.4px; color: var(--accent);
  text-shadow: var(--glow-a);
}
.panel-body { padding: 16px 14px 13px; }

.bio-box { font-size: 13px; color: var(--fg); line-height: 1.6; }

.widgets { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 14px; align-items: start; }
@media (max-width: 720px) { .widgets { grid-template-columns: 1fr; } }

/* ── clock ────────────────────────────────────────────────────── */
.clk-t {
  font-size: 30px; font-weight: 700; letter-spacing: 2px;
  color: var(--accent); text-shadow: var(--glow-a);
  font-variant-numeric: tabular-nums; line-height: 1.1; margin-bottom: 8px;
}

/* ── projects ─────────────────────────────────────────────────── */
.projects-grid { display: flex; flex-direction: column; gap: 0; }

.project {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px;
  border: 1px solid transparent; border-bottom: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s;
}
.project:hover { background: rgba(255, 176, 0, 0.05); border-color: var(--line); }

.project-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1px solid var(--line);
  background-size: cover; background-position: center;
  display: grid; place-content: center;
  font-size: 14px; font-weight: 700; color: var(--accent);
  filter: grayscale(1) contrast(1.1);
}
.project-icon.has-img { color: transparent; text-shadow: none; }

.project-body { min-width: 0; flex: 1; }
.project-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.project-name { font-size: 13px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.project-role { font-size: 10px; letter-spacing: 0.8px; color: var(--accent); text-shadow: var(--glow-a); }
.project-desc { margin-top: 3px; font-size: 11.5px; color: var(--dim); line-height: 1.45; }
.project-meta { margin-top: 5px; font-size: 11px; color: var(--dimmer); display: flex; align-items: center; }
.project-meta .dot { width: 5px; height: 5px; }
.project-join { align-self: center; flex-shrink: 0; }

/* ── music ────────────────────────────────────────────────────── */
.music-card { max-width: 100%; }
.music-link { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.music-link:hover .music-title { color: var(--accent); text-shadow: var(--glow-a); }
.music-art {
  width: 42px; height: 42px; flex-shrink: 0; display: block;
  border: 1px solid var(--line); object-fit: cover;
  filter: grayscale(1) contrast(1.15);
}
.music-titlewrap { min-width: 0; display: flex; flex-direction: column; }
.music-title {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color 0.15s;
}
.music-artist { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.music-progresswrap { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.music-time { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.music-bar {
  flex: 1; height: 13px; cursor: pointer; overflow: hidden;
  display: flex; align-items: center;
  color: var(--accent); text-shadow: var(--glow-a);
  font-size: 12px; line-height: 1; letter-spacing: -0.5px;
  white-space: nowrap;
}
.music-bar .track { white-space: pre; }

.music-ctrl { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.music-ctrl button {
  background: none; border: 1px solid var(--line); cursor: pointer;
  font: inherit; font-size: 11px; letter-spacing: 0.5px;
  color: var(--dim); padding: 3px 9px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.music-ctrl button:hover { color: #000; background: var(--accent); border-color: var(--accent); text-shadow: none; }
.music-ctrl .play { color: var(--accent); border-color: var(--accent-dim); text-shadow: var(--glow-a); }

.lyrics {
  position: relative; height: 210px; overflow: hidden; margin-top: 12px;
  border-top: 1px solid var(--line); padding-top: 10px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.lyrics-track { position: absolute; left: 0; right: 0; top: 50%; transition: transform 0.35s var(--ease-smooth); }
.lyric-line {
  padding: 4px 0; font-size: 13px; letter-spacing: 0.4px;
  color: var(--dimmer); transition: color 0.3s;
}
.lyric-line.active { color: var(--accent); text-shadow: var(--glow-a); }
.lyric-line.active::before { content: '> '; }
.lyrics-status { color: var(--dim); font-size: 12px; padding: 50px 0; text-align: center; }

/* ── command bar ──────────────────────────────────────────────── */
.cmdbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: center; gap: 8px;
  height: var(--bar-h); padding: 0 14px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.92);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  font-size: 12px;
}
.cmd-prompt { color: var(--accent); text-shadow: var(--glow-a); white-space: nowrap; flex-shrink: 0; cursor: text; }
.cmd-input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  font: inherit; color: var(--fg); text-shadow: var(--glow);
  caret-color: var(--accent);
}
.cmd-input::placeholder { color: var(--dimmer); text-shadow: none; }
.cmd-hint {
  color: var(--dim); font-size: 11px; white-space: nowrap; flex-shrink: 0;
  max-width: 52vw; overflow: hidden; text-overflow: ellipsis;
}
.cmd-hint.err { color: #ff5f56; }
.cmd-hint.ok { color: var(--accent); text-shadow: var(--glow-a); }

/* ── scroll hint ──────────────────────────────────────────────── */
.scroll-hint {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 44px); transform: translateX(-50%);
  z-index: 25; pointer-events: none;
  font-size: 10.5px; letter-spacing: 1.4px; color: var(--dimmer);
  transition: opacity 0.4s ease;
}
.scroll-hint.hide { opacity: 0; }

/* ── mini scroll indicator (bottom centre) ────────────────────── */
.scroll-ind {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 13px);
  transform: translateX(-50%);
  z-index: 26; display: flex; align-items: center; gap: 9px;
  padding: 5px 12px;
  font-size: 10px; letter-spacing: 1.2px;
  color: var(--dim);
  border: 1px solid #3a3a3a;
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9), 0 4px 18px rgba(0, 0, 0, 0.8);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.scroll-ind:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9), 0 4px 22px rgba(255, 176, 0, 0.14);
}

/* corner ticks — the bracket motif used elsewhere in the UI */
.scroll-ind::before,
.scroll-ind::after {
  content: ''; position: absolute; width: 5px; height: 5px;
  border: 1px solid var(--accent); opacity: 0.55;
  transition: opacity 0.25s ease;
}
.scroll-ind::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.scroll-ind::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.scroll-ind:hover::before, .scroll-ind:hover::after { opacity: 1; }

.si-pos {
  color: var(--accent); text-shadow: var(--glow-a);
  font-weight: 700; font-size: 11px;
}
.si-total { color: var(--dimmer); }

.si-track { display: flex; align-items: center; gap: 4px; }

/* one segment per section: past = dim bar, current = long amber bar */
.si-cell {
  position: relative;
  width: 9px; height: 4px; padding: 0;
  border: none; background: #333;
  cursor: pointer; display: block;
  transition: width 0.32s var(--ease-smooth), background 0.25s ease, box-shadow 0.25s ease;
}
.si-cell:hover { background: var(--dim); }
.si-cell.past { background: var(--accent-dim); }
.si-cell.on {
  width: 24px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 176, 0, 0.75);
}

/* section name, revealed on hover so the resting state stays minimal */
.si-label {
  max-width: 0; overflow: hidden; white-space: nowrap;
  opacity: 0; color: var(--fg);
  transition: max-width 0.35s var(--ease-smooth), opacity 0.25s ease;
}
.scroll-ind:hover .si-label { max-width: 100px; opacity: 1; }

/* ── boot / enter screen ──────────────────────────────────────── */
#enter {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  padding: 34px 26px; background: #000; cursor: pointer;
  transition: opacity 0.45s ease;
  overflow: hidden;
}
#enter.hidden { opacity: 0; pointer-events: none; }
.boot {
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
  color: var(--fg); text-shadow: var(--glow); white-space: pre-wrap;
}
.boot .a { color: var(--accent); text-shadow: var(--glow-a); }
.boot .d { color: var(--dim); }

/* caret that rides the end of the text while it types */
.boot-caret {
  color: var(--accent); text-shadow: var(--glow-a);
  animation: blink 0.75s steps(1) infinite;
}

/* flashing "enter my world" prompt, revealed once the boot log finishes */
.boot-cta {
  display: inline-block; margin-top: 20px;
  font-size: 15px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); text-shadow: var(--glow-a);
  padding: 7px 16px; border: 1px solid var(--accent-dim);
  opacity: 0; visibility: hidden;
  transition: background 0.15s, color 0.15s;
}
.boot-cta::before { content: '[ '; }
.boot-cta::after { content: ' ]'; }
.boot-cta.show {
  visibility: visible;
  animation: ctaFlash 1.15s steps(1) infinite;
}
#enter:hover .boot-cta.show {
  animation: none; opacity: 1;
  background: var(--accent); color: #000; border-color: var(--accent);
  text-shadow: none;
}
@keyframes ctaFlash { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.12; } }

/* ══════════════════════════════════════════════════════════════
   responsive
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px), (pointer: coarse) and (max-width: 900px) {
  body { font-size: 12px; }
  .section { padding: 84px 13px calc(var(--bar-h) + 40px); }

  .topbar { font-size: 10px; padding: 6px 11px; }
  .tabs { padding: 5px 11px; gap: 3px; }
  .tabs button { font-size: 10px; padding: 2px 7px; }

  .ascii { font-size: 5.2px; margin-bottom: 16px; }
  .hero-name { font-size: 20px; letter-spacing: 2px; }
  .avatar { width: 40px; height: 40px; }
  .hero-rows { max-width: 100%; }

  .heading { font-size: 13px; letter-spacing: 2px; }
  .panel-body { padding: 15px 11px 12px; }
  .clk-t { font-size: 24px; }

  .project { padding: 10px 9px; gap: 10px; }
  .project-icon { width: 30px; height: 30px; font-size: 12px; }
  .project-name { font-size: 12px; }
  .project-desc { font-size: 11px; }
  .project-join { align-self: flex-start; }

  .lyrics { height: 170px; }
  .lyric-line { font-size: 12px; }

  .cmd-hint { display: none; }
  .scroll-hint { font-size: 9.5px; letter-spacing: 1px; }
  .scroll-ind { padding: 4px 10px; gap: 7px; font-size: 9px; bottom: calc(var(--bar-h) + 11px); }
  .si-pos { font-size: 10px; }
  .si-cell { width: 8px; height: 3px; }
  .si-cell.on { width: 20px; }
  /* touch devices have no hover — keep the label out of the way */
  .si-label { display: none; }
  .boot { font-size: 10.5px; }
  #enter { padding: 24px 16px; }
}

@media (max-width: 420px) {
  .hero-name { font-size: 17px; }
  .music-ctrl button { font-size: 10px; padding: 3px 7px; }
  .row { font-size: 11px; }
}

/* ── accessibility ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  /* suppress ambient/decorative motion only */
  .flicker { animation: none !important; }
  #rain { display: none; }
  * { transition-duration: 0.01ms !important; }

  /* Carets and the enter prompt keep animating on purpose: a blinking cursor
     and a flashing CTA are functional signals, and both are small, local,
     and non-parallax — the class of motion this query is meant to spare. */
  .boot-caret, .cursor { animation: blink 0.75s steps(1) infinite !important; }
  .boot-cta.show { animation: ctaFlash 1.15s steps(1) infinite !important; }
}

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