:root {
  /* Dark Ocean Theme */
  --bg-start: #020b16;
  --bg-end: #051b35;
  --panel-bg: rgba(4, 20, 40, 0.75);
  --panel-border: rgba(0, 180, 216, 0.25);
  --panel-shadow: 0 32px 90px rgba(0, 15, 30, 0.5);
  --text-main: #e0f7fa;
  --text-soft: rgba(224, 247, 250, 0.7);
  --accent: #00b4d8;
  --accent-2: #0077b6;
  --accent-3: #48cae4;
  --chip-bg: rgba(0, 180, 216, 0.08);
  --chip-border: rgba(0, 180, 216, 0.18);
  --button-bg: rgba(0, 180, 216, 0.12);
  --button-hover: rgba(0, 180, 216, 0.25);
  --line: rgba(0, 180, 216, 0.2);
  --card-highlight: linear-gradient(135deg, rgba(0, 180, 216, 0.25), rgba(0, 119, 182, 0.2));
  --glow-1: rgba(0, 180, 216, 0.2);
  --glow-2: rgba(0, 119, 182, 0.2);
}

body.light-mode {
  /* Light Sky Theme */
  --bg-start: #e1f4fb;
  --bg-end: #c4eaf7;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --panel-border: rgba(0, 150, 199, 0.18);
  --panel-shadow: 0 28px 80px rgba(0, 119, 182, 0.12);
  --text-main: #003049;
  --text-soft: rgba(0, 48, 73, 0.7);
  --accent: #0096c7;
  --accent-2: #0077b6;
  --accent-3: #00b4d8;
  --chip-bg: rgba(0, 150, 199, 0.06);
  --chip-border: rgba(0, 150, 199, 0.15);
  --button-bg: rgba(255, 255, 255, 0.9);
  --button-hover: #ffffff;
  --line: rgba(0, 150, 199, 0.3);
  --card-highlight: linear-gradient(135deg, rgba(0, 150, 199, 0.12), rgba(0, 180, 216, 0.12));
  --glow-1: rgba(0, 180, 216, 0.15);
  --glow-2: rgba(0, 150, 199, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, var(--glow-1), transparent 35%),
    radial-gradient(circle at bottom right, var(--glow-2), transparent 30%),
    linear-gradient(145deg, var(--bg-start), var(--bg-end));
  font-family: "Be Vietnam Pro", sans-serif;
  transition: background 0.4s ease, color 0.4s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.particles-background,
.noise-layer {
  position: fixed;
  inset: 0;
}

.particles-background {
  z-index: -3;
}

.noise-layer {
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.10'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px 32px 30px;
}

.hud {
  position: fixed;
  top: 24px;
  left: 32px;
  right: 32px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.brand-block,
.hud-actions {
  pointer-events: auto;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-kicker,
.section-index,
.meta-label,
.project-year,
.contact-label {
  color: var(--text-soft);
}

.brand-kicker,
.eyebrow,
.section-index {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
}

.brand-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.hud-actions {
  display: flex;
  gap: 12px;
}

.function-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--chip-border);
  border-radius: 16px;
  background: var(--button-bg);
  color: var(--text-main);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.function-btn:hover {
  transform: translateY(-3px);
  background: var(--button-hover);
}

.slides-stage {
  position: relative;
  width: min(1140px, calc(100vw - 160px));
  height: 100vh;
  margin: 0 auto;
}

.panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 100px 0 84px;
  pointer-events: none;
}

.fade-panel {
  opacity: 0;
  transform: translateY(72px) scale(0.96);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-panel.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.panel-card {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(0, 140, 200, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(0, 80, 160, 0.16) 0%, transparent 50%),
    linear-gradient(158deg, rgba(2, 12, 28, 0.94), rgba(4, 22, 48, 0.92));
  backdrop-filter: blur(24px);
  box-shadow:
    0 32px 90px rgba(0, 10, 30, 0.55),
    inset 0 1px 0 rgba(0, 200, 255, 0.1);
  padding: 34px;
  position: relative;
  overflow: hidden;
}

body.light-mode .panel-card {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(0, 180, 216, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(0, 150, 199, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.78));
  box-shadow: var(--panel-shadow);
}

/* Bảng 2: section-head sticky với glassmorphism */
.scrollable-panel {
  padding-top: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 184px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scrollable-panel::-webkit-scrollbar {
  display: none;
}

.scrollable-panel > .section-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -34px 20px -34px;
  padding: 28px 34px 18px;
  background: rgba(2, 12, 28, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 32px 32px 0 0;
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

body.light-mode .scrollable-panel > .section-head {
  background: rgba(225, 244, 251, 0.95);
}

.panel-card::before {
  content: "";
  position: absolute;
  inset: auto -12% 58% 48%;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.22), transparent 70%);
  pointer-events: none;
}

body.light-mode .panel-card::before {
  background: radial-gradient(circle, rgba(0, 150, 199, 0.1), transparent 70%);
}

.hero-card {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  align-items: start;
  gap: 0;
}

.panel-copy {
  order: 2;
  padding-right: 0;
  padding-left: 0;
  margin-left: -100px;
}

.hero-name,
.section-head h2,
.project-title {
  font-family: "Space Grotesk", sans-serif;
}

.hero-name {
  margin: 10px 0 16px;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.95;
}

.hero-summary,
.section-subtitle,
.project-desc,
.contact-text,
.contact-link {
  color: var(--text-soft);
  line-height: 1.75;
}

.project-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.meta-chip,
.stat-card,
.project-item,
.contact-card,
.social-link-card {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
}

.meta-chip {
  min-width: 220px;
  padding: 16px 18px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-block {
  position: relative;
  margin-top: 24px;
}

.hero-card .section-head.compact {
  position: relative;
  margin-bottom: 18px;
  padding-left: 56px;
}

.hero-card .section-head.compact h2 {
  margin: 0;
}

.hero-card .section-head.compact .section-index {
  position: absolute;
  top: 2px;
  left: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head.compact {
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.section-subtitle {
  margin: 10px 0 0;
  max-width: 760px;
}

.skills-marquee-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  padding: 4px 0;
}

.skills-marquee-track {
  display: flex;
  width: max-content;
  gap: 12px;
  animation: scroll-marquee 15s linear infinite;
}

.skills-marquee-track:hover {
  animation-play-state: paused;
}

.skills-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
}

@keyframes scroll-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 6px)); }
}

