/* ─── Local Fonts ───────────────────────────── */
@font-face {
  font-family: 'Special Elite';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/SpecialElite.ttf') format('truetype');
}

/* ─── Design Tokens ─────────────────────────── */
:root {
  --deep-navy: #001A48;
  --deep-navy-light: #0a2255;
  --warm-ivory: #FEF6E4;
  --warm-ivory-dim: rgba(254, 246, 228, 0.7);
  --warm-ivory-faint: rgba(254, 246, 228, 0.4);
  --warm-ivory-ghost: rgba(254, 246, 228, 0.15);
  --accent-warm: #D4A574;
  --accent-warm-dim: rgba(212, 165, 116, 0.5);
  --accent-warm-faint: rgba(212, 165, 116, 0.22);
  --font-sans: 'Sintony', ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'Oranienbaum', 'Noto Serif SC', ui-serif, Georgia, serif;
  --font-display: 'Oranienbaum', 'Noto Serif SC', ui-serif, Georgia, serif;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--deep-navy);
  color: var(--warm-ivory);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Sub-page body backgrounds eliminate flash during page load */
body:has(.page-warm) {
  background: #F2ECE2;
}
body:has(.experience-ariel) {
  background: #001A48;
}

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

img {
  max-width: 100%;
  display: block;
}

/* ─── Utilities ─────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Scrollbar hide */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ─── Layout ────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--deep-navy);
  position: relative;
  overflow: hidden;
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── Typography ────────────────────────────── */
.text-logo {
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--warm-ivory-dim);
  text-transform: uppercase;
}

.text-page-title {
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--warm-ivory-dim);
  text-transform: uppercase;
}

.text-serif {
  font-family: var(--font-serif);
}

/* ─── Page Transition Overlay ───────────────── */
.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--deep-navy);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--transition-smooth), transform 0.5s var(--transition-smooth);
}
.transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.transition-overlay.slide-left {
  transform: translateX(-30%);
}
.transition-overlay.scale {
  transform: scale(0.98);
}
/* ─── Page Reveal Transitions ───────────────── */

/* Forward: old page content shrinks to origin */
.page-content.exit-circle {
  transform-origin: var(--circle-origin, center);
  animation: pageExitCircle 0.8s var(--transition-smooth) forwards;
}
@keyframes pageExitCircle {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

/* Forward: background layer expands from origin */
.reveal-circle-bg {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #001A48;
  clip-path: circle(0% at var(--circle-origin, center));
  transition: clip-path 0.8s var(--transition-smooth);
}
.reveal-circle-bg.active {
  clip-path: circle(150% at var(--circle-origin, center));
}

/* Forward: old page content slides out to left */
.page-content.exit-slide-left {
  animation: pageExitSlideLeft 0.6s var(--transition-smooth) forwards;
}
@keyframes pageExitSlideLeft {
  0%   { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-20%); opacity: 0; }
}

/* Forward: background layer slides in from right */
.reveal-slide-bg {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #001A48;
  transform: translateX(100%);
  transition: transform 0.6s var(--transition-smooth);
}
.reveal-slide-bg.active {
  transform: translateX(0);
}

/* Reverse: old page layer shrinks to origin, new content emerges behind */
.exit-circle-layer {
  position: fixed;
  inset: 0;
  z-index: 101;
  background: #001A48;
  clip-path: circle(150% at var(--circle-origin, center));
  transition: clip-path 1.2s var(--transition-smooth), opacity 1.2s var(--transition-smooth);
}
.exit-circle-layer.active {
  clip-path: circle(0% at var(--circle-origin, center));
  opacity: 0;
}

