/* =========================================================
   Nguyễn Bảo Hân – personal page
   ========================================================= */

:root {
  --paper: #faf6f0;        /* page background */
  --paper-2: #f3ebe1;
  --card: #fffdf9;
  --ink: #1c2433;          /* headings */
  --ink-2: #4a5161;        /* body text */
  --muted: #7c8291;
  --navy: #3a5070;
  --navy-deep: #1f2d44;
  --rose: #c4867e;         /* taken from the photo's watercolor frame */
  --rose-2: #e9c9c2;
  --rose-soft: #f6e6e1;
  --btn: #f8e1db;          /* light rose buttons */
  --btn-hover: #f2cdc4;
  --line: #e7ddd0;
  --danger: #b4473f;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --topbar-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-variant-numeric: lining-nums;   /* Cormorant defaults to old-style digits */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint paper grain over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection { background: var(--rose-2); color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rose);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.section-title {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--navy-deep);
}

.section-title em,
.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--rose);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.btn-primary {
  font-weight: 600;
  color: var(--navy-deep);
  background: var(--btn);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 12px 24px -14px rgba(196, 134, 126, 0.55);
}

.btn-primary:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 18px 30px -16px rgba(196, 134, 126, 0.7);
}

.btn-primary:hover svg { transform: translateX(3px); }
.btn-down:hover svg { transform: translateY(3px); }

.btn-ghost {
  color: var(--navy-deep);
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--rose-2);
}

.btn-ghost:hover {
  background: var(--rose-soft);
  border-color: var(--rose);
  transform: translateY(-2px);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -24px rgba(28, 36, 51, 0.4);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--container);
  height: var(--topbar-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--rose-2);
}

.brand span {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--navy-deep);
  white-space: nowrap;
}

.nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: 999px;
  transition: color 0.25s, background 0.25s;
}

.nav a:hover { color: var(--ink); background: rgba(58, 80, 112, 0.06); }
.nav a.active { color: var(--navy-deep); background: rgba(58, 80, 112, 0.09); }

.nav a.nav-cta {
  margin-left: 10px;
  padding: 9px 20px;
  font-weight: 600;
  color: var(--navy-deep);
  background: var(--btn);
}

.nav a.nav-cta:hover,
.nav a.nav-cta.active { background: var(--btn-hover); }

.menu-btn {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.menu-btn span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}

.menu-btn span:first-child { top: 18px; }
.menu-btn span:last-child { top: 24px; }

.nav-open .menu-btn span:first-child { top: 21px; transform: rotate(45deg); }
.nav-open .menu-btn span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(40px, 7vw, 96px) 0 clamp(72px, 9vw, 120px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.hero-title {
  margin: 18px 0 30px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(68px, 10vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--navy-deep);
}

.hero-title em {
  position: relative;
  display: inline-block;
  padding-right: 0.06em;
}

.squiggle {
  position: absolute;
  left: 0.04em;
  right: 0;
  bottom: -0.1em;
  width: 96%;
  height: 0.2em;
  overflow: visible;
}

.squiggle path {
  fill: none;
  stroke: var(--rose);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 360;
  stroke-dashoffset: 0;
}

.js .hero-title .squiggle path {
  stroke-dashoffset: 360;
  transition: stroke-dashoffset 1.4s var(--ease) 0.6s;
}

.js .hero-title.visible .squiggle path { stroke-dashoffset: 0; }

.lead {
  max-width: 33em;
  margin: 0;
  font-size: clamp(16.5px, 1.35vw, 19px);
  line-height: 1.8;
}

.lead strong {
  font-weight: 600;
  color: var(--ink);
}

/* nicknames: "Hân Dolphin", "Em bé dưa hấu" */
.nicknames {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 18px 0 0;
}

.nick-label {
  margin-right: 2px;
  font-size: 13.5px;
  color: var(--muted);
}

.nick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 6px 11px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-deep);
  white-space: nowrap;
  background: var(--rose-soft);
  border: 1px solid var(--rose-2);
  border-radius: 999px;
}

.nick span {
  font-style: normal;
  font-size: 15px;
}

.hero-thanks {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(21px, 1.9vw, 25px);
  line-height: 1.4;
  color: var(--navy);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

/* photo side */
.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 440px);
}

.blob {
  position: absolute;
  inset: 8% -12% -6% 6%;
  z-index: 0;
  background: radial-gradient(circle at 30% 30%, var(--rose-soft), var(--rose-2) 75%);
  border-radius: 58% 42% 55% 45% / 45% 55% 45% 55%;
  animation: morph 16s ease-in-out infinite alternate;
}

@keyframes morph {
  0%   { border-radius: 58% 42% 55% 45% / 45% 55% 45% 55%; transform: rotate(0deg); }
  50%  { border-radius: 42% 58% 40% 60% / 58% 40% 60% 42%; }
  100% { border-radius: 52% 48% 62% 38% / 40% 62% 38% 60%; transform: rotate(8deg); }
}