.skill-item,
.project-tags span {
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.project-tags span {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.skill-item i {
  font-size: 1.25rem;
}

.skill-item:hover,
.project-tags span:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 231, 255, 0.38);
}

.panel-visual {
  order: 1;
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding-left: 0;
  padding-right: 0;
}

.avatar-frame {
  position: relative;
  width: min(300px, 100%);
  margin: 0 0 0 32px;
  padding: 16px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.avatar-glow {
  position: absolute;
  inset: 0;
  background: conic-gradient(from 160deg, rgba(110, 231, 255, 0.28), rgba(255, 140, 107, 0.24), rgba(139, 255, 176, 0.2), rgba(110, 231, 255, 0.28));
  filter: blur(34px);
  opacity: 0.92;
}

.profile-img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  object-fit: cover;
  border-radius: 22px;
  z-index: 1;
}

.panel-visual .skill-block {
  width: 100%;
  max-width: 420px;
  margin-top: 22px;
}

.stat-card {
  padding: 18px;
  border-radius: 22px;
  backdrop-filter: blur(18px);
}

.stat-value {
  display: block;
  margin-bottom: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.project-grid,
.contact-grid,
.social-grid {
  display: grid;
  gap: 14px;
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-item,
.contact-card,
.social-link-card {
  position: relative;
  overflow: hidden;
}

.project-item,
.contact-card {
  border-radius: 22px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.project-item::before,
.contact-card::before,
.social-link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-highlight);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-item:hover::before,
.contact-card:hover::before,
.social-link-card:hover::before {
  opacity: 1;
}

.project-topline,
.project-tags,
.contact-card,
.social-link-card {
  position: relative;
  z-index: 1;
}

.project-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(110, 231, 255, 0.14);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.project-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.project-link,
.cta-button,
.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.project-link {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0; /* Thêm vùng đệm để dễ click hơn */
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  width: fit-content;
  position: relative;
  z-index: 10;
  pointer-events: auto; /* Đảm bảo nhận sự kiện click */
}

.project-link:hover {
  color: var(--accent-3);
  transform: translateX(5px);
}

.project-link i {
  font-size: 1.2rem;
}



.project-link:hover,
.cta-button:hover,
.back-to-top-btn:hover {
  transform: translateY(-3px);
}

.contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.contact-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  min-height: 120px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-label {
  margin-bottom: 0;
}

.contact-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(110, 231, 255, 0.16);
  color: var(--accent);
  font-size: 1.25rem;
}

.cta-button {
  margin-top: 30px;
  padding: 16px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 18px 34px rgba(13, 24, 42, 0.24);
}

.social-card {
  display: flex;
  flex-direction: column;
  /* Dark ocean background */
  background:
    radial-gradient(ellipse at 18% 0%, rgba(0, 110, 170, 0.38) 0%, transparent 52%),
    radial-gradient(ellipse at 82% 100%, rgba(0, 50, 130, 0.3) 0%, transparent 50%),
    linear-gradient(158deg, rgba(2, 14, 32, 0.97), rgba(3, 24, 52, 0.95));
  border-color: rgba(0, 180, 216, 0.3);
  box-shadow:
    0 36px 90px rgba(0, 15, 45, 0.65),
    inset 0 1px 0 rgba(0, 200, 255, 0.13);
}

/* Hiệu ứng ánh sáng sinh học đại dương */
.social-card::before {
  inset: auto -8% 60% 42%;
  height: 280px;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.24), transparent 68%);
  animation: ocean-pulse 6s ease-in-out infinite alternate;
}

