/* i18n FOUC prevention */
body[data-i18n-loading] [data-i18n],
body[data-i18n-loading] [data-i18n-html] { visibility: hidden; }

/* ===================================
   Pretendard (self-hosted variable font)
=================================== */
@font-face {
  font-family: "Pretendard";
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: local("Pretendard Variable"),
       url("assets/fonts/PretendardVariable.woff2") format("woff2-variations");
}

/* ===================================
   Portfolio - Common Styles
   Blueprint Background + Tracing Paper
=================================== */

:root {
  --bp-bg: #0a1929;
  --panel-bg: rgba(240, 245, 250, 0.92);
  --modal-bg: #f0f5fa;
  --panel-border: rgba(180, 200, 220, 0.5);
  --panel-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --text: #1a2a3a;
  --text-muted: #4a5a6a;
  --accent: #0891b2;
  --accent-hover: #06b6d4;
  --divider: rgba(100, 120, 140, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
  }
}

body {
  background: var(--bp-bg) url('assets/blueprint-bg.png') repeat;
  background-size: auto;
  color: var(--text);
  font-family: "Pretendard", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}

/* Dark overlay for vignette effect */
.bg-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center,
    rgba(10, 25, 41, 0.3) 0%,
    rgba(10, 25, 41, 0.6) 60%,
    rgba(5, 15, 30, 0.85) 100%
  );
}

/* ===================================
   Navigation
=================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-home {
  padding-right: 24px;
  margin-right: 8px;
  position: relative;
}

.nav-home::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background: var(--panel-border);
}

/* ===================================
   Language Toggle
=================================== */
.lang-toggle {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 99;
  display: flex;
  align-items: center;
  height: 36px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-toggle button:hover {
  background: rgba(8, 145, 178, 0.1);
}

.lang-toggle button.active {
  background: var(--accent);
  color: white;
}

/* ===================================
   Tracing Paper Panel (Content Container)
=================================== */
.panel {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===================================
   Hero Section
=================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 20px 80px;
}

.hero-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
  padding: 48px;
  max-width: 860px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

/* Greet Animation */
@keyframes greetFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.greet {
  display: inline;
  opacity: 0;
  animation: greetFadeUp 1s cubic-bezier(.2,.8,.2,1) forwards;
}

.greet-1 {
  animation-delay: 0.2s;
}

.greet-2 {
  animation-delay: 0.7s;
}

@media (prefers-reduced-motion: reduce) {
  .greet {
    opacity: 1;
    animation: none;
    transform: none;
  }
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.9;
  word-break: keep-all;
}

/* Hero description - enhanced readability */
.hero-content p {
  background: rgba(8, 145, 178, 0.04);
  padding: 16px 20px;
  border-left: 3px solid rgba(8, 145, 178, 0.4);
  border-radius: 0 6px 6px 0;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.channel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section .channel-heading h2 {
  margin-bottom: 0;
  min-width: 0;
}

.section .channel-heading h2::after {
  display: none;
}

.channel-heading .btn {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .channel-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* ===================================
   Hero Card - Premium Style
=================================== */
.hero-card {
  background: rgba(245, 248, 252, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(8, 145, 178, 0.35);
  border-radius: 16px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(8, 145, 178, 0.08),
    0 0 24px rgba(8, 145, 178, 0.12);
  padding-top: 0;
  overflow: hidden;
}

/* Title Block Header Bar */
.hero-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 48px;
  height: 48px;
  background: rgba(8, 145, 178, 0.06);
  border-bottom: 1px solid rgba(8, 145, 178, 0.2);
  margin-bottom: 24px;
}

.hero-title-bar .bar-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #0891b2;
}

.hero-title-bar .bar-info {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0.7;
}

.hero-content {
  padding: 0 48px 48px;
}

/* Name Badge */
.name-badge {
  display: inline-block;
  background: rgba(240, 245, 250, 0.7);
  border: 1px solid rgba(8, 145, 178, 0.5);
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0891b2;
  margin-bottom: 12px;
}

/* Project Badge */
.project-badge {
  display: inline-block;
  background: rgba(240, 245, 250, 0.85);
  border: 1px solid rgba(8, 145, 178, 0.4);
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0891b2;
  margin-bottom: 8px;
}

/* Company badges - emphasized */
.project-badge.badge-company {
  background: rgba(8, 145, 178, 0.12);
  border-color: rgba(8, 145, 178, 0.5);
  color: #0891b2;
  font-weight: 700;
}

/* Muted badges (University, Indie, etc.) */
.project-badge.badge-muted {
  background: rgba(100, 120, 140, 0.08);
  border-color: rgba(100, 120, 140, 0.25);
  color: var(--text-muted);
  font-weight: 500;
}

/* Subpage Hero - Enhanced but simpler */
.hero-subpage {
  background: rgba(245, 248, 252, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(8, 145, 178, 0.25);
  border-radius: 12px;
  box-shadow:
    0 6px 32px rgba(0, 0, 0, 0.2),
    0 0 16px rgba(8, 145, 178, 0.08);
}

/* Subpage Hero Section - Reduced height */
.hero-sub {
  min-height: auto;
  padding-top: 100px;
  padding-bottom: 60px;
}

/* Fallback for browsers supporting :has() */
.hero:has(.hero-subpage) {
  min-height: auto;
  padding-top: 100px;
  padding-bottom: 60px;
}

/* Hero Video Embed */
.hero-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-top: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(8, 145, 178, 0.4);
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.15);
}

.hero-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.hero-video-placeholder {
  padding-top: 0;
  padding: 60px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 145, 178, 0.05);
}

.hero-video-placeholder p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* TOC Navigation */
.toc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  justify-content: center;
}

.toc-btn {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(8, 145, 178, 0.1);
  border: 1.5px solid rgba(8, 145, 178, 0.3);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.toc-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

/* ===================================
   Buttons
=================================== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: 1.5px solid var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid rgba(8, 145, 178, 0.4);
  font-weight: 500;
}

.btn-secondary:hover {
  background: rgba(8, 145, 178, 0.08);
  border-color: var(--accent);
}

.btn-game {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: white;
  border: none;
}

.btn-game:hover {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-timestamp {
  opacity: 0.7;
  font-size: 0.8em;
}

.btn:disabled,
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
}

.btn-outline:hover {
  background: rgba(8, 145, 178, 0.05);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===================================
   Hero Role Summary
=================================== */
.hero-role {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.hero-pitch {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 20px;
  word-break: keep-all;
}

/* ===================================
   Featured Case Study Card
=================================== */
.featured-card {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  background: rgba(245, 248, 252, 0.6);
  border: 1.5px solid rgba(8, 145, 178, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.featured-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8eef4;
}

.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.featured-video-container {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.featured-video-container.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-video-container.active + .featured-thumb,
.featured-card .featured-thumb:has(+ .featured-video-container.active) {
  display: none;
}

.featured-video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.featured-card .featured-video-container.active ~ .featured-thumb {
  display: none;
}

.featured-body {
  padding: 24px;
}

.level-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
}

.level-badge {
  display: inline-block;
  background: rgba(8, 145, 178, 0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  width: fit-content;
  white-space: nowrap;
}

.badge-ownership {
  background: rgba(180, 80, 50, 0.15);
  color: #b45032;
}

.level-field-name {
  display: inline-block;
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.level-workdays {
  display: inline-block;
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.featured-body h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.featured-body p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.featured-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.featured-buttons .btn-block {
  width: 100%;
  text-align: center;
}

.featured-buttons-row {
  display: flex;
  gap: 10px;
}

.featured-buttons-row .btn {
  flex: 1;
  text-align: center;
  min-width: 120px;
}


/* ===================================
   Section Intro Text
=================================== */
.section-intro {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.section-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-note::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Section Intro Box - Combined */
.section-intro-box {
  background: #F5FAFF;
  padding: 18px 20px;
  border: 1px solid #D8E8FF;
  border-radius: 10px;
  margin-bottom: 24px;
}

.section-intro-box .intro-main,
.section-intro-box .intro-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.6;
}

.section-intro-box .intro-main::before,
.section-intro-box .intro-note::before {
  content: "•";
  color: var(--accent);
  font-weight: bold;
  flex-shrink: 0;
}

.section-intro-box .intro-note {
  margin-top: 8px;
}

/* ===================================
   Subsection Title
=================================== */
.subsection-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.subsection-title:first-of-type {
  margin-top: 0;
}

.subsection-title::before {
  content: "";
  width: 3px;
  height: 1em;
  background: var(--accent);
  border-radius: 2px;
}

.subsection-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 16px;
}

/* ===================================
   Level Grid & Cards
=================================== */
.level-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .level-grid {
    grid-template-columns: 1fr;
  }
}

.level-card {
  background: rgba(245, 248, 252, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.level-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8eef4;
}

.level-media-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.level-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.level-thumb-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.level-card:hover .level-thumb {
  opacity: 0;
}

.level-card:hover .level-thumb-hover {
  opacity: 1;
}

.level-video-container {
  position: absolute;
  inset: 0;
  background: #000;
  display: none;
}

.level-video-container.active {
  display: block;
}

.level-video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.level-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.level-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.level-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  background: rgba(8, 145, 178, 0.1);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: lowercase;
}

.level-body > p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.level-buttons {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ===================================
   Design Modal / Lightbox
=================================== */
.design-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.design-modal.active {
  display: flex;
}

.design-modal-content {
  background: var(--modal-bg);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.design-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  background: var(--modal-bg);
  z-index: 1;
}

.design-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.design-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.design-modal-close:hover {
  color: var(--text);
}

.design-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.design-item {
  background: #f5f8fc;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
}

.design-item .design-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8eef4;
}

.design-item .design-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.design-item .design-body {
  padding: 16px;
}

.design-item .design-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.design-item .design-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.design-modal-notice {
  margin: 0 20px 20px;
  padding: 20px;
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.2);
  border-radius: 8px;
  text-align: center;
}

.design-modal-notice .notice-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 12px;
}

.design-modal-notice p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.design-modal-notice .btn {
  display: inline-block;
}

/* ===================================
   Password Modal
=================================== */
.password-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.password-modal.active {
  display: flex;
}

.password-modal-content {
  background: var(--modal-bg);
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  margin: 24px;
}

.password-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
}

.password-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.password-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.password-modal-close:hover {
  color: var(--text);
}

.password-modal-body {
  padding: 24px;
  text-align: center;
}

.password-modal-body > p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.password-modal-body input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.password-modal-body input:focus {
  outline: none;
  border-color: var(--accent);
}

.password-error {
  color: #dc3545;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.password-error.show {
  display: block;
}

.password-lockout {
  display: none;
  text-align: center;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.25);
}