.photo {
  position: relative;
  z-index: 1;
  margin: 0;
  transform: rotate(2.2deg);
  box-shadow:
    0 2px 6px rgba(28, 36, 51, 0.06),
    0 40px 70px -34px rgba(28, 36, 51, 0.55);
  transition: transform 0.8s var(--ease);
}

.photo:hover { transform: rotate(0deg) scale(1.01); }

.photo img { width: 100%; }

/* washi tape holding the print */
.tape {
  position: absolute;
  top: -16px;
  left: 50%;
  z-index: 2;
  width: 124px;
  height: 34px;
  transform: translateX(-50%) rotate(-5deg);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0 6px, transparent 6px 12px),
    rgba(214, 186, 158, 0.72);
  clip-path: polygon(0 8%, 4% 0, 8% 10%, 12% 0, 88% 0, 92% 10%, 96% 0, 100% 8%, 100% 92%, 96% 100%, 92% 90%, 88% 100%, 12% 100%, 8% 90%, 4% 100%, 0 92%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* round "sticker" */
.badge {
  position: absolute;
  left: -46px;
  bottom: 54px;
  z-index: 3;
  width: 128px;
  height: 128px;
  filter: drop-shadow(0 14px 22px rgba(28, 36, 51, 0.2));
}

.badge circle { fill: var(--card); }

.badge text {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 9.6px;
  fill: var(--navy-deep);
}

.badge-ring {
  transform-origin: 60px 60px;
  animation: spin 24s linear infinite;
}

.badge .heart { fill: var(--rose); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Info cards ---------- */
.info {
  padding: clamp(8px, 2vw, 24px) 0 clamp(56px, 7vw, 96px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-note {
  max-width: 24em;
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 1.8vw, 24px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 3 / 4.4;
  padding: 22px;
  overflow: hidden;
  color: var(--navy-deep);
  text-decoration: none;
  background: var(--card-bg, var(--rose-soft));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  isolation: isolate;
  box-shadow: 0 24px 40px -30px rgba(28, 36, 51, 0.4);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

/* pastel background per card */
.card-rose { --card-bg: linear-gradient(165deg, #fcebe6 0%, #f3cbc2 100%); }
.card-sage { --card-bg: linear-gradient(165deg, #edf6e9 0%, #cbe3c5 100%); }
.card-sky { --card-bg: linear-gradient(165deg, #e8f5fb 0%, #bfe0ee 100%); }
.card-butter { --card-bg: linear-gradient(165deg, #fdf5df 0%, #f4dca2 100%); }

/* soft light in the top-left corner */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.7), transparent 55%);
}

.card-art {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: -1;
  width: 84%;
  max-width: 240px;
  transform: translate(-50%, -50%);
  transition: transform 0.7s var(--ease);
  pointer-events: none;
}

.card-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  opacity: 0.75;
}

.card-body {
  display: block;
  margin-top: auto;
}

.card-title {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(25px, 2.3vw, 31px);
  line-height: 1.1;
}

.card-desc {
  display: block;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(8px);
  transition: max-height 0.6s var(--ease), margin 0.6s var(--ease), opacity 0.5s, transform 0.6s var(--ease);
}

.card-arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 253, 249, 0.55);
  border: 1px solid rgba(31, 45, 68, 0.18);
  border-radius: 50%;
  transition: background 0.4s, border-color 0.4s, transform 0.6s var(--ease);
}

.card-arrow svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--navy-deep);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.4s;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 34px 50px -30px rgba(28, 36, 51, 0.5);
}

.card:hover .card-art,
.card:focus-visible .card-art { transform: translate(-50%, -55%) rotate(-3deg) scale(1.05); }

.card:hover .card-desc,
.card:focus-visible .card-desc {
  max-height: 4.5em;
  margin-top: 6px;
  opacity: 0.9;
  transform: none;
}

.card:hover .card-arrow,
.card:focus-visible .card-arrow {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  transform: rotate(45deg);
}

.card:hover .card-arrow svg,
.card:focus-visible .card-arrow svg { stroke: #fff; }

/* touch screens have no hover: always show the description */
@media (hover: none) {
  .card .card-desc {
    max-height: 4.5em;
    margin-top: 6px;
    opacity: 0.85;
    transform: none;
  }
}

/* ---------- Contact ---------- */
.contact {
  padding: 0 0 clamp(80px, 10vw, 140px);
}

.contact-panel {
  position: relative;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 40px 80px -60px rgba(28, 36, 51, 0.45);
}

.contact-panel::before {
  content: "";
  position: absolute;
  top: -140px;
  left: -140px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--rose-soft), transparent 70%);
  pointer-events: none;
}

.contact-intro {
  position: relative;
}

.contact-intro > p:not(.eyebrow) {
  margin: 22px 0 0;
  font-size: 16.5px;
}

.heart-inline { color: var(--rose); }

.contact-intro > p.signoff {
  margin-top: 34px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 27px;
  line-height: 1.3;
  color: var(--navy-deep);
}

.signoff span {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose);
}

.contact-form {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-content: start;
}

.field-full { grid-column: 1 / -1; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.field abbr {
  color: var(--rose);
  text-decoration: none;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.field input::placeholder,
.field textarea::placeholder { color: #a7aba5; }

.field textarea {
  min-height: 160px;
  resize: vertical;
}

/* on touch screens the resize grip gets grabbed by accident while scrolling,
   so it only appears once the box is tapped (focused) */
@media (hover: none), (pointer: coarse) {
  .field textarea { resize: none; }
  .field textarea:focus { resize: vertical; }
}

.field input:focus,
.field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(58, 80, 112, 0.1);
}

.field.invalid input {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 71, 63, 0.08);
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 4px;
}

.form-status {
  margin: 0;
  font-size: 14.5px;
  color: var(--navy);
}

.form-status.error { color: var(--danger); }

/* ---------- Footer ---------- */
.footer {
  padding: 22px 0;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
}

.footer-bottom p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* the full line needs ~350px; on phones keep just "© 2026 Nguyễn Bảo Hân ♥" */
@media (max-width: 460px) {
  .footer-thanks { display: none; }
}

/* back-to-top: small rose circle, same tone as the other buttons */
.btn-up {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--navy-deep);
  background: var(--btn);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 18px -10px rgba(196, 134, 126, 0.7);
  transition: background 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}

.btn-up svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.btn-up:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 12px 22px -10px rgba(196, 134, 126, 0.8);
}

.btn-up:hover svg { transform: translateY(-2px); }

/* =========================================================
   Subpages: Học vấn, Kinh nghiệm, Hoạt động, Thành tích
   ========================================================= */

/* ---------- Page banner ---------- */
.page-head {
  padding: clamp(16px, 3vw, 32px) 0 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--rose-2);
}

.breadcrumb a {
  text-decoration: none;
  transition: color 0.25s;
}

.breadcrumb a:hover { color: var(--navy-deep); }

.breadcrumb [aria-current] {
  font-weight: 500;
  color: var(--navy-deep);
}

.page-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(260px, 30vw, 380px);
  padding: clamp(26px, 4.5vw, 56px);
  overflow: hidden;
  color: var(--navy-deep);
  background: var(--card-bg, var(--rose-soft));   /* tint class: card-rose / card-sage / … */
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 32px;
  isolation: isolate;
  box-shadow: 0 40px 70px -50px rgba(28, 36, 51, 0.45);
}

