/* ---------- root + reset ---------- */
:root {
  --bg: #0c0b0a;
  --accent: #ffae42;
  --accent-dim: #c9821f;
  --accent-rgb: 255, 174, 66;
  --scan-alpha: 0.07;
  --glow-alpha: 0.05;
  --vignette-alpha: 0.5;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--accent);
  font-family: var(--mono); font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.25);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.45); }

@keyframes ans-blink { 50% { opacity: 0; } }

.ans-cursor {
  display: inline-block; width: 0.55em; height: 1em;
  margin-left: 0.12em; background: var(--accent);
  vertical-align: text-bottom;
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.8);
}
@media (prefers-reduced-motion: no-preference) {
  .ans-cursor { animation: ans-blink 1.1s steps(1) infinite; }
  html.js .reveal {
    opacity: 0; transform: translateY(14px);
    transition: opacity 0.65s ease, transform 0.65s ease;
  }
  html.js .reveal.on { opacity: 1; transform: none; }
}

a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
  transition: text-shadow 0.18s ease, border-color 0.18s ease;
}
a:hover {
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.75);
  border-bottom-color: var(--accent);
}

.swatch { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--sw), 0 0 14px var(--sw);
}
/* In light mode, swatches show the paper-readable variant of each accent
   so what you see is what the page will actually be coloured with. */
html.mode-light .swatch[data-accent="amber"] { background: #a86c10 !important; --sw: #a86c10 !important; }
html.mode-light .swatch[data-accent="green"] { background: #1b6e36 !important; --sw: #1b6e36 !important; }
html.mode-light .swatch[data-accent="white"] { background: #4a463d !important; --sw: #4a463d !important; }
.row, .log-line { transition: background 0.18s ease; }
.row:hover, .log-line:hover { background: rgba(var(--accent-rgb), 0.045); }

.term-chip {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.term-chip:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.6);
  color: var(--accent);
}
.term-window.is-focused {
  box-shadow: 0 0 0 1px var(--accent), 0 0 22px rgba(var(--accent-rgb), 0.18);
}
/* terminal-window background tracks dark/light mode */
html.mode-light .term-window {
  background: rgba(0, 0, 0, 0.025) !important;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.05) !important;
}
html.mode-light .term-window.is-focused {
  box-shadow: 0 0 0 1px var(--accent), 0 0 22px rgba(var(--accent-rgb), 0.15), inset 0 0 30px rgba(0,0,0,0.05) !important;
}
.term-input::placeholder { color: rgba(var(--accent-rgb), 0.35); }
.term-output a { border-bottom-style: dashed; }
.term-line { white-space: pre-wrap; }
.term-neofetch { white-space: pre; font-variant-ligatures: none; line-height: 1.25; }
.term-err { color: #ff6b5e; text-shadow: 0 0 8px rgba(255, 107, 94, 0.5); }
.term-banner { color: var(--accent-dim); }
.term-dim, .term-echo .term-prompt-glyph { color: var(--accent-dim); }
.term-echo { white-space: pre-wrap; margin-top: 4px; }

/* touch "exit" affordance — only shown on mobile (see media query below) */
.term-exit {
  display: none; flex: none; align-self: center;
  font-family: var(--mono); font-size: 11.5px; line-height: 1;
  padding: 0 12px; background: transparent;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  color: var(--accent-dim); cursor: pointer; letter-spacing: 0.04em;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.term-exit:hover { border-color: rgba(var(--accent-rgb), 0.6); color: var(--accent); }

/* ---------- statusline ticker (base; behaviour lives in the mobile query) ----------
   On desktop the ticker is hidden and the original statusline content (now wrapped
   in .statusline-static) renders exactly as before. */
.statusline-static { display: flex; align-items: center; gap: 18px; min-width: 0; flex: 1 1 auto; }
.ticker-viewport { display: none; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); } /* two copies → -50% == one copy width */
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr !important; }
  .hero-visual { order: -1; max-width: 360px; }
  .listing-head { display: none !important; }
  .row {
    grid-template-columns: 1fr !important;
    grid-template-areas: "name" "desc" "url" !important;
    gap: 3px !important; padding: 14px 4px !important;
  }
  .row .name { grid-area: name; }
  .row .desc { grid-area: desc; }
  .row .url  { grid-area: url; text-align: left !important; justify-self: start; }
  .listing-total { padding-left: 4px !important; }
  .log-line {
    grid-template-columns: 1fr !important;
    gap: 2px !important; padding: 12px 4px !important;
  }
  .statusline-row { font-size: 11.5px !important; gap: 10px !important; }
  .statusline-row .statusline-brand { display: none; }

  /* hero wordmark: clamp down so "anmolsandhu" never overflows narrow screens */
  .hero h1 { font-size: clamp(24px, 8.5vw, 40px) !important; max-width: 100%; }
  /* globe scales to viewport width, centered */
  .hero-visual { margin-left: auto; margin-right: auto; width: 100%; }

  /* touch targets ≥44px ------------------------------------------------ */
  /* swatches keep their look but gain a 44px hit area via ::after + wider gap */
  .swatches { gap: 18px !important; }
  .swatch { position: relative; }
  .swatch::after { content: ""; position: absolute; inset: -9px; } /* 26px + 18 = 44 */
  [data-mode-toggle] { min-height: 44px; }
  .term-chip { min-height: 44px; display: inline-flex; align-items: center; }
  .row .name a, .row .url a, .log-line a, footer nav a {
    display: inline-flex; align-items: center; min-height: 44px;
  }

  /* visible exit affordance (touch has no ESC) */
  .term-exit { display: inline-flex; align-items: center; min-height: 44px; }

  /* statusline → seamless scrolling ticker ---------------------------- */
  #statusline .statusline-static { display: none !important; }
  .ticker-viewport {
    display: block; flex: 1 1 auto; min-width: 0; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  }
  .ticker-row {
    display: inline-flex; flex-wrap: nowrap; white-space: nowrap; will-change: transform;
    animation: ticker-scroll var(--ticker-duration, 20s) linear infinite;
  }
  .ticker-row.is-paused { animation-play-state: paused; }
  .ticker-group {
    display: inline-flex; align-items: center; gap: 14px;
    padding-right: 14px; flex: 0 0 auto; /* padding == seam spacing between copies */
  }
  .ticker-item { display: inline-flex; align-items: baseline; gap: 6px; }
  .ticker-brand { color: var(--accent); font-weight: 500; }
  .ticker-name  { color: var(--accent); }
  .ticker-time  { font-variant-numeric: tabular-nums; }
  .ticker-wx    { opacity: 0.85; }
  .ticker-sep   { color: rgba(var(--accent-rgb), 0.3); }
  .ticker-tty   { color: rgba(var(--accent-rgb), 0.55); }
}

/* reduced motion: no auto-scroll — a static, horizontally-swipeable strip */
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .ticker-viewport {
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none; mask-image: none;
  }
  .ticker-row { animation: none; transform: none; }
  .ticker-group.ticker-clone { display: none; } /* one copy is enough when static */
}

@media (max-width: 520px) {
  .term-titlebar-meta { display: none; }
  .term-chips { font-size: 11px; }
}