.page-content.enter-circle {
  transform-origin: var(--circle-origin, center);
  animation: pageEnterCircle 1.2s var(--transition-smooth) forwards;
}
@keyframes pageEnterCircle {
  0%   { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* Reverse: old page layer slides out to right, new content slides in from left */
.exit-slide-layer {
  position: fixed;
  inset: 0;
  z-index: 101;
  background: #001A48;
  transition: transform 0.6s var(--transition-smooth), opacity 0.6s var(--transition-smooth);
}
.exit-slide-layer.active {
  transform: translateX(100%);
  opacity: 0;
}

.page-content.enter-slide-left {
  animation: pageEnterSlideLeft 0.6s var(--transition-smooth) forwards;
}
@keyframes pageEnterSlideLeft {
  0%   { transform: translateX(-3%); }
  100% { transform: translateX(0); }
}

/* ─── Fade In Animations ────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}
.animate-fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}
.animate-fade-in-down {
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeInDown 0.6s ease-out forwards;
}

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ─── Piano Keyboard ────────────────────────── */
.piano-container {
  position: relative;
  width: 100%;
}
.piano-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.piano-key-group {
  cursor: pointer;
}
.piano-key-visual {
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
  transform-box: fill-box;
  transform-origin: center bottom;
}
.piano-key-visual.hover {
  opacity: 0.96;
}
.piano-key-visual.pressed {
  opacity: 0.9;
  transform: translateY(3px);
}
.piano-visual {
  contain: paint;
}
.piano-interaction-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ─── Key Preview Animation ─────────────────── */
.key-preview-animation {
  position: absolute;
  left: 0;
  bottom: 102%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: none;
  opacity: 1;
  transition: opacity 120ms ease;
}
.key-preview-animation svg {
  display: block;
  filter: drop-shadow(0 0 6px rgba(254, 246, 227, 0.5)) drop-shadow(0 0 2px rgba(254, 246, 227, 0.3));
}
.key-preview-animation path[data-anim-type="fill"] {
  opacity: 0;
  transition: opacity 200ms ease;
}
.key-preview-animation path[data-anim-type="fill"].revealed {
  opacity: 1;
}

/* ─── Portfolio ─────────────────────────────── */
.page-title {
  font-family: 'Special Elite', 'Courier New', 'Courier', monospace;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: bold;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 0;
  color: #6B5E53;
  text-align: left;
  position: relative;
  z-index: 10;
}

.page-warm .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.page-warm .page-title {
  padding-top: 0.5rem;
}

.portfolio-epilogue {
  text-align: center;
  padding: clamp(3rem, 8vh, 5rem) 24px;
  font-family: 'LXGW WenKai', serif;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: 0.1em;
  color: var(--warm-ivory-dim);
}

/* Showcase: editorial magazine layout */
.portfolio-showcase {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(5rem, 12vh, 10rem);
  padding: 0 24px 6rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.project-piece {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  min-height: 50vh;
}

.project-piece--mirrored {
  direction: rtl;
}
.project-piece--mirrored > * {
  direction: ltr;
}

.project-visual {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.project-piece:hover .project-visual {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
}
.project-visual img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-piece:hover .project-visual img {
  transform: scale(1.03);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1rem 0;
}

.project-meta {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.project-info h2 {
  font-family: 'Special Elite', 'LXGW WenKai', serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--warm-ivory);
}

.project-info p {
  font-family: 'LXGW WenKai', serif;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--warm-ivory-dim);
  max-width: 42ch;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-info p a {
  color: var(--accent-warm);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}
.project-info p a:hover {
  color: var(--warm-ivory);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-warm);
  transition: color 0.3s ease;
  margin-top: 0.5rem;
}
.project-link:hover {
  color: var(--warm-ivory);
}
.project-link svg {
  transition: transform 0.3s ease;
}
.project-link:hover svg {
  transform: translate(2px, -2px);
}


/* ─── About ─────────────────────────────────── */
.about-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 5rem 3rem;
  text-align: center;
}

/* Hero: left text + right avatar */
.about-hero {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 1.25rem 4rem;
  align-items: start;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  text-align: left;
}
.about-hero > .about-name {
  grid-column: 1;
  text-align: left;
  margin-bottom: 0;
}
.about-hero > .about-typewriter {
  grid-column: 1;
  margin-bottom: 0;
}
.about-hero > .about-handwriting {
  grid-column: 1;
  margin-bottom: 0;
  overflow: hidden;
  width: fit-content;
}
.about-hero > .about-avatar {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: start;
  justify-self: center;
  width: 200px;
  height: auto;
  border-radius: 0;
  border: none;
  box-shadow: none;
  margin-top: -0.5rem;
  margin-bottom: 0;
}

/* Lower section: bio + social, full width */
.about-hero > .about-bio {
  grid-column: 1 / span 2;
  margin-top: 1.25rem;
  margin-bottom: 0;
}
.about-hero > .about-bio p {
  text-align: left;
}
.about-hero > .about-social {
  grid-column: 1 / span 2;
  margin-bottom: 0;
}

.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 2rem;
}
.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-name {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 400;
  color: var(--warm-ivory);
  margin-bottom: 3.5rem;
}
.about-bio {
  margin-bottom: 2rem;
}
.about-bio p {
  font-size: 1rem;
  color: var(--warm-ivory-dim);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}
.about-bio a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.about-bio a:hover {
  opacity: 0.8;
}
.about-skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}
.skill-pill {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--warm-ivory-ghost);
  color: var(--warm-ivory-dim);
  transition: border-color 0.3s ease, color 0.3s ease;
}
.skill-pill:hover {
  border-color: var(--warm-ivory-faint);
  color: var(--warm-ivory);
}
.about-social {
  display: flex;
  gap: 2rem;
}
.about-social a {
  font-size: 0.875rem;
  color: var(--warm-ivory-faint);
  transition: color 0.3s ease;
}
.about-social a:hover {
  color: var(--warm-ivory);
}
.social-item {
  position: relative;
  cursor: default;
  font-size: 0.875rem;
  color: var(--warm-ivory-faint);
  transition: color 0.3s ease;
}
.social-item:hover {
  color: var(--warm-ivory);
}
.social-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
  z-index: 10;
}
.social-item:hover .social-tooltip {
  opacity: 1;
  visibility: visible;
}
.social-tooltip.tooltip-right {
  left: 100%;
  bottom: auto;
  top: 50%;
  right: auto;
  transform: translateY(-50%);
  margin-left: 8px;
  margin-bottom: 0;
}
.social-tooltip img {
  display: block;
  max-width: 100px;
  max-height: 100px;
  border-radius: 8px;
}
.social-tooltip span {
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--warm-ivory);
}

