/* ==========================================================================
   Maynard K. Nay-osan — Medieval Gothic Portfolio Stylesheet
   Theme: Ancient Gothic Library / Fixed-Screen Desktop Experience (100dvh)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500;1,600&family=IBM+Plex+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* CSS Variables: Dual Theme System */
:root {
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-gothic: 'Cinzel', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Dark Theme (Default) */
  --bg-deep: #0b0d11;
  --bg-surface: rgba(16, 19, 25, 0.82);
  --bg-card: rgba(23, 27, 35, 0.72);
  --bg-card-hover: rgba(32, 38, 49, 0.9);
  
  --text-main: #f5f2ea;
  --text-muted: #aba495;
  --text-faint: #756f63;

  --accent-gold: #c9a46c;
  --accent-gold-light: #e6c58f;
  --accent-gold-dark: #8c6a38;
  --gold-glow: rgba(201, 164, 108, 0.25);
  
  --border-line: rgba(212, 180, 130, 0.16);
  --border-gold: rgba(201, 164, 108, 0.42);
  --border-subtle: rgba(255, 255, 255, 0.07);

  --bg-image: url('../assets/medieval-interior-dark.webp');
  --bg-overlay: linear-gradient(180deg, rgba(11, 13, 17, 0.74) 0%, rgba(11, 13, 17, 0.84) 100%);
  
  --shadow-card: 0 14px 34px -8px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-line);
  --card-radius: 10px;
  --gold-btn-text: #101216;
  --status-done-color: #34d399;
  --status-done-bg: rgba(52, 211, 153, 0.14);
  --status-done-border: rgba(52, 211, 153, 0.34);
  --status-done-glow: rgba(52, 211, 153, 0.45);
}

[data-theme="light"] {
  /* Light Theme: Sunlit Gothic Scriptorium */
  --bg-deep: #f2eee4;
  --bg-surface: rgba(246, 242, 233, 0.88);
  --bg-card: rgba(255, 252, 246, 0.78);
  --bg-card-hover: rgba(255, 255, 255, 0.96);

  --text-main: #24211a;
  --text-muted: #665f50;
  --text-faint: #847b6c;

  --accent-gold: #8c6738;
  --accent-gold-light: #a98048;
  --accent-gold-dark: #5e4320;
  --gold-glow: rgba(140, 103, 56, 0.2);

  --border-line: rgba(140, 103, 56, 0.2);
  --border-gold: rgba(140, 103, 56, 0.48);
  --border-subtle: rgba(36, 33, 26, 0.1);

  --bg-image: url('../assets/medieval-interior-light.webp');
  --bg-overlay: linear-gradient(180deg, rgba(242, 238, 228, 0.76) 0%, rgba(242, 238, 228, 0.86) 100%);
  --shadow-card: 0 12px 28px -8px rgba(90, 75, 55, 0.16), 0 0 0 1px var(--border-line);
  --gold-btn-text: #fffcf6;
  --status-done-color: #15803d;
  --status-done-bg: rgba(21, 128, 61, 0.11);
  --status-done-border: rgba(21, 128, 61, 0.35);
  --status-done-glow: rgba(21, 128, 61, 0.25);
}

/* Base Reset & Fixed Viewport */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden; /* Desktop: strictly no vertical page scroll */
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.55;
  position: relative;
  transition: background-color 0.5s ease, color 0.5s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Background System & Atmospheric Layers
   Layer 0: Medieval Background Image
   Layer 1: Atmospheric Candlelight/Mist
   Layer 2: Interactive Smoke Cursor Canvas (#smoke-canvas)
   Layer 3: Atmospheric Dust Motes Canvas (#dust-canvas)
   Layer 4: App Shell (Navigation, Content, Footer)
   ========================================================================== */

.medieval-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  transition: background-image 0.7s ease;
  pointer-events: none;
}

.medieval-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

.atmospheric-mist {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 55% 40% at 20% 70%, var(--gold-glow), transparent 70%),
    radial-gradient(ellipse 45% 45% at 85% 30%, rgba(200, 160, 100, 0.08), transparent 60%);
  opacity: 0.65;
  animation: atmosphericBreathe 20s ease-in-out infinite alternate;
}

