/* ==========================================================================
   Rishi Porwal — Lofi Portfolio
   Pure CSS — no Tailwind, no preprocessor
   ========================================================================== */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; /* JS handles smooth scroll */ cursor: none; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; cursor: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: none; }
a { color: inherit; cursor: none; }
input, textarea, select { cursor: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Custom cursor */
.cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lofi-text); pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 150ms ease, height 150ms ease, background 150ms ease;
}
.cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9998;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--lofi-accent);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 250ms cubic-bezier(.22,.61,.36,1), height 250ms cubic-bezier(.22,.61,.36,1),
             border-color 200ms ease, opacity 200ms ease;
  opacity: 0.6;
}
.cursor-hover .cursor-dot {
  width: 14px; height: 14px;
  background: var(--lofi-accent);
}
.cursor-hover .cursor-ring {
  width: 50px; height: 50px;
  border-color: var(--lofi-accent-hover);
  opacity: 0.4;
}
@media (pointer: coarse), (hover: none) {
  .cursor-dot, .cursor-ring { display: none !important; }
  html, body, button, a, input, textarea, select { cursor: auto; }
}

/* Design tokens */
:root {
  --lofi-bg: #FAF7F2;
  --lofi-text: #1A1A1A;
  --lofi-muted: #5C5A56;
  --lofi-accent: #7C8BA1;
  --lofi-accent-hover: #5A6D88;
  --lofi-accent-light: #EBE4D8;
  --lofi-terminal-bg: #1B2028;
  --lofi-terminal-text: #A0C1B8;
  --lofi-terminal-prompt: #F4D160;
  --lofi-border-width: 3px;
  --lofi-radius: 12px;
  --font-sans-lofi: 'Outfit', sans-serif;
  --font-display-lofi: 'Fredoka', sans-serif;
  --font-mono-lofi: 'VT323', monospace;
}

.lofi-page {
  background-color: var(--lofi-bg);
  color: var(--lofi-text);
  font-family: var(--font-sans-lofi);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
}