/* Typewriter */
.about-typewriter {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  line-height: 2.2;
  letter-spacing: 0.08em;
  color: var(--warm-ivory-dim);
}
.typewriter-text {
  display: inline;
  border-right: 2px solid transparent;
}

/* Handwriting */
.handwriting-text {
  font-family: 'Dancing Script', 'STXingkai', '华文行楷', 'KaiTi', '楷体', 'Brush Script MT', cursive;
  font-size: 1.5rem;
  color: var(--accent-warm);
  display: inline-block;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
}
.about-stagger.active .handwriting-text {
  animation: handwriting-reveal 1.5s ease-in-out 0.8s forwards;
}

@keyframes blink-caret {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--accent-warm); }
}
@keyframes handwriting-reveal {
  to { clip-path: inset(0 0 0 0); }
}

/* About stagger animation */
.about-stagger > * {
  opacity: 0;
  transform: translateY(20px);
}
.about-stagger.active > *:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.2s forwards; }
.about-stagger.active > *:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.4s forwards; }
.about-stagger.active > *:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.6s forwards; }
.about-stagger.active > *:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.8s forwards; }
.about-stagger.active > *:nth-child(5) { animation: fadeInUp 0.6s ease-out 1.0s forwards; }
.about-stagger.active > *:nth-child(6) { animation: fadeInUp 0.6s ease-out 1.2s forwards; }

/* ─── Tag Pill (shared) ─────────────────────── */
.tag-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--warm-ivory-ghost);
  color: var(--warm-ivory-dim);
}

/* ─── Mobile / Desktop Display ──────────────── */
.desktop-only { display: none; }
@media (min-width: 641px) {
  .desktop-only { display: flex; }
  .mobile-only { display: none; }
}

/* ─── Staff Section ─────────────────────────── */
.staff-section {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding-bottom: 2rem;
}

.staff-scroll-viewport {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  margin-bottom: 0.5rem;
}
.staff-scroll-viewport:active {
  cursor: grabbing;
}

.staff-container {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  will-change: transform;
}

.staff-svg {
  height: 100%;
  width: auto;
  display: block;
}

.staff-line {
  stroke: var(--warm-ivory-ghost);
  stroke-width: 1;
}

