/* ============================================
   403 Super Vega Custom Font
   ============================================ */
@font-face {
  font-family: '403 Super Vega';
  src: url('../fonts/403-super-vega-regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  /* Colors */
  --color-bg: #000000;
  --color-text: #FFFFFF;
  --color-acrylic-yellow: #FDFF00;
  --color-acrylic-red: #FF0505;
  --color-acrylic-green: #11FF00;
  --color-acrylic-blue: #2600FF;
  
  /* Typography - Desktop */
  --font-title: '403 Super Vega', sans-serif;
  --font-body: 'Nanum Myeongjo', serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-arrow: 'Alegreya', serif;
  
  --title-size: 136px;
  --title-line-height: 130px;
  --title-letter-spacing: -4px;
  
  --body-size: 20px;
  --body-line-height: 26px;
  
  --label-size: 14px;
  --label-line-height: 14px;
  
  --arrow-size: 18px;
  --arrow-line-height: 21.6px;
  
  /* Spacing */
  --page-padding: 30px;
  --corner-size: 25px;
  
  /* Layout */
  --content-max-width: 510px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Performance: GPU acceleration */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ============================================
   Corner Accents
   ============================================ */
.corner-accent {
  position: fixed;
  width: var(--corner-size);
  height: var(--corner-size);
  background-color: var(--color-text);
  z-index: 100;
}

.corner-accent.top-left {
  top: 0;
  left: 0;
}

.corner-accent.top-right {
  top: 0;
  right: 0;
}

.corner-accent.bottom-left {
  bottom: 0;
  left: 0;
}

.corner-accent.bottom-right {
  bottom: 0;
  right: 0;
}

/* ============================================
   Landing Page Layout
   ============================================ */
.landing-page {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* ============================================
   Content Section (Left Side)
   ============================================ */
.content-section {
  display: flex;
  flex-direction: column;
  padding: var(--page-padding);
  padding-top: 35px;
  width: 45%;
  min-width: 540px;
  position: relative;
  z-index: 10;
  height: 100vh;
  overflow: visible;
}

/* Title */
.title {
  font-family: var(--font-title);
  font-size: var(--title-size);
  font-weight: normal;
  line-height: var(--title-line-height);
  letter-spacing: var(--title-letter-spacing);
  white-space: nowrap;
  margin-bottom: 20px;
}

.title span {
  display: block;
}

/* Description */
.description {
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: 700;
  line-height: var(--body-line-height);
  max-width: var(--content-max-width);
  margin-bottom: 60px;
}

/* Desktop/Mobile visibility */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

/* Meta Information */
.meta-info {
  display: flex;
  gap: 136px;
  flex-grow: 1;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 500;
  line-height: var(--label-line-height);
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.meta-value {
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: 700;
  line-height: var(--body-line-height);
}

/* CTA Section */
.cta-section {
  margin-top: auto;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: visible;
}

.cta-text {
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: 700;
  line-height: var(--body-line-height);
  margin-bottom: 0;
  white-space: nowrap;
}

.cta-primary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.cta-primary-row .cta-text {
  margin-bottom: 0;
  display: inline;
  white-space: nowrap;
}

.cta-arrow {
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: 700;
  color: var(--color-text);
  line-height: var(--body-line-height);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 30px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  width: fit-content;
  flex-shrink: 0;
  overflow: visible;
}

.btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.btn-text {
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 500;
  line-height: var(--label-line-height);
  text-transform: uppercase;
}

.btn-arrow {
  font-family: var(--font-arrow);
  font-size: var(--arrow-size);
  font-style: italic;
  line-height: 1;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--color-text);
  color: var(--color-bg);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-secondary.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: visible;
}

/* ============================================
   3D Scene Section (Right Side)
   ============================================ */
.scene-section {
  flex: 1;
  position: relative;
  height: 100vh;
  min-width: 0;
}

#three-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#three-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.scene-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 250px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 60%, #000000 100%);
  pointer-events: none;
  z-index: 5;
}

/* ============================================
   Settings Toggle Button (Hidden on home page)
   ============================================ */
.settings-toggle {
  display: none !important;
}


/* ============================================
   Settings Panel
   ============================================ */
.settings-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 280px;
  max-height: calc(100vh - 120px);
  background: rgba(18, 18, 20, 0.96);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
  contain: layout style;
}

.settings-panel.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.settings-header span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.5);
}

