/* ============================================================
   DINCHARA — Annual Book Website
   Theme: Comic Book / Pop Art
   Color: Blue #1565C0, Red #C62828, Yellow #FFD600
   ============================================================ */

/* === CSS VARIABLES === */
:root {
  --blue: #1565C0;
  --blue-dark: #0D47A1;
  --blue-light: #1976D2;
  --blue-bright: #2196F3;
  --red: #C62828;
  --red-bright: #E53935;
  --yellow: #FFD600;
  --yellow-bright: #FFEA00;
  --white: #FFFFFF;
  --black: #111111;
  --dark: #0A0A1A;
  --gray: #424242;
  --gray-light: #E0E0E0;

  --outline: 3px solid var(--black);
  --outline-thick: 4px solid var(--black);
  --shadow-comic: 5px 5px 0 var(--black);
  --shadow-comic-lg: 8px 8px 0 var(--black);
  --shadow-comic-red: 5px 5px 0 var(--red);
  --shadow-comic-blue: 5px 5px 0 var(--blue-dark);

  --font-hero: 'Bangers', cursive;
  --font-title: 'Oswald', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --font-comic: 'Comic Neue', cursive;

  --radius: 8px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.15s ease;

  --nav-h: 70px;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  background: var(--blue);
  color: var(--white);
  overflow-x: hidden;
  position: relative;
}
body.loaded { overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font-body); }

/* === HALFTONE PATTERN MIXIN === */
.hero-halftone, .ebook-bg-halftone, .preview-halftone, .footer-halftone, .loading-comic-bg {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.15) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 0;
}

/* ===================== LOADING SCREEN ===================== */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--blue-dark);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loading-screen.fade-out { opacity: 0; visibility: hidden; }

.loading-action-lines {
  position: absolute; inset: 0;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(255,255,255,0.04) 0deg 5deg,
    transparent 5deg 10deg
  );
  pointer-events: none;
}

.loading-content {
  position: relative; z-index: 2;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}

.loading-stars { display: flex; gap: 8px; }
.loading-stars .star {
  font-size: 2rem; color: var(--yellow);
  animation: starPop 0.5s ease both;
}
.loading-stars .s1 { animation-delay: 0.1s; }
.loading-stars .s2 { animation-delay: 0.2s; }
.loading-stars .s3 { animation-delay: 0.3s; }
.loading-stars .s4 { animation-delay: 0.4s; }
.loading-stars .s5 { animation-delay: 0.5s; }
@keyframes starPop {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  70% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.loading-logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.loading-badge {
  font-family: var(--font-title); font-size: 0.85rem; letter-spacing: 3px;
  color: var(--yellow); border: 2px solid var(--yellow); padding: 4px 16px;
  animation: fadeInDown 0.5s ease 0.6s both;
}
.loading-title {
  font-family: var(--font-hero); font-size: clamp(5rem, 15vw, 10rem);
  color: var(--yellow); letter-spacing: 4px;
  -webkit-text-stroke: 3px var(--black);
  text-shadow: 6px 6px 0 var(--black), -2px -2px 0 var(--black);
  animation: titleBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
  line-height: 1;
}
@keyframes titleBounce {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.loading-subtitle {
  font-family: var(--font-title); font-size: 1rem; letter-spacing: 4px;
  color: var(--white); background: var(--red);
  padding: 6px 20px; border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  animation: fadeInUp 0.5s ease 1.1s both;
}

.loading-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: fadeInUp 0.5s ease 1.3s both; }
.loading-bar {
  width: 300px; max-width: 80vw; height: 14px;
  background: rgba(255,255,255,0.2);
  border: 2px solid var(--black);
  border-radius: 99px; overflow: hidden;
}
.loading-bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--yellow), var(--yellow-bright));
  border-radius: 99px;
  animation: barFill 1.8s ease 1.4s forwards;
}
@keyframes barFill { to { width: 100%; } }
.loading-text {
  font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 3px;
  color: rgba(255,255,255,0.7);
}

/* ===================== NAVIGATION ===================== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
#navbar.scrolled {
  background: var(--blue-dark);
  box-shadow: 0 4px 0 var(--black);
}

.nav-progress {
  position: absolute; top: 0; left: 0; height: 4px;
  background: var(--yellow);
  width: 0; transition: width 0.1s;
  z-index: 1;
}
.nav-container {
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  position: relative;
}

.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-hero); font-size: 1.8rem;
  color: var(--yellow);
  -webkit-text-stroke: 1px var(--black);
  text-shadow: 2px 2px 0 var(--black);
  transition: transform var(--transition);
}
.nav-logo:hover { transform: scale(1.05) rotate(-2deg); }
.nav-logo-badge { font-size: 1.2rem; animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.nav-links {
  display: flex; gap: 4px; align-items: center;
}
.nav-link {
  font-family: var(--font-title); font-size: 0.9rem; font-weight: 500;
  letter-spacing: 1px; padding: 6px 14px;
  color: rgba(255,255,255,0.85);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; padding: 6px;
}
.nav-toggle span {
  display: block; width: 26px; height: 3px;
  background: var(--yellow); border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===================== HERO SECTION ===================== */