@keyframes atmosphericBreathe {
  0% { transform: scale(1) translateY(0); opacity: 0.55; }
  50% { transform: scale(1.03) translateY(-8px); opacity: 0.75; }
  100% { transform: scale(1.01) translateY(4px); opacity: 0.6; }
}

/* Smoke Canvas Layer (Cursor Trail) */
#smoke-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.85;
}

/* Ambient Dust Particles Layer */
#dust-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* Main Application Shell: Full Height Fixed Layout */
.app-shell {
  position: relative;
  z-index: 4;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   Top Navigation Bar (Fixed Height: 68px)
   ========================================================================== */
.topbar {
  flex: 0 0 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 3rem;
  border-bottom: 1px solid var(--border-line);
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 20;
}

/* Brand Monogram Shield */
.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-shield {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 42px;
  border: 1px solid var(--border-gold);
  border-radius: 2px 2px 18px 18px;
  background: rgba(20, 22, 28, 0.45);
  color: var(--accent-gold);
  font-family: var(--font-gothic);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.05em;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.brand-shield::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(201, 164, 108, 0.2);
  border-radius: 1px 1px 16px 16px;
  pointer-events: none;
}

.brand-mark:hover .brand-shield {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--gold-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-gothic);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--text-main);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Navigation Links (Strictly 3 Pages: 01 Homepage, 02 Personal Info, 03 Achievements) */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
}

.nav-item a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-gothic);
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.2rem;
  white-space: nowrap;
  transition: color 0.25s ease;
  cursor: pointer;
}

.nav-item a .nav-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-gold);
  opacity: 0.8;
}

.nav-item a:hover {
  color: var(--text-main);
}

.nav-item.active a {
  color: var(--accent-gold);
  font-weight: 600;
}

.nav-item.active a::after {
  content: "✦";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--accent-gold);
  text-shadow: 0 0 6px var(--gold-glow);
}

/* Header Actions & Theme Toggle */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-line);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--accent-gold);
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  position: relative;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px var(--gold-glow);
  transform: rotate(15deg);
}

.theme-toggle-btn svg {
  width: 19px;
  height: 19px;
  display: block;
  transition: transform 0.3s ease;
}

/* Medieval Vector Icon Utilities */
.med-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  color: var(--accent-gold);
  vertical-align: middle;
}

.med-chip-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  display: block;
}

.ab-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.4rem;
  color: var(--text-faint);
  transition: color 0.2s ease, transform 0.2s ease;
}

.ab-tab.active .ab-tab-icon {
  color: var(--accent-gold);
  transform: scale(1.1);
}

.ab-tab-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  display: block;
}

/* ==========================================================================
   Main Viewport: Fixed Screen Container
   ========================================================================== */
.main-viewport {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 3rem;
  overflow: hidden;
}

.view-stage {
  width: 100%;
  max-width: 1360px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Individual Section Views */
.section-view {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-view.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Section 1: HOME VIEW (Side-by-Side Portrait & Information)
   ========================================================================== */
.home-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1.25fr;
  gap: 3.5rem;
  align-items: center;
}

/* Portrait Stage & Celestial Astrolabe */
.portrait-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.astrolabe-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201, 164, 108, 0.22);
  pointer-events: none;
}

.astrolabe-outer {
  width: 400px;
  height: 400px;
  border-style: dashed;
  animation: astrolabeRotate 110s linear infinite;
}

.astrolabe-mid {
  width: 340px;
  height: 340px;
  border-color: rgba(201, 164, 108, 0.3);
}

.astrolabe-inner {
  width: 290px;
  height: 290px;
  border: 1px solid rgba(201, 164, 108, 0.16);
  animation: astrolabeRotateReverse 85s linear infinite;
}

.astrolabe-star {
  position: absolute;
  color: var(--accent-gold);
  font-size: 0.8rem;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px var(--gold-glow));
}
.star-top { top: -7px; left: calc(50% - 5px); }
.star-right { right: -7px; top: calc(50% - 5px); }
.star-bottom { bottom: -7px; left: calc(50% - 5px); }
.star-left { left: -7px; top: calc(50% - 5px); }

