:root {
  --blue: #2f6bf7;
  --blue-dark: #1b46b8;
  --green: #2fbf71;
  --orange: #ff8a3d;
  --cream: #fdfaf3;
  --ink: #101a33;
  --ink-soft: #465579;
  --paper: #ffffff;
  --shadow: 0 10px 30px rgba(16, 26, 51, 0.08);
  --shadow-lg: 0 20px 50px rgba(16, 26, 51, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(112, 156, 255, 0.4), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(94, 220, 156, 0.32), transparent 35%),
    radial-gradient(circle at 50% 100%, rgba(255, 170, 100, 0.24), transparent 45%),
    #eef3fb;
  min-height: 100vh;
  line-height: 1.55;
}
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p  { margin: 0 0 0.8em; color: var(--ink-soft); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

#confetti-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
}

/* ───────── Scroll-in animation ───────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ───────── Top bar ───────── */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(238, 243, 251, 0.7);
  border-bottom: 1px solid rgba(16, 26, 51, 0.06);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: 1120px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Fraunces', serif; font-weight: 800; font-size: 1.15rem;
}
.brand-ball {
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.18));
  display: inline-block; transform-origin: center;
  animation: ballBounce 2.6s ease-in-out infinite;
  user-select: none;
}
@keyframes ballBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-4px) rotate(20deg); }
}
.lang-switch { display: flex; gap: 6px; background: var(--paper); padding: 4px; border-radius: 999px; box-shadow: var(--shadow); }
.lang-switch button {
  border: 0; cursor: pointer; padding: 6px 12px; border-radius: 999px;
  font: 600 0.85rem 'Inter', sans-serif; color: var(--ink-soft);
  background: transparent; transition: all 0.2s ease;
}
.lang-switch button.active { background: var(--ink); color: var(--cream); }
.lang-switch button:hover:not(.active) { background: rgba(16, 26, 51, 0.06); }

