:root {
  --background-deep: #060606;
  --background-highlight: #1b1b1b;
  --card: rgba(20, 20, 20, 0.8);
  --accent: #f0f0f0;
  --accent-alt: #c9c9c9;
  --text: #f9f9f9;
  --muted: #aaaaaa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(135deg, #040404, #151515, #2a2a2a, #1a1a1a);
  background-size: 300% 300%;
  animation: gradientShift 28s ease-in-out infinite;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 55%),
    radial-gradient(circle at 70% 40%, rgba(200, 200, 200, 0.06), transparent 60%),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.07), transparent 50%),
    radial-gradient(circle at 80% 85%, rgba(180, 180, 180, 0.05), transparent 55%);
  mix-blend-mode: lighten;
  pointer-events: none;
  animation: glowPulse 18s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes glowPulse {
  0% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.45;
    transform: scale(1.02);
  }
}

@keyframes psyGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.site-header {
  padding: 3rem 1.5rem;
  background: rgba(15, 15, 15, 0.7);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}

.title-block {
  text-align: center;
}

.site-header h1 {
  margin: 0;
  font-size: 2.75rem;
}

.tagline {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  color: var(--muted);
}

.header-links {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem 0.5rem;
  flex-wrap: wrap;
}

.header-links .button {
  margin-top: 0;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .header-links {
    width: 100%;
    max-width: 420px;
  }

  .header-links .button {
    flex: 1 1 calc(50% - 0.4rem);
    text-align: center;
    padding: 0.5rem 0.8rem;
  }
}

.profile {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.profile-right {
  transform: scaleX(-1);
}

.bubble-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.bubble {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  opacity: 0;
  transform: scale(0.8);
  transform-origin: 50% 50%;
  will-change: transform, opacity, left, bottom;
  transition: opacity 0.25s ease-in-out;
  z-index: 1000;
}

.bubble-trigger {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(18, 18, 18, 0.75);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  z-index: 1200;
}

.bubble-trigger:hover,
.bubble-trigger:focus-visible {
  transform: translateY(-2px);
  background: rgba(28, 28, 28, 0.85);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.bubble-trigger:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

.bubble-trigger:active {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .bubble-layer {
    display: none;
  }

  .bubble-trigger {
    display: none;
  }
}

.bubble-pop {
  --size: 64px;
  position: absolute;
  left: 0;
  bottom: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 1;
  z-index: 1001;
}

.bubble-pop-arm {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size);
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scaleX(1);
  -webkit-mask-image: linear-gradient(
    to right,
    black 0%,
    black calc(50% - var(--gap, 10px)),
    transparent calc(50% - var(--gap, 10px)),
    transparent calc(50% + var(--gap, 10px)),
    black calc(50% + var(--gap, 10px)),
    black 100%
  );
  mask-image: linear-gradient(
    to right,
    black 0%,
    black calc(50% - var(--gap, 10px)),
    transparent calc(50% - var(--gap, 10px)),
    transparent calc(50% + var(--gap, 10px)),
    black calc(50% + var(--gap, 10px)),
    black 100%
  );
}
main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
}

section + section {
  margin-top: 3rem;
}

h2 {
  margin-bottom: 1rem;
}

.intro p {
  line-height: 1.6;
}

.video-highlight {
  margin: 3rem auto 0;
  width: min(78vw, 700px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

.video-frame {
  width: 100%;
  aspect-ratio: 1280 / 850;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55);
  background: rgba(8, 8, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-frame iframe,
.video-frame div,
#videoHighlight {
  width: 100%;
  height: 100%;
}

.video-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.video-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.25em;
}

.video-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  max-width: 100%;
  word-break: break-word;
}

.video-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.video-control {
  padding: 0.65rem 2rem;
  border-radius: 999px;
  border: none;
  color: #050608;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(79, 11, 115, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 0;
  isolation: isolate;
}

.video-control::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: inherit;
  filter: blur(14px);
  opacity: 0.55;
  z-index: -1;
}

.video-control:hover,
.video-control:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px rgba(79, 11, 115, 0.55);
}

.video-control:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
}

.video-control:active {
  transform: translateY(0);
}