@keyframes astrolabeRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes astrolabeRotateReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Portrait Frame */
.portrait-frame {
  position: relative;
  width: 290px;
  height: 380px;
  border-radius: 145px 145px 8px 8px; /* Gothic arch curvature */
  overflow: hidden;
  border: 2px solid var(--border-gold);
  box-shadow: 
    0 20px 40px -10px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(201, 164, 108, 0.28),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  background: var(--bg-surface);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.portrait-frame:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.75), 0 0 20px var(--gold-glow);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  display: block;
}

.portrait-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 72%, rgba(11, 13, 17, 0.45) 100%);
  pointer-events: none;
}

/* Home Content Column */
.home-content {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-gothic);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.kicker-line {
  width: 40px;
  height: 1px;
  background: var(--accent-gold);
  opacity: 0.6;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 3.8vw, 3.9rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-wrap: balance;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.accent-italic {
  font-style: italic;
  color: var(--accent-gold);
  font-weight: 400;
  padding-left: 0.15em;
}

.hero-role {
  font-family: var(--font-gothic);
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.hero-role::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--border-gold);
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 1.8vw, 1.65rem);
  line-height: 1.35;
  font-weight: 300;
  color: var(--text-main);
  max-width: 32ch;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero-lead {
  font-size: 0.91rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 58ch;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.hero-lead-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hero-lead strong {
  color: var(--text-main);
  font-weight: 600;
}

.hero-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.chip-status-active {
  border-color: var(--status-done-border);
}

.chip-status-active .med-chip-icon {
  color: var(--status-done-color);
}

.lang-sub {
  color: var(--text-muted);
  font-size: 0.67rem;
}

/* Key Qualification Cards Grid */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 0.2rem 0;
}

.fact-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--card-radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}

.fact-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

.fact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(201, 164, 108, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(201, 164, 108, 0.25);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.fact-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.fact-text {
  display: flex;
  flex-direction: column;
}

.fact-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

.fact-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Home Currently Learning Panel */
.currently-learning-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
  background: rgba(201, 164, 108, 0.08);
  border: 1px solid var(--border-line);
  border-radius: var(--card-radius);
  font-size: 0.85rem;
}

.learning-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-gothic);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.learning-tags {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-main);
}

.lang-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
  margin-right: 0.35rem;
}

/* Action Buttons Strip */
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.45rem;
  font-family: var(--font-gothic);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 30px;
  transition: all 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gold);
  color: var(--gold-btn-text);
  border: 1px solid var(--accent-gold);
  font-weight: 600;
  box-shadow: 0 4px 14px var(--gold-glow);
}

.btn-primary:hover {
  background: var(--accent-gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--gold-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-gold);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

/* ==========================================================================
   Page 02: PERSONAL INFO VIEW
   1. Player Info (Left) -> 2. More About Me -> 3. Skills -> 4. My Advancement
   ========================================================================== */
.about-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 355px 1fr;
  gap: 1.75rem;
  align-items: stretch;
  min-height: 0;
}

/* Left Column: Player Info Card */
.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--card-radius);
  padding: 1.05rem 1.25rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
  overflow-y: visible;
}

.player-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-line);
}

.player-thumb-ring {
  width: 68px;
  height: 68px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-gold);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.player-thumb-ring img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.player-title-block h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.15;
}

.player-role-badge {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* Level & XP Gauge */
.player-xp-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.65rem;
  background: rgba(201, 164, 108, 0.08);
  border: 1px solid var(--border-line);
  border-radius: 6px;
}

.lvl-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--gold-btn-text);
  background: var(--accent-gold);
  padding: 0.14rem 0.42rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.xp-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-line);
}

.xp-bar-fill {
  width: 75%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold-dark), var(--accent-gold-light));
  border-radius: 3px;
  box-shadow: 0 0 6px var(--gold-glow);
}

.xp-percent {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent-gold);
}