/* ───────── Hero ───────── */
.hero { padding: 70px 24px 40px 56px; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 50px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); padding: 8px 16px; border-radius: 999px;
  font-weight: 600; font-size: 0.85rem; color: var(--blue-dark);
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.35);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.35); }
  50%      { box-shadow: 0 0 0 7px rgba(47, 191, 113, 0); }
}
.name-highlight {
  background: linear-gradient(
    120deg,
    #ff4d6d 0%,
    #ff9f43 18%,
    #ffd93d 34%,
    #6bd968 52%,
    #4ec3f7 68%,
    #6a5cff 84%,
    #c264ff 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbowShift 6s ease-in-out infinite;
}
@keyframes rainbowShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .name-highlight { animation: none; }
}
.age-pill {
  display: inline-block; margin-top: 8px;
  background: var(--ink); color: var(--cream);
  padding: 6px 14px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
}
.hero-lead { font-size: 1.15rem; max-width: 520px; margin-top: 16px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag {
  background: var(--paper); border: 1px solid rgba(16, 26, 51, 0.08);
  padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
}

.hero-card {
  background: var(--paper); border-radius: 28px; padding: 28px;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.hero-card::before {
  content: ""; position: absolute; inset: -50% -20% auto auto; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(47, 191, 113, 0.8), transparent 60%); opacity: 0.5;
}
.photo-frame {
  aspect-ratio: 1; border-radius: 20px; overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(47, 107, 247, 0.1) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, rgba(47, 107, 247, 0.15), rgba(255, 138, 61, 0.15));
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; position: relative; z-index: 1;
  cursor: pointer;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ───────── Countdowns ───────── */
section.counters { padding-top: 30px; padding-bottom: 50px; }
/* auto-fit: fills the row whether 2 or 3 counters are active */
.counter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.counter {
  background: var(--paper); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.counter-icon { font-size: 2.2rem; margin-bottom: 6px; }
.counter-label { color: var(--ink-soft); font-size: 0.95rem; font-weight: 500; }
.counter-value {
  font-family: 'Fraunces', serif; font-weight: 800;
  font-size: clamp(2.8rem, 6vw, 4rem); line-height: 1; margin: 8px 0;
  color: var(--ink);
}
.counter-value .num { background: linear-gradient(120deg, var(--blue), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.counter-sub { font-size: 0.9rem; color: var(--ink-soft); }
.counter.birthday { border-left: 6px solid var(--orange); }
.counter.trip     { border-left: 6px solid var(--blue); }
.counter.holiday  { border-left: 6px solid var(--green); }
.counter.trip .counter-value .num { background: linear-gradient(120deg, var(--blue), var(--green)); -webkit-background-clip: text; background-clip: text; }
.counter.holiday .counter-value .num { background: linear-gradient(120deg, var(--green), var(--blue)); -webkit-background-clip: text; background-clip: text; }
.counter.today .counter-value .num {
  background: linear-gradient(120deg, var(--orange), var(--green));
  -webkit-background-clip: text; background-clip: text;
}

/* ───────── Sections ───────── */
section.block { padding-top: 60px; padding-bottom: 60px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head p { font-size: 1.05rem; }

/* ───────── Hobbies (hidden games) ───────── */
.hobbies { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.hobby {
  background: var(--paper); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative; overflow: hidden; cursor: pointer;
  border: 0; text-align: left; font: inherit; color: inherit;
  display: block; width: 100%;
}
.hobby:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hobby:active { transform: translateY(-1px) scale(0.99); }
.hobby-thumb {
  aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; position: relative;
  margin-bottom: 14px;
  background:
    repeating-linear-gradient(45deg, rgba(47, 107, 247, 0.08) 0 10px, transparent 10px 20px),
    linear-gradient(135deg, rgba(47, 107, 247, 0.12), rgba(255, 138, 61, 0.1));
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
}
.hobby-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; transition: transform 0.35s ease; }
.hobby:hover .hobby-thumb img { transform: scale(1.06); }
.hobby h3 { margin-bottom: 6px; }
.hobby p { font-size: 0.95rem; margin: 0; }
.hobby:nth-child(1) { background: linear-gradient(160deg, #fff, rgba(47, 191, 113, 0.14)); }
.hobby:nth-child(2) { background: linear-gradient(160deg, #fff, rgba(255, 138, 61, 0.14)); }
.hobby:nth-child(3) { background: linear-gradient(160deg, #fff, rgba(47, 107, 247, 0.12)); }
.hobby:nth-child(4) { background: linear-gradient(160deg, #fff, rgba(106, 92, 255, 0.12)); }
.hobby:nth-child(5) { background: linear-gradient(160deg, #fff, rgba(255, 213, 96, 0.18)); }
.hobby::after {
  content: "✨"; position: absolute; top: 16px; right: 16px;
  background: var(--ink); color: var(--cream); width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font-size: 0.9rem; transition: transform 0.2s; opacity: 0.9;
}
.hobby:hover::after { transform: scale(1.15) rotate(15deg); }

/* ───────── Dream ───────── */
.dream {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--cream); border-radius: 32px; padding: 50px; position: relative; overflow: hidden;
}
.dream::before, .dream::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.4;
}
.dream::before { width: 240px; height: 240px; background: var(--green); top: -60px; right: -40px; }
.dream::after  { width: 200px; height: 200px; background: var(--orange); bottom: -60px; left: 10%; }
.dream-inner { position: relative; z-index: 1; }
.dream h2 { color: var(--cream); }
.dream p { color: rgba(253, 250, 243, 0.85); font-size: 1.1rem; }
.dream-bullets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.dream-bullet {
  background: rgba(253, 250, 243, 0.1); border: 1px solid rgba(253, 250, 243, 0.2);
  padding: 16px; border-radius: 16px; backdrop-filter: blur(6px);
}
.dream-bullet strong { display: block; font-size: 1.6rem; font-family: 'Fraunces', serif; color: #9fe8c3; }

/* ───────── Footer ───────── */
footer {
  margin-top: 60px; padding: 30px 0; text-align: center;
  color: var(--ink-soft); font-size: 0.9rem;
  border-top: 1px solid rgba(16, 26, 51, 0.08);
}
footer .heart { color: var(--orange); }

/* ───────── Game modal ───────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 26, 51, 0.55);
  backdrop-filter: blur(6px);
  display: none; place-items: center;
  z-index: 500; padding: 20px;
}
.modal-overlay.open { display: grid; }
.modal {
  background: var(--paper); border-radius: 28px; padding: 32px;
  max-width: 640px; width: 100%;
  box-shadow: var(--shadow-lg); position: relative;
  animation: pop 0.25s ease;
}
@keyframes pop { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  border: 0; background: rgba(16, 26, 51, 0.06); color: var(--ink);
  width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; font-size: 16px; transition: transform 0.15s, background 0.15s;
}
.modal-close:hover { transform: rotate(90deg); background: rgba(16, 26, 51, 0.12); }
.modal h3 { font-size: 1.5rem; margin-bottom: 4px; }
.modal p.game-sub { color: var(--ink-soft); margin-bottom: 16px; }

/* ---- Football game ---- */
.field {
  position: relative;
  background: linear-gradient(#3fae5a, #2e9149);
  border-radius: 16px; height: 300px;
  overflow: hidden; user-select: none;
}
.goal {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 180px; height: 70px;
  border: 5px solid #fff; border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.15) 0 8px, transparent 8px 16px);
}
.keeper {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  font-size: 34px; transition: left 0.25s ease;
}
.ball {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-size: 40px; transition: all 0.5s cubic-bezier(0.5, -0.3, 0.3, 1.4);
}
.aim-row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.aim-btn {
  flex: 1; padding: 13px; border: 0; border-radius: 14px;
  background: var(--ink); color: var(--cream); cursor: pointer;
  font: 700 1rem 'Inter', sans-serif;
  transition: transform 0.15s, background 0.15s;
}
.aim-btn:hover { transform: translateY(-2px); background: var(--blue); }
.score-line { text-align: center; margin-top: 14px; font-weight: 700; font-size: 1.05rem; }

/* ---- Piano ---- */
.piano { display: flex; justify-content: center; position: relative; height: 180px; margin-top: 10px; }
.white-key {
  width: 46px; height: 170px; background: #fff; border: 1px solid #ccc;
  border-radius: 0 0 8px 8px; cursor: pointer; position: relative; z-index: 1;
}
.white-key:active, .white-key.pressed { background: #dfe9ff; }
.black-key {
  width: 30px; height: 105px; background: #1a1a1a; margin: 0 -15px; z-index: 2;
  border-radius: 0 0 6px 6px; cursor: pointer;
}
.black-key:active, .black-key.pressed { background: var(--blue); }

/* ---- Taekwondo ---- */
.tkd-stage { text-align: center; }
.board { font-size: 90px; cursor: pointer; user-select: none; transition: transform 0.1s ease; }
.board:active { transform: scale(0.9); }
.tkd-belt { font-size: 1.1rem; font-weight: 700; margin-top: 10px; }
.belt-bar { height: 14px; border-radius: 8px; background: rgba(16, 26, 51, 0.08); overflow: hidden; margin-top: 8px; }
.belt-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--blue)); transition: width 0.3s; }

/* ---- Code ---- */
#matrix { width: 100%; height: 220px; border-radius: 14px; background: #05130a; display: block; }
.type-line { font-family: monospace; font-size: 1.05rem; margin-top: 14px; color: var(--green); min-height: 1.4em; }

/* ---- English flashcards ---- */
.flashcard { perspective: 1000px; height: 170px; cursor: pointer; margin-top: 10px; }
.flashcard-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.5s; transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: grid; place-items: center; border-radius: 18px;
  font-family: 'Fraunces', serif; font-size: 2.1rem; font-weight: 800;
  box-shadow: var(--shadow);
}
.flash-front { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: var(--cream); }
.flash-back { background: var(--cream); color: var(--ink); transform: rotateY(180deg); }
.flash-nav { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.flash-nav button {
  padding: 11px 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--cream);
  font: 600 0.95rem 'Inter', sans-serif;
  transition: transform 0.15s, background 0.15s;
}
.flash-nav button:hover { transform: translateY(-2px); background: var(--blue); }

/* ───────── Responsive ───────── */
@media (max-width: 900px) {
  .container { padding: 0 20px; }
  .hero { padding: 50px 20px 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  section.counters { padding-top: 10px; padding-bottom: 20px; }
  section.block { padding-top: 40px; padding-bottom: 40px; }
  .counter-grid { grid-template-columns: 1fr; gap: 16px; }
  .counter { padding: 22px; }
  .section-head { margin-bottom: 28px; }
  .hobbies { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .hobby { padding: 18px; }
  .dream { padding: 28px 22px; }
  .dream-bullets { grid-template-columns: 1fr; }
  footer { padding: 24px 0; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 40px 16px 16px; }
  .hobbies { grid-template-columns: 1fr; }
  h1 { font-size: 2.2rem; }
  .counter { padding: 20px; }
  .dream { padding: 24px 20px; }
  .white-key { width: 36px; }
}