#hero {
  min-height: 100vh;
  background: var(--blue);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 40px) 24px 60px;
}

.hero-action-lines {
  position: absolute; inset: 0;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(255,255,255,0.04) 0deg 3deg,
    transparent 3deg 6deg
  );
  pointer-events: none;
}

.hero-stars-bg { position: absolute; inset: 0; pointer-events: none; }
.hstar {
  position: absolute; color: var(--yellow);
  font-size: 2rem; opacity: 0.8;
  animation: floatStar 3s ease-in-out infinite;
}
.hs1 { top: 10%; left: 5%; font-size: 2.5rem; animation-delay: 0s; }
.hs2 { top: 20%; right: 8%; font-size: 1.5rem; animation-delay: 0.5s; }
.hs3 { top: 60%; left: 3%; font-size: 3rem; animation-delay: 1s; }
.hs4 { top: 75%; right: 5%; font-size: 2rem; animation-delay: 1.5s; }
.hs5 { top: 40%; left: 85%; font-size: 1.8rem; animation-delay: 2s; }
.hs6 { top: 85%; left: 20%; font-size: 2.2rem; animation-delay: 0.8s; }
@keyframes floatStar {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-15px) rotate(20deg); }
}

.hero-panel {
  position: absolute; pointer-events: none;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.1);
}
.hp1 { width: 200px; height: 200px; top: 10%; left: -50px; transform: rotate(-15deg); border-radius: 8px; }
.hp2 { width: 150px; height: 150px; bottom: 15%; right: -20px; transform: rotate(10deg); border-radius: 8px; overflow: hidden; }

.hero-container {
  position: relative; z-index: 2;
  max-width: 900px; width: 100%;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}

.hero-school-badge {
  display: inline-block;
}
.badge-inner {
  background: var(--red);
  border: 3px solid var(--black);
  box-shadow: var(--shadow-comic);
  padding: 12px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transform: rotate(-2deg);
  transition: transform var(--transition);
}
.badge-inner:hover { transform: rotate(0deg) scale(1.05); }
.badge-top { font-family: var(--font-title); font-size: 0.75rem; letter-spacing: 3px; color: rgba(255,255,255,0.8); }
.badge-school { font-family: var(--font-hero); font-size: 1.2rem; letter-spacing: 2px; color: var(--white); }
.badge-year { font-family: var(--font-title); font-size: 0.8rem; color: var(--yellow); letter-spacing: 2px; }

.hero-tag {
  font-family: var(--font-title); font-size: 1rem; letter-spacing: 5px;
  color: var(--white); background: var(--blue-light);
  padding: 8px 24px; border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
}

.hero-title {
  font-family: var(--font-hero);
  font-size: clamp(5rem, 18vw, 14rem);
  line-height: 0.9;
  display: flex; flex-direction: column; align-items: center;
}
.title-line1 {
  color: var(--white);
  -webkit-text-stroke: 4px var(--black);
  text-shadow: 8px 8px 0 var(--black);
}
.title-line2 {
  color: var(--yellow);
  -webkit-text-stroke: 4px var(--black);
  text-shadow: 8px 8px 0 var(--black);
  transform: rotate(-2deg);
}

.hero-tagline { max-width: 600px; }
.tagline-bubble {
  background: var(--white);
  color: var(--black);
  border: 3px solid var(--black);
  box-shadow: var(--shadow-comic-blue);
  padding: 16px 24px;
  border-radius: 8px;
  position: relative;
  font-family: var(--font-comic); font-size: 1.05rem; font-style: italic;
}
.tagline-bubble::before {
  content: '';
  position: absolute; top: -16px; left: 40px;
  border: 8px solid transparent;
  border-bottom-color: var(--black);
}
.tagline-bubble::after {
  content: '';
  position: absolute; top: -11px; left: 42px;
  border: 6px solid transparent;
  border-bottom-color: var(--white);
}

.hero-meta {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center;
  font-family: var(--font-title); font-size: 0.85rem; letter-spacing: 1px;
  color: rgba(255,255,255,0.9);
}
.hero-meta i { color: var(--yellow); }
.meta-divider { color: var(--yellow); }