/* Player Stats Table */
.player-specs-table {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.76rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.24rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-key {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.spec-val {
  color: var(--text-main);
  text-align: right;
  font-weight: 500;
  font-size: 0.77rem;
}

.spec-val a {
  color: var(--text-main);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}
.spec-val a:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

/* Right Column: Ordered Content Stage */
.about-stage {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  height: 100%;
  min-height: 0;
}

/* Section Selector Bar (3 Independent Sections) */
.about-tabbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ab-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-gothic);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.ab-tab:hover {
  color: var(--text-main);
  border-color: var(--border-gold);
}

.ab-tab.active {
  background: rgba(201, 164, 108, 0.16);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 600;
  box-shadow: 0 0 10px var(--gold-glow);
}

.ab-tab-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  background: rgba(201, 164, 108, 0.18);
  color: var(--accent-gold);
}

.pi-tab-counter {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-gold);
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border-line);
  border-radius: 4px;
  background: var(--bg-card);
}

/* Single-Panel Desktop Stage (No Internal Scrollbar) */
.pi-panels-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.pi-block {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pi-block.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.pi-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-line);
}

.pi-block-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.pi-block-title h3 {
  font-family: var(--font-serif);
  font-size: 1.38rem;
  font-weight: 500;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  border: none;
}

.pi-order-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--accent-gold);
  padding: 0.16rem 0.5rem;
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  background: rgba(201, 164, 108, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ==========================================================================
   2. More About Me (Personal Biography & Interests)
   ========================================================================== */
.bio-card {
  padding: 1.25rem 1.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bio-text-content {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.bio-text-content p strong {
  color: var(--text-main);
  font-weight: 600;
}

.hobbies-inline-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-subtle);
}

.hobby-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-main);
  padding: 0.25rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 5px;
}

.hobby-tag svg {
  color: var(--accent-gold);
  flex-shrink: 0;
}

.hobby-sep {
  color: var(--accent-gold);
  opacity: 0.55;
  font-weight: 600;
}

/* ==========================================================================
   3. Skills & Technical Knowledge (3-Column, 2-Row Balanced Desktop Grid)
   ========================================================================== */
.skills-panel-wrapper {
  padding: 0.95rem 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.pi-skills-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.72rem;
  align-items: stretch;
}

/* Row 1: Three equal cards */
.skill-pos-1 { grid-column: 1 / 3; }
.skill-pos-2 { grid-column: 3 / 5; }
.skill-pos-3 { grid-column: 5 / 7; }

/* Row 2: Two equal cards centered cleanly */
.skill-pos-4 { grid-column: 2 / 4; }
.skill-pos-5 { grid-column: 4 / 6; }

/* ==========================================================================
   4. My Advancement (Milestones)
   ========================================================================== */
.advancements-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.adv-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.95rem;
  background: rgba(201, 164, 108, 0.1);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  font-size: 0.78rem;
}

.adv-banner-title {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-gothic);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.adv-banner-progress {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-main);
}

.advancements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.adv-card {
  display: flex;
  gap: 0.8rem;
  padding: 0.95rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--card-radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  position: relative;
}

.adv-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

.adv-card.completed {
  border-top: 2px solid var(--status-done-color);
}

.adv-card.in-progress {
  border-top: 2px solid var(--accent-gold);
}

.adv-icon-slot {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-line);
  background: var(--bg-card);
  transition: all 0.25s ease;
}

.adv-icon-slot svg {
  width: 21px;
  height: 21px;
  display: block;
}

.adv-card.completed .adv-icon-slot {
  border-color: var(--status-done-border);
  background: var(--status-done-bg);
  color: var(--status-done-color);
}

.adv-card.completed .adv-icon-slot svg {
  stroke: var(--status-done-color);
  filter: drop-shadow(0 0 5px var(--status-done-glow));
}

.adv-card.in-progress .adv-icon-slot {
  border-color: var(--border-gold);
  background: rgba(201, 164, 108, 0.12);
  color: var(--accent-gold);
}

.adv-card.in-progress .adv-icon-slot svg {
  stroke: var(--accent-gold);
  filter: drop-shadow(0 0 5px var(--gold-glow));
}

.adv-info {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1;
}

.adv-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.adv-num {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--accent-gold);
}

.adv-status-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.1rem 0.42rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.adv-status-tag.done {
  background: var(--status-done-bg);
  color: var(--status-done-color);
  border: 1px solid var(--status-done-border);
}

.adv-status-tag.prog {
  background: rgba(201, 164, 108, 0.15);
  color: var(--accent-gold);
  border: 1px solid var(--border-gold);
}