.password-lockout.show {
  display: block;
}

.password-lockout .lockout-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.password-lockout p {
  color: #dc3545;
  font-size: 0.85rem;
  margin: 0;
}

.lockout-timer {
  font-size: 2rem;
  font-weight: 700;
  color: #dc3545;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  margin: 8px 0;
}

.password-lockout .lockout-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.password-modal-body input.input-error {
  border-color: #dc3545;
}

.password-modal-body input.input-shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.password-modal-body input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.password-modal-body .btn.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.password-remaining {
  display: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

.password-remaining.show {
  display: block;
}

.password-remaining.danger {
  color: #dc3545;
  font-weight: 700;
}

.password-modal-body .btn {
  width: 100%;
}

/* ===================================
   Contributions Grid
=================================== */
.contrib-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 24px;
}

.contrib-item {
  background: rgba(245, 248, 252, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 24px;
}

.contrib-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.contrib-item > p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.contrib-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.contrib-bullet-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 0;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.contrib-bullet-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* Unified Block Style (Summary / Case Study) */
.contrib-block {
  background: rgba(8, 145, 178, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin-top: 16px;
}

.contrib-block:first-of-type {
  margin-top: 12px;
}

.contrib-block-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px 0;
}

.contrib-block-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 12px 0;
}

/* Labeled bullet list */
.contrib-bullet-labeled li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.contrib-bullet-labeled li strong {
  color: var(--text);
  font-weight: 600;
  flex-shrink: 0;
}

.contrib-bullet-labeled li span {
  color: var(--text-muted);
}

/* Case Study subtitle */
.contrib-case-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* Inline label style for P/A/R */
.contrib-case-inline {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.contrib-case-inline strong {
  color: var(--text);
  font-weight: 600;
}

.contrib-case-inline + .contrib-bullet-list {
  margin-top: -8px;
  margin-bottom: 12px;
}

.contrib-block > p:last-child,
.contrib-block > ul:last-child {
  margin-bottom: 0;
}

/* Case Study Small Video */
.contrib-case-video-small {
  aspect-ratio: 16 / 9;
  max-width: 480px;
  margin: 12px auto;
  border-radius: 6px;
  overflow: hidden;
}

.contrib-case-video-small iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.contrib-figures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.contrib-figures figure {
  margin: 0;
}

.contrib-figures img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
}

.fig-center {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--panel-bg);
  border-radius: 6px;
}

.fig-center img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  border: none;
}

.contrib-figures figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.fig-cover,
.fig-contain {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
}

.fig-cover img,
.fig-contain img {
  display: block;
  width: 100%;
  height: 100%;
}

.fig-cover img {
  object-fit: cover;
}

.fig-contain {
  background-color: #eef2f7;
}

.fig-contain img {
  object-fit: contain;
}

.contrib-video {
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  border-radius: 6px;
  overflow: hidden;
}

