/* ==========================================================================
   Page modes (js/modes.js) and styles for the terminal extras
   ========================================================================== */

/* ---------- retro: green phosphor CRT --------------------------------- */
html.mode-retro {
  filter: grayscale(1) sepia(1) hue-rotate(58deg) saturate(3.2) contrast(1.08) brightness(0.95);
}

html.mode-retro body::before {
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
  z-index: 99;
}

html.mode-retro body {
  text-shadow: 0 0 6px rgba(120, 255, 160, 0.35);
}

/* ---------- light mode ------------------------------------------------ */
html.mode-light {
  --bg: #f4f2ec;
  --bg-2: #ebe8e0;
  --bg-3: #e1ddd3;
  --panel: rgba(255, 255, 255, 0.86);
  --fg: #16181c;
  --fg-2: #3b4048;
  --mute: #6d727b;
  --accent: #008f58;
  --accent-dim: #007548;
  --accent-glow: rgba(0, 143, 88, 0.16);
  --rule: rgba(20, 24, 28, 0.1);
  --rule-accent: rgba(0, 143, 88, 0.25);
}

html.mode-light .header {
  background: linear-gradient(to bottom, rgba(244, 242, 236, 0.96), rgba(244, 242, 236, 0.8) 60%, rgba(244, 242, 236, 0));
}

html.mode-light .projects {
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 80px 80px,
    #eceae3;
}