.video-mute {
  background: linear-gradient(120deg, #f7b733, #fc4a1a, #f7b733);
  background-size: 220% 220%;
  animation: psyGradient 7s linear infinite;
}

.video-next {
  background: linear-gradient(120deg, #f72585, #7209b7, #4361ee, #4cc9f0, #f72585);
  background-size: 250% 250%;
  animation: psyGradient 6s ease infinite;
}

.coding-projects {
  margin: 4rem auto 0;
  width: min(75vw, 680px);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.coding-projects h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 18, 0.85);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.18);
}

.project-card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 3px;
}

.project-card__body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
}

.project-card__body p {
  margin: 0;
  color: var(--muted);
}

.project-card__cta {
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .project-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-card__cta {
    align-self: flex-start;
  }
}

.sand-page-intro {
  width: min(75vw, 640px);
  margin: 4rem auto 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sand-page-intro h2 {
  margin: 0;
}

.sand-page-intro p {
  margin: 0;
  color: var(--muted);
}

.sand-return {
  margin: 3rem auto 0;
  width: min(75vw, 320px);
  display: flex;
  justify-content: center;
}

.sand-lab {
  background: rgba(12, 12, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1.5rem;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: min(90vw, 680px);
  margin: 0 auto;
}

.sand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sand-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

.sand-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sand-btn {
  padding: 0.45rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 20, 28, 0.85);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sand-btn:hover,
.sand-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  background: rgba(35, 35, 50, 0.95);
}

.sand-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
}

.sand-btn.secondary {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(30, 30, 40, 0.7);
}

.material-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.material-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.55);
}

.material-buttons {
  display: flex;
  gap: 0.5rem;
}

.material-btn {
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(25, 25, 35, 0.8);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.material-btn:hover,
.material-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
  background: rgba(40, 40, 55, 0.9);
}

.material-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

.material-btn.active {
  border-color: rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
}

