/* ============================================================
   BITWISE ROMANCE — PIXEL ART DESIGN SYSTEM
   Based on Stitch "Bitwise Romance" Design System
   ============================================================ */

/* ---- CSS VARIABLES (DESIGN TOKENS) ---- */
:root {
  /* Primary palette */
  --bg: #fff3fa;
  --bg-dim: #efc8ee;
  --surface: #fff3fa;
  --surface-container: #ffdefc;
  --surface-container-high: #fbd8f9;
  --surface-container-highest: #f7d1f5;
  --surface-container-low: #ffebfb;

  --primary: #b50357;
  --primary-container: #ff709d;
  --primary-dim: #9f004c;
  --on-primary: #ffeff1;
  --on-primary-container: #4c0021;

  --secondary: #9720ab;
  --secondary-container: #fcbcff;
  --on-secondary: #ffeefb;
  --on-secondary-container: #7c0091;

  --tertiary: #6c5a00;
  --tertiary-container: #ffd709;
  --on-tertiary: #fff2cd;

  --on-background: #3b283c;
  --on-surface: #3b283c;
  --on-surface-variant: #6b546a;
  --outline: #876f86;
  --outline-variant: #c0a5be;
  --inverse-surface: #18081a;

  /* Pixel art specific */
  --pixel-shadow-color: rgba(75, 0, 33, 0.25);
  --pixel-border: 4px;
  --pixel-shadow-offset: 4px;

  /* Typography */
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'Be Vietnam Pro', sans-serif;

  /* Sizing */
  --nav-height: 60px;
  --admin-height: 52px;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 12px);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--on-background);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Pixel-art elements should NOT be anti-aliased */
.pixel-font, h1, h2, h3, .section-title, .timeline-badge,
.hero-title, .nav-brand, .music-label, .footer-title,
.lock-modal-title, .admin-badge, .btn-save-forever,
.quality-card h3 {
  font-family: var(--font-pixel);
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: var(--surface-container);
  border-left: var(--pixel-border) solid var(--outline-variant);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border: 2px solid var(--primary-dim);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dim);
}

/* ---- PARTICLES CANVAS ---- */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---- FLOATING HEARTS (CSS) ---- */
#floating-hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.float-heart {
  position: absolute;
  font-size: 16px;
  color: var(--primary-container);
  opacity: 0;
  animation: floatUp 8s linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) translateX(0) scale(0.5);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    transform: translateY(50vh) translateX(30px) scale(1);
    opacity: 0.4;
  }
  90% {
    opacity: 0.1;
  }
  100% {
    transform: translateY(-10vh) translateX(-20px) scale(0.3);
    opacity: 0;
  }
}

/* ---- ADMIN BAR ---- */
.admin-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--admin-height);
  background: var(--inverse-surface);
  color: var(--on-primary);
  z-index: 1000;
  display: flex;
  align-items: center;
  border-bottom: var(--pixel-border) solid var(--primary);
}

.admin-bar.hidden {
  display: none;
}

.admin-bar-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-badge {
  font-family: var(--font-pixel);
  font-size: 10px;
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  white-space: nowrap;
}

.admin-hint {
  font-size: 12px;
  opacity: 0.7;
  flex: 1;
}

.btn-save-forever {
  font-family: var(--font-pixel);
  font-size: 10px;
  background: var(--tertiary-container);
  color: var(--on-primary-container);
  border: var(--pixel-border) solid var(--tertiary);
  padding: 8px 20px;
  cursor: pointer;
  box-shadow: var(--pixel-shadow-offset) var(--pixel-shadow-offset) 0 rgba(108, 90, 0, 0.4);
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
  white-space: nowrap;
}

.btn-save-forever:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(108, 90, 0, 0.4);
}

.btn-save-forever:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.btn-pixel-icon {
  font-style: normal;
}

/* ---- NAVIGATION ---- */
.pixel-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 243, 250, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: var(--pixel-border) solid var(--outline-variant);
  transition: top 0.2s steps(4);
}

body.edit-mode .pixel-nav {
  top: var(--admin-height);
}

.nav-brand {
  font-size: 12px;
  text-decoration: none;
  color: var(--primary);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-pixel);
  font-size: 9px;
  text-decoration: none;
  color: var(--on-surface-variant);
  padding: 8px 14px;
  border: 2px solid transparent;
  transition: all 0.1s steps(2);
}

.nav-link:hover {
  color: var(--primary);
  border-color: var(--primary-container);
  background: var(--surface-container-low);
}

.nav-icon {
  margin-right: 4px;
}

/* ---- PIXEL CARD (base component) ---- */
.pixel-card {
  background: var(--surface-container-low);
  border: var(--pixel-border) solid var(--outline-variant);
  box-shadow: var(--pixel-shadow-offset) var(--pixel-shadow-offset) 0 var(--pixel-shadow-color);
  position: relative;
}