.contrib-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 600px) {
  .contrib-figures {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   Breadcrumb
=================================== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ===================================
   Case Study Sticky TOC
=================================== */
.case-toc {
  position: sticky;
  top: 60px;
  z-index: 90;
  background: rgba(245, 248, 252, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  padding: 12px 20px;
}

.case-toc-inner {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 860px;
  margin: 0 auto;
}

.case-toc-item {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.case-toc-item:hover {
  color: var(--accent);
  background: rgba(8, 145, 178, 0.05);
}

.case-toc-item.active {
  color: var(--accent);
  background: rgba(8, 145, 178, 0.1);
  border-color: rgba(8, 145, 178, 0.2);
}

/* ===================================
   Overview Grid
=================================== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.overview-item {
  background: rgba(8, 145, 178, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
}

.overview-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.overview-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

@media (max-width: 768px) {
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

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

.highlight-list li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: var(--text);
}

.highlight-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* Highlight Badges */
.highlight-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.highlight-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Highlight Line - Achievement Banner */
.highlight-line {
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fcd34d 100%);
  padding: 16px 24px;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

/* ===================================
   Role List
=================================== */
.role-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.role-list li {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  border-bottom: 1px solid var(--panel-border);
}

.role-list li:last-child {
  border-bottom: none;
}

.role-list strong {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.role-list span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===================================
   Flow Diagram
=================================== */
.flow-diagram {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 24px;
  overflow-x: auto;
  padding: 16px 0;
}

.flow-step {
  flex: 1;
  min-width: 140px;
  background: rgba(245, 248, 252, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.flow-phase {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.flow-step h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.flow-step p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.flow-arrow {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: var(--accent);
  font-size: 1.2rem;
}

.flow-arrow::after {
  content: "→";
}

.flow-image {
  margin: 0;
}

.flow-image img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
}

.flow-image figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

@media (max-width: 768px) {
  .flow-diagram {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-arrow {
    justify-content: center;
    padding: 8px 0;
  }
  .flow-arrow::after {
    content: "↓";
  }
}

/* ===================================
   Key Moments Grid
=================================== */
.moments-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.moment-item {
  margin: 0;
}

.moment-item img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  margin-bottom: 12px;
}

.moment-item figcaption {
  padding: 0;
}

.moment-item figcaption strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.moment-item figcaption span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .moments-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   Iteration Section
=================================== */
.iteration-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 24px;
}

.iteration-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
}

.iteration-before,
.iteration-after {
  background: rgba(245, 248, 252, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
}

.iteration-before h4,
.iteration-after h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.iteration-before img,
.iteration-after img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 12px;
}

.iteration-before p,
.iteration-after p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.iteration-before p strong,
.iteration-after p strong {
  color: var(--text);
}

.iteration-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
  padding-top: 80px;
}

.iteration-arrow::after {
  content: "→";
}

.iteration-result {
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.2);
  border-radius: 8px;
  padding: 20px;
}

.iteration-result h4 {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.iteration-result ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.iteration-result li {
  padding: 4px 0;
  color: var(--text);
}

@media (max-width: 768px) {
  .iteration-item {
    grid-template-columns: 1fr;
  }
  .iteration-arrow {
    padding: 0;
  }
  .iteration-arrow::after {
    content: "↓";
  }
}

/* ===================================
   Polish Checklist
=================================== */
.polish-checklist {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.polish-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(245, 248, 252, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
}

.polish-check {
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.polish-check::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
}

.polish-content strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.polish-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.polish-example {
  margin: 0;
}

.polish-example img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
}

.polish-example figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===================================
   Post-mortem
=================================== */
.postmortem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.postmortem-section {
  background: rgba(245, 248, 252, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 20px;
}

.postmortem-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
}

.postmortem-good h3 {
  color: #059669;
  border-color: #059669;
}

.postmortem-improve h3 {
  color: #d97706;
  border-color: #d97706;
}

.postmortem-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.postmortem-section li {
  margin-bottom: 12px;
}

.postmortem-section li:last-child {
  margin-bottom: 0;
}

.postmortem-section li strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.postmortem-section li span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.postmortem-learned {
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.2);
  border-radius: 8px;
  padding: 20px;
}

.postmortem-learned h3 {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.postmortem-learned p {
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 768px) {
  .postmortem-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   Section Styles
=================================== */
.section {
  padding: 60px 20px;
}

.section + .section {
  padding-top: 30px;
}

.section-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
  padding: 40px;
  max-width: 860px;
  margin: 0 auto;
  letter-spacing: 0.01em;
  word-break: keep-all;
}

/* Homepage uses a wider container across all panels for a consistent layout
   (the Projects/Studies grids need the width for 3 columns; the rest match it).
   Detail/case-study pages are not .home, so they keep the 860px reading width. */
.home .hero-panel,
.home .section-panel {
  max-width: 1200px;
}

.section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.section h2::after {
  content: "";
  display: block;
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.section p {
  margin-top: 16px;
  color: var(--text-muted);
}

/* Case Study - Text paragraphs enhanced readability */
.section-panel > p {
  background: #F5FAFF;
  padding: 16px 20px;
  border: 1px solid #D8E8FF;
  border-radius: 10px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  word-break: keep-all;
  color: #1F2937;
}

.section-panel > p + p {
  margin-top: 12px;
}

/* Section headings - enhanced contrast */
.section-panel h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin-top: 28px;
  margin-bottom: 12px;
}

.section-panel h3:first-of-type {
  margin-top: 0;
}

/* Channel studies use plain paragraphs inside the shared section panel. */
.channel-study > p {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin-top: 12px;
}

.channel-study > h3,
.channel-study > h3:first-of-type {
  margin-top: 28px;
  margin-bottom: 8px;
}

/* Role list - no background box */
.section-panel ul.role-detail-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.section-panel ul.role-detail-list li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  font-size: 0.95rem;
  color: #1F2937;
  line-height: 1.65;
  letter-spacing: 0.02em;
}

.section-panel ul.role-detail-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.section-panel ul.role-detail-list li strong {
  font-weight: 600;
  color: #111827;
}

/* Plain text paragraphs - no callout box */
.section-panel .text-plain {
  background: none;
  border: none;
  padding: 0;
  margin-top: 12px;
  line-height: 1.7;
  color: #1F2937;
}

/* Callout card - wraps multiple paragraphs in one box */
.section-panel .callout-card {
  background: #F5FAFF;
  padding: 18px 20px;
  border: 1px solid #D8E8FF;
  border-radius: 10px;
  margin-top: 16px;
}

.section-panel .callout-card p {
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 12px 0;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: #1F2937;
}

.section-panel .callout-card p:last-child {
  margin-bottom: 0;
}

.section-panel .callout-card hr {
  border: none;
  border-top: 1px solid #D8E8FF;
  margin: 14px 0;
}

.section-panel .callout-card .conclusion {
  font-weight: 600;
}

/* ===================================
   Project Cards
=================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.project-card {
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.project-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text);
}

.card-location {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-location .loc-pin {
  flex-shrink: 0;
}


.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.project-card-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.project-card-buttons .btn {
  flex: 1;
  text-align: center;
  min-width: 120px;
}

/* ===================================
   Inline Trailer (Project Cards)
=================================== */
.project-media {
  position: relative;
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.project-media-wide {
  background: #1a1a2e;
}

.project-media-wide img {
  object-fit: contain;
}

.project-media .video-container {
  display: none;
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.project-media .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

.project-media .video-container .close-trailer {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.project-media .video-container .close-trailer:hover {
  background: rgba(0,0,0,0.9);
}

.project-media .video-container .sound-on {
  position: absolute;
  top: 8px;
  right: 48px;
  height: 32px;
  padding: 0 12px;
  background: rgba(8, 145, 178, 0.85);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s;
}

.project-media .video-container .sound-on:hover {
  background: rgba(8, 145, 178, 1);
}

.project-media .video-container .sound-on.hidden {
  display: none;
}

.project-media.playing img {
  display: none;
}

.project-media.playing .video-container {
  display: block;
}

/* Key Experience Card - Highlighted */
.project-card.card-highlight {
  border: 2px solid rgba(8, 145, 178, 0.5);
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.15);
  background: rgba(248, 252, 255, 1);
}

.project-card.card-highlight:hover {
  box-shadow: 0 8px 32px rgba(8, 145, 178, 0.25);
  border-color: rgba(8, 145, 178, 0.6);
}

/* Key Experience Badge - subtle on highlighted card */
.key-exp-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  background: rgba(8, 145, 178, 0.85);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  transition: background 0.2s ease;
}

.key-exp-badge:hover {
  background: rgba(8, 145, 178, 1);
}

.project-media.playing .key-exp-badge {
  display: none;
}

/* ===================================
   Records (consolidated Game/Book/Archive tiles)
=================================== */
.records-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.record-tile {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 22px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.record-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(8, 145, 178, 0.4);
}

.record-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(8, 145, 178, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.record-tile .record-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0;
  margin-bottom: 6px;
}

.record-tag {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  padding: 1px 7px;
  border-radius: 4px;
  vertical-align: 2px;
  margin-left: 4px;
  letter-spacing: 0.02em;
}

.record-tile .record-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 0;
  margin-bottom: 16px;
}

.record-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.record-link::after {
  content: "→";
  transition: transform 0.2s;
}

.record-tile:hover .record-link::after {
  transform: translateX(3px);
}

.record-tile-locked .record-icon {
  background: rgba(100, 116, 139, 0.12);
}

.record-tile-locked .record-link {
  color: #64748b;
}

.record-link-ext::after {
  content: "↗";
}

@media (max-width: 768px) {
  .records-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   Figure / Images
=================================== */
figure {
  margin: 24px 0;
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
}

figure img {
  width: 100%;
  display: block;
}

figcaption {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  border-top: 1px solid var(--divider);
  background: rgba(240, 245, 250, 0.7);
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.img-grid figure {
  margin: 0;
}

/* ===================================
   Video Embed
=================================== */
.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-top: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(8, 145, 178, 0.4);
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.15);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Video Caption */
.video-caption {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(8, 145, 178, 0.05);
  border-left: 3px solid rgba(8, 145, 178, 0.4);
  border-radius: 0 6px 6px 0;
}

.video-caption p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  background: none;
  padding: 0;
  border: none;
}

.video-caption p + p {
  margin-top: 8px;
}

/* Video Card */
.video-card {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.video-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.video-media .video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-media .watch-video {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.video-media .video-container {
  position: absolute;
  inset: 0;
  display: none;
  background: #000;
}

.video-media .video-container.active {
  display: block;
}

.video-media .video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-media .video-container .close-video {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 20;
}

.video-media .video-container .sound-on {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 20;
}

/* Process List */
.process-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px 0;
}

.process-list > li {
  position: relative;
  padding: 4px 0 4px 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.process-list > li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.process-list > li strong {
  color: var(--text);
  font-weight: 600;
}

.process-sublist {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 20px;
}

.process-sublist li {
  position: relative;
  padding: 4px 0 4px 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.process-sublist li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.section-panel h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 8px;
}

/* Video section - special styling */
#trailer .section-panel,
#playthrough .section-panel {
  background: rgba(235, 242, 248, 0.95);
  border-color: rgba(8, 145, 178, 0.25);
}

/* ===================================
   Info List
=================================== */
.info-list {
  margin-top: 16px;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  color: var(--text-muted);
}

.info-list li {
  background: rgba(255, 255, 255, 0.6);
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  line-height: 1.6;
}

.info-list strong {
  color: var(--text);
  margin-right: 4px;
}

/* Contact inline link pill (used in contactDesc) */
/* Contact 인라인 링크 — Records 카드의 .record-link 화살표 스타일과 통일 */
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: baseline;
  transition: color 0.15s ease;
}

.contact-link::before {
  content: "";
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.2s ease;
}

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

.contact-link:hover::before {
  transform: rotate(-12deg) scale(1.08);
}

/* ===================================
   Contact Blocks (Capabilities / Background)
=================================== */
.contact-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.contact-block {
  background: rgba(255, 255, 255, 0.5);
  padding: 20px 24px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.contact-block h3 {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(8, 145, 178, 0.08);
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.contact-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.contact-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.contact-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 14px;
  padding-left: 16px;
  line-height: 1.6;
  opacity: 0.65;
}

.contact-note + .contact-note {
  margin-top: 6px;
}

/* ===================================
   Summary Text (Project M style)
=================================== */
.summary-text {
  border-left: 3px solid rgba(8, 145, 178, 0.4);
  padding-left: 20px;
  margin-bottom: 28px;
}

.summary-text p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 14px;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

.summary-text p:last-child {
  margin-bottom: 0;
}

/* ===================================
   Responsibilities List
=================================== */
.responsibilities-list {
  padding-left: 24px;
  margin: 0;
  display: grid;
  gap: 14px;
}

.responsibilities-list li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 8px;
}

.responsibilities-list li::marker {
  color: var(--accent);
  font-weight: bold;
}

/* ===================================
   Contact Info
=================================== */
.contact-info {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.7);
  padding: 16px 24px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  flex: 1;
  min-width: 200px;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.contact-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

/* ===================================
   Footer
=================================== */
footer {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 24px;
  max-width: 860px;
  margin: 0 auto;
}

.footer-easter-egg {
  display: block;
  font-size: 0.75rem;
  opacity: 0.15;
  max-height: 2em;
  margin-top: 8px;
}

.footer-easter-egg:hover,
.footer-easter-egg:focus {
  opacity: 0.35;
  outline: none;
}

/* ===================================
   Back Button (Subpages)
=================================== */
.back-btn {
  position: fixed;
  top: 70px;
  left: 24px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.15);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  z-index: 90;
}

.back-btn:hover {
  background: var(--card-bg);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
}

/* ===================================
   Back to Top
=================================== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  z-index: 90;
}

.back-to-top:hover {
  background: var(--accent);
  color: white;
}

/* ===================================
   Bored Button & Snake Game
=================================== */
.game-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.game-modal.active {
  display: flex;
}

.game-modal-content {
  background: var(--modal-bg);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.game-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.game-close:hover {
  opacity: 1;
}

.game-modal h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: var(--accent);
}

.game-score {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text);
}

#gameCanvas {
  background: #1a1a2e;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.game-controls {
  margin-top: 16px;
}