.sand-lab canvas {
  width: 100%;
  background: #050508;
  border-radius: 1rem;
  image-rendering: pixelated;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sand-instructions {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  text-align: center;
}

/* ----------------------- HISTORY SNAPSHOT CHALLENGE ----------------------- */

.timeline-intro {
  max-width: 720px;
  margin: 0 auto 2rem;
  text-align: center;
  padding: 0 1rem;
}

.timeline-intro h2 {
  margin-bottom: 0.75rem;
}

.timeline-game {
  width: min(960px, calc(100% - 2.5rem));
  margin: 0 auto 2.5rem;
  padding: 1.75rem;
  background: linear-gradient(160deg, rgba(18, 24, 44, 0.92), rgba(11, 14, 22, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 28px 50px -30px rgba(0, 0, 0, 0.6);
  display: grid;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.timeline-game__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.timeline-refresh {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.timeline-refresh:hover,
.timeline-refresh:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.timeline-refresh:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 3px;
}

.timeline-status {
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}


.timeline-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.timeline-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  padding: 0.5rem 1.05rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.timeline-filter-button:hover,
.timeline-filter-button:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.timeline-filter-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
}

.timeline-filter-button[aria-pressed='true'] {
  background: linear-gradient(135deg, #4a6cf7, #7f53ff);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.filter-label-text {
  font-weight: 600;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.filter-toggle--inline {
  gap: 0.5rem;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 20px;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.2s ease;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(0);
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch-input:checked + .switch-track {
  background: linear-gradient(135deg, #4a6cf7, #7f53ff);
}

.switch-input:checked + .switch-track::after {
  transform: translateX(16px);
  background: #fff;
}

.switch-input:disabled + .switch-track {
  opacity: 0.5;
}

.switch-input:disabled + .switch-track::after {
  background: rgba(255, 255, 255, 0.75);
}

.switch-input:focus-visible + .switch-track {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
}

.filter-expander {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  font-size: 1rem;
  line-height: 1;
}

.filter-expander:hover,
.filter-expander:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.filter-expander:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
}

.filter-expander[aria-expanded='true'] {
  transform: rotate(180deg);
}

.filter-expander[aria-expanded='true']:hover,
.filter-expander[aria-expanded='true']:focus-visible {
  transform: rotate(180deg) translateY(-1px);
}

.timeline-filters {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 0.85rem;
}

.timeline-filters[hidden] {
  display: none !important;
}

.timeline-filter {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.timeline-celebration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.confetti-piece {
  position: absolute;
  top: -12%;
  width: var(--size, 8px);
  height: var(--height, 18px);
  border-radius: 2px;
  background: var(--color, #fff);
  opacity: 0;
  transform: translate3d(0, 0, 0) rotate(0deg);
  animation: confettiFall var(--duration, 1600ms) ease-out forwards;
  animation-delay: var(--delay, 0ms);
}

.confetti-piece.is-circle {
  border-radius: 999px;
  height: var(--size, 10px);
}

.confetti-piece.is-star {
  width: var(--size, 14px);
  height: var(--size, 14px);
  background: transparent;
}

.confetti-piece.is-star::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color, #fff);
  clip-path: polygon(50% 0%, 63% 35%, 98% 35%, 69% 57%, 79% 91%, 50% 71%, 21% 91%, 31% 57%, 2% 35%, 37% 35%);
}

.celebration-halo {
  position: absolute;
  inset: 18% 14%;
  border-radius: 999px;
  background: radial-gradient(
    circle at center,
    var(--halo-color, rgba(255, 255, 255, 0.35)) 0%,
    rgba(255, 255, 255, 0.05) 45%,
    rgba(255, 255, 255, 0) 70%
  );
  opacity: 0;
  animation: celebrationHalo var(--halo-duration, 1.3s) ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translate3d(var(--driftStart, 0px), -20%, 0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--driftEnd, 0px), 115%, 0) rotate(var(--rotation, 360deg));
    opacity: 0;
  }
}

@keyframes celebrationHalo {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  40% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

.filter-input {
  width: 120px;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(7, 9, 16, 0.75);
  color: inherit;
  font-size: 0.95rem;
}

.filter-input:disabled {
  opacity: 0.6;
}

.filter-input:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
}

.timeline-media {
  display: grid;
  gap: 0.75rem;
}

.timeline-media__frame {
  position: relative;
  width: 100%;
  min-height: 220px;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: #07090f;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 20px 38px rgba(7, 9, 16, 0.45);
  overflow: hidden;
}

.timeline-media__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.08), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  animation: timeline-placeholder-pulse 2.2s ease-in-out infinite;
}

.timeline-media__placeholder-text {
  position: relative;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: rgba(12, 16, 27, 0.68);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.timeline-media__placeholder-text::before {
  content: '';
  position: absolute;
  inset: -0.25rem;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
}

.timeline-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  background: transparent;
}

.timeline-attribution {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.timeline-form {
  display: grid;
  gap: 0.75rem;
}

.timeline-label {
  font-weight: 600;
}

.timeline-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline-input-row input {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(7, 9, 16, 0.75);
  color: inherit;
  font-size: 1rem;
}

.timeline-input-row input:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
}

.timeline-submit,
.timeline-next {
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #4a6cf7, #7f53ff);
  color: #fff;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.timeline-submit:hover,
.timeline-next:hover,
.timeline-submit:focus-visible,
.timeline-next:focus-visible {
  filter: brightness(105%);
  transform: translateY(-1px);
}


.timeline-feedback {
  position: relative;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  line-height: 1.5;
  overflow: hidden;
  isolation: isolate;
}

.timeline-feedback strong {
  font-weight: 700;
}

.timeline-feedback.is-perfect,
.timeline-feedback.is-range-hit {
  background: linear-gradient(
    120deg,
    rgba(255, 110, 205, 0.85),
    rgba(125, 255, 221, 0.95),
    rgba(255, 230, 102, 0.9),
    rgba(158, 255, 107, 0.9),
    rgba(118, 216, 255, 0.88),
    rgba(255, 110, 205, 0.85)
  );
  background-size: 320% 320%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 0 45px rgba(255, 183, 255, 0.55),
    0 0 80px rgba(123, 247, 255, 0.35);
  color: #0f131c;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.4);
  animation: timeline-feedback-spectrum 1.2s ease-in-out infinite alternate;
}

.timeline-feedback.is-perfect::after,
.timeline-feedback.is-range-hit::after {
  content: '';
  position: absolute;
  inset: -25%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.65),
    rgba(255, 164, 244, 0.4),
    rgba(132, 255, 238, 0.4),
    rgba(255, 255, 255, 0.65)
  );
  filter: blur(42px);
  opacity: 0.6;
  mix-blend-mode: screen;
  animation: timeline-feedback-glow 0.9s linear infinite;
  z-index: -1;
}

.timeline-feedback.is-almost {
  background: linear-gradient(135deg, rgba(255, 91, 181, 0.24), rgba(118, 216, 255, 0.2));
  border: 1px solid rgba(255, 196, 120, 0.5);
  box-shadow: 0 0 32px rgba(255, 140, 237, 0.45);
}

.timeline-feedback.is-close {
  background: rgba(255, 219, 125, 0.18);
  border: 1px solid rgba(255, 231, 171, 0.5);
  box-shadow: 0 0 22px rgba(255, 220, 130, 0.24);
}

.timeline-feedback.is-near {
  background: rgba(146, 188, 255, 0.16);
  border: 1px solid rgba(186, 216, 255, 0.45);
  box-shadow: 0 0 18px rgba(150, 200, 255, 0.22);
}

@keyframes timeline-placeholder-pulse {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

@keyframes timeline-feedback-spectrum {
  0% {
    background-position: 0% 50%;
    box-shadow:
      0 0 45px rgba(255, 183, 255, 0.55),
      0 0 80px rgba(123, 247, 255, 0.35);
  }
  50% {
    background-position: 100% 50%;
    box-shadow:
      0 0 55px rgba(255, 219, 164, 0.6),
      0 0 95px rgba(118, 216, 255, 0.42);
  }
  100% {
    background-position: 0% 50%;
    box-shadow:
      0 0 45px rgba(255, 183, 255, 0.55),
      0 0 80px rgba(123, 247, 255, 0.35);
  }
}

@keyframes timeline-feedback-glow {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}


.timeline-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-details p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.timeline-info {
  margin: 1.75rem 0 0;
  padding: 1.3rem 1.5rem;
  list-style: none;
  border-radius: 1rem;
  background: rgba(10, 12, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 0.75rem;
}

.timeline-info__item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
}

.timeline-info__label {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.68);
}

.timeline-info__item a {
  color: #8fc7ff;
  text-decoration: underline;
}

.timeline-info__item a:hover,
.timeline-info__item a:focus {
  color: #c1e3ff;
}

.timeline-next[hidden] {
  display: none;
}

.timeline-return {
  margin: 2.5rem auto 0;
  text-align: center;
}

@media (max-width: 768px) {
  .timeline-game {
    width: calc(100% - 2rem);
    padding: 1.25rem;
    gap: 1.25rem;
  }

  .timeline-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline-submit {
    width: 100%;
  }

  .timeline-refresh {
    padding: 0.45rem 0.85rem;
  }

  .timeline-header-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .timeline-media__frame {
    min-height: 180px;
    max-height: 50vh;
  }

  .timeline-filters {
    padding: 0.85rem;
  }

  .filter-input {
    width: 100%;
  }

  .timeline-header-actions {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .timeline-filter-button,
  .timeline-refresh {
    width: 100%;
  }

  .filter-expander {
    align-self: center;
  }
}

.contact {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(24, 24, 24, 0.75);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contact-button:hover,
.contact-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  background: rgba(36, 36, 36, 0.85);
}

.contact-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

.contact-button:active {
  transform: translateY(0);
}

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1.1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: #0b0b0b;
  font-weight: bold;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(255, 255, 255, 0.25);
}

.site-footer {
  position: relative;
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}

.visitor-link {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translate(3.5rem, 0);
  width: 140px;
  height: 36px;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

.contact-modal[hidden] {
  display: none;
}

.contact-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 20;
}

.contact-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(22, 22, 22, 0.95);
  border-radius: 1rem;
  padding: 2.25rem 2rem;
  width: min(420px, 90vw);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--text);
}