.pixel-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid rgba(181, 3, 87, 0.08);
  pointer-events: none;
}

/* ---- EDITABLE FIELDS ---- */
.editable[contenteditable="true"] {
  outline: 2px dashed var(--primary-container);
  outline-offset: 4px;
  cursor: text;
  min-height: 1.5em;
  transition: outline-color 0.2s;
}

.editable[contenteditable="true"]:focus {
  outline-color: var(--primary);
  background: rgba(255, 112, 157, 0.06);
}

.editable[contenteditable="true"]:hover {
  outline-color: var(--secondary-container);
}

/* ---- SECTION HEADERS ---- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
  animation: iconBounce 2s steps(6) infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.section-title {
  font-size: 18px;
  color: var(--primary);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.pixel-divider {
  width: 120px;
  height: 4px;
  margin: 0 auto;
  background: repeating-linear-gradient(
    90deg,
    var(--primary) 0px,
    var(--primary) 8px,
    transparent 8px,
    transparent 12px,
    var(--primary-container) 12px,
    var(--primary-container) 20px,
    transparent 20px,
    transparent 24px
  );
}

/* ---- HERO SECTION ---- */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 32px 80px;
  position: relative;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(252, 188, 255, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(255, 112, 157, 0.2) 0%, transparent 50%),
    var(--bg);
  overflow: hidden;
}

.hero-pixel-border {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  top: var(--nav-height);
  background: repeating-linear-gradient(
    90deg,
    var(--primary) 0px, var(--primary) 8px,
    var(--primary-container) 8px, var(--primary-container) 16px,
    var(--secondary-container) 16px, var(--secondary-container) 24px,
    var(--tertiary-container) 24px, var(--tertiary-container) 32px
  );
}
.hero-pixel-border.bottom {
  top: auto;
  bottom: 0;
}

body.edit-mode .hero-pixel-border:not(.bottom) {
  top: calc(var(--nav-height) + var(--admin-height));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-hearts {
  margin-bottom: 32px;
}

.pixel-heart {
  display: inline-block;
  font-size: 28px;
  color: var(--primary);
  margin: 0 12px;
  animation: heartPulse 1.2s steps(4) infinite;
}

.ph-2 { animation-delay: 0.4s; }
.ph-3 { animation-delay: 0.8s; }

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.hero-title {
  font-size: clamp(16px, 3vw, 28px);
  color: var(--primary);
  line-height: 1.8;
  margin-bottom: 24px;
  text-shadow: 2px 2px 0 var(--primary-container);
  letter-spacing: 2px;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.8vw, 18px);
  color: var(--on-surface-variant);
  font-weight: 300;
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 48px;
}

.hero-arrow {
  cursor: pointer;
  display: inline-block;
}

.arrow-pixel {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--primary);
  animation: arrowBounce 1.5s steps(4) infinite;
  display: inline-block;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}

/* ---- TIMELINE ---- */
.section-journey {
  padding: 100px 32px;
  position: relative;
  z-index: 2;
  background: var(--surface-container-low);
  border-top: var(--pixel-border) solid var(--outline-variant);
  border-bottom: var(--pixel-border) solid var(--outline-variant);
}

.timeline {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(
    180deg,
    var(--primary) 0px, var(--primary) 8px,
    transparent 8px, transparent 16px
  );
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 48px;
  position: relative;
  opacity: 0;
  transition: opacity 0.3s steps(4), transform 0.4s steps(6);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0) !important;
}

.timeline-item.left {
  justify-content: flex-start;
  padding-right: calc(50% + 32px);
  transform: translateX(-30px);
}

.timeline-item.right {
  justify-content: flex-end;
  padding-left: calc(50% + 32px);
  transform: translateX(30px);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--surface);
  border: var(--pixel-border) solid var(--primary);
  z-index: 2;
}

.timeline-card {
  padding: 24px;
  width: 100%;
}

.timeline-badge {
  font-size: 8px;
  color: var(--on-tertiary);
  background: var(--tertiary-container);
  padding: 4px 10px;
  display: inline-block;
  margin-bottom: 12px;
  border: 2px solid var(--tertiary);
}

.timeline-card h3 {
  font-size: 11px;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 1px;
  line-height: 1.8;
}

.timeline-card p {
  font-size: 14px;
  color: var(--on-surface-variant);
  line-height: 1.7;
}

/* ---- GALLERY ---- */
.section-gallery {
  padding: 100px 32px;
  position: relative;
  z-index: 2;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(252, 188, 255, 0.2) 0%, transparent 50%),
    var(--bg);
}

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