.settings-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.settings-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.settings-content {
  padding: 16px 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.settings-content::-webkit-scrollbar {
  width: 6px;
}

.settings-content::-webkit-scrollbar-track {
  background: transparent;
}

.settings-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Section Headers */
.setting-section {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 20px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

/* Setting Row */
.setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 2px;
  min-width: 0;
  width: 100%;
}

.setting-row label {
  flex: 0 0 68px;
  min-width: 68px;
  max-width: 68px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Color picker */
.setting-row input[type="color"] {
  width: 36px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  padding: 0;
}

.setting-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.setting-row input[type="color"]::-webkit-color-swatch {
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Checkbox */
.setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #64d2ff;
  border-radius: 4px;
}

/* Select dropdown */
.setting-row select {
  flex: 1;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.setting-row select:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.setting-row select:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: #64d2ff;
}

.setting-row input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}

.setting-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.setting-row input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(0.95);
}

.setting-row .value {
  flex: 0 0 50px;
  min-width: 50px;
  max-width: 50px;
  font-size: 11px;
  color: #64d2ff;
  text-align: right;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  white-space: nowrap;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons */
.setting-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.setting-buttons button {
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.setting-buttons button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Words List Styling */
#wordsList::-webkit-scrollbar {
  width: 6px;
}

#wordsList::-webkit-scrollbar-track {
  background: transparent;
}

#wordsList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

#wordsList::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.setting-buttons button:active {
  transform: scale(0.97);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .settings-panel {
    right: 10px;
    bottom: 70px;
    width: calc(100vw - 20px);
    max-width: 300px;
  }
  
}

/* ============================================
   Credit Footer
   ============================================ */
.credit {
  position: absolute;
  bottom: var(--page-padding);
  right: var(--page-padding);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  z-index: 10;
}

/* ============================================
   Responsive - Tablet (1024px and below)
   ============================================ */
@media screen and (max-width: 1024px) {
  :root {
    --title-size: 90px;
    --title-line-height: 86px;
    --title-letter-spacing: -3px;
  }
  
  /* Allow content to display at tablet sizes */
  .landing-page {
    overflow: visible;
  }
  
  .content-section {
    min-width: 420px;
    width: 50%;
  }
  
  .scene-section {
    min-width: 0;
    overflow: hidden;
  }
}

/* iPad-specific breakpoint */
@media screen and (min-width: 769px) and (max-width: 900px) {
  :root {
    --title-size: 72px;
    --title-line-height: 70px;
    --title-letter-spacing: -2px;
    --body-size: 17px;
    --body-line-height: 24px;
  }
  
  .content-section {
    min-width: 380px;
    width: 48%;
    padding: 25px;
  }
  
  .meta-info {
    gap: 60px;
  }
  
  .description {
    margin-bottom: 40px;
  }
}

/* ============================================
   Mobile Responsive Styles (Phone)
   ============================================ */
