/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #0d1b3e;
  --forest:  #0d3b2e;
  --purple:  #2a1052;
  --gold:    #e6c31c;
  --dark:    #0a0e1a;
  --surface: #111827;
  --text:    #e8eaf0;
  --muted:   #8892a8;
  --radius:  16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--dark);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.accent { color: var(--gold); }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, var(--navy) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, var(--purple) 0%, transparent 50%),
              var(--dark);
}

.fav-chip {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.fav-chip--navy {
  color: #c5d5f0;
  background: rgba(13,27,62,0.7);
  border: 1px solid rgba(160,185,230,0.35);
}

.fav-chip--green {
  color: #a0e0c4;
  background: rgba(13,59,46,0.7);
  border: 1px solid rgba(100,210,160,0.35);
}

.fav-chip--yellow {
  color: #ffe066;
  background: rgba(120,100,0,0.35);
  border: 1px solid rgba(230,195,28,0.45);
}

.hero__content {
  position: relative; z-index: 2;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 8vh;
}

.hero__avatar {
  width: 140px; height: 140px;
  margin: 0 auto 2.5rem;
  position: relative;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 3s ease-in-out infinite;
  z-index: 3;
}

.hero__avatar-letter {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--gold);
  z-index: 2;
}

.hero__avatar-ring {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  opacity: 0.4;
  animation: pulse-ring 2s ease-in-out infinite;
}

.hero__name {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero__name--hand {
  font-family: 'Caveat', cursive;
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  font-weight: 700;
}

.hero__tagline {
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero__colors {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.color-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid;
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
}

.color-dot--navy {
  background: #1a2d5e;
  border-color: #4a6fa5;
  box-shadow: 0 0 8px rgba(74,111,165,0.4);
}

.color-dot--green {
  background: #0d3b2e;
  border-color: #2a8a5e;
  box-shadow: 0 0 8px rgba(42,138,94,0.4);
}

.color-dot--yellow {
  background: #b89a00;
  border-color: #e6c31c;
  box-shadow: 0 0 8px rgba(230,195,28,0.4);
}

.color-dot:hover {
  transform: scale(1.3);
  box-shadow: 0 0 16px rgba(230,195,28,0.6);
}

.hero__scroll {
  display: inline-block;
  font-size: 1.8rem;
  color: var(--gold);
  text-decoration: none;
  animation: bounce 2s infinite;
}

/* ===== SECTIONS ===== */
.section {
  padding: 5rem 0;
}

.section__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 3rem;
}

/* ===== ABOUT ===== */
.about {
  background: linear-gradient(180deg, var(--dark) 0%, var(--surface) 40%, #080a0e 80%, #0e1016 100%);
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
}

.about__card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}

.about__card:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 12px 32px rgba(230,195,28,0.12);
}

.about__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.about__card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.about__icon--green {
  filter: hue-rotate(40deg) saturate(1.5);
}

.about__card--green {
  border-color: rgba(13,59,46,0.3);
}

.about__card--green:hover {
  border-color: #2a8a5e;
  box-shadow: 0 12px 32px rgba(13,59,46,0.2);
}

.about__card p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ===== HOBBIES ===== */
.hobbies {
  background: linear-gradient(180deg,
    #0e1016 0%,
    #0b0d12 8%,
    #1e2e26 25%,
    #0d3b2e 50%,
    #0f4a35 70%,
    #0c2a1e 100%
  );
}

.hobbies__list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hobby-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  transition: transform .3s, border-color .3s;
}

.hobby-card:hover {
  transform: translateX(8px);
  border-color: var(--gold);
}

.hobby-card:nth-child(even) {
  flex-direction: row-reverse;
}

.hobby-card--green {
  border-color: rgba(42,138,94,0.3);
}

.hobby-card--green:hover {
  border-color: #2a8a5e;
  box-shadow: 0 12px 32px rgba(42,138,94,0.15);
}

.hobby-card__visual {
  flex: 0 0 140px;
  height: 140px;
}

.hobby-card__svg {
  width: 100%;
  height: 100%;
}

.hobby-card__info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.hobby-card__info p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Globe rotation */
@keyframes globe-rotate {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 120; }
}

.globe-rotate {
  animation: globe-rotate 4s linear infinite;
}

/* ===== CHESS SECTION ===== */
.chess-section {
  background: linear-gradient(180deg,
    #0c2a1e 0%,
    #0e3826 25%,
    #104a32 50%,
    #0d3b2e 75%,
    #0a1a12 92%,
    #1c1e24 100%
  );
  overflow: visible;
}

.chess-section__subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.chess-pieces {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chess-colors {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chess-color-desc {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.chess-color-btn {
  padding: 0.35rem 0.8rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}

.chess-color-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.chess-color-btn.active {
  background: rgba(230,195,28,0.18);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

.chess-piece-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}

.chess-piece-btn span {
  font-size: 0.8rem;
  font-weight: 600;
}

.chess-piece-btn:hover {
  background: rgba(230,195,28,0.15);
  border-color: var(--gold);
}

.chess-piece-btn.active {
  background: rgba(230,195,28,0.2);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(230,195,28,0.2);
}

.chess-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(440px, 90vw);
  margin: 0 auto;
  border: 3px solid var(--gold);
  border-radius: 8px;
}

/* Ghost piece that follows cursor on the board */
.chess-ghost {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
  opacity: 0;
  transition: opacity .12s, left .12s ease-out, top .12s ease-out;
}

.chess-ghost.visible {
  opacity: 1;
}

.chess-ghost.wobble {
  animation: chess-wobble .35s ease-out;
}

@keyframes chess-wobble {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  30%  { transform: translate(-50%, -50%) rotate(-5deg); }
  60%  { transform: translate(-50%, -50%) rotate(4deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

.chess-piece-desc {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.chess-piece-desc__symbol {
  font-size: 1.3rem;
  vertical-align: middle;
}

.chess-piece-desc__label {
  font-weight: 700;
  color: var(--gold);
}

.chess-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.8rem, 4.6vw, 2.8rem);
  cursor: pointer;
  transition: background .2s;
  position: relative;
  overflow: hidden;
}

.chess-cell.light { background: #f0d9a0; }
.chess-cell.dark  { background: #8b5e3c; }
.chess-cell.knight-move {
  background: rgba(230,195,28,0.45) !important;
}

.chess-cell.capture-move {
  background: rgba(220,60,60,0.4) !important;
}

.chess-cell:hover { filter: brightness(1.15); }

/* ===== FOOTER ===== */
.footer {
  padding: 2rem 0;
  text-align: center;
  color: #6a6e76;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: #1c1e24;
}

/* ===== ANIMATIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes pulse-ring {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.06); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40%  { transform: translateY(-10px); }
  60%  { transform: translateY(-5px); }
}

/* Scroll reveal */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .hobby-card,
  .hobby-card:nth-child(even) {
    flex-direction: column;
    text-align: center;
  }

  .hobby-card__visual {
    flex: 0 0 100px;
    width: 100px;
  }

  .about__grid {
    grid-template-columns: 1fr 1fr;
  }
}