.hero-scroll-hint {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-title); font-size: 0.75rem; letter-spacing: 3px;
  color: rgba(255,255,255,0.6);
  animation: fadeInUp 0.5s ease 1s both;
}
.scroll-arrows { animation: bounce 1.5s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ===================== SECTION HEADER ===================== */
.section-header {
  text-align: center; padding: 0 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 48px;
}
.section-header.small { margin-top: 48px; margin-bottom: 24px; }
.section-tag {
  font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 4px;
  color: var(--yellow); background: transparent;
}
.section-title {
  font-family: var(--font-hero); font-size: clamp(2.5rem, 7vw, 4.5rem);
  color: var(--white);
  -webkit-text-stroke: 2px var(--black);
  text-shadow: 5px 5px 0 var(--black);
  letter-spacing: 3px; line-height: 1;
}
.section-underline {
  width: 80px; height: 6px;
  background: var(--yellow);
  border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
}
.section-underline.yellow { background: var(--yellow); }
.section-underline.red { background: var(--red); }

/* ===================== GALLERY / DOWNLOAD ===================== */
#gallery {
  background: var(--white);
  color: var(--black);
  padding: 80px 24px;
  position: relative;
}
#gallery .section-title { color: var(--black); -webkit-text-stroke: 2px var(--black); text-shadow: 5px 5px 0 var(--blue); }
#gallery .section-tag { color: var(--blue); }

.gallery-container { max-width: 1200px; margin: 0 auto; }
.download-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}

.download-card {
  border: 3px solid var(--black);
  box-shadow: var(--shadow-comic-lg);
  padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  border-radius: 4px;
}
.download-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0 var(--black);
}
.dc-red { background: var(--red); color: var(--white); }
.dc-blue { background: var(--blue); color: var(--white); }
.dc-green { background: #1B5E20; color: var(--white); }

.dc-number {
  position: absolute; top: 12px; right: 16px;
  font-family: var(--font-hero); font-size: 5rem; color: rgba(255,255,255,0.1);
  line-height: 1;
}
.dc-icon {
  font-size: 3.5rem; color: var(--yellow);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
  transition: transform var(--transition);
}
.download-card:hover .dc-icon { transform: scale(1.2) rotate(-10deg); }
.dc-content { text-align: center; flex: 1; }
.dc-tag {
  font-family: var(--font-title); font-size: 0.7rem; letter-spacing: 3px;
  color: var(--yellow); margin-bottom: 8px;
}
.dc-title {
  font-family: var(--font-hero); font-size: 2rem; letter-spacing: 2px;
  color: var(--white); text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  margin-bottom: 8px;
}
.dc-desc { font-size: 0.88rem; line-height: 1.6; color: rgba(255,255,255,0.9); margin-bottom: 12px; }
.dc-meta { font-size: 0.78rem; color: rgba(255,255,255,0.7); font-family: var(--font-comic); }

.btn-download {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--yellow); color: var(--black);
  font-family: var(--font-title); font-size: 1rem; font-weight: 700;
  letter-spacing: 2px; padding: 12px 28px;
  border: 3px solid var(--black);
  box-shadow: 4px 4px 0 var(--black);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-download:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--black);
}
.btn-download:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--black); }

.dc-stars {
  position: absolute; bottom: 8px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 4px;
  font-size: 0.7rem; color: rgba(255,255,0,0.4);
}

/* ===================== eBOOK SECTION ===================== */
#ebook {
  background: var(--blue-dark);
  padding: 80px 24px;
  position: relative; overflow: hidden;
}

.ebook-bg-halftone { opacity: 0.5; }

.ebook-covers {
  max-width: 1100px; margin: 0 auto 16px;
  display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 24px;
  align-items: end;
}

.cover-card {
  border: 3px solid var(--black);
  box-shadow: var(--shadow-comic-lg);
  overflow: hidden; position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
  background: var(--black);
}
.cover-card:hover {
  transform: translateY(-8px) rotate(1deg);
  box-shadow: 12px 12px 0 var(--black);
}
.cover-card.featured {
  box-shadow: 0 0 0 4px var(--yellow), 8px 8px 0 var(--black);
  transform: translateY(-16px);
}
.cover-card.featured:hover { transform: translateY(-24px); }