.adv-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.2;
}

.adv-desc {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.48;
}

/* ==========================================================================
   Tab 3: Inventory (Hobbies & Interests Hotbar)
   ========================================================================== */
.inventory-stage {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.inventory-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.8rem;
  background: rgba(201, 164, 108, 0.08);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-gold);
}

.hotbar-slots-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.inv-slot {
  aspect-ratio: 1;
  max-height: 80px;
  background: rgba(14, 17, 23, 0.9);
  border: 2px solid var(--border-line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7);
}

.inv-slot:hover {
  border-color: var(--accent-gold-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--gold-glow);
}

.inv-slot.selected {
  border-color: var(--accent-gold);
  background: rgba(201, 164, 108, 0.16);
  box-shadow: 0 0 14px var(--gold-glow), inset 0 0 8px rgba(201, 164, 108, 0.2);
  transform: scale(1.03);
}

.inv-slot-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.inv-slot-icon svg {
  width: 25px;
  height: 25px;
  stroke: var(--accent-gold);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  transition: transform 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
}

.inv-slot:hover .inv-slot-icon svg,
.inv-slot.selected .inv-slot-icon svg {
  stroke: #fdf6e7;
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px rgba(201, 164, 108, 0.7));
}

.inv-slot-number {
  position: absolute;
  top: 4px;
  left: 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
}

.inv-slot.selected .inv-slot-number {
  color: var(--accent-gold);
  font-weight: 600;
}

/* Item Lore Inspector Card */
.item-lore-panel {
  padding: 1.25rem 1.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.lore-large-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: rgba(201, 164, 108, 0.12);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lore-large-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--accent-gold);
  filter: drop-shadow(0 0 10px rgba(201, 164, 108, 0.5));
  transition: all 0.3s ease;
}

.lore-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.lore-type-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lore-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.2;
}

.lore-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.lore-instruction {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  margin-top: 0.2rem;
}

/* About Right Side Cards */
.about-cards {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--card-radius);
  padding: 1.4rem 1.6rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease;
}

.glass-panel:hover {
  border-color: var(--border-gold);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.panel-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-gold);
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-gold);
  border-radius: 4px;
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--text-main);
}

.glass-panel p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.glass-panel strong {
  color: var(--text-main);
  font-weight: 600;
}

.interests-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.interest-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-main);
}

/* ==========================================================================
   Section Header Shared & Page 03: ACHIEVEMENTS SHOWCASE VIEW
   ========================================================================== */
.section-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 2.8vw, 2.55rem);
  font-weight: 400;
  color: var(--text-main);
  line-height: 1.1;
}

.section-head p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 58ch;
}

.skill-card {
  padding: 0.78rem 0.92rem;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--card-radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

.skill-card-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-gothic);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent-gold);
  text-transform: uppercase;
  line-height: 1.2;
}

.skill-badge-list {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.skill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.55rem;
  background: rgba(201, 164, 108, 0.08);
  border: 1px solid var(--border-line);
  border-radius: 5px;
  font-size: 0.77rem;
  line-height: 1.25;
  color: var(--text-main);
}

.skill-level {
  font-family: var(--font-mono);
  font-size: 0.59rem;
  color: var(--accent-gold);
  text-align: right;
  white-space: nowrap;
}

/* Page 03: My Achievements (One-Page Showcase with Subtle Historical Framing) */
@media (min-width: 1121px) {
  .main-viewport:has(#view-achievements.active) {
    padding: 0.72rem 1.85rem;
  }

  .main-viewport:has(#view-achievements.active) .view-stage {
    max-width: 1540px;
  }
}

.achievements-container {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.58rem;
}

.archive-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
}

.archive-kicker {
  margin-bottom: 0;
}

.archive-ornament {
  color: var(--accent-gold);
  font-size: 0.88rem;
  line-height: 1;
}