.game-controls p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.game-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.game-mobile-controls,
.game-mobile-controls-simple,
.game-mobile-controls-shoot,
.game-mobile-controls-rotate,
.game-mobile-controls-asteroids {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.game-mobile-controls.active,
.game-mobile-controls-simple.active,
.game-mobile-controls-shoot.active,
.game-mobile-controls-rotate.active,
.game-mobile-controls-asteroids.active {
  display: flex;
}

.game-mobile-controls-simple,
.game-mobile-controls-shoot,
.game-mobile-controls-rotate,
.game-mobile-controls-asteroids {
  flex-direction: row;
  justify-content: center;
}

.shoot-btn {
  background: #ef4444;
  min-width: 60px;
}

.mobile-ctrl-row {
  display: flex;
  gap: 8px;
}

.mobile-ctrl {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 8px;
  background: #4b5563;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}

.mobile-ctrl:active {
  background: #6b7280;
  transform: scale(0.95);
}

.mobile-ctrl.wide {
  width: 80px;
}

@media (max-width: 640px) {
  #gameCanvas {
    width: 280px;
    height: 280px;
  }

  .game-controls p {
    display: none;
  }
}

/* ===================================
   Fun Reaction Buttons
=================================== */
.reaction-bar {
  position: fixed;
  bottom: 80px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 89;
  transition: opacity 3s ease;
}

.reaction-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.reaction-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.reaction-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.reaction-btn:active {
  transform: scale(0.95);
}

/* 기능 아이콘(게임/운동) — 원형은 reaction-btn 공유, a 태그 중앙정렬용 */
.reaction-extra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
  padding: 0;
}

/* 본문 속 인라인 링크 (연락처 등) — 본문과 같은 크기, 링크 티 나게 */
.inline-link,
.inline-link:link,
.inline-link:visited {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color 0.15s;
}
.inline-link:hover { color: var(--accent-hover); }
.inline-link .ico-mail {
  width: 0.95em; height: 0.95em;
  vertical-align: -0.13em;
  margin-right: 0.32em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reaction-bar.hidden {
  opacity: 0;
  pointer-events: none;
}

.reaction-toggle {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.reaction-toggle:hover {
  transform: scale(1.1);
}

.reaction-bar .reaction-btn {
  overflow: hidden;
}

/* Desktop: collapse vertically */
.reaction-bar.collapsed .reaction-btn {
  opacity: 0;
  height: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
  transition: opacity 0.3s, height 0.3s, max-height 0.3s, margin 0.3s, padding 0.3s;
}

/* Floating Emoji Animation */
@keyframes emojiFloatUp {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1);
  }
}

.emoji-float {
  position: fixed;
  top: 50%;
  left: 50%;
  font-size: 5rem;
  pointer-events: none;
  z-index: 9999;
  animation: emojiFloatUp 1.2s cubic-bezier(.2,.8,.2,1) forwards;
}

/* Konami Code Emoji Explosion */
@keyframes emojiExplode {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  40% {
    opacity: 1;
    transform: translate(calc(-50% + var(--tx) * 0.7), calc(-50% + var(--ty) * 0.5)) scale(1);
  }
  70% {
    opacity: 0.6;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty) + 80px)) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx) * 1.1), calc(-50% + var(--ty) + 200px)) scale(0.6);
  }
}

.emoji-particle {
  position: fixed;
  top: 50%;
  left: 50%;
  font-size: 2.5rem;
  pointer-events: none;
  z-index: 9999;
  animation: emojiExplode 2s cubic-bezier(.2,.6,.4,1) forwards;
}

/* ===================================
   Responsive
=================================== */

/* Tablet */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: 100px 16px 60px;
  }

  .hero-panel,
  .section-panel {
    padding: 32px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .section {
    padding: 60px 16px;
  }

  /* Hero Title Bar - Tablet */
  .hero-title-bar {
    padding: 12px 32px;
  }

  .hero-content {
    padding: 0 32px 32px;
  }

  .project-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .hero {
    padding: 80px 12px 40px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
    max-width: 100%;
    line-height: 1.8;
  }

  .hero-content p {
    padding: 12px 16px;
  }

  .hero-panel,
  .section-panel {
    padding: 20px;
    border-radius: 12px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* Hero Title Bar - Mobile */
  .hero-title-bar {
    padding: 10px 20px;
    height: auto;
    min-height: 44px;
  }

  .hero-title-bar .bar-label {
    font-size: 0.65rem;
  }

  .hero-title-bar .bar-info {
    font-size: 0.65rem;
  }

  .hero-content {
    padding: 0 20px 24px;
  }

  /* Navigation - Mobile */
  .nav-inner {
    padding: 10px 16px;
  }

  .nav-logo {
    font-size: 1rem;
  }

  .nav-links {
    gap: 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

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

  .nav-links a {
    font-size: 0.75rem;
    white-space: nowrap;
  }

  /* Section - Mobile */
  .section {
    padding: 40px 12px;
  }

  .section h2 {
    font-size: 1.25rem;
    flex-wrap: wrap;
  }

  .section h2::after {
    flex-basis: 100%;
    margin-top: 8px;
  }

  /* Section panel text - Mobile */
  .section-panel > p {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  /* Project Cards - Mobile */
  .project-card-body {
    padding: 16px;
  }

  .project-card h3 {
    font-size: 1.1rem;
  }

  .project-card p {
    font-size: 0.85rem;
  }

  .project-card-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .project-card-buttons .btn {
    width: 100%;
    text-align: center;
  }

  .featured-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .featured-buttons .btn {
    width: 100%;
    text-align: center;
  }

  .featured-buttons-row {
    flex-direction: column;
    gap: 8px;
  }

  .featured-buttons-row .btn {
    width: 100%;
  }

  /* Lang Toggle - Mobile */
  .lang-toggle {
    top: 60px;
    right: 12px;
    height: 36px;
    align-items: center;
  }

  .lang-toggle button {
    height: 100%;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
  }

  /* Footer - Mobile */
  .footer-panel {
    padding: 16px;
  }

  /* Back to Top - Mobile */
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 16px;
    right: 16px;
  }

  /* Back Button - Mobile */
  .back-btn {
    top: 60px;
    left: 12px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    font-size: 0.8rem;
  }

  /* Image Grid - Mobile */
  .img-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Info List - Mobile */
  .info-list {
    padding-left: 16px;
  }

  .info-list li {
    font-size: 0.9rem;
  }

  /* Reaction Bar - Mobile: Horizontal */
  .reaction-bar {
    flex-direction: row;
    bottom: 20px;
    left: 20px;
    right: 20px;
    transform: none;
    justify-content: center;
  }

  .reaction-bar.collapsed {
    justify-content: flex-start;
  }

  /* Mobile: collapse horizontally, override desktop vertical collapse */
  .reaction-bar.collapsed .reaction-btn {
    width: 0;
    min-width: 0;
    height: 44px;
    max-height: 44px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    border: none;
    box-shadow: none;
    transition: width 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  }

  .reaction-bar .reaction-btn {
    width: 44px;
    min-width: 44px;
    transition: width 0.3s ease, min-width 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  }

  .reaction-real-estate {
    display: none;
  }
}

/* Small Mobile */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .hero-title-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 16px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    font-size: 0.7rem;
    white-space: nowrap;
  }
}