.cover-image-wrap {
  position: relative; aspect-ratio: 3/4; overflow: hidden;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
}
.cover-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.cover-card:hover .cover-image-wrap img { transform: scale(1.05); }
.cover-image-wrap.no-image::after {
  content: '📚 Cover\nImage'; white-space: pre;
  display: flex; align-items: center; justify-content: center;
  position: absolute; inset: 0; color: rgba(255,255,255,0.4);
  font-family: var(--font-hero); font-size: 2rem; text-align: center;
}
.cover-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--yellow);
  opacity: 0; transition: opacity 0.25s;
}
.cover-card:hover .cover-overlay { opacity: 1; }
.cover-badge {
  position: absolute; top: 12px; right: -30px;
  background: var(--yellow); color: var(--black);
  font-family: var(--font-title); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 2px; padding: 4px 40px;
  transform: rotate(45deg);
  border: 1px solid var(--black);
}
.cover-label {
  padding: 12px 16px; background: var(--black);
  display: flex; gap: 10px; align-items: center;
}
.cover-num { font-family: var(--font-hero); font-size: 1.2rem; color: var(--yellow); }
.cover-name { font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 2px; color: var(--white); }

.design-details-grid {
  max-width: 1000px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}

.detail-card {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  padding: 24px 20px;
  text-align: center;
  border-radius: 4px;
  transition: transform var(--transition), background 0.2s;
}
.detail-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.12); }
.detail-icon {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--white);
  margin: 0 auto 16px;
}
.detail-card h4 { font-family: var(--font-title); font-size: 1.1rem; letter-spacing: 1px; margin-bottom: 8px; }
.detail-card p { font-size: 0.88rem; line-height: 1.6; color: rgba(255,255,255,0.75); }

/* ===================== ABOUT SECTION ===================== */
#about {
  background: var(--blue);
  padding: 80px 24px;
  position: relative; overflow: hidden;
}
#about::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.about-container {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 60px;
  align-items: center;
}

.photo-frame-wrap { position: relative; }
.photo-frame {
  border: 4px solid var(--black);
  box-shadow: 10px 10px 0 var(--black);
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  aspect-ratio: 4/5;
  position: relative;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame img.no-image-fallback {
  filter: opacity(0);
}
.photo-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--yellow); color: var(--black);
  font-family: var(--font-title); font-size: 0.75rem; letter-spacing: 2px;
  font-weight: 700; text-align: center; padding: 8px;
  border-top: 2px solid var(--black);
}
.photo-decor {
  position: absolute;
  font-family: var(--font-hero); font-size: 1.1rem; letter-spacing: 2px;
  background: var(--red); color: var(--white);
  padding: 8px 14px; border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
}
.pd1 { bottom: -20px; right: -20px; transform: rotate(5deg); line-height: 1.2; text-align: center; }
.pd2 { top: -16px; left: -16px; transform: rotate(-6deg); background: var(--yellow); color: var(--black); }

.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-bottom: 32px;
}
.stat-box {
  background: var(--yellow); color: var(--black);
  border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--black);
  padding: 20px 12px; text-align: center;
  transition: transform var(--transition);
}
.stat-box:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--black); }
.stat-number { font-family: var(--font-hero); font-size: 2.8rem; color: var(--black); line-height: 1; }
.stat-label { font-family: var(--font-title); font-size: 0.7rem; letter-spacing: 3px; color: var(--black); margin-top: 4px; }

.story-title {
  font-family: var(--font-hero); font-size: 2rem; letter-spacing: 3px;
  color: var(--yellow); text-shadow: 3px 3px 0 var(--black);
  margin-bottom: 16px;
}
.story-speech-bubble {
  background: var(--white); color: var(--black);
  border: 3px solid var(--black); box-shadow: 5px 5px 0 var(--black);
  padding: 20px 24px; border-radius: 8px;
  margin-bottom: 24px;
  position: relative;
}
.story-speech-bubble::before {
  content: '';
  position: absolute; top: -16px; left: 40px;
  border: 8px solid transparent;
  border-bottom-color: var(--black);
}
.story-speech-bubble::after {
  content: '';
  position: absolute; top: -11px; left: 42px;
  border: 6px solid transparent;
  border-bottom-color: var(--white);
}
.story-speech-bubble p { font-size: 0.92rem; line-height: 1.7; margin-bottom: 12px; }
.story-speech-bubble p:last-child { margin-bottom: 0; }

.logo-phil {
  background: rgba(0,0,0,0.3);
  border: 2px solid var(--yellow);
  padding: 20px; border-radius: 4px;
}
.logo-phil-title {
  font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 3px;
  color: var(--yellow); margin-bottom: 10px; font-weight: 700;
}
.logo-phil p { font-size: 0.88rem; line-height: 1.7; color: rgba(255,255,255,0.85); }

/* ===================== PREVIEW / FLIPBOOK ===================== */
#preview {
  background: var(--red);
  padding: 80px 24px;
  position: relative; overflow: hidden;
}
#preview .section-title { color: var(--white); -webkit-text-stroke: 2px var(--black); text-shadow: 5px 5px 0 var(--black); }

.flipbook-container { max-width: 900px; margin: 0 auto; }