html.mode-light .feat__art { background: #f8f7f3; }
html.mode-light .term,
html.mode-light .term__body { color: var(--fg); }
html.mode-light .stratum:nth-child(3) { background: #dfe7ea; color: var(--fg); }
html.mode-light .statusbar,
html.mode-light .footer { background: var(--bg-2); }
html.mode-light body::after { opacity: 0.04; }
html.mode-light body::before { display: none; }

/* ---------- large text ------------------------------------------------ */
html.mode-large body { zoom: 1.14; }

/* ---------- 1995 homepage --------------------------------------------- */
html.mode-y1995 body {
  background: #c0c0c0 !important;
  color: #000;
  font-family: "Times New Roman", Times, serif !important;
  cursor: auto;
}

html.mode-y1995 body::before,
html.mode-y1995 body::after,
html.mode-y1995 .cursor,
html.mode-y1995 .hero__canvas,
html.mode-y1995 .meter,
html.mode-y1995 .stratum__pattern { display: none !important; }

html.mode-y1995 *,
html.mode-y1995 *::before {
  font-family: "Comic Sans MS", "Comic Sans", "Times New Roman", serif !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

html.mode-y1995 .hero,
html.mode-y1995 .section,
html.mode-y1995 .projects,
html.mode-y1995 .stratum,
html.mode-y1995 .footer,
html.mode-y1995 .ticker,
html.mode-y1995 .feat,
html.mode-y1995 .feat__art,
html.mode-y1995 .header {
  background: #c0c0c0 !important;
  color: #000 !important;
}

html.mode-y1995 a,
html.mode-y1995 .accent,
html.mode-y1995 em.s { color: #0000ee !important; text-decoration: underline; }

html.mode-y1995 .hero__title,
html.mode-y1995 .h2,
html.mode-y1995 .summit__title {
  color: #ff00ff !important;
  -webkit-text-stroke: 0;
}

html.mode-y1995 .term,
html.mode-y1995 .editor,
html.mode-y1995 .feat {
  border: 3px outset #fff !important;
  background: #000 !important;
  color: #0f0 !important;
}

html.mode-y1995 .term__body,
html.mode-y1995 .term__body * { color: #0f0 !important; font-family: "Courier New", monospace !important; }

html.mode-y1995 .magnetic,
html.mode-y1995 .filters button,
html.mode-y1995 .kbd {
  background: #c0c0c0 !important;
  color: #000 !important;
  border: 3px outset #fff !important;
}

.y95-banner {
  position: relative;
  z-index: 60;
  background: #000080;
  color: #ffff00;
  font-family: "Comic Sans MS", "Times New Roman", serif;
  font-size: 15px;
  padding: 6px 0;
  overflow: hidden;
}

.y95-marquee { overflow: hidden; white-space: nowrap; }
.y95-marquee span { display: inline-block; padding-left: 100%; animation: y95-scroll 16s linear infinite; }

@keyframes y95-scroll {
  to { transform: translateX(-100%); }
}

.y95-row {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  padding-top: 4px;
  font-size: 13px;
  color: #fff;
}

.y95-construction {
  background: repeating-linear-gradient(45deg, #ffcc00 0 10px, #000 10px 20px);
  color: #fff;
  padding: 0 8px;
  font-weight: 700;
  -webkit-text-stroke: 0.5px #000;
}

.y95-counter {
  background: #000;
  color: #0f0;
  padding: 0 4px;
  font-family: "Courier New", monospace;
}

/* ---------- toast (Konami, mode changes) ------------------------------ */
.mode-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 120;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 1px solid var(--rule-accent);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* ---------- terminal extras: games, grep, themes ---------------------- */
.term__body .grep-hit { color: var(--bg); background: var(--accent); }
.term__body .snake-body { color: var(--accent); font-weight: 700; }
.term__body .snake-food { color: var(--orange); font-weight: 700; }
.term__body .snake-msg { color: var(--yellow); font-weight: 700; }
.term__body .vim-tilde { color: #3b5bdb; }
.term__body .vim-mode { font-weight: 700; }
.term__body .vim-status { display: inline-block; width: 100%; background: var(--fg-2); color: var(--bg); }
.term__body .ln.game { line-height: 1.15; }

.term.term--dracula { --panel: rgba(40, 42, 54, 0.95); --fg-2: #f8f8f2; --mute: #6272a4; --accent: #50fa7b; --cyan: #8be9fd; --purple: #bd93f9; --orange: #ffb86c; --red: #ff5555; --yellow: #f1fa8c; }
.term.term--solarized { --panel: rgba(0, 43, 54, 0.96); --fg-2: #93a1a1; --mute: #586e75; --accent: #859900; --cyan: #2aa198; --purple: #6c71c4; --orange: #cb4b16; --red: #dc322f; --yellow: #b58900; }
.term.term--monokai { --panel: rgba(39, 40, 34, 0.96); --fg-2: #f8f8f2; --mute: #75715e; --accent: #a6e22e; --cyan: #66d9ef; --purple: #ae81ff; --orange: #fd971f; --red: #f92672; --yellow: #e6db74; }
.term.term--gruvbox { --panel: rgba(40, 40, 40, 0.96); --fg-2: #ebdbb2; --mute: #928374; --accent: #b8bb26; --cyan: #83a598; --purple: #d3869b; --orange: #fe8019; --red: #fb4934; --yellow: #fabd2f; }

/* ---------- guided tour (js/tour.js) ---------------------------------- */
.tour-chip {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 97;
  width: min(380px, calc(100vw - 32px));
  padding: 14px 16px 12px;
  border: 1px solid rgba(217, 119, 87, 0.6);
  border-radius: 12px;
  background: #1a1816;
  color: #ece7df;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 60px -20px rgba(217, 119, 87, 0.5);
}

.tour-chip__head { display: flex; justify-content: space-between; align-items: center; color: #d97757; margin-bottom: 6px; }
.tour-chip__step { color: #8b857d; font-size: 11px; }
.tour-chip__text { min-height: 4.8em; }
.tour-chip__text b { color: #fff; }
.tour-chip__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.tour-chip__dots { display: flex; gap: 5px; }
.tour-chip__dots i { width: 6px; height: 6px; border-radius: 50%; background: #5f5a54; }
.tour-chip__dots i.is-on { background: #d97757; }

.tour-chip button {
  padding: 5px 10px;
  border: 1px solid #5f5a54;
  border-radius: 6px;
  background: none;
  color: #ece7df;
  font-family: var(--mono);
  font-size: 12px;
}

.tour-chip button.tour-chip__next { border-color: #d97757; color: #d97757; }
.tour-chip button:hover { background: rgba(217, 119, 87, 0.12); }

.tour-focus {
  outline: 2px solid #d97757 !important;
  outline-offset: 8px;
  border-radius: 6px;
  transition: outline-color 0.3s;
  animation: tour-pulse 1.6s ease-in-out infinite;
}

@keyframes tour-pulse {
  50% { outline-color: rgba(217, 119, 87, 0.35); }
}

.is-spotlight {
  outline: 2px solid #d97757 !important;
  outline-offset: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45), 0 0 80px rgba(217, 119, 87, 0.5) !important;
  position: relative;
  z-index: 5;
  transition: box-shadow 0.4s;
}

.term.is-running .ln.prompt { display: none; }