.archive-title {
  font-family: var(--font-gothic);
  font-size: clamp(1.45rem, 2.25vw, 1.96rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.08;
  color: var(--text-main);
}

.archive-intro {
  font-size: clamp(0.8rem, 0.96vw, 0.9rem);
  line-height: 1.44;
  color: var(--text-muted);
  max-width: 1220px;
}

/* 5-Column Simultaneous Achievements Grid */
.achievements-showcase-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.archive-card {
  position: relative;
  height: 100%;
  min-height: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-top: 2px solid var(--accent-gold);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

/* Subtle antique-gold four-corner ticks (0px extra layout space) */
.archive-card::before {
  content: "";
  position: absolute;
  inset: 3px;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(var(--accent-gold), var(--accent-gold)) top left / 10px 1px no-repeat,
    linear-gradient(var(--accent-gold), var(--accent-gold)) top left / 1px 10px no-repeat,
    linear-gradient(var(--accent-gold), var(--accent-gold)) top right / 10px 1px no-repeat,
    linear-gradient(var(--accent-gold), var(--accent-gold)) top right / 1px 10px no-repeat,
    linear-gradient(var(--accent-gold), var(--accent-gold)) bottom left / 10px 1px no-repeat,
    linear-gradient(var(--accent-gold), var(--accent-gold)) bottom left / 1px 10px no-repeat,
    linear-gradient(var(--accent-gold), var(--accent-gold)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--accent-gold), var(--accent-gold)) bottom right / 1px 10px no-repeat;
  opacity: 0.55;
}

.archive-card::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201, 164, 108, 0.12);
  border-radius: calc(var(--card-radius) - 3px);
  pointer-events: none;
}

.archive-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  box-shadow: 0 16px 34px -10px rgba(0, 0, 0, 0.52), 0 0 16px var(--gold-glow);
}

.archive-card:hover::before {
  opacity: 0.9;
}

.archive-card-active {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-card), 0 0 12px var(--gold-glow);
}

.archive-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.42rem 0.72rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(201, 164, 108, 0.045);
  flex-shrink: 0;
}

.archive-numeral {
  font-family: var(--font-gothic);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  line-height: 1;
}

.archive-seal-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-line);
  background: rgba(201, 164, 108, 0.06);
  padding: 0.12rem 0.42rem;
  border-radius: 3px;
  white-space: nowrap;
}

.archive-status-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--status-done-color);
  background: var(--status-done-bg);
  border: 1px solid var(--status-done-border);
  padding: 0.12rem 0.44rem;
  border-radius: 3px;
  white-space: nowrap;
}

/* Framed Certificate / ID Preview Slot (Larger previews, object-fit: contain) */
.archive-frame {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-bottom: 1px solid var(--border-line);
  width: 100%;
  height: clamp(192px, 29.5vh, 360px);
  flex-shrink: 0;
  padding: 0.28rem;
  background: rgba(12, 14, 18, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  transition: background-color 0.25s ease;
}

[data-theme="light"] .archive-frame {
  background: rgba(140, 103, 56, 0.07);
}

.archive-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 3px;
  border: 1px solid rgba(201, 164, 108, 0.32);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease;
}

.archive-card:hover .archive-frame img,
.archive-frame:focus-visible img {
  transform: scale(1.025);
}

.evidence-zoom-pill {
  position: absolute;
  right: 0.5rem;
  bottom: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-btn-text);
  background: var(--accent-gold);
  padding: 0.15rem 0.44rem;
  border-radius: 3px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.archive-frame:hover .evidence-zoom-pill,
.archive-frame:focus-visible .evidence-zoom-pill {
  opacity: 1;
  transform: translateY(0);
}

.achievement-card-body {
  padding: 0.58rem 0.78rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  flex: 1 1 auto;
  min-height: 0;
}

.achievement-category {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 0.66vw, 0.66rem);
  color: var(--accent-gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.achievement-card-title {
  font-family: var(--font-serif);
  font-size: clamp(1.04rem, 1.22vw, 1.2rem);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.16;
}

.archive-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.07rem;
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 0.65vw, 0.66rem);
  color: var(--text-faint);
  line-height: 1.28;
  padding-bottom: 0.22rem;
  border-bottom: 1px solid var(--border-subtle);
}

.archive-date {
  color: var(--accent-gold);
  font-weight: 500;
}

.achievement-card-desc {
  font-size: clamp(0.76rem, 0.85vw, 0.86rem);
  color: var(--text-muted);
  line-height: 1.4;
}