/* ===================================
   Level Case Study - New Sections
=================================== */

/* Hero Tagline */
.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 12px;
  font-weight: 400;
}

/* Challenge Grid (Goals & Constraints) */
.challenge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.challenge-block {
  background: rgba(8, 145, 178, 0.04);
  border-left: 3px solid rgba(8, 145, 178, 0.3);
  border-radius: 0 6px 6px 0;
  padding: 20px;
}

.challenge-block h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

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

.challenge-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 6px 0;
  padding-left: 16px;
  position: relative;
}

.challenge-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

@media (max-width: 768px) {
  .challenge-grid {
    grid-template-columns: 1fr;
  }
}

/* Inspired List */
.inspired-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.inspired-list li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}

.inspired-list li:last-child {
  border-bottom: none;
}

.inspired-list li strong {
  color: var(--text);
  font-weight: 600;
  min-width: 120px;
}

.inspired-list li span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Process Grid */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.process-block {
  background: rgba(8, 145, 178, 0.04);
  border: 1px solid rgba(8, 145, 178, 0.15);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.process-block h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.process-block h3 span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
}

.process-block p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.process-summary {
  margin-top: 20px;
  padding: 16px 20px;
  background: rgba(8, 145, 178, 0.08);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text);
  text-align: center;
}

@media (max-width: 768px) {
  .process-grid {
    grid-template-columns: 1fr;
  }
}

/* Phase List */
.phase-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.phase-list li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  gap: 8px;
}

.phase-list li:last-child {
  border-bottom: none;
}

.phase-list li strong {
  color: var(--accent);
  font-weight: 600;
  min-width: 80px;
}

.phase-list li span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Feedback Grid */
.feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.feedback-block {
  background: rgba(8, 145, 178, 0.04);
  border-radius: 8px;
  padding: 20px;
}

.feedback-block h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider);
}

.feedback-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feedback-block li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
}

@media (max-width: 768px) {
  .feedback-grid {
    grid-template-columns: 1fr;
  }
}

/* Iteration Cards */
.iteration-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.iteration-card {
  background: rgba(8, 145, 178, 0.04);
  border: 1px solid rgba(8, 145, 178, 0.15);
  border-radius: 8px;
  padding: 20px;
}

.iteration-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider);
}

.iteration-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 8px 0;
  line-height: 1.5;
}

.iteration-card p strong {
  color: var(--text);
}

@media (max-width: 768px) {
  .iteration-cards {
    grid-template-columns: 1fr;
  }
  .footer-easter-egg {
    font-size: 0.65rem;
  }
}

/* ── Game Records ── */
.game-records-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 12px;
}

.game-records-img {
  width: 140px;
  flex-shrink: 0;
  border-radius: 12px;
}

.game-records-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.game-records-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.game-records-cta {
  margin-top: 4px;
}

@media (max-width: 600px) {
  .game-records-layout {
    flex-direction: column;
  }
  .game-records-img {
    width: 120px;
  }
}

.gr-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.gr-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1.5px solid var(--panel-border);
  border-radius: 4px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  transition: border-color 0.2s;
}

.gr-search:focus {
  outline: none;
  border-color: var(--accent);
}

.gr-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.gr-stats strong {
  color: var(--accent);
  font-size: 1.1rem;
}

.gr-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.gr-sortable:hover {
  color: var(--accent);
}

.gr-sortable.sort-active {
  color: var(--accent);
}

.sort-icon {
  font-size: 0.75rem;
}

.gr-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 0;
  font-size: 0.95rem;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.game-records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.game-records-table thead {
  background: rgba(8, 145, 178, 0.08);
}

.game-records-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
}

.game-records-table td {
  padding: 10px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--divider);
}

.game-records-table td:nth-child(2),
.game-records-table td:nth-child(3),
.game-records-table td:nth-child(4) {
  white-space: nowrap;
}

.game-records-table th:nth-child(n+3),
.game-records-table td:nth-child(n+3) {
  text-align: center;
}

.game-records-table tbody tr:hover {
  background: rgba(8, 145, 178, 0.04);
}

.game-records-table th:last-child,
.game-records-table td:last-child {
  text-align: center;
  color: var(--accent);
}

.game-records-table td a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
  transition: color 0.2s;
}

.game-records-table td a:hover {
  color: var(--accent);
}

@media (max-width: 480px) {
  .game-records-table th,
  .game-records-table td {
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}

/* Game Records page - wider layout */
.gr-wide .section-panel,
.gr-wide .hero-panel {
  max-width: 1100px;
}

.gr-wide .nav-inner {
  max-width: 1100px;
}

/* Game Records page reuses the home page's "Warped City" scene verbatim —
   see the .home-scene markup + scroll script in game-records.html. All the
   visual rules live in the .home-scene block above; nothing page-specific here. */

/* ===================================
   Game Records - Note Button
=================================== */
.gr-note-cell {
  text-align: center;
}

.gr-note-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: transform 0.15s, background 0.2s;
}

.gr-note-btn:hover {
  background: rgba(8, 145, 178, 0.08);
  transform: scale(1.15);
}

/* ===================================
   Note Password Modal
=================================== */
.note-pw-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 41, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.note-pw-modal.active {
  display: flex;
}

.note-pw-card {
  background: var(--modal-bg);
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  margin: 24px;
}

.note-pw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
}

.note-pw-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.note-pw-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.note-pw-close:hover {
  color: var(--text);
}

.note-pw-body {
  padding: 24px;
  text-align: center;
}

.note-pw-body > p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.note-pw-body input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.note-pw-body input:focus {
  outline: none;
  border-color: var(--accent);
}

.note-pw-error {
  color: #dc3545;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.note-pw-error.show {
  display: block;
}

.note-pw-body .btn {
  width: 100%;
}

/* ===================================
   Note Content Modal
=================================== */
.note-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 41, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.note-modal.active {
  display: flex;
}

.note-modal-content {
  background: var(--modal-bg);
  border-radius: 12px;
  width: 100%;
  max-width: 960px;
  margin: 24px;
  max-height: 86vh;
  overflow-y: auto;
}

.note-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 40px;
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--modal-bg);
}

.note-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.note-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.note-modal-close:hover {
  color: var(--text);
}

.note-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 40px 0;
}

.note-modal-body {
  padding: 20px 40px 40px;
}

.note-disclaimer {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.75;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.note-section {
  margin-top: 16px;
}

.note-section:first-child {
  margin-top: 0;
}

.note-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.note-section-body {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.85;
}

.note-section-body br + br {
  content: "";
  display: block;
  margin-top: 0.35em;
}

.note-bullet-list {
  margin: 0.4em 0 1em;
  padding-left: 1.35em;
}

.note-bullet-list li {
  margin: 0 0 0.9em;
  padding-left: 0.3em;
}

.note-bullet-list li:last-child {
  margin-bottom: 0;
}

.note-bullet-list li::marker {
  color: var(--accent);
}

.note-content-heading {
  margin: 2.4em 0 0.8em;
  padding: 0 0 0.45em;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text);
  font-size: 1.22em;
  line-height: 1.4;
}

.note-content-subheading {
  margin: 1.6em 0 0.55em;
  color: var(--text);
  font-size: 1.08em;
  font-weight: 700;
  line-height: 1.45;
}