.flipbook-placeholder {
  border: 4px solid var(--black);
  box-shadow: var(--shadow-comic-lg);
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
}
.flipbook-mock {
  display: flex; gap: 0; height: 400px;
  padding: 24px;
  background: #F5F5DC;
}
.mock-page {
  flex: 1; background: var(--white);
  border: 2px solid #ccc;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.mock-page-left { border-right: none; }
.mock-spine { width: 8px; background: linear-gradient(to right, #aaa, #ddd, #aaa); }
.mock-header {
  font-family: var(--font-hero); font-size: 1.2rem; color: var(--blue);
  text-align: center; letter-spacing: 2px;
}
.mock-img-placeholder {
  flex: 1; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  border-radius: 4px; opacity: 0.2;
}
.mock-lines { display: flex; flex-direction: column; gap: 6px; }
.mock-lines span { display: block; height: 8px; background: #E0E0E0; border-radius: 4px; }
.mock-lines span:nth-child(2) { width: 80%; }
.mock-lines span:nth-child(3) { width: 60%; }
.flipbook-msg {
  padding: 24px; text-align: center; color: var(--gray);
  border-top: 2px solid #eee; background: #FAFAFA;
}
.flipbook-msg i { font-size: 2rem; color: var(--blue); margin-bottom: 8px; }
.flipbook-msg p { font-family: var(--font-title); margin-bottom: 4px; }
.flipbook-msg small { font-size: 0.82rem; color: #888; }

/* ===================== MESSAGES SECTION ===================== */
#messages {
  background: var(--dark);
  padding: 80px 24px;
  position: relative;
}
#messages::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}
#messages .section-tag { color: var(--yellow); }

.messages-container {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}

.msg-form-wrap {
  background: var(--blue-dark);
  border: 3px solid var(--black);
  box-shadow: var(--shadow-comic);
  overflow: hidden;
}
.form-comic-header {
  background: var(--yellow); color: var(--black);
  font-family: var(--font-hero); font-size: 1.4rem; letter-spacing: 2px;
  padding: 14px 24px; border-bottom: 3px solid var(--black);
}
.msg-form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-family: var(--font-title); font-size: 0.85rem; letter-spacing: 1px;
  color: rgba(255,255,255,0.8);
}
.req { color: var(--yellow); }
.form-group input, .form-group select, .form-group textarea {
  background: rgba(255,255,255,0.1); color: var(--white);
  border: 2px solid rgba(255,255,255,0.25);
  padding: 10px 14px; border-radius: 0;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(255,255,255,0.4); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--yellow);
}
.form-group select option { background: var(--blue-dark); color: var(--white); }
.form-group textarea { resize: vertical; min-height: 100px; }
.char-count { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-align: right; }
.field-error { font-size: 0.78rem; color: #ff6b6b; min-height: 14px; }

.btn-submit {
  background: var(--yellow); color: var(--black);
  font-family: var(--font-title); font-size: 1.1rem; font-weight: 700;
  letter-spacing: 3px; padding: 14px 32px;
  border: 3px solid var(--black); box-shadow: 5px 5px 0 var(--black);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  transition: all var(--transition);
}
.btn-submit:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--black); }
.btn-submit:active { transform: translate(2px,2px); box-shadow: 3px 3px 0 var(--black); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-notif {
  padding: 0 24px 16px;
  font-family: var(--font-title); font-size: 0.9rem; letter-spacing: 1px;
  min-height: 20px;
}
.form-notif.success { color: #69f0ae; }
.form-notif.error { color: #ff6b6b; }

.msg-display-wrap {
  display: flex; flex-direction: column; gap: 0;
  background: rgba(255,255,255,0.05);
  border: 3px solid rgba(255,255,255,0.15);
  overflow: hidden; max-height: 520px;
}
.msg-display-header {
  background: var(--red); color: var(--white);
  font-family: var(--font-hero); font-size: 1.1rem; letter-spacing: 2px;
  padding: 14px 20px; border-bottom: 3px solid var(--black);
  display: flex; justify-content: space-between; align-items: center;
}
.msg-count {
  font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 1px;
  background: var(--black); color: var(--yellow);
  padding: 4px 12px;
}
.msg-list {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.msg-list::-webkit-scrollbar { width: 4px; }
.msg-list::-webkit-scrollbar-track { background: transparent; }
.msg-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.msg-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; color: rgba(255,255,255,0.4); text-align: center;
}
.msg-empty i { font-size: 3rem; margin-bottom: 12px; }
.msg-empty p { font-family: var(--font-title); font-size: 0.9rem; letter-spacing: 1px; }

.msg-item {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.1);
  border-left: 4px solid var(--yellow);
  padding: 14px 16px;
  animation: msgAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes msgAppear {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
.msg-item-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  flex-wrap: wrap;
}
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); border: 2px solid var(--black);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hero); font-size: 0.9rem; color: var(--yellow);
  flex-shrink: 0;
}
.msg-name { font-family: var(--font-title); font-size: 0.92rem; font-weight: 700; letter-spacing: 1px; flex: 1; }
.msg-role {
  font-family: var(--font-title); font-size: 0.68rem; letter-spacing: 1px;
  background: var(--blue); color: var(--white);
  padding: 2px 8px;
}
.msg-date { font-size: 0.72rem; color: rgba(255,255,255,0.4); font-family: var(--font-comic); }
.msg-text { font-size: 0.88rem; line-height: 1.6; color: rgba(255,255,255,0.85); font-family: var(--font-comic); }

/* ===================== FOOTER ===================== */
#footer {
  background: var(--black);
  padding: 60px 24px 24px;
  position: relative; overflow: hidden;
}
.footer-halftone { opacity: 0.3; }
.footer-stars {
  text-align: center; margin-bottom: 40px;
  display: flex; justify-content: center; gap: 16px;
  position: relative; z-index: 1;
}
.footer-stars span {
  font-size: 2rem; color: var(--yellow);
  animation: floatStar 3s ease-in-out infinite;
}
.footer-stars span:nth-child(2) { animation-delay: 0.3s; }
.footer-stars span:nth-child(3) { animation-delay: 0.6s; font-size: 3rem; }
.footer-stars span:nth-child(4) { animation-delay: 0.9s; }
.footer-stars span:nth-child(5) { animation-delay: 1.2s; }