.modal-text {
  margin: 0.75rem auto 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.modal-action {
  padding: 0.85rem 1.2rem;
  border-radius: 0.75rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: #0b0b0b;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-action:hover,
.modal-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.25);
}

.modal-action.secondary {
  background: rgba(28, 28, 28, 0.85);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-action.secondary:hover,
.modal-action.secondary:focus-visible {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.copy-status {
  min-height: 1.2rem;
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.visitor-stats {
  padding: 3rem 2.25rem;
  margin: 0 auto 3rem;
  width: min(900px, 100%);
  background: rgba(12, 12, 12, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.visitor-stats h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.visitor-stats__note {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.visitor-stats__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.75rem;
}

.visitor-stats__item {
  padding: 1.25rem;
  background: rgba(24, 24, 24, 0.9);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.visitor-stats__label {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.visitor-stats__value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.visitor-stats__updated {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.visitor-stats__recent {
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.9rem;
  padding: 0.75rem 1.1rem;
}

.visitor-stats__recent summary {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.visitor-stats__recent[open] summary {
  margin-bottom: 0.75rem;
}

.visitor-stats__recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.visitor-stats__recent-list li {
  font-size: 0.95rem;
  color: var(--accent);
}

.visitor-stats__recent-list li[data-viewer="self"] {
  color: #9fd4ff;
}

.visitor-stats__empty {
  margin: 1rem 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .site-header h1 {
    font-size: 2.1rem;
  }

  main {
    padding: 1.5rem 1rem 3rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1.25rem;
  }

  .profile {
    width: 96px;
    height: 96px;
  }

  .header-links {
    margin-top: 1rem;
  }

  .profile-right {
    display: none;
  }

  .video-highlight {
    width: min(92vw, 420px);
    gap: 1.25rem;
  }

  .video-header {
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
    text-align: left;
  }

  .video-controls {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
  }

  .video-control {
    width: 100%;
    max-width: 260px;
    align-self: center;
  }

  .coding-projects {
    width: min(92vw, 420px);
    gap: 1.4rem;
  }

  .sand-lab {
    padding: 1.5rem 1.2rem 1.25rem;
  }

  .sand-controls,
  .material-controls,
  .material-buttons {
    width: 100%;
    justify-content: center;
  }

  .material-buttons {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .material-btn {
    flex: 1 1 140px;
    text-align: center;
  }
}

.project-body {
  align-items: stretch;
}

.project-header {
  width: min(960px, 92vw);
  margin: 2.5rem auto 1.5rem;
  padding: 1.75rem 2rem;
  border-radius: 18px;
  background: rgba(18, 18, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.project-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 1.6rem + 1vw, 2.6rem);
}

.project-header p {
  margin: 0;
  color: var(--muted);
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.project-back:hover,
.project-back:focus-visible {
  color: #ffffff;
}

.project-main {
  width: min(960px, 92vw);
  margin: 0 auto 3rem;
}

.finder-controls {
  padding: 1.75rem 2rem;
  border-radius: 18px;
  background: rgba(18, 18, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.finder-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.finder-label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.finder-input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.finder-input-group input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(3, 3, 3, 0.65);
  color: var(--text);
  font-size: 1rem;
}

.finder-input-group button {
  flex: 0 0 auto;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  background: linear-gradient(135deg, #ef8354, #f6c667);
  color: #141414;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.finder-input-group button:hover,
.finder-input-group button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.finder-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.finder-results {
  margin-top: 2rem;
}

.finder-status {
  padding: 1.6rem 2rem;
  border-radius: 18px;
  background: rgba(12, 12, 12, 0.78);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--muted);
  text-align: center;
  font-size: 1rem;
}

.finder-status[data-tone='loading'] {
  color: var(--text);
}

.finder-status[data-tone='error'] {
  color: #ff9f9f;
  border-color: rgba(255, 159, 159, 0.4);
}

.finder-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 720px) {
  .finder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.finder-footnote {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.85rem;
}

.finder-card {
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 15, 0.82);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.finder-card__media {
  width: 100%;
  background: rgba(5, 5, 5, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.finder-card__media img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.finder-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
}

.finder-card__description {
  margin: 0;
  color: var(--accent-alt);
  line-height: 1.5;
}

.finder-card__context {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.finder-card__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent-alt);
  font-style: italic;
}

.finder-card__sources {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.finder-card__footer {
  margin-top: auto;
}

.finder-card__footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.finder-card__footer a:hover,
.finder-card__footer a:focus-visible {
  color: #ffffff;
}

.project-footer {
  width: min(960px, 92vw);
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 600px) {
  .finder-input-group {
    flex-direction: column;
  }

  .finder-input-group button {
    width: 100%;
  }

  .finder-card__body {
    padding: 1.5rem;
  }
}