.note-entry-meta {
  margin: 1.35em 0 0.65em;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.note-section-body > .note-entry-meta:first-child {
  margin-top: 0.25em;
}

.note-list-item {
  margin: 0.3em 0;
  padding-left: 0.55em;
}

.note-section-body strong {
  color: var(--text);
  font-weight: 700;
}

.note-process {
  margin: 1.2em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: #e5f3f7;
  color: #18394a;
  font-weight: 600;
  line-height: 1.7;
}

.note-video {
  margin: 14px 0;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  max-width: 720px;
}

.note-video iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.note-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.note-link-card {
  display: flex;
  gap: 14px;
  align-items: stretch;
  margin: 12px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  max-width: 640px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.note-link-card:hover {
  background: rgba(8, 145, 178, 0.06);
  border-color: rgba(8, 145, 178, 0.35);
}

.note-link-image {
  flex: 0 0 120px;
  aspect-ratio: 16 / 9;
  background: rgba(148, 163, 184, 0.12) center/cover no-repeat;
  border-radius: 6px;
}

.note-link-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.note-link-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-all;
}

.note-link-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.note-link-site {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.note-link-loading .note-link-title {
  color: var(--text-muted);
  font-weight: 400;
}

@media (max-width: 540px) {
  .note-modal-content {
    margin: 10px;
    max-height: 92vh;
    border-radius: 10px;
  }
  .note-modal-header {
    padding: 16px 20px;
  }
  .note-modal-header h3 {
    font-size: 1.2rem;
  }
  .note-modal-badges {
    padding: 12px 20px 0;
  }
  .note-modal-body {
    padding: 16px 20px 28px;
  }
  .note-section-body {
    font-size: 1rem;
    line-height: 1.8;
  }
  .note-link-card {
    flex-direction: column;
  }
  .note-link-image {
    flex: 0 0 auto;
    width: 100%;
  }
}

.note-section-design {
  background: rgba(8, 145, 178, 0.04);
  border-left: 3px solid rgba(8, 145, 178, 0.3);
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
  margin-top: 16px;
}

.note-section-design .note-section-label {
  color: var(--accent);
}

.note-section-level .note-section-label {
  color: #7c3aed;
}

.note-modal.note-longform .note-section-body > .note-content-heading:first-child {
  margin-top: 0.45em;
}

.note-modal.note-longform .note-section-design {
  background: transparent;
  border-left: 0;
  padding: 0;
}

/* Badge styles for note modal */
.pn-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.pn-badge-genre {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.pn-badge-period {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* ===================================
   Personal Archive
=================================== */
.archive-panel {
  max-width: 960px;
  margin: 0 auto;
}

.archive-subtitle {
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.archive-gate {
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.archive-gate[hidden] {
  display: none;
}

.archive-gate-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.archive-gate-icon {
  display: inline-block;
  font-size: 2rem;
  margin-bottom: 12px;
}

.archive-gate-card > p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.archive-gate-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.archive-gate-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.archive-gate-card input.input-shake {
  animation: input-shake 0.4s;
}

.archive-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.archive-keypad button {
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

.archive-keypad-key {
  min-height: 44px;
  font-size: 1.08rem;
  font-weight: 700;
}

.archive-keypad-delete {
  grid-column: 1 / -1;
  min-height: 34px;
  font-size: 1rem;
}

.archive-keypad button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(15, 157, 194, 0.1);
}

.archive-keypad button:active:not(:disabled) {
  transform: translateY(1px);
}

.archive-keypad button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.archive-keypad button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.archive-error {
  color: #dc3545;
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}

.archive-error.show {
  display: block;
}

.archive-lockout {
  display: none;
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.2);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.archive-lockout.show {
  display: block;
}

.archive-lockout .lockout-icon {
  font-size: 1.5rem;
}

.archive-lockout .lockout-timer {
  font-size: 1.4rem;
  font-weight: 700;
  color: #dc3545;
  margin: 6px 0;
}

.archive-lockout .lockout-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.archive-gate-card .btn {
  width: 100%;
}

.archive-remaining {
  display: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.archive-remaining.show {
  display: block;
}

.archive-remaining.danger {
  color: #dc3545;
}

.archive-content {
  padding: 16px 0;
}

.archive-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.archive-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  box-sizing: border-box;
}

.archive-search:focus {
  outline: none;
  border-color: var(--accent);
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.archive-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.archive-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.archive-filter-chip .chip-count {
  font-size: 0.75rem;
  opacity: 0.65;
}

.archive-row-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: middle;
  flex: none;
}

.archive-filter-chip:hover {
  color: var(--text);
  border-color: var(--accent);
}

.archive-filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.archive-subfilters {
  margin-top: -10px;
  padding-left: 12px;
  border-left: 2px solid rgba(29, 158, 117, 0.45);
}

.archive-subfilters .archive-filter-chip {
  font-size: 0.78rem;
  padding: 4px 10px;
}

.archive-subfilters .archive-filter-chip.active {
  background: #1d9e75;
  border-color: #1d9e75;
}

.archive-no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 0;
}

/* Archive table row interactivity */
.archive-table tbody tr.archive-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.archive-table tbody tr.archive-row:hover {
  background: rgba(59, 130, 246, 0.06);
}

.archive-row-title {
  font-weight: 600;
  color: var(--text);
}

/* Archive date column */
.archive-table th:last-child,
.archive-table td:last-child {
  width: 9.5rem;
  text-align: right;
}

.archive-table th:last-child {
  color: var(--text);
}

.archive-row-date {
  color: var(--text-muted) !important;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.archive-date-note {
  margin: 10px 2px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .archive-table th:last-child,
  .archive-table td:last-child {
    width: 7.75rem;
  }

  .archive-row-date {
    font-size: 0.76rem;
  }
}

.archive-row-tags {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Viewer modal — navigation */
.archive-viewer-content {
  max-width: 1000px;
  max-height: 90vh;
}

.archive-viewer-meta {
  flex: 1;
  min-width: 0;
}

.archive-viewer-subtitle {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.archive-viewer-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.archive-viewer-navbtn {
  background: none;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.12s ease;
}

.archive-viewer-navbtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.archive-viewer-navbtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.archive-viewer-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 8px;
  min-width: 48px;
  text-align: center;
}

/* Viewer body — image vs text modes */
.archive-viewer-body.is-image {
  padding: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.archive-viewer-body.is-image img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
}

.archive-viewer-body.is-text {
  padding: 24px 28px;
}

.archive-viewer-text {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.7;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
}

.archive-inline-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.archive-column-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
  border-radius: 6px;
  background: #0a0a0a;
}

/* Long-form archive article */
.archive-viewer-body.is-article {
  padding: 0;
  white-space: normal;
  background:
    radial-gradient(circle at top right, rgba(224, 82, 99, 0.1), transparent 36%),
    #f3f7fb;
}

.archive-article-status {
  margin: 0;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.archive-article {
  width: 100%;
}

.dayya-article {
  width: min(100%, var(--content-shell));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 3rem) clamp(3.5rem, 7vw, 6rem);
  box-sizing: border-box;
  color: var(--text);
}

.dayya-article a {
  color: #b93648;
  text-decoration-color: rgba(185, 54, 72, 0.35);
  text-underline-offset: 3px;
}

.dayya-article a:hover {
  color: #8e2635;
}

.dayya-hero {
  padding: 34px;
  border: 1px solid rgba(224, 82, 99, 0.3);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(224, 82, 99, 0.13), rgba(56, 189, 248, 0.06) 72%),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 70px rgba(39, 62, 86, 0.1);
}

.dayya-eyebrow,
.dayya-topic-label,
.dayya-section-heading > p {
  margin: 0 0 8px;
  color: #f08b96;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.dayya-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.dayya-lead {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.dayya-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.dayya-meta span {
  padding: 6px 10px;
  border: 1px solid rgba(224, 82, 99, 0.22);
  border-radius: 999px;
  background: rgba(224, 82, 99, 0.08);
  color: var(--text-muted);
  font-size: 0.76rem;
}

.dayya-notice,
.dayya-context {
  margin: 22px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.dayya-notice {
  border-left: 3px solid #e05263;
}

.dayya-notice strong {
  display: block;
  margin-bottom: 5px;
}

.dayya-notice p,
.dayya-context p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.75;
}

.dayya-context h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.dayya-toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}

.dayya-toc a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dayya-toc a:hover {
  border-color: rgba(224, 82, 99, 0.55);
  background: rgba(224, 82, 99, 0.08);
}

.dayya-toc span {
  color: #f08b96;
  font-size: 0.72rem;
  font-weight: 800;
}

.dayya-layout {
  --content-rail: 13rem;
  --content-layout-gap: clamp(2rem, 4vw, 3rem);
  margin-top: clamp(2.75rem, 6vw, 4.5rem);
}

.dayya-rail .dayya-toc {
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--content-rule);
}

.dayya-rail .dayya-toc a {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.72rem 0;
  border: 0;
  border-bottom: 1px solid var(--content-rule);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.dayya-rail .dayya-toc a:hover,
.dayya-rail .dayya-toc a:focus-visible {
  border-color: var(--content-rule);
  background: transparent;
  color: #b93648;
}

.dayya-rail .dayya-toc a:focus-visible {
  outline: 2px solid #b93648;
  outline-offset: 3px;
}

.dayya-main > .dayya-context {
  margin-top: 0;
}

.dayya-section {
  margin-top: 58px;
  scroll-margin-top: 16px;
}

.dayya-section-heading {
  margin-bottom: 22px;
}

.dayya-section-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.025em;
}

.dayya-section-heading span {
  display: block;
  max-width: 700px;
  margin-top: 9px;
  color: var(--text-muted);
  line-height: 1.7;
}

.dayya-topic {
  margin-top: 18px;
  padding: 26px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  scroll-margin-top: 16px;
}

.dayya-topic + .dayya-topic {
  margin-top: 16px;
}

.dayya-topic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dayya-topic-header h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
}

.dayya-source-link {
  flex: none;
  font-size: 0.78rem;
}

.dayya-editor-note {
  margin: 17px 0 22px;
  padding: 13px 15px;
  border-radius: 8px;
  background: rgba(224, 82, 99, 0.08);
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.dayya-original {
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.78;
}

.dayya-original p {
  margin: 0 0 15px;
}

.dayya-original h4 {
  margin: 28px 0 12px;
  font-size: 1.08rem;
}

.dayya-original ul,
.dayya-original ol {
  margin: 0 0 18px;
  padding-left: 1.4rem;
}

.dayya-original li + li {
  margin-top: 7px;
}

.dayya-original hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--panel-border);
}

.dayya-original figure {
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: #080b11;
}

.dayya-original figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 760px;
  object-fit: contain;
}