.footer-container {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 2fr; gap: 48px;
  position: relative; z-index: 1;
  border-top: 2px solid rgba(255,255,255,0.1);
  padding-top: 40px; margin-bottom: 40px;
}

.footer-logo {
  font-family: var(--font-hero); font-size: 3.5rem; color: var(--yellow);
  -webkit-text-stroke: 2px rgba(255,255,255,0.2);
  text-shadow: 4px 4px 0 rgba(255,214,0,0.3);
  line-height: 1;
}
.footer-logo-sub {
  font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 3px;
  color: rgba(255,255,255,0.6); margin-bottom: 12px;
}
.footer-tagline { font-family: var(--font-comic); font-style: italic; color: rgba(255,255,255,0.7); font-size: 0.95rem; margin-bottom: 20px; }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  width: 40px; height: 40px; background: var(--blue);
  border: 2px solid var(--black); box-shadow: 3px 3px 0 rgba(255,214,0,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--white);
  transition: all var(--transition);
}
.footer-socials a:hover { background: var(--yellow); color: var(--black); transform: translate(-2px,-2px); box-shadow: 5px 5px 0 rgba(255,214,0,0.5); }

.footer-nav h4, .footer-info h4, .footer-quote h4 {
  font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 3px;
  color: var(--yellow); margin-bottom: 16px; font-weight: 700;
}
.footer-nav ul, .footer-info ul { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a {
  font-size: 0.9rem; color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--yellow); }
.footer-info li {
  font-size: 0.88rem; color: rgba(255,255,255,0.7);
  display: flex; align-items: center; gap: 10px;
}
.footer-info i { color: var(--yellow); width: 14px; }

.footer-quote blockquote {
  font-family: var(--font-comic); font-style: italic; font-size: 0.9rem;
  color: rgba(255,255,255,0.75); line-height: 1.7;
  border-left: 3px solid var(--yellow); padding-left: 16px; margin-bottom: 8px;
}
.footer-quote cite { font-size: 0.8rem; color: var(--yellow); font-family: var(--font-title); letter-spacing: 1px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px; text-align: center;
  font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  position: relative; z-index: 1;
}