.archive-card-actions {
  margin-top: auto;
  padding-top: 0.34rem;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  position: relative;
  z-index: 2;
}

.archive-card-actions-dual {
  gap: 0.22rem;
}

.archive-btn {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  background: rgba(201, 164, 108, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: clamp(0.59rem, 0.64vw, 0.65rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.archive-btn:hover,
.archive-btn:focus-visible {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--gold-btn-text);
}

.archive-btn-gold {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--gold-btn-text);
  font-weight: 600;
}

.archive-btn-gold:hover,
.archive-btn-gold:focus-visible {
  background: var(--accent-gold-light);
  border-color: var(--accent-gold-light);
  color: var(--gold-btn-text);
}

/* Compact Closing Section (~10% height) */
.archive-closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
  padding-top: 0.04rem;
}

.archive-closing-rule {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rule-wing {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.rule-diamond {
  color: var(--accent-gold);
  font-size: 0.72rem;
  line-height: 1;
}

.archive-closing-content {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  max-width: 1120px;
}

.archive-closing-title {
  font-family: var(--font-gothic);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  color: var(--accent-gold);
}

.archive-closing-text {
  font-size: clamp(0.74rem, 0.84vw, 0.82rem);
  color: var(--text-muted);
  line-height: 1.35;
}

/* Desktop Short Viewport Adaptation (1366 x 768) */
@media (max-height: 820px) and (min-width: 1121px) {
  .achievements-container {
    gap: 0.4rem;
  }

  .archive-head {
    gap: 0.12rem;
  }

  .archive-title {
    font-size: 1.4rem;
  }

  .archive-intro {
    font-size: 0.77rem;
    line-height: 1.35;
  }

  .archive-card-top {
    padding: 0.34rem 0.65rem;
  }

  .archive-frame {
    height: 194px;
    padding: 0.26rem;
  }

  .achievement-card-body {
    padding: 0.44rem 0.65rem 0.48rem;
    gap: 0.18rem;
  }

  .achievement-category {
    font-size: 0.59rem;
  }

  .achievement-card-title {
    font-size: 1.02rem;
  }

  .archive-meta-stack {
    font-size: 0.58rem;
    padding-bottom: 0.16rem;
  }

  .achievement-card-desc {
    font-size: 0.75rem;
    line-height: 1.34;
  }

  .archive-btn {
    padding: 0.28rem 0.44rem;
    font-size: 0.58rem;
  }

  .archive-closing {
    gap: 0.12rem;
  }

  .archive-closing-text {
    font-size: 0.73rem;
  }
}

/* ==========================================================================
   Royal Archive Modals (Image Lightbox & TESDA NC II Competency Details)
   ========================================================================== */
.archive-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 10, 14, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

[data-theme="light"] .archive-modal-overlay {
  background: rgba(28, 24, 18, 0.74);
}

.archive-modal-overlay.open {
  display: flex;
}

.archive-lightbox-panel,
.archive-modal-panel {
  width: 100%;
  max-width: 960px;
  max-height: 90dvh;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-top: 2px solid var(--accent-gold);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.archive-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-line);
  background: rgba(201, 164, 108, 0.06);
}

.archive-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.archive-modal-kicker {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.archive-modal-heading h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1.8vw, 1.38rem);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.archive-modal-sub {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
}

.archive-modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.archive-modal-close:hover,
.archive-modal-close:focus-visible {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--gold-btn-text);
}

.archive-lightbox-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.28);
}

[data-theme="light"] .archive-lightbox-stage {
  background: rgba(242, 238, 228, 0.55);
}

.lightbox-image-wrap {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 66dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.lightbox-nav-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-nav-btn:hover,
.lightbox-nav-btn:focus-visible {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--gold-btn-text);
}