.dayya-original figcaption {
  padding: 9px 12px;
  border-top: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
}

.dayya-sources ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 22px 22px 22px 42px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.dayya-sources li {
  min-width: 0;
}

/* Learning criteria — long-form archive essay */
.learning-criteria-article {
  width: min(100%, var(--content-shell));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 3rem) clamp(3.5rem, 7vw, 6rem);
  background: #f6f8fc;
  color: var(--text);
}

.learning-criteria-intro {
  margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
  padding-bottom: clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--content-rule);
}

.learning-criteria-eyebrow {
  margin: 0 0 0.8rem;
  color: #6259b8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.learning-criteria-origin {
  margin: 1.1rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.learning-criteria-layout {
  --content-rail: 13rem;
  --content-layout-gap: clamp(2rem, 4vw, 3rem);
}

.learning-criteria-rail nav {
  display: grid;
  border-top: 1px solid var(--content-rule);
}

.learning-criteria-rail a {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--content-rule);
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
  text-decoration: none;
}

.learning-criteria-rail a:hover,
.learning-criteria-rail a:focus-visible {
  color: #51499f;
}

.learning-criteria-rail a:focus-visible {
  outline: 2px solid #6259b8;
  outline-offset: 3px;
}

.learning-criteria-rail a span {
  color: #7770bf;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.learning-criteria-main > .content-section:first-child {
  margin-top: 0;
}

.learning-criteria-main .content-section {
  scroll-margin-top: 1.5rem;
}

.learning-criteria-main .content-section__header {
  margin-bottom: 1.35rem;
}

.learning-criteria-main h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.learning-criteria-main h4 {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
  line-height: 1.45;
}

.learning-criteria-main p {
  margin: 0 0 var(--content-paragraph-gap);
}

.learning-criteria-main ul,
.learning-criteria-main ol {
  margin: 0 0 1.5rem;
  padding-left: 1.4rem;
}

.learning-criteria-main li + li {
  margin-top: 0.55rem;
}

.learning-criteria-main code {
  padding: 0.12em 0.32em;
  border: 1px solid rgba(98, 89, 184, 0.18);
  border-radius: 0.3rem;
  background: rgba(98, 89, 184, 0.07);
  font-size: 0.92em;
}

.learning-criteria-main blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 3px solid #7770bf;
  color: #35465a;
  font-size: clamp(1.02rem, 1rem + 0.15vw, 1.12rem);
  line-height: 1.75;
}

.learning-criteria-main blockquote p {
  margin: 0;
}

.learning-criteria-main .content-subsection p:last-child {
  margin-bottom: 0;
}

.learning-depth-list {
  margin-bottom: 2rem;
}

.learning-depth-list dt {
  color: #51499f;
  font-weight: 750;
}

.learning-depth-list dd {
  line-height: 1.72;
}

.learning-criteria-main .learning-related-note {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--content-rule);
  color: var(--text-muted);
}

.learning-related-note a {
  color: #51499f;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.learning-related-note a:hover,
.learning-related-note a:focus-visible {
  color: #3f397f;
}

.learning-related-note a:focus-visible {
  outline: 2px solid #6259b8;
  outline-offset: 3px;
}

/* Shared long-form rendering for archived text posts */
.archive-longform-intro p {
  margin: 0 0 var(--content-paragraph-gap);
  white-space: pre-line;
}

.archive-longform-intro p:last-child {
  margin-bottom: 0;
}

.archive-longform-main p {
  white-space: pre-line;
}

.archive-longform-main a,
.archive-longform-intro a {
  color: #51499f;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.archive-longform-main a:hover,
.archive-longform-main a:focus-visible,
.archive-longform-intro a:hover,
.archive-longform-intro a:focus-visible {
  color: #383276;
}

.archive-longform-main hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--content-rule);
}

.archive-longform-media {
  margin: 1.75rem 0;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: #0a0d13;
}

.archive-longform-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 760px;
  object-fit: contain;
}

.archive-longform-video {
  position: relative;
  width: 100%;
  margin: 1.75rem 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #0a0d13;
}

.archive-longform-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 62.5rem) {
  .learning-criteria-rail {
    margin-bottom: 3rem;
  }

  .learning-criteria-rail nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
  }

  .dayya-rail {
    margin-bottom: 3rem;
  }

  .dayya-rail .dayya-toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
  }
}

@media (max-width: 40rem) {
  .learning-criteria-article {
    padding-inline: 1rem;
  }

  .learning-criteria-rail nav {
    grid-template-columns: 1fr;
  }

  .dayya-rail .dayya-toc {
    grid-template-columns: 1fr;
  }

  .learning-criteria-main blockquote {
    padding-left: 1rem;
  }
}

.archive-group {
  margin-bottom: 40px;
}

.archive-group h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.archive-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

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

.archive-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  cursor: zoom-in;
}

.archive-card-title {
  margin: 8px 4px 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.archive-column-btn {
  width: 100%;
  padding: 20px 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.archive-column-btn:hover {
  background: rgba(59, 130, 246, 0.15);
}

.archive-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.archive-foot {
  margin-top: 32px;
  text-align: center;
}

.archive-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 41, 0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.archive-viewer.active {
  display: flex;
}

.archive-viewer-content {
  background: var(--modal-bg);
  border-radius: 12px;
  width: 100%;
  max-width: 1100px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.archive-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
}

.archive-viewer-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.archive-viewer-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.archive-viewer-close:hover {
  color: var(--text);
}

.archive-viewer-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.65;
  color: var(--text);
}

/* Lobby entry card */
.archive-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--panel-border);
  border-radius: 10px;
  margin-top: 20px;
}

.archive-entry-icon {
  font-size: 1.4rem;
}

.archive-entry-text {
  flex: 1;
  min-width: 0;
}