/* ===================== BACK TO TOP ===================== */
.btn-back-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 52px; height: 52px;
  background: var(--yellow); color: var(--black);
  border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--black);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  transform: translateY(100px); opacity: 0;
  z-index: 999;
}
.btn-back-top.visible { transform: translateY(0); opacity: 1; }
.btn-back-top:hover { transform: translateY(-3px); box-shadow: 6px 6px 0 var(--black); }
.btt-star { font-size: 0.6rem; animation: spin 2s linear infinite; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; bottom: 90px; right: 28px;
  background: var(--yellow); color: var(--black);
  font-family: var(--font-title); font-size: 0.9rem; font-weight: 700;
  letter-spacing: 1px; padding: 12px 20px;
  border: 3px solid var(--black); box-shadow: 5px 5px 0 var(--black);
  transform: translateX(200px); opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2000; max-width: 300px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.error { background: var(--red); color: var(--white); }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeInDown {
  0% { transform: translateY(-20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes fadeInUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ===================== RESPONSIVE ===================== */

/* 1400px+ */
@media (min-width: 1400px) {
  .hero-title { font-size: 16rem; }
}

/* 1024px */
@media (max-width: 1024px) {
  .footer-container { grid-template-columns: 1fr 1fr; gap: 32px; }
  .about-container { grid-template-columns: 1fr; gap: 40px; }
  .photo-frame-wrap { max-width: 400px; margin: 0 auto; }
  .ebook-covers { grid-template-columns: 1fr 1.2fr 1fr; gap: 16px; }
}

/* ===== 768px — TABLET & MOBILE ===== */
@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  /* KUNCI UTAMA: stop horizontal scroll */
  html, body { overflow-x: hidden; max-width: 100vw; }
  section, footer, nav { max-width: 100vw; overflow-x: hidden; }

  /* --- Navbar --- */
  .nav-links {
    position: fixed; top: 60px; left: 0; right: 0;
    background: var(--blue-dark);
    flex-direction: column; gap: 0;
    border-top: 3px solid var(--black);
    border-bottom: 3px solid var(--black);
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease;
    z-index: 999;
  }
  .nav-links.open { max-height: 400px; }
  .nav-link {
    padding: 14px 24px; width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.1);
    border-bottom-color: rgba(255,255,255,0.1);
  }
  .nav-toggle { display: flex; }

  /* --- Hero: semua elemen potensial overflow dibuang --- */
  #hero {
    min-height: 100svh; /* safe area viewport height */
    padding: calc(var(--nav-h) + 20px) 16px 40px;
    overflow: hidden;
  }
  .hero-container { gap: 16px; max-width: 100%; }
  .hero-title { font-size: clamp(3.8rem, 18vw, 7rem); }

  /* CHARA tidak boleh translateX karena bisa overflow */
  .title-line2 { transform: rotate(-2deg); }
  .title-line1 { -webkit-text-stroke: 3px var(--black); text-shadow: 6px 6px 0 var(--black); }
  .title-line2 { -webkit-text-stroke: 3px var(--black); }

  /* Sembunyikan elemen dekoratif yang menyebabkan overflow */
  .hero-panel { display: none; }
  .hs5 { display: none; } /* bintang di left:90% penyebab overflow */

  /* Badge compact */
  .badge-inner { padding: 8px 20px; transform: rotate(-1deg); }
  .badge-top { font-size: 0.65rem; letter-spacing: 2px; }
  .badge-school { font-size: 1rem; letter-spacing: 1px; }
  .badge-year { font-size: 0.72rem; }

  /* Hero tag */
  .hero-tag { font-size: 0.7rem; letter-spacing: 3px; padding: 7px 12px; }

  /* Tagline */
  .hero-tagline { width: 100%; padding: 0; max-width: 100%; }
  .tagline-bubble { font-size: 0.9rem; padding: 12px 16px; }

  /* Meta items */
  .hero-meta { gap: 8px; font-size: 0.78rem; padding: 0 4px; }
  .meta-item { white-space: nowrap; }

  /* --- Gallery / Download --- */
  #gallery { padding: 56px 16px; }
  .gallery-container { max-width: 100%; }
  .download-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }

  /* --- eBook --- */
  #ebook { padding: 56px 16px; }
  .ebook-covers { grid-template-columns: 1fr; max-width: 300px; margin: 0 auto 16px; }
  .cover-card.featured { transform: none; }
  .cover-card.featured:hover { transform: translateY(-4px); }
  .design-details-grid { grid-template-columns: 1fr 1fr; gap: 16px; }

  /* --- About --- */
  #about { padding: 56px 16px; }
  .about-container { grid-template-columns: 1fr; gap: 32px; }
  .photo-frame-wrap { max-width: 320px; margin: 0 auto; }
  .pd1, .pd2 { display: none; }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 10px; }

  /* --- Preview --- */
  #preview { padding: 56px 16px; }
  .flipbook-mock { height: clamp(180px, 45vw, 320px); padding: 12px; }
  .mock-header { font-size: 0.9rem; }

  /* --- Messages --- */
  #messages { padding: 56px 16px; }
  .messages-container { grid-template-columns: 1fr; gap: 28px; }
  .msg-display-wrap { max-height: 360px; }

  /* --- Footer --- */
  #footer { padding: 48px 16px 20px; }
  .footer-container { grid-template-columns: 1fr; gap: 24px; }
  .footer-quote { display: none; }
  .footer-logo { font-size: 2.8rem; }

  /* --- Section header --- */
  .section-header { margin-bottom: 32px; padding: 0 8px; }
}