/* soft light in the top-left corner, like the homepage cards */
.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.75), transparent 50%);
}

.page-banner > :not(.banner-art) { max-width: 58%; }

.banner-art {
  position: absolute;
  top: 50%;
  right: clamp(16px, 6vw, 80px);
  z-index: -1;
  width: clamp(200px, 30vw, 360px);
  margin-top: calc(clamp(200px, 30vw, 360px) / -2);
  animation: banner-float 6s ease-in-out infinite;
}

@keyframes banner-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-2deg); }
}

.page-num {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  opacity: 0.7;
}

.page-title {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(54px, 8.5vw, 108px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.page-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--rose);
}

.page-intro {
  max-width: 32em;
  margin: 18px 0 0;
  font-size: clamp(15.5px, 1.3vw, 17.5px);
  line-height: 1.7;
  color: var(--ink-2);
}

.page-body {
  padding: clamp(56px, 8vw, 104px) 0 clamp(64px, 8vw, 110px);
}

.block + .block { margin-top: clamp(64px, 9vw, 120px); }

.block-head { margin-bottom: clamp(28px, 4vw, 44px); }

.section-title.sm { font-size: clamp(34px, 4.2vw, 52px); }

/* ---------- Clickable photo / gallery ---------- */
.media-fig { margin: 0; }

.media {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: zoom-in;
  isolation: isolate;
}

.media img {
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--paper-2);
  border-radius: 16px;
  box-shadow:
    0 2px 6px rgba(28, 36, 51, 0.05),
    0 24px 40px -28px rgba(28, 36, 51, 0.45);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.media:hover img {
  transform: translateY(-4px);
  box-shadow:
    0 2px 6px rgba(28, 36, 51, 0.05),
    0 32px 48px -28px rgba(28, 36, 51, 0.55);
}

/* several photos: the first one large, the rest as a grid of thumbnails
   (--cols on .gallery sets how many thumbnails per row) */
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.thumb {
  display: block;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: var(--paper-2);
  border: 0;
  border-radius: 10px;
  cursor: zoom-in;
  box-shadow: 0 10px 20px -16px rgba(28, 36, 51, 0.5);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.3s;
}

.thumb:hover img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

/* two photos: side by side, same size */
.gallery.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.gallery.pair .media img { border-radius: 12px; }

.media-fig figcaption {
  margin-top: 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.4;
  text-align: center;
  color: var(--muted);
}