.archive-entry-text h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.archive-entry-text p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 540px) {
  .archive-entry {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .archive-viewer {
    padding: 8px;
  }

  .archive-viewer-content {
    max-height: 94vh;
  }

  .dayya-article {
    padding: 22px 14px 48px;
  }

  .dayya-hero {
    padding: 24px 20px;
  }

  .dayya-toc,
  .dayya-sources ul {
    grid-template-columns: 1fr;
  }

  .dayya-topic {
    padding: 20px 16px;
  }

  .dayya-topic-header {
    display: block;
  }

  .dayya-source-link {
    display: inline-block;
    margin-top: 7px;
  }
}

/* ============================================================
   HOME — 레트로 네온 하강 배경 (Hyper Light Drifter 무드)
   city art: "Warped City" by Luis Zuno (@ansimuz) — CC0 (assets/city-CREDIT.txt)
   다크 테마는 body.home 한정 → 다른 상세페이지는 영향 없음
   ============================================================ */
body.home{
  --bp-bg:#04060a;
  --panel-bg:rgba(9,16,28,0.6);
  --panel-border:rgba(34,211,238,0.18);
  --panel-shadow:0 14px 60px rgba(0,0,0,.55);
  --text:#eaf4fb;
  --text-muted:#9fb4c9;
  --divider:rgba(120,160,200,0.16);
  background:#04060a;
}
body.home .bg-overlay{display:none}

/* 고정 배경 씬 (z-index:-1 → 콘텐츠 뒤, 섹션 z-index 불필요) */
.home-scene{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none}
.home-scene .hl{position:absolute;inset:0;will-change:opacity,transform}
.home-scene .sky-space{background:linear-gradient(180deg,#03050a 0%,#060d1c 46%,#081427 62%,#050a14 100%)}
.home-scene .sky-dusk{opacity:0;background:linear-gradient(180deg,#060a1a 0%,#1a1040 42%,#2a1444 70%,#120e2a 100%)}
.home-scene .stars .hl-star{position:absolute;width:2px;height:2px;background:#d6ecf7;animation:hlTwinkle 3.6s ease-in-out infinite}
@keyframes hlTwinkle{0%,100%{opacity:.1}50%{opacity:.9}}
.home-scene .moon-wrap{position:absolute;top:9%;left:13%;width:100px;height:100px;will-change:opacity,transform}
.home-scene .moon-glow{position:absolute;inset:-70%;background:radial-gradient(circle,rgba(130,185,230,.3) 0%,rgba(80,140,190,.1) 45%,transparent 68%)}
.home-scene .moon{position:relative;width:100%;height:100%;image-rendering:pixelated;filter:drop-shadow(0 0 16px rgba(150,200,235,.5))}
.home-scene .clouds .hl-cloud{position:absolute;will-change:transform}
.home-scene .clouds .hl-cloud svg{display:block;image-rendering:pixelated}
@keyframes hlDrift{from{transform:translateX(116vw)}to{transform:translateX(-46vw)}}
.home-scene .grid-floor{position:absolute;left:-80%;right:-80%;bottom:0;height:38vh;
  background-image:linear-gradient(to right,rgba(34,211,238,.4) 1.5px,transparent 1.5px),linear-gradient(to bottom,rgba(34,211,238,.36) 1.5px,transparent 1.5px);
  background-size:62px 62px;transform:perspective(300px) rotateX(76deg);transform-origin:bottom center;
  -webkit-mask-image:linear-gradient(to top,#000 8%,rgba(0,0,0,.5) 40%,transparent 92%);mask-image:linear-gradient(to top,#000 8%,rgba(0,0,0,.5) 40%,transparent 92%);
  animation:hlFloor 2.4s linear infinite}
@keyframes hlFloor{from{background-position-y:0}to{background-position-y:62px}}
.home-scene .city-far{opacity:0;background:url('assets/city-far.png') center bottom/cover no-repeat;image-rendering:pixelated;filter:saturate(1.1) brightness(1.02)}
.home-scene .city-mid{opacity:0;background:url('assets/city-mid.png') center bottom/100% auto no-repeat;image-rendering:pixelated}
.home-scene .city-near{opacity:0;background:url('assets/city-near.png') left bottom/auto 56vh repeat-x;image-rendering:pixelated}
/* 네온 블룸(빛번짐) + 생기 색보정 — 도시를 화려·생동감 있게 */
.home-scene .city-glow{mix-blend-mode:screen;will-change:opacity,transform;filter:blur(6px) brightness(1.45) saturate(1.3)}
.home-scene .city-glow.gm{opacity:0;background:url('assets/city-mid.png') center bottom/100% auto no-repeat;image-rendering:pixelated;animation:hlNeon 5.5s ease-in-out infinite}
.home-scene .city-glow.gn{opacity:0;background:url('assets/city-near.png') left bottom/auto 56vh repeat-x;image-rendering:pixelated;animation:hlNeon 4.6s ease-in-out infinite .9s}
.home-scene .city-grade{opacity:0;mix-blend-mode:screen;background:linear-gradient(180deg,transparent 34%,rgba(255,77,224,.06) 60%,rgba(34,211,238,.07) 100%)}
@keyframes hlNeon{0%,100%{filter:blur(6px) brightness(1.35) saturate(1.25)}50%{filter:blur(6px) brightness(1.7) saturate(1.45)}}
.home-scene .hl-vignette{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 40%,transparent 0%,rgba(3,5,10,.4) 62%,rgba(3,5,10,.84) 100%)}
@media(prefers-reduced-motion:reduce){.home-scene .grid-floor,.home-scene .hl-cloud,.home-scene .hl-star,.home-scene .city-far,.home-scene .city-mid,.home-scene .city-near,.home-scene .city-glow{animation:none!important}}

/* 하드코딩 밝은 표면 → 다크 글래스 (home 한정) */
body.home .hero-card{background:rgba(9,16,28,.6);border-color:rgba(34,211,238,.2);box-shadow:0 16px 60px rgba(0,0,0,.55),inset 0 0 0 1px rgba(34,211,238,.05)}
body.home .hero-title-bar{background:rgba(34,211,238,.05);border-bottom-color:rgba(34,211,238,.12)}
body.home .name-badge{background:rgba(34,211,238,.12)}
body.home .project-card,
body.home .project-card.card-highlight{background:rgba(9,16,28,.6);border:1px solid rgba(34,211,238,.16)}
body.home .project-media,
body.home .project-media-wide{background:rgba(6,11,20,.7)}
body.home .project-badge{background:rgba(34,211,238,.1);color:#86dcea}
body.home .record-tile{background:rgba(9,16,28,.6);border:1px solid rgba(34,211,238,.14)}
body.home .record-tag{background:rgba(34,211,238,.12);color:#86dcea}
body.home .section-panel > p{background:rgba(34,211,238,.05);color:var(--text-muted);border-color:rgba(34,211,238,.14)}
body.home .section-panel h3{color:var(--text)}
body.home .callout-card{background:rgba(34,211,238,.05);border-color:rgba(34,211,238,.14)}
body.home .callout-card p{color:var(--text-muted)}
body.home .contact-block{background:rgba(9,16,28,.62)}
body.home .contact-block h3{background:rgba(34,211,238,.08)}
body.home .contact-item{background:rgba(9,16,28,.62)}
body.home .contact-item:hover{background:rgba(14,24,38,.78)}
body.home figure{background:rgba(9,16,28,.6)}
body.home figcaption{background:rgba(34,211,238,.06);color:var(--text)}
/* Contact = 도시 최고 밝은 구간 → 패널 더 불투명 */
body.home #contact .section-panel{background:rgba(9,16,28,.66)}

/* 모바일 최적화 */
@media (max-width:640px){
  .home-scene .moon-wrap{width:66px;height:66px;top:7%;left:8%}
  .home-scene .city-near{background-size:auto 42vh}
  .home-scene .grid-floor{height:30vh}
  .home-scene .hl-vignette{background:radial-gradient(ellipse at 50% 42%,transparent 0%,rgba(3,5,10,.42) 58%,rgba(3,5,10,.86) 100%)}
  /* 모바일: 블렌드+애니블러 레이어가 점멸 유발 → 끔 (PNG 네온은 그대로 유지) */
  .home-scene .city-glow,.home-scene .city-grade{display:none!important}
}

/* ============================================================
   CASE STUDY — 네이비 블루프린트 배경 (홈=네온 도시 / 케이스=그 도시의 설계도)
   원래 쓰던 blueprint-bg.png 네이비 텍스처 복원 → 흰 카드와 대비가 부드러워
   눈 편함 + "설계도" 컨셉으로 홈과 연결. 흰 종이 카드(검정 글자) 유지.
   .bg-overlay(네이비 비네트)도 원래대로. body.study 한정.
   ============================================================ */
body.study{background:#0a1929 url('assets/blueprint-bg.png') repeat}