.gallery-item {
  overflow: hidden;
  transition: transform 0.15s steps(3), box-shadow 0.15s steps(3);
}

.gallery-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--pixel-shadow-color);
}

.gallery-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface-container);
  overflow: hidden;
  cursor: pointer;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--outline);
  background: 
    repeating-conic-gradient(
      var(--surface-container) 0% 25%, 
      var(--surface-container-high) 0% 50%
    ) 50% / 16px 16px;
}

.placeholder-icon {
  font-size: 36px;
  opacity: 0.5;
}

.placeholder-text {
  font-family: var(--font-pixel);
  font-size: 8px;
  text-align: center;
  padding: 0 8px;
  line-height: 1.6;
}

.gallery-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(181, 3, 87, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s steps(3);
  color: white;
  font-family: var(--font-pixel);
  font-size: 10px;
}

.gallery-upload-overlay.hidden {
  display: none;
}

body.edit-mode .gallery-image-wrapper:hover .gallery-upload-overlay:not(.hidden) {
  opacity: 1;
}

.gallery-caption {
  font-family: var(--font-pixel);
  font-size: 9px;
  text-align: center;
  padding: 12px 8px;
  color: var(--on-surface-variant);
  letter-spacing: 0.5px;
  line-height: 1.6;
}

/* ---- QUALITIES ---- */
.section-qualities {
  padding: 100px 32px;
  position: relative;
  z-index: 2;
  background: var(--surface-container-low);
  border-top: var(--pixel-border) solid var(--outline-variant);
  border-bottom: var(--pixel-border) solid var(--outline-variant);
}

.qualities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.quality-card {
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.15s steps(3), box-shadow 0.15s steps(3);
}

.quality-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--pixel-shadow-color);
}

.quality-icon {
  font-size: 36px;
  margin-bottom: 16px;
  animation: iconSpin 4s steps(8) infinite;
}

@keyframes iconSpin {
  0%, 80%, 100% { transform: rotateY(0); }
  90% { transform: rotateY(180deg); }
}

.quality-card h3 {
  font-size: 10px;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: 1px;
  line-height: 1.8;
}

.quality-card p {
  font-size: 14px;
  color: var(--on-surface-variant);
  line-height: 1.7;
}

/* ---- LOVE LETTER ---- */
.section-letter {
  padding: 100px 32px;
  position: relative;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 215, 9, 0.08) 0%, transparent 60%),
    var(--bg);
}

.letter-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 48px 40px;
  position: relative;
  background:
    linear-gradient(135deg, var(--surface-container-low) 0%, rgba(255, 235, 251, 0.8) 100%);
  border-color: var(--primary-container);
}

.letter-decoration {
  position: absolute;
  font-size: 20px;
  color: var(--primary-container);
  opacity: 0.5;
  animation: heartPulse 2s steps(4) infinite;
}

.letter-decoration.top-left { top: 12px; left: 16px; }
.letter-decoration.top-right { top: 12px; right: 16px; animation-delay: 0.5s; }
.letter-decoration.bottom-left { bottom: 12px; left: 16px; animation-delay: 1s; }
.letter-decoration.bottom-right { bottom: 12px; right: 16px; animation-delay: 1.5s; }

.letter-greeting {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 500;
  color: var(--primary);
  font-style: italic;
  margin-bottom: 24px;
}

.letter-body {
  font-size: 15px;
  color: var(--on-surface);
  line-height: 1.9;
  margin-bottom: 32px;
  white-space: pre-wrap;
}

.letter-closing {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--secondary);
  margin-bottom: 8px;
}

.letter-signature {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 1px;
}

/* ---- FOOTER ---- */
.pixel-footer {
  padding: 60px 32px;
  text-align: center;
  background: var(--inverse-surface);
  color: var(--on-primary);
  border-top: var(--pixel-border) solid var(--primary);
  position: relative;
  z-index: 2;
}

.footer-hearts {
  font-size: 24px;
  color: var(--primary-container);
  margin-bottom: 20px;
  letter-spacing: 8px;
  animation: heartPulse 2s steps(4) infinite;
}

.footer-title {
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 20px;
  line-height: 2;
  color: var(--tertiary-container);
}

.footer-credit {
  font-size: 12px;
  opacity: 0.5;
}

/* ---- MUSIC PLAYER ---- */
.music-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 280px;
  padding: 16px;
  z-index: 800;
  background: var(--surface-container-highest);
  border-color: var(--primary);
}

.music-player-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.music-icon {
  font-size: 18px;
  animation: iconBounce 1.5s steps(4) infinite;
}

.music-label {
  font-size: 8px;
  color: var(--primary);
  letter-spacing: 1px;
}