/* ---------- Bullet list ---------- */
.points {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  position: relative;
  padding-left: 22px;
  font-size: 15.5px;
}

.points li + li { margin-top: 8px; }

.points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  background: var(--rose);
  border-radius: 50%;
}

.points .points { margin-top: 8px; }

.points .points li::before {
  background: none;
  border: 1.5px solid var(--rose);
}

/* ---------- Học vấn ---------- */
.degree {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 5vw, 60px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 40px 80px -60px rgba(28, 36, 51, 0.45);
}

.degree-school {
  margin: 16px 0 0;
  font-size: 16.5px;
}

.degree-school strong {
  font-weight: 600;
  color: var(--ink);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 0;
}

.stat {
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
  color: var(--navy-deep);
}

.stat b small {
  font-size: 0.5em;
  font-weight: 500;
  color: var(--muted);
}

.stat span {
  display: block;
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

.thesis {
  margin-top: 30px;
  padding-left: 22px;
  border-left: 2px solid var(--rose-2);
}

.thesis-label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose);
}

.thesis blockquote {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.4;
  color: var(--navy-deep);
}

.thesis p {
  margin: 12px 0 0;
  font-size: 15px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy-deep);
  text-decoration: underline;
  text-decoration-color: var(--rose-2);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: color 0.25s, text-decoration-color 0.25s;
}

.text-link:hover {
  color: var(--rose);
  text-decoration-color: var(--rose);
}

.degree-visual {
  justify-self: center;
  width: min(100%, 340px);
}

.degree-visual .photo .media img {
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.photo-caption {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  text-align: center;
  color: var(--muted);
}

.certs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cert {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}

.cert:hover {
  transform: translateY(-4px);
  border-color: var(--rose-2);
  box-shadow: 0 24px 40px -30px rgba(28, 36, 51, 0.5);
}

.cert-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--rose);
  background: var(--rose-soft);
  border-radius: 14px;
}

.cert-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cert h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-deep);
}

.cert p {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Kinh nghiệm: timeline ---------- */
.timeline {
  --date-w: 200px;
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: var(--date-w);
  width: 1px;
  background: linear-gradient(var(--rose-2), var(--line));
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--date-w) 1fr;
  column-gap: 44px;
}

.tl-item + .tl-item { margin-top: clamp(28px, 4vw, 44px); }

.tl-item::before {
  content: "";
  position: absolute;
  top: 12px;
  left: var(--date-w);
  width: 13px;
  height: 13px;
  background: var(--paper);
  border: 2px solid var(--rose);
  border-radius: 50%;
  transform: translateX(-50%);
}

.tl-item.current::before {
  background: var(--rose);
  box-shadow: 0 0 0 5px rgba(196, 134, 126, 0.18);
}

.tl-date {
  padding: 2px 28px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
  color: var(--navy-deep);
}

.now-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-deep);
  background: var(--btn);
  border-radius: 999px;
}

.tl-card {
  padding: clamp(22px, 3vw, 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 60px -50px rgba(28, 36, 51, 0.45);
}

.tl-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy-deep);
}

.tl-card > p {
  margin: 12px 0 0;
  font-size: 15.5px;
}

.tl-card .media-fig {
  max-width: 440px;
  margin-top: 26px;
}

/* ---------- Hoạt động ---------- */
.year-nav {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  z-index: 20;
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto clamp(40px, 6vw, 64px);
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 30px -22px rgba(28, 36, 51, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.year-nav::-webkit-scrollbar { display: none; }

.year-nav a {
  flex: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: 999px;
  transition: background 0.25s, color 0.25s;
}

.year-nav a:hover { color: var(--navy-deep); background: var(--rose-soft); }
.year-nav a.active { color: var(--navy-deep); background: var(--btn); }

.year {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: clamp(24px, 4vw, 56px);
  scroll-margin-top: calc(var(--topbar-h) + 84px);
}

.year + .year {
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: clamp(56px, 7vw, 88px);
  border-top: 1px solid var(--line);
}

.year-label {
  position: sticky;
  top: calc(var(--topbar-h) + 90px);
  align-self: start;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(56px, 7vw, 92px);
  line-height: 0.9;
  color: var(--rose);
}

.acts {
  columns: 2;
  column-gap: 24px;
}

.act {
  break-inside: avoid;
  margin: 0 0 24px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 60px -50px rgba(28, 36, 51, 0.45);
}

.act > p {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink);
}

.act .media-fig { margin-top: 20px; }

/* ---------- Thành tích ---------- */
.achievements {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ach {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: clamp(20px, 3vw, 40px);
  padding: clamp(28px, 4vw, 44px) 0;
  border-top: 1px solid var(--line);
}

.ach:last-child { border-bottom: 1px solid var(--line); }

.ach-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(56px, 6vw, 80px);
  line-height: 0.9;
  color: var(--rose);
}

.ach-body {
  display: grid;
  grid-template-columns: 1fr minmax(0, 340px);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
}

.ach-body.text-only { grid-template-columns: 1fr; }

.ach-body h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 31px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--navy-deep);
}