.staff-bar-line {
  stroke: var(--warm-ivory-faint);
  stroke-width: 1.2;
}

.staff-clef {
  fill: var(--warm-ivory-dim);
}

.deco-note-head {
  fill: var(--warm-ivory-faint);
}

.deco-note-stem {
  stroke: var(--warm-ivory-faint);
  stroke-width: 1.5;
}

.nav-note {
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.nav-note:hover {
  opacity: 0.85;
}
.nav-note-head {
  fill: var(--accent-warm);
}
.nav-note-stem {
  stroke: var(--accent-warm);
  stroke-width: 2.5;
}
.nav-note-flag {
  fill: var(--accent-warm);
}
.nav-note-aura {
  fill: var(--accent-warm-faint);
}
.nav-note-text {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  fill: var(--deep-navy);
  text-anchor: middle;
  pointer-events: none;
  letter-spacing: 0.03em;
}

.staff-hint {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--warm-ivory-ghost);
  opacity: 0;
  animation: fadeIn 1s ease-out 2.5s forwards;
  pointer-events: none;
}

/* Staff Image */
.staff-img {
  height: 100%;
  width: auto;
  display: block;
  max-width: none;
  opacity: 0.65;
  transition: opacity 0.3s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.staff-scroll-viewport:hover .staff-img {
  opacity: 0.9;
}

/* Piano wrapper for flex layout */
.piano-wrapper {
  width: 100%;
  min-height: 140px;
  flex-shrink: 0;
  position: relative;
  margin-top: auto;
}
/* ─── Vinyl Cursor ──────────────────────────── */
@keyframes vinylSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

body.vinyl-cursor-active,
body.vinyl-cursor-active * {
  cursor: none !important;
}

/* ─── China Map ─────────────────────────────── */
.china-map-svg {
  width: 100%;
  height: 100%;
}
.china-map-svg path {
  stroke: rgba(254, 246, 228, 0.15);
  stroke-width: 0.3;
  fill: none;
  shape-rendering: geometricPrecision;
}

/* ─── Reduced Motion ────────────────────────── */
/* Back/forward navigation: skip entrance animations */
.prefers-no-animation .animate-fade-in-up,
.prefers-no-animation .animate-fade-in-down,
.prefers-no-animation .animate-fade-in {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================= ArielMu Experience Page ================= */

/* Base overrides for experience page */
.experience-ariel {
  --exp-bg: #F2ECE2;
  --exp-bg-map: #E3D9CA;
  --exp-ink: #1C1916;
  --exp-ink-mid: #574D44;
  --exp-ink-muted: #8C7E74;
  --exp-accent: #9E6347;
  --exp-border: rgba(28, 25, 22, 0.14);
  background: var(--exp-bg);
  color: var(--exp-ink);
  min-height: 100vh;
}


.experience-ariel .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 18px;
  position: relative;
}

/* Hero / Map Section */
.experience-ariel .hero-section {
  position: relative;
  margin-top: 0;
  margin-bottom: 24px;
}

.experience-ariel .map-container {
  position: relative;
  width: 100%;
  height: 560px;
  margin-top: 0;
  z-index: 1;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--exp-bg);
}

.experience-ariel #map-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.experience-ariel .world-map {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.8;
  display: block;
}



/* SVG Map Markers */
.experience-ariel .svg-marker {
  cursor: pointer;
}

.experience-ariel .marker-pulse {
  animation: markerPulseAriel 2.4s ease-in-out infinite;
}
@keyframes markerPulseAriel {
  0%, 100% { stroke-width: 1; opacity: 0.35; r: 10; }
  50% { stroke-width: 0.3; opacity: 0; r: 22; }
}

.experience-ariel .marker-dot {
  transition: fill 0.2s ease, transform 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.experience-ariel .marker-label {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

/* Experience List */
.experience-ariel .experience-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 80px;
}

.experience-ariel .experience-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  column-gap: 40px;
  align-items: start;
  border-bottom: 1px solid var(--exp-border, rgba(0, 0, 0, 0.08));
  padding-bottom: 40px;
}