/* ========== Nav ========== */
.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 0 12px 0;
  font-family: var(--font-display-lofi);
  font-size: 1.1rem;
}
.nav-link {
  color: var(--lofi-text);
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.2s ease, color 0.2s ease;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 2px;
  background-color: var(--lofi-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.2s ease-in-out;
}
.nav-link:hover { transform: translateY(-2px); color: var(--lofi-accent); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-sep { color: var(--lofi-accent); opacity: 0.6; }

/* ========== Hero ========== */
.hero-container {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1.08fr 1.2fr;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 80px 40px;
  gap: 30px;
  width: 100%;
  overflow: visible;
}
.hero-left { display: flex; flex-direction: column; gap: 28px; }
.greeting-box { display: flex; flex-direction: column; gap: 12px; }
.typewriter-line { font-family: var(--font-mono-lofi); font-size: 2.2rem; color: var(--lofi-accent); font-weight: 400; height: 40px; }
.cursor { font-weight: 300; animation: lofi-blink 0.8s infinite; }
.main-heading { font-family: var(--font-display-lofi); font-size: 2.8rem; font-weight: 700; line-height: 1.15; }
.name-accent { color: var(--lofi-accent); position: relative; display: inline-block; }
.name-accent::after { content: ''; position: absolute; bottom: 4px; left: 0; width: 100%; height: 8px; background-color: var(--lofi-accent-light); z-index: -1; border-radius: 4px; }
.cute-face { font-size: 1.8rem; font-weight: 500; color: var(--lofi-accent); display: inline-block; animation: lofi-float-slow 3s ease-in-out infinite alternate; }
.bio-text { font-size: 1.15rem; color: var(--lofi-muted); line-height: 1.6; max-width: 520px; }

/* ========== Terminal ========== */
.terminal {
  background-color: var(--lofi-terminal-bg);
  border: var(--lofi-border-width) solid var(--lofi-text);
  border-radius: var(--lofi-radius);
  box-shadow: 4px 4px 0px var(--lofi-text);
  overflow: hidden; width: 100%; max-width: 480px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.terminal:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0px var(--lofi-text); }
.terminal-header {
  background-color: var(--lofi-accent-light);
  border-bottom: var(--lofi-border-width) solid var(--lofi-text);
  padding: 10px 14px; display: flex; align-items: center; justify-content: space-between;
}
.terminal-dots { display: flex; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--lofi-text); }
.dot.red { background-color: #FF8F8F; }
.dot.yellow { background-color: #FFE48F; }
.dot.green { background-color: #8FFF9F; }
.terminal-title { font-family: var(--font-mono-lofi); font-size: 1.05rem; font-weight: 700; color: var(--lofi-text); letter-spacing: 0.5px; }
.terminal-body {
  padding: 16px;
  height: 112px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.terminal-line {
  font-family: var(--font-mono-lofi);
  font-size: 1.25rem;
  color: var(--lofi-terminal-text);
  line-height: 1.4;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}
.prompt { color: var(--lofi-terminal-prompt); font-weight: 700; margin-right: 8px; }
.char-cursor { display: inline-block; width: 10px; background-color: var(--lofi-terminal-text); margin-left: 5px; animation: lofi-blink 1s step-end infinite; }

/* ========== Buttons ========== */
.cta-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  font-family: var(--font-display-lofi); font-size: 1.1rem; font-weight: 600; text-decoration: none;
  padding: 12px 28px; border-radius: var(--lofi-radius);
  border: var(--lofi-border-width) solid var(--lofi-text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s cubic-bezier(0.175,0.885,0.32,1.275), box-shadow 0.15s cubic-bezier(0.175,0.885,0.32,1.275);
  cursor: pointer; background: transparent;
}
.btn-primary { background-color: var(--lofi-accent); color: var(--lofi-bg); box-shadow: 4px 4px 0px var(--lofi-text); }
.btn-primary:hover { transform: translate(-3px,-3px); box-shadow: 7px 7px 0px var(--lofi-text); background-color: var(--lofi-accent-hover); }
.btn-primary:active { transform: translate(1px,1px); box-shadow: 2px 2px 0px var(--lofi-text); }
.btn-primary:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: 4px 4px 0px var(--lofi-text); }
.btn-secondary { background-color: transparent; color: var(--lofi-text); box-shadow: 4px 4px 0px var(--lofi-text); }
.btn-secondary:hover { transform: translate(-3px,-3px); box-shadow: 7px 7px 0px var(--lofi-text); background-color: var(--lofi-accent-light); }
.btn-secondary:active { transform: translate(1px,1px); box-shadow: 2px 2px 0px var(--lofi-text); }
.btn-ghost {
  background: transparent; color: var(--lofi-muted);
  border: 2px dashed var(--lofi-muted); box-shadow: none;
}
.btn-ghost:hover { background: var(--lofi-accent-light); color: var(--lofi-text); border-style: solid; border-color: var(--lofi-text); }

/* ========== Hero right / room ========== */
.hero-right { display: flex; align-items: center; justify-content: center; }
.interactive-image-container {
  position: relative; width: 100%; max-width: 650px;
  aspect-ratio: 2404 / 1760;
  filter: drop-shadow(4px 4px 0px rgba(26,26,26,0.05));
  border-radius: var(--lofi-radius); overflow: visible; background-color: transparent;
  user-select: none; container-type: inline-size;
}
.hero-image { width: 100%; height: 100%; object-fit: contain; display: block; }
.layered-asset {
  position: absolute; pointer-events: auto; object-fit: contain; z-index: 10; cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  will-change: transform, filter; transform: translateZ(0); backface-visibility: hidden;
  filter: drop-shadow(0px 0px 0px rgba(124,139,161,0));
  user-select: none;
}
.layered-asset:hover { filter: drop-shadow(0px 0px 8px rgba(124,139,161,0.35)); }
.image-hotspot { position: absolute; cursor: pointer; background-color: transparent; border: none; outline: none; }
#hotspot-laptop:hover { transform: scale(1.02); }
#hotspot-character:hover { transform: scale(1.01) translateY(-2px); }
#hotspot-backpack:hover { transform: scale(1.03) rotate(2deg); }
#hotspot-table:hover { transform: scale(1.005); }
#hotspot-chessboard:hover { transform: scale(1.02); }
#hotspot-hustle:hover { transform: scale(1.05) translateY(-2px); }
#hotspot-kaws:hover { transform: scale(1.08) rotate(-3deg); }
#hotspot-notebook:hover { transform: scale(1.03); }
#hotspot-phone:hover { transform: scale(1.05); }
#hotspot-gameboy:hover { transform: scale(1.04) rotate(3deg); }
#hotspot-soccerball:hover { transform: scale(1.05) rotate(15deg); }

/* ========== Profile cloud ========== */
.profile-cloud-wrapper {
  position: absolute; top: -6%; left: 66%; width: 32%; z-index: 100;
  opacity: 0; transform: scale(0.8) translateY(15px);
  transition: opacity 0.3s cubic-bezier(0.34,1.56,0.64,1), transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
#hotspot-character:hover ~ .profile-cloud-wrapper,
.profile-cloud-wrapper:hover {
  opacity: 1; transform: scale(1) translateY(0); pointer-events: auto;
}
.profile-cloud-float { position: relative; width: 100%; animation: lofi-cloudFloat 4s ease-in-out infinite alternate; }
.profile-cloud-body {
  background-color: var(--lofi-bg); border: var(--lofi-border-width) solid var(--lofi-text);
  border-radius: 18px; padding: 5% 6%; box-shadow: 4px 4px 0px var(--lofi-text);
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 3px;
}
.profile-cloud-title { font-family: var(--font-display-lofi); font-weight: 700; color: var(--lofi-accent); font-size: clamp(13px, 3.2cqi, 22px); margin-bottom: 4%; border-bottom: 2px solid var(--lofi-accent-light); padding-bottom: 2%; }
.profile-cloud-row { font-family: var(--font-sans-lofi); color: var(--lofi-muted); font-size: clamp(9px, 2cqi, 13px); line-height: 1.35; display: flex; justify-content: space-between; gap: 8px; }
.profile-cloud-row .label { font-family: var(--font-mono-lofi); color: var(--lofi-accent); text-transform: uppercase; letter-spacing: 0.5px; font-size: clamp(8px, 1.85cqi, 12px); }
.profile-cloud-row .value { color: var(--lofi-text); text-align: right; }
.thought-bubble-dot { position: absolute; background-color: var(--lofi-bg); border: var(--lofi-border-width) solid var(--lofi-text); border-radius: 50%; z-index: 1; }
.thought-bubble-dot.dot-1 { width: 16%; aspect-ratio: 1; bottom: -15%; left: 18%; box-shadow: -3px 3px 0px var(--lofi-text); }
.thought-bubble-dot.dot-2 { width: 11%; aspect-ratio: 1; bottom: -32%; left: 8%; box-shadow: -2px 2px 0px var(--lofi-text); }
.thought-bubble-dot.dot-3 { width: 7%; aspect-ratio: 1; bottom: -46%; left: 0%; box-shadow: -1.5px 1.5px 0px var(--lofi-text); }

/* ========== Polaroid cloud ========== */
.polaroid-cloud {
  position: absolute; width: 34%; max-width: 230px; min-width: 170px; z-index: 90;
  opacity: 0; transform: scale(0.85) translateY(15px) rotate(var(--pol-rot, -4deg));
  transition:
    opacity 0.35s cubic-bezier(.22,.61,.36,1),
    transform 0.4s cubic-bezier(.34,1.56,.64,1),
    top 0.4s cubic-bezier(.22,.61,.36,1),
    left 0.4s cubic-bezier(.22,.61,.36,1),
    right 0.4s cubic-bezier(.22,.61,.36,1);
  pointer-events: none;
}
.polaroid-cloud.is-active { opacity: 1; transform: scale(1) translateY(0) rotate(var(--pol-rot, -3deg)); }
.polaroid-card {
  background: #fdfcf7;
  padding: 12px 12px 20px 12px;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  animation: lofi-cloudFloat 4s ease-in-out infinite alternate;
  display: flex; flex-direction: column;
}
.polaroid-photo {
  width: 100%; aspect-ratio: 1 / 1; height: auto; max-height: none; object-fit: cover;
  border-radius: 14px; display: block; background: #eee;
  border: none;
}
.polaroid-caption {
  font-family: var(--font-display-lofi);
  text-align: center; margin-top: 14px;
  font-size: clamp(0.85rem, 2.2cqi, 1.05rem); font-weight: 500;
  color: #2b2a26; letter-spacing: 0.2px; line-height: 1.3;
  white-space: normal; overflow: visible;
}

/* ========== Ticker ========== */
.ticker-tape {
  background-color: var(--lofi-text); color: var(--lofi-bg);
  padding: 16px 0; border-top: var(--lofi-border-width) solid var(--lofi-text);
  overflow: hidden; width: 100vw; position: relative;
  left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
}
.marquee { display: flex; overflow: hidden; user-select: none; width: 100%; }
.marquee-group {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-around;
  min-width: 100%;
  animation: lofi-scrollMarquee 24s linear infinite;
  font-family: var(--font-display-lofi); font-size: 0.95rem; font-weight: 700; letter-spacing: 2px;
}

/* ========== Sections ========== */
.lofi-section {
  flex-grow: 1; max-width: 1200px; margin: 0 auto;
  padding: 20px 40px 60px 40px; width: 100%;
  position: relative; overflow: visible;
}
#projects { padding-top: 0; margin-top: 0; }
.section-heading {
  font-family: var(--font-display-lofi); font-size: 2.6rem; font-weight: 700;
  color: var(--lofi-text); margin-bottom: 8px;
}
.section-heading .name-accent { color: var(--lofi-accent); }
.section-sub {
  font-family: var(--font-mono-lofi); color: var(--lofi-accent);
  font-size: 1.25rem; margin-bottom: 32px;
}

/* ========== Card grid (projects) ========== */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px;
}
.lofi-card {
  background-color: var(--lofi-bg);
  border: var(--lofi-border-width) solid var(--lofi-text);
  border-radius: var(--lofi-radius);
  box-shadow: 6px 6px 0px var(--lofi-text);
  padding: 22px; display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none; color: inherit;
}
.lofi-card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0px var(--lofi-text); }
.card-tag {
  font-family: var(--font-mono-lofi); font-size: 0.95rem; color: var(--lofi-accent);
  text-transform: uppercase; letter-spacing: 1px;
}
.card-title { font-family: var(--font-display-lofi); font-size: 1.5rem; font-weight: 700; color: var(--lofi-text); }
.card-desc { color: var(--lofi-muted); line-height: 1.5; font-size: 1rem; flex-grow: 1; }
.card-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.card-chip {
  font-family: var(--font-mono-lofi); background-color: var(--lofi-accent-light);
  border: 2px solid var(--lofi-text); padding: 2px 10px; border-radius: 999px;
  font-size: 0.9rem; color: var(--lofi-text);
}

/* ========== Playground ========== */
#playground { max-width: 1200px; margin: 0 auto; }
.playground-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.playground-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; width: 100%; }
@media (max-width: 680px) {
  .playground-duo { grid-template-columns: 1fr; gap: 20px; }
}
.play-tile {
  background-color: #FAF7F2;
  border: 3px solid #1A1A1A;
  border-radius: 20px;
  box-shadow: 7px 7px 0px #1A1A1A;
  padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 420px;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.play-title { font-family: var(--font-display-lofi); font-size: 1.55rem; font-weight: 700; color: #1A1A1A; line-height: 1.2; }
.play-note { font-family: var(--font-mono-lofi); color: #5A6D88; font-size: 1.05rem; margin-top: -4px; }

/* Typing challenge */
.typing-paragraph {
  font-family: var(--font-mono-lofi); font-size: 1.02rem; line-height: 1.7;
  padding: 18px 20px; background: linear-gradient(135deg, #F5F1E8 0%, #EBE4D8 100%);
  border: 2px solid var(--lofi-text); border-radius: 14px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.06), 3px 3px 0 var(--lofi-text);
  overflow: hidden; letter-spacing: 0.03em;
  word-break: break-word;
}
.tp-char {
  transition: color 120ms ease, background-color 120ms ease;
  border-radius: 2px; padding: 0 0.5px;
}
.tp-untyped { color: #A09D96; }
.tp-correct { color: #1A1A1A; font-weight: 600; }
.tp-wrong {
  color: #fff; background-color: #D94F4F; border-radius: 3px; padding: 1px 1px;
  text-decoration: none;
  animation: tp-shake 200ms ease;
}
.typing-cursor-char {
  background: var(--lofi-accent) !important; color: var(--lofi-bg) !important;
  border-radius: 3px; padding: 1px 1px;
  animation: typing-cursor-pulse 1s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(124,139,161,0.5);
}
@keyframes tp-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
@keyframes typing-cursor-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(124,139,161,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 4px rgba(124,139,161,0.2); }
}
.typing-input {
  padding: 12px 14px; border: 3px solid #1A1A1A; border-radius: 12px;
  font-family: var(--font-mono-lofi); background: #FAF7F2; color: #1A1A1A;
  font-size: 0.98rem; resize: none; min-height: 96px; line-height: 1.45; outline: none;
  width: 100%;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.typing-input:focus { box-shadow: 0 0 0 3px rgba(124,139,161,0.4); border-color: var(--lofi-accent); }
.typing-stats {
  display: flex; gap: 12px; font-family: var(--font-mono-lofi); flex-wrap: wrap; font-size: 0.92rem;
}
.typing-stats span {
  background: var(--lofi-accent-light); border: 2px solid var(--lofi-text);
  border-radius: 8px; padding: 4px 10px; color: #5C5A56; font-weight: 600;
}
.typing-stats b { color: var(--lofi-accent-hover); font-weight: 800; }
#typing-reset {
  padding: 8px 24px; border-radius: 10px; border: 3px solid #1A1A1A;
  background: #FAF7F2; font-family: var(--font-display-lofi); font-size: 1.05rem; font-weight: 700;
  color: #1A1A1A; box-shadow: 3px 3px 0px #1A1A1A; cursor: pointer; margin-top: auto;
  align-self: flex-start; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#typing-reset:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0px #1A1A1A; }
#typing-reset:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0px #1A1A1A; }

/* ========== Riddle tile ========== */
.riddle-tile { min-height: 420px; display: flex; flex-direction: column; gap: 12px; }
.riddle-panel { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.riddle-lead { font-family: var(--font-mono-lofi); color: #1A1A1A; font-size: 0.98rem; line-height: 1.55; margin: 0; }
.riddle-highlight { color: #5A6D88; font-weight: 700; }
.riddle-start-btn {
  width: 100%; padding: 14px 18px; background-color: #73869C; color: #FFFFFF;
  font-family: var(--font-display-lofi); font-size: 1.15rem; font-weight: 700;
  border: 3px solid #1A1A1A; border-radius: 12px; box-shadow: 4px 4px 0px #1A1A1A;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  margin-top: auto; text-align: center; display: inline-flex; align-items: center; justify-content: center;
}
.riddle-start-btn:hover { background-color: #5E7187; transform: translate(-2px, -2px); box-shadow: 6px 6px 0px #1A1A1A; }
.riddle-start-btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0px #1A1A1A; }
.riddle-start-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0px #1A1A1A; }
.riddle-clues { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.riddle-clue {
  background: #FAF7F2; border: 2px solid #1A1A1A; border-radius: 12px;
  padding: 10px 14px; font-family: var(--font-mono-lofi); text-align: left; cursor: pointer;
  box-shadow: 3px 3px 0 #1A1A1A; transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column; gap: 6px;
}
.riddle-clue:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 #1A1A1A; }
.riddle-clue.is-open { background: var(--lofi-accent-light); }
.riddle-clue-label { color: #5A6D88; font-weight: 700; font-size: 0.98rem; }
.riddle-clue-detail { color: #1A1A1A; font-size: 0.9rem; line-height: 1.5; }
.riddle-suspects { display: flex; flex-direction: column; gap: 10px; }
.riddle-suspect {
  background: #FAF7F2; border: 2px solid #1A1A1A; border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; text-align: left;
  cursor: pointer; box-shadow: 3px 3px 0 #1A1A1A;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.riddle-suspect:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 #1A1A1A; }
.riddle-suspect.is-selected { background: var(--lofi-accent-light); box-shadow: inset 0 0 0 2px #5A6D88, 3px 3px 0 #1A1A1A; }
.riddle-suspect-name { font-family: var(--font-display-lofi); font-weight: 700; color: #1A1A1A; font-size: 1.1rem; }
.riddle-suspect-motive { font-family: var(--font-mono-lofi); color: #5C5A56; font-size: 0.9rem; }
.riddle-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.riddle-verdict {
  font-family: var(--font-display-lofi); font-weight: 700; font-size: 1.5rem;
  padding: 8px 16px; border-radius: 12px; border: 3px solid #1A1A1A;
  width: fit-content; box-shadow: 4px 4px 0 #1A1A1A;
}
.riddle-verdict--correct { background: #73869C; color: #FFFFFF; }
.riddle-verdict--wrong { background: #E86A6A; color: #FFFFFF; }

/* ========== Contact ========== */
.contact-card {
  max-width: 720px; margin: 0 auto; background: var(--lofi-bg);
  border: var(--lofi-border-width) solid var(--lofi-text); border-radius: 22px;
  box-shadow: 6px 6px 0 var(--lofi-text); padding: clamp(20px, 3vw, 32px);
  display: flex; flex-direction: column; gap: 18px;
}
.contact-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.contact-label { font-family: var(--font-mono-lofi); text-transform: uppercase; letter-spacing: 1px; color: var(--lofi-accent); font-size: 0.85rem; }
.contact-email {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--lofi-terminal-bg); color: var(--lofi-terminal-text);
  font-family: var(--font-mono-lofi); font-size: 1.05rem;
  padding: 10px 14px; border-radius: 10px; border: 2px solid var(--lofi-text); cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.contact-email:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--lofi-text); }
.contact-copy {
  font-size: 0.75rem; padding: 2px 8px; border-radius: 999px;
  background: var(--lofi-terminal-prompt); color: var(--lofi-terminal-bg); font-weight: 700;
}
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 2px solid var(--lofi-text);
  background: var(--lofi-bg); font-family: var(--font-sans-lofi); font-weight: 600;
  color: var(--lofi-text); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.contact-chip:hover { transform: translate(-2px,-2px); box-shadow: 3px 3px 0 var(--lofi-text); background: var(--lofi-accent-light); }
.contact-chip-mark {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  background: var(--lofi-accent); color: var(--lofi-bg);
  font-family: var(--font-mono-lofi); font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
}
.contact-hint { font-family: var(--font-mono-lofi); font-size: 0.85rem; color: var(--lofi-muted); }

/* ========== Back to top ========== */
.back-to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--lofi-accent); color: var(--lofi-bg);
  border: 2px solid var(--lofi-text); box-shadow: 3px 3px 0 var(--lofi-text);
  font-size: 1.2rem; font-weight: 800; cursor: pointer;
  opacity: 0; transform: translateY(10px) scale(0.9);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
  pointer-events: none;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { transform: translate(-2px,-4px); box-shadow: 5px 6px 0 var(--lofi-text); }

/* ========== Chess modal ========== */
.chess-modal {
  position: fixed; inset: 0; background: rgba(20,18,15,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px; backdrop-filter: blur(2px);
}
.chess-panel {
  background: var(--lofi-bg); border: 3px solid var(--lofi-text);
  border-radius: 16px; box-shadow: 8px 8px 0 var(--lofi-text);
  padding: 16px; max-width: min(92vw, 520px); width: 100%;
  display: flex; flex-direction: column; gap: 12px;
  font-family: var(--font-mono-lofi);
}
.chess-header { display: flex; justify-content: space-between; align-items: center; }
.chess-title { font-weight: 700; color: var(--lofi-text); }
.chess-close { background: transparent; border: none; font-size: 1.6rem; cursor: pointer; color: var(--lofi-text); line-height: 1; }
.chess-status { color: var(--lofi-muted); font-size: 0.9rem; }
.chess-board {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1 / 1; width: 100%; border: 3px solid var(--lofi-text);
  border-radius: 8px; overflow: hidden; position: relative;
}
.chess-sq { border: none; padding: 0; cursor: pointer; position: relative; width: 100%; height: 100%; }
.chess-sq.light { background: #EBE4D8; }
.chess-sq.dark { background: #7C8BA1; }
.chess-sq.sel { box-shadow: inset 0 0 0 3px #F4D160; }
.chess-sq.tgt::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 30%; height: 30%; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(27,32,40,0.35);
}
.chess-board .chess-piece {
  position: absolute; top: 0; left: 0; width: 12.5%; height: 12.5%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.4rem, 5vw, 2.4rem); line-height: 1;
  user-select: none; pointer-events: none;
  transition: transform 320ms cubic-bezier(.22,.61,.36,1), opacity 280ms ease;
  will-change: transform, opacity;
}
.chess-piece-captured {
  opacity: 0 !important;
  transform: scale(0.3) !important;
  transition: transform 280ms ease, opacity 280ms ease !important;
}
.chess-piece-enter {
  opacity: 0;
  transform: scale(0.4);
}
.chess-sq.last-move {
  background: rgba(244, 209, 96, 0.45) !important;
}
.chess-actions { display: flex; gap: 8px; justify-content: flex-end; }
.promo-overlay {
  position: absolute; inset: 0; background: rgba(20, 18, 14, 0.55);
  display: flex; align-items: center; justify-content: center; border-radius: inherit; z-index: 10;
}
.promo-panel {
  background: #fdfcf7; border: 2px solid #2b2a26; border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); text-align: center;
}
.promo-title { font-family: var(--font-mono-lofi); font-size: 20px; margin-bottom: 8px; }
.promo-choices { display: flex; gap: 8px; }
.promo-btn {
  width: 56px; height: 56px; font-size: 36px; line-height: 1;
  background: #f5f1e6; border: 2px solid #2b2a26; border-radius: 10px;
  cursor: pointer; transition: transform 120ms ease, background 120ms ease;
}
.promo-btn:hover { transform: translateY(-2px); background: #ebe4d1; }

/* ========== Toothless modal ========== */
.toothless-modal {
  position: fixed; inset: 0; background: rgba(20,18,15,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 220; padding: 16px; backdrop-filter: blur(2px);
  animation: fade-in 0.25s ease-out;
}
.toothless-panel {
  position: relative; background: var(--lofi-bg); border: 3px solid var(--lofi-text);
  border-radius: 20px; box-shadow: 10px 10px 0 var(--lofi-text);
  padding: 28px 32px 32px; max-width: min(92vw, 460px); width: 100%;
  font-family: var(--font-mono-lofi); animation: scale-in 0.3s ease-out;
}
.toothless-close { position: absolute; top: 8px; right: 14px; background: transparent; border: none; font-size: 1.8rem; cursor: pointer; color: var(--lofi-text); line-height: 1; }
.toothless-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.toothless-bubble {
  background: #fff; border: 2px solid var(--lofi-text); border-radius: 14px;
  padding: 10px 16px; font-size: clamp(0.95rem, 2.4vw, 1.15rem); color: var(--lofi-text);
  position: relative; box-shadow: 4px 4px 0 var(--lofi-text);
}
.toothless-bubble::after {
  content: ""; position: absolute; bottom: -12px; left: 50%;
  width: 16px; height: 16px; background: #fff;
  border-right: 2px solid var(--lofi-text); border-bottom: 2px solid var(--lofi-text);
  transform: translateX(-50%) rotate(45deg);
}
.toothless-wink { display: inline-block; animation: toothless-wink 2.2s ease-in-out infinite; transform-origin: center; }
.toothless-figure { width: clamp(180px, 45vw, 280px); height: auto; animation: toothless-bob 2.8s ease-in-out infinite; filter: drop-shadow(4px 6px 0 rgba(27,32,40,0.2)); }

/* ========== Console / Snake game ========== */
.console-modal {
  position: fixed; inset: 0; background: rgba(20,18,15,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 230; padding: 16px; backdrop-filter: blur(2px);
  animation: fade-in 0.25s ease-out;
}
.console-shell {
  position: relative; background: #e8e1d5; border: 4px solid var(--lofi-text);
  border-radius: 22px; box-shadow: 12px 12px 0 var(--lofi-text);
  padding: 18px 22px 22px; max-width: min(94vw, 520px); width: 100%;
  font-family: var(--font-mono-lofi); animation: scale-in 0.3s ease-out;
  display: flex; flex-direction: column; gap: 14px;
}
.console-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.console-dots { display: flex; gap: 6px; }
.console-title { font-family: var(--font-display-lofi); font-weight: 700; color: var(--lofi-text); font-size: 1.1rem; flex: 1; text-align: center; }
.console-close { background: transparent; border: none; font-size: 1.8rem; cursor: pointer; color: var(--lofi-text); line-height: 1; padding: 0; margin-right: -4px; }
.console-screen {
  position: relative; background: #8ea37d; border: 4px solid var(--lofi-text);
  border-radius: 14px; padding: 10px; box-shadow: inset 0 0 16px rgba(0,0,0,0.2); outline: none;
}
.console-status { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono-lofi); font-size: 0.85rem; color: #2b3a26; margin-bottom: 8px; flex-wrap: wrap; }
.console-status b { color: var(--lofi-text); }
.snake-grid { display: grid; gap: 2px; background: #7a8d6b; padding: 6px; border-radius: 8px; justify-content: center; margin: 0 auto; border: 2px solid #5c6b4f; }
.snake-cell { width: 100%; height: 100%; border-radius: 3px; }
.snake-cell.snake-head { background: #1b2028; border-radius: 5px; }
.snake-cell.snake-body { background: #3a3a3a; }
.snake-cell.snake-food { background: #e86a6a; border-radius: 50%; animation: food-pulse 0.8s ease-in-out infinite; }
.console-overlay {
  position: absolute; inset: 0; background: rgba(27,32,40,0.85);
  border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: #fff;
}
.console-overlay-text { font-family: var(--font-display-lofi); font-size: 1.8rem; font-weight: 700; }
.console-overlay-score { font-size: 1rem; }
.console-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dpad { display: grid; grid-template-columns: 44px 44px 44px; grid-template-rows: 44px 44px 44px; gap: 4px; }
.dpad-btn {
  background: #d6cbb7; border: 2px solid var(--lofi-text); border-radius: 8px;
  color: var(--lofi-text); font-size: 1rem; cursor: pointer;
  box-shadow: 2px 2px 0 var(--lofi-text); transition: transform 0.1s ease, box-shadow 0.1s ease;
  display: flex; align-items: center; justify-content: center;
}
.dpad-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 transparent; }
.dpad-btn:disabled { opacity: 0.4; cursor: default; }
.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; background: #c4b8a2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }
.console-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.console-action-btn {
  background: var(--lofi-bg); border: 2px solid var(--lofi-text); border-radius: 10px;
  padding: 8px 18px; font-family: var(--font-display-lofi); font-weight: 700;
  color: var(--lofi-text); cursor: pointer; box-shadow: 3px 3px 0 var(--lofi-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.console-action-btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--lofi-text); }
.console-action-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--lofi-text); }
.console-action-btn--accent { background: var(--lofi-accent); color: #fff; }
.console-hint { text-align: center; color: var(--lofi-muted); font-size: 0.85rem; margin: 0; }
@media (max-width: 540px) {
  .console-controls { flex-direction: column; align-items: center; }
  .console-actions { align-items: center; }
}

/* ========== Hidden modals ========== */
.modal-hidden { display: none !important; }

/* ========== Animations ========== */
@keyframes lofi-blink { 50% { opacity: 0; } }
@keyframes lofi-float-slow { 0% { transform: translateY(0) rotate(0deg); } 100% { transform: translateY(-4px) rotate(3deg); } }
@keyframes lofi-cloudFloat { 0% { transform: translateY(0); } 100% { transform: translateY(-6px); } }
@keyframes lofi-scrollMarquee { 0% { transform: translateX(0%); } 100% { transform: translateX(-100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes food-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.85); } }
@keyframes toothless-wink { 0%, 40%, 60%, 100% { transform: scale(1); } 48%, 52% { transform: scale(1, 0.15); } }
@keyframes toothless-bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }


/* ========== Responsive ========== */
@media (max-width: 992px) {
  .hero-container { grid-template-columns: 1fr; gap: 40px; padding: 20px 24px 60px 24px; text-align: center; }
  .hero-left { align-items: center; }
  .bio-text { margin: 0 auto; }
  .terminal { margin: 0 auto; }
  .cta-buttons { justify-content: center; }
}
@media (max-width: 576px) {
  .main-heading { font-size: 2.2rem; }
  .typewriter-line { font-size: 1.6rem; height: 30px; }
  .cute-face { font-size: 1.4rem; }
  .terminal-line { font-size: 1.05rem; }
  .btn { padding: 10px 20px; font-size: 0.95rem; }
  .ticker-tape { padding: 12px 0; }
  .section-heading { font-size: 2rem; }
}

/* ========== Scroll reveal — dramatic bidirectional ========== */
.reveal {
  opacity: 0;
  filter: blur(8px);
  transition:
    opacity 700ms cubic-bezier(.16,1,.3,1),
    transform 800ms cubic-bezier(.16,1,.3,1),
    filter 700ms cubic-bezier(.16,1,.3,1);
  will-change: transform, opacity, filter;
}

/* Default: slide up + scale down + blur */
.reveal { transform: translateY(60px) scale(0.92); }
.reveal.is-visible { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }

/* Variant: slide from left */
.reveal-left { transform: translateX(-80px) rotate(-4deg) scale(0.9); }
.reveal-left.is-visible { transform: translateX(0) rotate(0) scale(1); }

/* Variant: slide from right */
.reveal-right { transform: translateX(80px) rotate(4deg) scale(0.9); }
.reveal-right.is-visible { transform: translateX(0) rotate(0) scale(1); }

/* Variant: scale pop */
.reveal-pop { transform: scale(0.6) rotate(-2deg); }
.reveal-pop.is-visible { transform: scale(1) rotate(0); }

/* Variant: 3D flip */
.reveal-flip { transform: perspective(800px) rotateX(25deg) translateY(40px) scale(0.95); transform-origin: bottom center; }
.reveal-flip.is-visible { transform: perspective(800px) rotateX(0) translateY(0) scale(1); }

/* Stagger delays — trail cascade */
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* ========== Global motion ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-pop, .reveal-flip {
    opacity: 1; transform: none; filter: none;
  }
}