.music-filename {
  font-size: 11px;
  color: var(--on-surface-variant);
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.music-btn {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: var(--on-primary);
  border: 2px solid var(--primary-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 2px 2px 0 var(--pixel-shadow-color);
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
  font-family: var(--font-pixel);
}

.music-btn:hover:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--pixel-shadow-color);
}

.music-btn:disabled {
  background: var(--outline-variant);
  cursor: not-allowed;
  opacity: 0.5;
}

.music-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--surface-container);
  border: 2px solid var(--outline-variant);
  overflow: hidden;
}

.music-progress {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.5s linear;
}

.music-upload-area {
  margin-top: 8px;
}

.music-upload-area.hidden {
  display: none;
}

.music-upload-btn {
  width: 100%;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 10px 12px;
  background: var(--tertiary-container);
  color: var(--on-primary-container);
  border: 2px solid var(--tertiary);
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(108, 90, 0, 0.3);
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
  letter-spacing: 0.5px;
}

.music-upload-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(108, 90, 0, 0.3);
}

/* ---- LOCK MODAL ---- */
.lock-modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 8, 26, 0.8);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-modal.hidden {
  display: none;
}

.lock-modal-content {
  width: 90%;
  max-width: 420px;
  padding: 36px 32px;
  text-align: center;
  background: var(--surface);
  border-color: var(--primary);
  animation: modalPop 0.3s steps(6);
}

@keyframes modalPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.lock-modal-title {
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.lock-modal-text {
  font-size: 14px;
  color: var(--on-surface-variant);
  margin-bottom: 24px;
  line-height: 1.7;
}

.lock-modal-pin {
  margin-bottom: 24px;
}

.lock-modal-pin label {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--secondary);
  display: block;
  margin-bottom: 8px;
}

.pin-input {
  font-family: var(--font-pixel);
  font-size: 20px;
  text-align: center;
  width: 120px;
  padding: 8px;
  letter-spacing: 8px;
  background: var(--surface-container);
  border: var(--pixel-border) solid var(--outline-variant);
  color: var(--primary);
  outline: none;
}

.pin-input:focus {
  border-color: var(--primary);
}

.lock-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-cancel, .btn-confirm {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 10px 20px;
  cursor: pointer;
  border: var(--pixel-border) solid;
  box-shadow: var(--pixel-shadow-offset) var(--pixel-shadow-offset) 0;
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
}

.btn-cancel {
  background: var(--surface-container);
  border-color: var(--outline-variant);
  color: var(--on-surface-variant);
  box-shadow-color: rgba(0,0,0,0.1);
}

.btn-confirm {
  background: var(--primary);
  border-color: var(--primary-dim);
  color: var(--on-primary);
  box-shadow-color: var(--pixel-shadow-color);
}

.btn-cancel:hover, .btn-confirm:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0;
}

/* ---- TOAST NOTIFICATIONS ---- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 12px 20px;
  border: var(--pixel-border) solid;
  box-shadow: 3px 3px 0;
  animation: toastIn 0.3s steps(6), toastOut 0.3s steps(6) forwards;
  animation-delay: 0s, 3s;
  max-width: 300px;
}

.toast.success {
  background: var(--tertiary-container);
  border-color: var(--tertiary);
  color: var(--on-primary-container);
}

.toast.error {
  background: #fb5151;
  border-color: #b31b25;
  color: white;
}

.toast.info {
  background: var(--secondary-container);
  border-color: var(--secondary);
  color: var(--on-secondary-container);
}

@keyframes toastIn {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* ---- SCROLL ANIMATIONS ---- */
[data-anim] {
  opacity: 0;
  transition: opacity 0.4s steps(6), transform 0.4s steps(6);
}

[data-anim="pop"] {
  transform: scale(0.8);
}

[data-anim].visible {
  opacity: 1;
  transform: none;
}

/* ---- LOADING STATE ---- */
body.loading::after {
  content: 'LOADING...';
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--primary);
  z-index: 9999;
  animation: loadBlink 0.6s steps(2) infinite;
}

@keyframes loadBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .timeline-item.left,
  .timeline-item.right {
    padding-left: 48px;
    padding-right: 0;
    justify-content: flex-start;
  }

  .timeline-line {
    left: 16px;
  }

  .timeline-dot {
    left: 16px;
  }

  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: 14px;
  }

  .music-player {
    width: 240px;
    right: 12px;
    bottom: 12px;
  }

  .admin-hint {
    display: none;
  }

  .letter-container {
    padding: 32px 20px;
  }

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

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

  .music-player {
    width: calc(100% - 24px);
    right: 12px;
    left: 12px;
  }
}

/* ---- SPARKLE CURSOR TRAIL (edit mode) ---- */
body.edit-mode {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ctext y='14' font-size='12'%3E✏%3C/text%3E%3C/svg%3E"), auto;
}