.experience-ariel .experience-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Left Column */
.experience-ariel .col-left {
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* Dates: end date (large) + start date (small) — tightly grouped */
.experience-ariel .col-dates {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.experience-ariel .col-date-end {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  line-height: 1.3;
  color: var(--exp-ink);
}

.experience-ariel .col-date-start {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--exp-ink-muted);
}

/* Tag — separated from dates, lighter style */
.experience-ariel .col-left .tag {
  /* margin handled by .tag-row */
}

/* Org / Position / City — tightly grouped */
.experience-ariel .company-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--exp-ink);
  line-height: 1.4;
  margin-top: 10px;
}

.experience-ariel .col-position {
  font-size: 0.8rem;
  color: var(--exp-ink-mid);
  line-height: 1.5;
}

.experience-ariel .col-city {
  font-size: 0.75rem;
  color: var(--exp-ink-muted);
  line-height: 1.5;
}

.experience-ariel .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  color: var(--exp-ink-mid);
  line-height: 1;
  box-sizing: border-box;
  letter-spacing: 0.05em;
  background: var(--exp-bg-map);
}

.experience-ariel .tag-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 8px;
}

/* Right Column */
.experience-ariel .col-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Job Item */
.experience-ariel .job-item {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 40px;
  align-items: flex-start;
  transition: opacity 0.3s ease;
}

.experience-ariel .experience-list:hover .job-item {
  opacity: 0.5;
}

.experience-ariel .job-item:hover {
  opacity: 1 !important;
}

.experience-ariel .job-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--exp-ink-mid);
}

.experience-ariel .job-desc > div > * {
  margin: 0 0 0.6em 0;
}
.experience-ariel .job-desc > div > *:last-child {
  margin-bottom: 0;
}

.experience-ariel .job-desc ul {
  padding-left: 1.2em;
  margin: 0.4em 0;
}
.experience-ariel .job-desc li {
  margin-bottom: 0.3em;
}
.experience-ariel .job-desc li:last-child {
  margin-bottom: 0;
}

.experience-ariel .job-desc strong,
.experience-ariel .job-desc b {
  color: var(--exp-ink);
  font-weight: 600;
}

.experience-ariel .job-desc a {
  color: var(--accent-warm);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}
.experience-ariel .job-desc a:hover {
  color: var(--exp-ink);
}

.experience-ariel .job-role {
  text-align: right;
}

.experience-ariel .role-zh {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  display: block;
  color: var(--exp-ink);
  margin-bottom: 4px;
}

.experience-ariel .role-en {
  font-size: 12px;
  color: var(--exp-ink-muted);
  display: block;
}