@media screen and (max-width: 768px) {
  :root {
    --title-size: 42px;
    --title-line-height: 40px;
    --title-letter-spacing: -1px;
    
    --body-size: 15px;
    --body-line-height: 24px;
    
    --label-size: 12px;
    --arrow-size: 14px;
    
    --page-padding: 20px;
    --corner-size: 15px;
  }
  
  /* Show/hide based on device */
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block !important;
  }
  
  /* Allow scrolling on mobile */
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
  }
  
  /* Stack layout - content top, 3D bottom, scrollable */
  .landing-page {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: auto !important;
    width: 100vw !important;
    overflow: visible !important;
  }
  
  /* Content section - compact at top */
  .content-section {
    position: relative !important;
    z-index: 10 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: var(--page-padding) !important;
    padding-top: 25px !important;
    padding-bottom: 15px !important;
    height: auto !important;
    flex-shrink: 0 !important;
    background: #000 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }
  
  /* 3D scene takes up most of viewport height */
  .scene-section {
    position: relative !important;
    width: 100% !important;
    height: 80vh !important;
    min-height: 400px !important;
    z-index: 1 !important;
    flex-shrink: 0 !important;
  }
  
  #three-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
  
  /* Gradient mask at bottom of 3D scene */
  .scene-gradient {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 40% !important;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 70%, #000000 100%) !important;
    z-index: 2 !important;
  }
  
  .title {
    margin-bottom: 8px !important;
  }
  
  .description {
    max-width: 100% !important;
    margin-bottom: 12px !important;
    font-size: 15px !important;
  }
  
  .description.mobile-only {
    white-space: nowrap !important;
  }
  
  .meta-info {
    gap: 24px !important;
    margin-bottom: 12px !important;
    flex-grow: 0 !important;
  }
  
  .meta-item {
    flex: none !important;
  }
  
  .meta-label {
    font-size: 10px !important;
  }
  
  .meta-value {
    font-size: 15px !important;
  }
  
  /* CTA section - stays in normal flow, compact */
  .cta-section {
    position: relative !important;
    z-index: 10 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    background: transparent !important;
    gap: 10px !important;
  }
  
  .cta-text {
    font-size: 15px !important;
  }
  
  .cta-primary-row {
    gap: 10px !important;
  }
  
  .cta-arrow {
    font-size: 12px !important;
  }
  
  .nav-links {
    flex-wrap: wrap !important;
    gap: 8px !important;
    overflow: visible !important;
  }
  
  .btn {
    padding: 6px 12px !important;
    width: fit-content !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
  }
  
  .btn-text {
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }
  
  .btn-arrow {
    font-size: 14px !important;
    flex-shrink: 0 !important;
  }
  
  /* Credit - in the 3D section area */
  .credit {
    position: absolute !important;
    bottom: 10px !important;
    left: var(--page-padding) !important;
    right: auto !important;
    z-index: 20 !important;
    font-size: 10px !important;
  }
  
  .settings-panel {
    right: 15px !important;
    bottom: 75px !important;
    width: 90vw !important;
    max-width: 320px !important;
    max-height: 70vh !important;
  }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
  :root {
    --title-size: 48px;
    --title-line-height: 44px;
    --title-letter-spacing: -1.5px;
    
    --body-size: 15px;
    --body-line-height: 24px;
  }
  
  .meta-info {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .description {
    max-width: 250px !important;
  }
  
  .nav-links {
    gap: 6px !important;
  }
  
  .btn {
    padding: 5px 10px !important;
    width: fit-content !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
  }
  
  .btn-text {
    font-size: 11px !important;
    flex-shrink: 0 !important;
  }
  
  .btn-arrow {
    font-size: 13px !important;
    flex-shrink: 0 !important;
  }
}

/* ============================================
   Cinematic Intro Animation
   ============================================ */

/* Hide all content elements during cinematic intro */
body.cinematic-intro .title,
body.cinematic-intro .description,
body.cinematic-intro .meta-info,
body.cinematic-intro .cta-section,
body.cinematic-intro .credit,
body.cinematic-intro .corner-accent {
  opacity: 0 !important;
  transform: translateY(20px);
  transition: none !important;
}

/* Reveal animations with staggered timing */
body.cinematic-revealed .title,
body.cinematic-revealed .description,
body.cinematic-revealed .meta-info,
body.cinematic-revealed .cta-section,
body.cinematic-revealed .credit,
body.cinematic-revealed .corner-accent {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Staggered reveal delays */
body.cinematic-revealed .corner-accent {
  transition-delay: 0s;
}

body.cinematic-revealed .title {
  transition-delay: 0.1s;
}

body.cinematic-revealed .description {
  transition-delay: 0.2s;
}

body.cinematic-revealed .meta-info {
  transition-delay: 0.3s;
}

body.cinematic-revealed .cta-section {
  transition-delay: 0.4s;
}

/* Scene gradient hidden during zoom, fades in after */
.scene-gradient {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.scene-gradient.visible {
  opacity: 1;
}

body.cinematic-revealed .credit {
  transition-delay: 0.6s;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}