/* ---------- Prev / next page ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: clamp(64px, 9vw, 110px);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 28px;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}

.pager a:hover {
  transform: translateY(-4px);
  border-color: var(--rose-2);
  box-shadow: 0 30px 50px -36px rgba(28, 36, 51, 0.5);
}

.pager .next {
  align-items: flex-end;
  text-align: right;
}

.pager small {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose);
}

.pager span {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--navy-deep);
}

/* ---------- Lightbox ---------- */
.lightbox {
  --lb-pad-x: 84px;
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 64px var(--lb-pad-x) 24px;
  background: rgba(17, 24, 38, 0.93);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

/* the stage spans the full width so neighbouring photos slide in from the screen edge */
.lb-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0 calc(var(--lb-pad-x) * -1);
  overflow: hidden;
  touch-action: pan-y pinch-zoom;     /* horizontal swipes are handled by the script */
  user-select: none;
  -webkit-user-select: none;
}

.lightbox.many .lb-stage { cursor: grab; }
.lightbox.many .lb-stage:active { cursor: grabbing; }

/* three slides side by side: previous · current · next */
.lb-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 300%;
  transform: translateX(-33.3333%);
  will-change: transform;
}

.lb-track.animating { transition: transform 0.38s cubic-bezier(0.22, 0.8, 0.24, 1); }

.lb-slide {
  position: relative;
  display: flex;
  flex: 0 0 33.3333%;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 var(--lb-pad-x);
}

/* while the sharp photo loads: a blurred preview, or nothing plus a spinner */
.lb-slide.preview img { filter: blur(6px); }
.lb-slide.loading img { opacity: 0; transition: none; }   /* hide the old photo instantly */

.lb-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  animation: spin 0.8s linear infinite;
}

.lb-slide.loading .lb-spinner,
.lb-slide.preview .lb-spinner { opacity: 1; }

/* the script sets the exact size; these caps are only a fallback.
   --lb-reserved = top padding + bottom padding + caption */
.lb-slide img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - var(--lb-reserved, 140px));
  max-height: calc(100dvh - var(--lb-reserved, 140px));
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  -webkit-user-drag: none;            /* no native image dragging, swipes go to the stage */
  transition: filter 0.35s ease, opacity 0.2s ease;
}

.lb-slide img:not([src]) { visibility: hidden; }

.lb-caption {
  margin: 16px 0 0;
  font-size: 14.5px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
}

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.25s;
}

.lb-btn:hover { background: rgba(255, 255, 255, 0.2); }

.lb-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-close { top: 16px; right: 16px; }
.lb-prev { top: 50%; left: 20px; transform: translateY(-50%); }
.lb-next { top: 50%; right: 20px; transform: translateY(-50%); }
.lb-btn[hidden] { display: none; }

body.lb-open { overflow: hidden; }

/* ---------- Subpages: responsive ---------- */
@media (max-width: 900px) {
  .degree { grid-template-columns: 1fr; }
  .certs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .year { grid-template-columns: 1fr; gap: 20px; }
  .year-label { position: static; }

  .ach-body { grid-template-columns: 1fr; }
  .ach-body .media-fig { max-width: 420px; }
}