.archive-lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 1.2rem;
  border-top: 1px solid var(--border-line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.lightbox-counter {
  color: var(--accent-gold);
  font-weight: 600;
  white-space: nowrap;
}

.archive-modal-body {
  padding: 1rem 1.2rem 1.15rem;
  overflow-y: auto;
}

.nc2-competency-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.nc2-right-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nc2-group {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-top: 2px solid var(--accent-gold);
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
}

.nc2-group h4 {
  font-family: var(--font-gothic);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.nc2-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.nc2-unit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.nc2-unit-list li {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 0.55rem;
  align-items: baseline;
  font-size: 0.77rem;
  line-height: 1.38;
  color: var(--text-main);
}

.nc2-code {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent-gold);
  background: rgba(201, 164, 108, 0.1);
  border: 1px solid var(--border-line);
  padding: 0.08rem 0.32rem;
  border-radius: 3px;
  text-align: center;
  white-space: nowrap;
}

/* ==========================================================================
   Footer Bar (Fixed Height: 48px)
   ========================================================================== */
.footer-bar {
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-line);
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20;
}

.footer-pager {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-btn-nav {
  background: none;
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  padding: 0.25rem 0.72rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.footer-btn-nav:hover:not(:disabled) {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--gold-btn-text);
}

.footer-btn-nav:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-color: var(--border-line);
  color: var(--text-faint);
}

.page-number-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.page-num-btn {
  min-width: 28px;
  height: 26px;
  padding: 0 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-num-btn:hover {
  border-color: var(--border-gold);
  color: var(--text-main);
}

.page-num-btn.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--gold-btn-text);
  font-weight: 600;
  box-shadow: 0 0 8px var(--gold-glow);
}

.page-counter {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 48px;
  text-align: center;
}

.footer-links {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
}

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

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1120px) {
  .topbar, .footer-bar, .main-viewport {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .home-grid {
    grid-template-columns: 280px 1fr;
    gap: 2rem;
  }

  .portrait-frame {
    width: 250px;
    height: 330px;
  }

  .astrolabe-outer { width: 330px; height: 330px; }
  .astrolabe-mid { width: 280px; height: 280px; }
  .astrolabe-inner { width: 240px; height: 240px; }

  .achievements-container {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 100%;
    overflow-y: auto;
    justify-content: flex-start;
    gap: 0.9rem;
    padding-right: 0.25rem;
  }

  .achievements-showcase-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.9rem;
    height: auto;
  }

  .archive-card {
    grid-column: span 2;
    height: auto;
  }

  .archive-card:nth-child(n+4) {
    grid-column: span 3;
  }

  .archive-frame {
    height: 175px;
  }

  .pi-skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill-pos-1,
  .skill-pos-2,
  .skill-pos-3,
  .skill-pos-4 {
    grid-column: auto;
  }

  .skill-pos-5 {
    grid-column: 1 / -1;
    max-width: 50%;
    width: 100%;
    justify-self: center;
  }
}

/* Small Screens / Mobile: Allow clean internal scroll when vertical space is constrained */
@media (max-width: 860px) {
  html, body {
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 0.7rem 1rem;
    gap: 0.75rem;
  }

  .main-viewport {
    overflow: visible;
    padding: 1.5rem 1.1rem;
    height: auto;
  }

  .view-stage {
    height: auto;
  }

  .section-view {
    height: auto;
  }

  .home-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.75rem;
  }

  .portrait-stage {
    margin: 0 auto;
  }

  .kicker, .hero-role, .hero-actions, .hero-chips-row, .currently-learning-box {
    justify-content: center;
  }

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

  .pi-panels-stage {
    overflow: visible;
  }

  .pi-tab-counter {
    margin-left: 0;
  }

  .pi-skills-grid,
  .advancements-grid,
  .achievements-showcase-grid {
    grid-template-columns: 1fr;
  }

  .achievements-container {
    overflow: visible;
    padding-right: 0;
  }

  .archive-card,
  .archive-card:nth-child(n+4) {
    grid-column: auto;
  }

  .archive-frame {
    height: 210px;
  }

  .nc2-competency-columns {
    grid-template-columns: 1fr;
  }

  .archive-lightbox-stage {
    gap: 0.35rem;
    padding: 0.65rem 0.5rem;
  }

  .lightbox-nav-btn {
    width: 32px;
    height: 32px;
  }

  .skill-pos-5 {
    grid-column: auto;
    max-width: none;
  }

  .nav-links {
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-item a {
    font-size: 0.72rem;
  }

  .footer-bar {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
  }

  .footer-links {
    justify-content: center;
  }
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .astrolabe-outer, .astrolabe-inner {
    animation: none !important;
  }
}