/* Responsive - Tablet (640px - 1024px) */
@media (max-width: 1024px) {
  .experience-ariel .job-item {
    grid-template-columns: 1fr 150px;
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .page-title {
    font-size: 36px;
  }

  .experience-ariel .experience-list {
    gap: 24px;
  }

  .experience-ariel .experience-item {
    grid-template-columns: 1fr;
    padding-bottom: 24px;
  }

  .experience-ariel .experience-item:last-child {
    padding-bottom: 0;
  }

  .experience-ariel .col-left {
    flex-direction: column;
    gap: 3px;
  }

  .experience-ariel .col-date-end {
    font-size: 1.5rem;
  }

  .experience-ariel .col-date-start {
    font-size: 0.9rem;
  }

  .experience-ariel .job-item {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .experience-ariel .job-role {
    text-align: left;
  }

  .experience-ariel .experience-list:hover .job-item {
    opacity: 1;
  }

  .experience-ariel .map-container {
    height: 360px;
    background-position: center center;
    background-size: 475px auto;
  }
}

/* ─── Warm Theme (Portfolio, About) ─────────── */
.page-warm {
  --deep-navy: #F2ECE2;
  --deep-navy-light: #E3D9CA;
  --warm-ivory: #1C1916;
  --warm-ivory-dim: #574D44;
  --warm-ivory-faint: rgba(28, 25, 22, 0.35);
  --warm-ivory-ghost: rgba(28, 25, 22, 0.12);
  --accent-warm: #2A7B72;
  background: #F2ECE2;
  color: #1C1916;
}
@media (max-width: 640px) {
  .page-title {
    font-size: 28px;
  }
}


/* Portfolio warm overrides */
.page-warm .project-visual {
  box-shadow: 0 4px 20px rgba(28, 25, 22, 0.1), 0 1px 4px rgba(28, 25, 22, 0.06);
}
.page-warm .project-piece:hover .project-visual {
  box-shadow: 0 8px 32px rgba(28, 25, 22, 0.14), 0 2px 8px rgba(28, 25, 22, 0.08);
}
.page-warm .tag-pill {
  border-color: var(--warm-ivory-ghost);
  color: var(--warm-ivory-dim);
}
.page-warm .portfolio-epilogue {
  color: #574D44;
}

@media (max-width: 640px) {
  .project-piece {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: auto;
  }
  .project-piece--mirrored {
    direction: ltr;
  }
  .project-info {
    padding: 0;
    gap: 1rem;
  }
  .project-info h2 {
    font-size: 1.5rem;
  }
  .project-visual {
    order: -1;
  }
}

/* About page responsive */
@media (max-width: 900px) {
  .about-hero {
    grid-template-columns: 1fr 200px;
    gap: 0 2rem;
  }
  .about-hero > .about-avatar {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 640px) {
  .about-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .about-hero > .about-name {
    text-align: center;
  }
  .about-hero > .about-typewriter {
    font-size: 0.8rem;
  }
  .about-hero > .about-handwriting {
    margin: 0 auto;
  }
  .about-hero > .about-bio p {
    text-align: center;
  }
  .about-hero > .about-avatar {
    width: 180px;
    height: 180px;
    margin-bottom: 0.5rem;
    order: -1;
  }
}

@media (max-width: 640px) {
  .experience-ariel .map-container {
    height: 300px;
    background-position: center center;
    background-size: 380px auto;
  }

  .portfolio-showcase {
    padding: 0 16px 4rem;
    gap: 3rem;
  }

  .project-modal-body {
    padding: 1.5rem;
  }
  .project-modal-image {
    height: 200px;
  }
}

/* ─── Page Header Navigation ────────────────── */
.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: #F2ECE2;
}

/* Push page content down to avoid being hidden under fixed header */
/* Header height ~56px (20px top + 28px title + 8px bottom) + small buffer */
body:has(.page-header) .page {
  padding-top: 80px;
}

.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

/* Title inside header: preserve existing .page-title animation classes */
.page-header .page-title {
  margin: 0;
  padding-top: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.page-nav a {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: #8B7E73;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.page-nav a:hover {
  color: #2A7B72;
}

.page-nav a[aria-current="page"] {
  font-weight: 600;
  color: #1C1916;
  cursor: default;
}

/* Experience page nav hover override */
.experience-ariel .page-nav a:hover {
  color: #9E6347;
}

/* Mobile */
@media (max-width: 640px) {
  .page-header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.875rem 1rem 0.375rem;
    gap: 0.5rem;
  }

  .page-header .page-title {
    font-size: 1.125rem;
  }

  .page-nav {
    gap: 1rem;
  }

  .page-nav a {
    font-size: 0.6875rem;
  }

  /* Mobile header taller due to vertical stacking: ~80px + buffer */
  body:has(.page-header) .page {
    padding-top: 104px;
  }
}

/* ─── Page Quote ────────────────────────────── */
.page-quote {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--deep-navy);
  padding: 1rem 1rem 2.5rem;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* ─── Portrait Gate (deprecated) ─────────────── */
/* The piano keyboard, journey map, and BSWC experience are all horizontal compositions.
   On portrait mobile we no longer block the site — instead we rotate the entire body 90deg
   so the horizontal layout fills the screen without forcing the user to physically rotate. */
.portrait-gate {
  display: none;
}

@media (max-width: 1024px) and (orientation: portrait) {
  /* Rotate the document so a portrait mobile viewport renders the horizontal layout. */
  html {
    overflow: hidden;
    height: 100%;
    width: 100%;
  }
  body {
    /* Swap dimensions: body lays out as a landscape canvas (vh wide, vw tall). */
    width: 100vh;
    height: 100vw;
    /* Center body geometrically inside the portrait viewport, then rotate around its center. */
    position: fixed;
    top: calc((100vh - 100vw) / 2);
    left: calc((100vw - 100vh) / 2);
    transform-origin: center center;
    transform: rotate(90deg);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