@media (max-width: 720px) {
  /* banner: illustration sits top-right, text takes the full width below */
  .page-banner { min-height: 0; }
  .page-banner > :not(.banner-art) { max-width: none; }

  .banner-art {
    position: static;
    order: -1;
    align-self: flex-end;
    width: 132px;
    margin: -14px -8px -6px 0;
  }

  .timeline { --date-w: 7px; }

  .tl-item {
    grid-template-columns: 1fr;
    padding-left: 32px;
  }

  .tl-item::before { top: 8px; }

  .tl-date {
    padding: 0 0 12px;
    font-size: 20px;
    text-align: left;
  }

  .now-badge { margin: 0 0 0 10px; vertical-align: 2px; }

  .acts { columns: 1; }

  .ach {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ach-num { font-size: 52px; }
}

@media (max-width: 560px) {
  .page-banner { border-radius: 24px; }

  .certs { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 30px; white-space: nowrap; }
  .stat span { font-size: 12.5px; }

  .year-nav { gap: 2px; }
  .year-nav a { padding: 7px 8px; font-size: 13px; }
  .act { padding: 18px; }

  .pager { grid-template-columns: 1fr; }
  .pager .next { align-items: flex-start; text-align: left; }

  .lightbox { --lb-reserved: 216px; --lb-pad-x: 10px; padding: 64px var(--lb-pad-x) 92px; }
  .lb-prev,
  .lb-next { top: auto; bottom: 22px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}

/* =========================================================
   Trò chơi: Mưa dưa hấu
   ========================================================= */

/* nickname pill that links to the game */
a.nick {
  text-decoration: none;
  transition: background 0.25s, border-color 0.25s, transform 0.3s var(--ease);
}

a.nick:hover {
  background: var(--btn-hover);
  border-color: var(--rose);
  transform: translateY(-2px) rotate(-2deg);
}

/* ---------- Homepage teaser ---------- */
.teaser-section {
  padding: 0 0 clamp(80px, 10vw, 140px);
}

.teaser {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
  padding: clamp(22px, 3.5vw, 34px) clamp(22px, 4vw, 44px);
  overflow: hidden;
  text-decoration: none;
  background: linear-gradient(115deg, var(--rose-soft) 0%, #fdf5f1 65%);
  border: 1px solid var(--rose-2);
  border-radius: 28px;
  box-shadow: 0 30px 60px -50px rgba(28, 36, 51, 0.5);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.teaser:hover {
  transform: translateY(-4px);
  box-shadow: 0 36px 60px -40px rgba(28, 36, 51, 0.5);
}

.teaser-art {
  width: clamp(76px, 9vw, 104px);
  transition: transform 0.6s var(--ease);
}

.teaser:hover .teaser-art { transform: rotate(-10deg) scale(1.06); }

.teaser-text small {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose);
}

.teaser-text b {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 600;
  line-height: 1.05;
  color: var(--navy-deep);
}

.teaser-text b em {
  font-style: italic;
  font-weight: 500;
  color: var(--rose);
}

.teaser-text > span {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-2);
}

/* ---------- Game page ---------- */
.game-head {
  padding: clamp(16px, 3vw, 32px) 0 0;
  text-align: center;
}

.game-head .breadcrumb { justify-content: center; }

.game-title {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: clamp(50px, 7.5vw, 88px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--navy-deep);
}

.game-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--rose);
}

.game-sub {
  max-width: 32em;
  margin: 14px auto 0;
  color: var(--muted);
}

.game-section {
  padding: clamp(24px, 4vw, 40px) 0 clamp(64px, 8vw, 110px);
}

.game-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px;
  scroll-margin-top: calc(var(--topbar-h) + 10px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 40px 80px -60px rgba(28, 36, 51, 0.5);
}

.g-hud {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-bottom: 10px;
}

.g-stat {
  flex: 1;
  min-width: 0;
  padding: 7px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.g-stat small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.g-stat b {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--navy-deep);
}

.g-stat.low { border-color: rgba(180, 71, 63, 0.4); }
.g-stat.low b { color: var(--danger); }

.g-pause-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  padding: 0;
  color: var(--navy-deep);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.25s;
}

.g-pause-btn:hover:not(:disabled) { background: var(--rose-soft); }
.g-pause-btn:disabled { opacity: 0.4; cursor: default; }

.g-pause-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.g-stage {
  position: relative;
  height: clamp(420px, 68vh, 640px);
  overflow: hidden;
  background: #fdf1ec;
  border-radius: 20px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* while playing, a finger on the stage moves the bowl instead of scrolling */
.g-stage.playing { touch-action: none; }

.g-stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.g-combo {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 2;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--rose);
  border-radius: 999px;
  transform: translateX(-50%);
  pointer-events: none;
}

.g-combo[hidden] { display: none; }

.g-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;               /* panel uses margin: auto so it never gets cut off */
  overflow-y: auto;
  padding: 16px;
  background: rgba(253, 246, 240, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.g-overlay[hidden] { display: none; }

.g-panel {
  width: min(100%, 360px);
  margin: auto;
  padding: 24px 22px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 60px -36px rgba(28, 36, 51, 0.55);
}

.g-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose);
}

.g-panel h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--navy-deep);
}

.g-panel h2 em {
  font-style: italic;
  font-weight: 500;
  color: var(--rose);
}

.g-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.g-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  font-size: 13px;
  line-height: 1.3;
  background: var(--paper);
  border-radius: 12px;
}

.g-rules b { color: var(--navy-deep); }

.g-icon {
  flex: none;
  width: 30px;
  height: 30px;
}