.social-card::after {
  content: "";
  position: absolute;
  inset: 68% 55% auto -8%;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 90, 200, 0.2), transparent 65%);
  pointer-events: none;
  animation: ocean-pulse 8s ease-in-out infinite alternate-reverse;
}

@keyframes ocean-pulse {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 1;    transform: scale(1.18); }
}

/* Section-head ocean */
.social-card .section-head .section-index {
  color: rgba(72, 202, 228, 0.8);
}

.social-card .section-head h2 {
  background: linear-gradient(130deg, #90e0ef, #00b4d8, #48cae4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.social-card .section-subtitle {
  color: rgba(144, 224, 239, 0.72);
}



.social-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
}

.social-link-card {
  min-height: auto;
  border-radius: 22px;
  padding: 18px 20px;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  background: rgba(0, 45, 90, 0.4);
  border-color: rgba(0, 180, 216, 0.22);
  transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.social-link-card:hover {
  background: rgba(0, 80, 145, 0.52);
  border-color: rgba(0, 210, 255, 0.5);
  box-shadow: 0 8px 28px rgba(0, 130, 220, 0.3), 0 0 0 1px rgba(0, 200, 255, 0.14);
}

.social-link-card i {
  font-size: 1.7rem;
  flex-shrink: 0;
}

.social-link-card span {
  font-weight: 700;
  font-size: 0.95rem;
}

.social-link-card.facebook i   { color: #74b3ff; }
.social-link-card.twitter i    { color: #48cae4; }
.social-link-card.instagram i  { color: #ff9f7f; }
.social-link-card.github i     { color: #a8d8ea; }
.social-link-card.telegram i   { color: #00d4ff; }

.back-to-top-btn {
  align-self: auto;
  margin: 28px auto 0;
  padding: 14px 22px;
  border: 1px solid rgba(0, 180, 216, 0.45);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 100, 170, 0.42), rgba(0, 50, 120, 0.5));
  color: #90e0ef;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 70, 150, 0.3);
}

.social-card .back-to-top-btn:hover {
  background: linear-gradient(135deg, rgba(0, 140, 220, 0.55), rgba(0, 80, 165, 0.65));
  border-color: rgba(0, 230, 255, 0.65);
  box-shadow: 0 12px 32px rgba(0, 110, 200, 0.45);
}

/* ── Light Sky theme overrides cho social-card ── */
body.light-mode .social-card {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(0, 180, 216, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 82% 100%, rgba(0, 150, 199, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel-bg);
  border-color: var(--panel-border);
  box-shadow: var(--panel-shadow);
}

body.light-mode .social-card::before {
  background: radial-gradient(circle, rgba(0, 180, 216, 0.1), transparent 68%);
  animation: none;
}

body.light-mode .social-card::after {
  background: radial-gradient(circle, rgba(0, 150, 199, 0.08), transparent 65%);
  animation: none;
}

body.light-mode .social-card .section-head .section-index {
  color: var(--text-soft);
}

body.light-mode .social-card .section-head h2 {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: var(--text-main);
}

body.light-mode .social-card .section-subtitle {
  color: var(--text-soft);
}

body.light-mode .social-link-card {
  background: var(--chip-bg);
  border-color: var(--chip-border);
}

body.light-mode .social-link-card:hover {
  background: rgba(0, 150, 199, 0.1);
  border-color: rgba(0, 150, 199, 0.35);
  box-shadow: 0 8px 24px rgba(0, 119, 182, 0.15);
}

body.light-mode .social-link-card.facebook i  { color: #1877f2; }
body.light-mode .social-link-card.twitter i   { color: #1da1f2; }
body.light-mode .social-link-card.instagram i { color: #e1306c; }
body.light-mode .social-link-card.github i    { color: #24292e; }
body.light-mode .social-link-card.telegram i  { color: #0088cc; }

body.light-mode .back-to-top-btn {
  background: var(--button-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-main);
  box-shadow: 0 4px 16px rgba(0, 119, 182, 0.1);
}

body.light-mode .social-card .back-to-top-btn:hover {
  background: var(--button-hover);
  border-color: rgba(0, 150, 199, 0.4);
  box-shadow: 0 8px 24px rgba(0, 119, 182, 0.18);
}



.slide-progress {
  position: fixed;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
}

.progress-line {
  width: 1px;
  height: 180px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
}

.progress-dots {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dot-container {
  position: relative;
  display: flex;
  align-items: center;
}

.dot-label {
  position: absolute;
  left: 28px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  background: var(--panel-bg);
  border: 1px solid var(--chip-border);
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.dot-container:hover .dot-label {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.progress-dot {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

body.light-mode .progress-dot {
  background: rgba(0, 48, 73, 0.15);
}

.progress-dot.active {
  background: var(--accent);
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(110, 231, 255, 0.12);
}

body.light-mode .progress-dot.active {
  box-shadow: 0 0 0 8px rgba(0, 150, 199, 0.15);
}


.scroll-hint {
  position: fixed;
  right: 32px;
  bottom: 24px;
  z-index: 20;
  color: var(--text-soft);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.18s ease, box-shadow 0.25s ease;
}

.tilt-card:hover {
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
}

@media (max-width: 1200px) {
  .slides-stage {
    width: min(100vw - 120px, 1020px);
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .panel-copy {
    order: 1;
    padding-left: 0;
  }

  .panel-visual {
    order: 2;
    min-height: auto;
    padding-left: 0;
    padding-right: 0;
  }

  .panel-visual .skill-block {
    max-width: none;
  }

  .social-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .page-shell {
    padding: 18px;
  }

  .hud {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 0 16px;
    background: linear-gradient(180deg, rgba(6, 17, 31, 0.9), transparent);
    backdrop-filter: blur(12px);
  }

  body.light-mode .hud {
    background: linear-gradient(180deg, rgba(237, 244, 255, 0.96), transparent);
  }

  .slides-stage {
    width: 100%;
    height: auto;
  }

  .panel {
    position: relative;
    inset: auto;
    min-height: auto;
    padding: 0;
    margin-bottom: 18px;
    pointer-events: auto;
  }

  .fade-panel,
  .fade-panel.is-visible {
    opacity: 1;
    transform: none;
  }

  .panel-card {
    padding: 24px;
    border-radius: 26px;
  }

  .slide-progress,
  .scroll-hint {
    display: none;
  }

  .project-grid,
  .contact-grid,
  .social-grid {
    grid-template-columns: 1fr;
  }
}

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

  .brand-name {
    font-size: 1rem;
  }

  .hero-name {
    font-size: 2.4rem;
  }

  .hero-meta {
    flex-direction: column;
  }

  .meta-chip {
    min-width: auto;
  }

  .hero-card .section-head.compact {
    position: static;
    margin-bottom: 18px;
    padding-left: 0;
  }

  .hero-card .section-head.compact .section-index {
    position: static;
  }

  .social-link-card,
  .contact-card {
    min-height: 0;
  }
}