/* ===== 480px — SMALL PHONE ===== */
@media (max-width: 480px) {
  #hero { padding: calc(var(--nav-h) + 16px) 12px 32px; }
  .hero-container { gap: 14px; }
  .hero-title { font-size: clamp(3.2rem, 20vw, 5.5rem); }
  .hero-tag { font-size: 0.62rem; letter-spacing: 2px; }

  .section-title { font-size: clamp(1.8rem, 9vw, 2.8rem); }

  .download-card { padding: 24px 16px; }
  .dc-title { font-size: 1.6rem; }

  .stats-row { gap: 8px; }
  .stat-number { font-size: 2rem; }
  .stat-label { font-size: 0.6rem; letter-spacing: 1px; }
  .stat-box { padding: 16px 8px; }

  .ebook-covers { max-width: 260px; }
  .design-details-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }

  .nav-logo { font-size: 1.4rem; }
  .btn-download { padding: 10px 20px; font-size: 0.9rem; }
  .btn-submit { font-size: 0.95rem; letter-spacing: 2px; padding: 12px 16px; }
  .msg-display-wrap { max-height: 320px; }

  .toast { max-width: 240px; font-size: 0.8rem; padding: 10px 14px; right: 12px; }
  .btn-back-top { right: 12px; bottom: 16px; width: 44px; height: 44px; }
  .section-header { margin-bottom: 24px; }
}

/* ===== 320px — VERY SMALL ===== */
@media (max-width: 320px) {
  #hero { padding: calc(var(--nav-h) + 12px) 10px 28px; }
  .hero-container { gap: 12px; }
  .hero-title { font-size: 3rem; }
  .section-title { font-size: 1.8rem; }
  .hero-meta { flex-direction: column; gap: 4px; }
  .meta-divider { display: none; }
  .badge-inner { padding: 6px 14px; }
  .badge-top { font-size: 0.58rem; letter-spacing: 1px; }
  .badge-school { font-size: 0.85rem; }
  .stats-row { grid-template-columns: 1fr; max-width: 160px; margin: 0 auto 24px; }
  .nav-container { padding: 0 10px; }
  #gallery, #ebook, #about, #preview, #messages { padding: 40px 10px; }
}

<style>
/* ── 3D Flip Animation ─────────────────────────────────── */
#book-spread {
  perspective: 1800px;
  perspective-origin: center center;
}

.page-side {
  position: relative;
  flex: 1;
  max-width: 420px;
  transform-style: preserve-3d;
}

/* Wrapper yang benar-benar di-flip */
.page-flipper {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: none; /* dikelola JS */
  transform-origin: left center; /* right page: flip dari kiri */
}

/* Left page flipper origin */
#side-left .page-flipper  { transform-origin: right center; }
/* Right page flipper origin */
#side-right .page-flipper { transform-origin: left center; }

/* Shared canvas style */
.page-flipper canvas {
  display: block;
  width: 100%;
  background: #f5f0e8;
}
#canvas-left  { border-radius: 6px 0 0 6px; box-shadow: -6px 6px 30px rgba(0,0,0,0.45); }
#canvas-right { border-radius: 0 6px 6px 0; box-shadow:  6px 6px 30px rgba(0,0,0,0.45); }

/* Page label */
.page-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

/* Page-turn shadow overlay (gloss/shadow on the flipping page) */
.flip-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.05s;
}

/* Animating classes */
.flip-out-left {
  animation: flipOutLeft var(--flip-dur, 0.55s) ease-in forwards;
}
.flip-in-left {
  animation: flipInLeft var(--flip-dur, 0.55s) ease-out forwards;
}
.flip-out-right {
  animation: flipOutRight var(--flip-dur, 0.55s) ease-in forwards;
}
.flip-in-right {
  animation: flipInRight var(--flip-dur, 0.55s) ease-out forwards;
}

/* Going NEXT: right page flips to the left */
@keyframes flipOutRight {
  0%   { transform: rotateY(0deg);    }
  100% { transform: rotateY(-180deg); }
}
@keyframes flipInLeft {
  0%   { transform: rotateY(180deg);  }
  100% { transform: rotateY(0deg);    }
}

/* Going PREV: left page flips to the right */
@keyframes flipOutLeft {
  0%   { transform: rotateY(0deg);   }
  100% { transform: rotateY(180deg); }
}
@keyframes flipInRight {
  0%   { transform: rotateY(-180deg); }
  100% { transform: rotateY(0deg);    }
}

/* Spine stays on top */
#book-spine {
  width: 10px;
  background: linear-gradient(to right,#b0a090,#e8dcc8,#b0a090);
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
  flex-shrink: 0;
  z-index: 20;
  position: relative;
}

/* Button disabled state */
button:disabled { opacity: 0.35; cursor: not-allowed; }
</style>