.g-how {
  margin: 14px 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.g-final {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 600;
  line-height: 1;
  color: var(--navy-deep);
}

.g-final small {
  font-size: 0.4em;
  font-weight: 500;
  color: var(--muted);
}

.g-rank {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  color: var(--rose);
}

.g-best {
  margin: 10px 0 18px;
  font-size: 14px;
  color: var(--muted);
}

.g-best b { color: var(--navy-deep); }

.g-note {
  margin: 14px 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.g-more {
  margin: 8px 0 0;
  font-size: 15px;
  text-align: center;
}

.g-more a {
  font-weight: 600;
  color: var(--navy-deep);
  text-decoration: underline;
  text-decoration-color: var(--rose-2);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.g-more a:hover { color: var(--rose); }

/* ---------- Cá heo học toán ---------- */
.g-stage.sea { background: #cdeef6; }

.hearts span { color: var(--rose); }
.hearts span.lost { color: var(--line); }

.q-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 2;
  margin: 0;
  padding: 4px 22px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
  color: var(--navy-deep);
  background: rgba(255, 253, 249, 0.94);
  border-radius: 999px;
  box-shadow: 0 10px 24px -14px rgba(28, 36, 51, 0.5);
  transform: translateX(-50%);
  pointer-events: none;
}

.q-banner[hidden] { display: none; }
.q-banner.good { color: #2e9e6a; }
.q-banner.bad { color: var(--danger); }

/* combo badge sits under the question on the sea stage */
.g-stage.sea .g-combo { top: 66px; }

.g-steps {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  text-align: left;
}

.g-steps li {
  position: relative;
  padding: 7px 10px 7px 40px;
  font-size: 13.5px;
  line-height: 1.45;
  background: var(--paper);
  border-radius: 12px;
  counter-increment: step;
}

.g-steps li + li { margin-top: 6px; }

.g-steps li::before {
  content: counter(step);
  position: absolute;
  top: 7px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-deep);
  background: #cdeef6;
  border-radius: 50%;
}

.g-steps b { color: var(--navy-deep); }

/* ---------- Cá heo vượt sóng ---------- */
/* what can be eaten vs. what must be avoided */
.w-legend {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  text-align: left;
}

.w-group {
  padding: 8px 10px 10px;
  border: 1.5px solid;
  border-radius: 14px;
}

.w-group.good { background: #effaf4; border-color: #bfe6d0; }
.w-group.bad { background: #fdf0ee; border-color: #f1c4bd; }

.w-group-title {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
}

.w-group.good .w-group-title { color: #2e8a5e; }
.w-group.bad .w-group-title { color: var(--danger); }

.w-group ul {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.w-group li {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  color: var(--ink-2);
}

.w-group b { color: var(--navy-deep); }

.w-group .g-icon { width: 36px; height: 36px; }

.w-name-form {
  display: grid;
  gap: 8px;
  text-align: left;
}

.w-name-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-deep);
}

.w-name-form input {
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  font-size: 16px;               /* 16px keeps iPhone from zooming in */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.w-name-form input::placeholder { color: #a7aba5; }

.w-name-form input:focus {
  outline: none;
  background: #fff;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(58, 80, 112, 0.1);
}

.w-name-form input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 71, 63, 0.08);
}

.w-name-error {
  margin: -2px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.w-name-error[hidden] { display: none; }

.w-name-row {
  display: flex;
  gap: 8px;
}

.w-name-row input {
  flex: 1;
  min-width: 0;
}

.w-name-row .btn {
  flex: none;
  padding: 12px 18px;
}

/* the start screen holds more than the others, so it is a bit tighter */
#w-start .g-panel { width: min(100%, 380px); padding-block: 20px; }
#w-start .g-panel h2 { font-size: 36px; }
#w-start .g-how { margin: 12px 0 14px; }

.w-player {
  margin: 6px 0 0;
  font-weight: 600;
  color: var(--navy-deep);
  overflow-wrap: anywhere;
}

.g-panel .w-player + .g-final { margin-top: 2px; }

.w-place {
  margin: -8px 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.w-place:empty { display: none; }

.w-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.w-board-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--rose-2);
  text-underline-offset: 4px;
}

.w-board-link:hover { color: var(--rose); }

/* leaderboard under the game */
.rank-board {
  max-width: 560px;
  margin: 18px auto 0;
  padding: 20px 20px 16px;
  scroll-margin-top: calc(var(--topbar-h) + 10px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 40px 80px -60px rgba(28, 36, 51, 0.5);
}

.rank-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 0 4px 12px;
}

.rank-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--navy-deep);
}

.rank-head h2 em {
  font-style: italic;
  font-weight: 500;
  color: var(--rose);
}

.rank-note {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 8px;
  border-radius: 14px;
}

.rank-row:nth-child(odd) { background: var(--paper); }

.rank-row.me {
  background: var(--rose-soft);
  box-shadow: inset 0 0 0 1.5px var(--rose-2);
}

.rank-pos {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
}

.rank-row:nth-child(-n + 3) .rank-pos { font-size: 20px; }

.rank-name {
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
}

.rank-score {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--navy-deep);
}

.rank-empty {
  padding: 18px 8px;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}

.rank-foot {
  margin: 12px 0 0;
  font-size: 12.5px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Homepage: game cards ---------- */
/* wide screens: 3 cards side by side, art on top and the button at the bottom */
.teasers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.teasers .teaser {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 16px;
}

.teasers .teaser .btn { justify-self: start; }

.teaser.sea {
  background: linear-gradient(115deg, #d9f0f7 0%, #f5fbfd 65%);
  border-color: #bfe3ef;
}

.teaser.wave {
  background: linear-gradient(115deg, #fde4d6 0%, #fdf5ef 65%);
  border-color: #f6cdb9;
}

/* narrower screens: one card per row, art on the left */
@media (max-width: 960px) {
  .teasers { grid-template-columns: 1fr; }

  .teasers .teaser {
    grid-template-columns: auto 1fr;
    grid-template-rows: none;
    align-items: center;
    gap: clamp(18px, 3vw, 36px);
  }

  .teasers .teaser-art { grid-row: span 2; }
  .teasers .teaser .btn { grid-column: 2; }
}

@media (max-width: 720px) {
  .teaser {
    grid-template-columns: auto 1fr;
  }

  .teaser .btn,
  .teasers .teaser .btn {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: center;
  }

  .teasers .teaser-art { grid-row: auto; }
}

@media (max-width: 560px) {
  .game-card {
    margin: 0 calc(var(--gutter) * -0.5);
    padding: 8px;
    border-radius: 22px;
  }

  .g-stat { padding: 6px 9px; }
  .g-stat b { font-size: 22px; }
  .g-pause-btn { width: 42px; }
  .g-stage { height: clamp(400px, 66vh, 600px); border-radius: 16px; }
  .g-overlay { padding: 10px; }
  .g-panel { padding: 18px 14px; }
  .g-panel h2 { font-size: 32px; }
  .g-rules { gap: 6px; margin-top: 12px; }
  .g-rules li { padding: 6px 7px; font-size: 12.5px; }
  .g-steps li { font-size: 12.5px; }
  .q-banner { font-size: 26px; padding: 3px 18px; }
  .g-icon { width: 26px; height: 26px; }
  .g-how { margin: 10px 0 14px; font-size: 12.5px; }
  .w-legend { gap: 6px; margin-top: 10px; }
  .w-group { padding: 6px 8px 8px; }
  .w-group-title { font-size: 12px; margin-bottom: 4px; }
  .w-group li { font-size: 11.5px; }
  .w-group .g-icon { width: 32px; height: 32px; }
  .w-name-form input { padding: 10px 12px; }
  .w-name-row .btn { padding: 10px 14px; }
  #w-start .g-panel { padding-block: 16px; }
  #w-start .g-panel h2 { font-size: 30px; }
  #w-start .g-how { margin: 10px 0 12px; }
  .rank-board { margin: 14px calc(var(--gutter) * -0.5) 0; padding: 16px 10px 14px; border-radius: 22px; }
  .rank-head h2 { font-size: 28px; }
  .rank-row { padding: 8px 12px 8px 4px; }
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

.hero-text .reveal:nth-child(2) { transition-delay: 0.08s; }
.hero-text .reveal:nth-child(3) { transition-delay: 0.16s; }
.hero-text .reveal:nth-child(4) { transition-delay: 0.24s; }
.hero-text .reveal:nth-child(5) { transition-delay: 0.32s; }
.hero-text .reveal:nth-child(6) { transition-delay: 0.4s; }
.hero-visual.reveal { transition-delay: 0.2s; }

.cards .reveal:nth-child(2) { transition-delay: 0.08s; }
.cards .reveal:nth-child(3) { transition-delay: 0.16s; }
.cards .reveal:nth-child(4) { transition-delay: 0.24s; }

/* after the entrance (script adds .revealed), drop the stagger delay
   so hover effects respond immediately */
.js .reveal.revealed { transition-delay: 0s; }

.js .card.reveal.revealed {
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card { aspect-ratio: 4 / 4.6; }
}

/* the 7-item menu needs ~1080px; below that it collapses into the ☰ button */
@media (max-width: 1080px) {
  :root { --topbar-h: 64px; }

  .menu-btn { display: block; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 40px -30px rgba(28, 36, 51, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s, transform 0.4s var(--ease), visibility 0.3s;
  }

  .nav-open .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav a {
    padding: 12px 4px;
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--navy-deep);
    border-radius: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav a:hover,
  .nav a.active { background: none; color: var(--rose); }

  .nav a.nav-cta {
    margin: 18px 0 0;
    padding: 14px 20px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    border: 0;
    border-radius: 999px;
  }

  .nav a.nav-cta:hover,
  .nav a.nav-cta.active { color: var(--navy-deep); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { width: min(86%, 400px); margin-top: 16px; }

  .contact-panel { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand span { font-size: 20px; }

  .hero-title { margin-bottom: 24px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* label on its own line so both nickname pills sit side by side */
  .nick-label { flex-basis: 100%; }
  .nick { font-size: 17.5px; }

  .badge {
    left: -22px;
    bottom: 30px;
    width: 96px;
    height: 96px;
  }

  .card {
    aspect-ratio: 3 / 4.4;
    padding: 16px;
    border-radius: 18px;
  }

  .card-num { font-size: 17px; }
  .card-title { font-size: 22px; }
  .card-art { top: 38%; width: 80%; }
  .card .card-desc { font-size: 12.5px; }

  .card-arrow {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
  }

  .card-arrow svg { width: 14px; height: 14px; }

  .contact-panel { border-radius: 24px; }
  .contact-form { grid-template-columns: 1fr; }
  .form-foot .btn { width: 100%; justify-content: center; }
}
