/* Theme variables */
:root {
  --bg: #0b0b0b;
  --bg-2: #111111;
  --bg-3: #171717;
  --fg: #efefef;
  --muted: #a5a5a5;
  --border: #2a2a2a;
  --accent: #e5e5e5;
  /* Text size adjust for mobile browsers */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Light theme swap */
:root[data-theme='light'] {
  --bg: #f7f7f7;
  --bg-2: #ffffff;
  --bg-3: #f1f1f1;
  --fg: #101010;
  --muted: #4a4a4a;
  --border: #d7d7d7;
  --accent: #222222;
}

html, body { height: 100%; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--fg);
  border-radius: 0.375rem;
}
.btn[aria-disabled='true'] { opacity: 0.6; cursor: not-allowed; }
.btn:hover { background: var(--bg-3); }

/* Compact controls inside the Three.js overlay */
#logoStage .controls-mini .btn {
  padding: 0.25rem 0.5rem;
  font-size: 10px;
  line-height: 1.1;
}
#logoStage .controls-mini {
  max-height: calc(100% - 8px);
  overflow: auto;
  align-content: flex-start; /* allow multi-row wrap from top */
}
#logoStage .controls-mini.collapsed > *:not(#collapseTestPanels) {
  display: none !important;
}
#logoStage .controls-mini label { font-size: 10px; }
#logoStage .controls-mini input[type=range] { height: 0.5rem; }

/* Shadow tuning mini buttons */
#logoStage .controls-mini [data-shadow-size].btn { padding: 0.2rem 0.4rem; }

/* Removed .logo-top-spacer per layout update */

/* Hero / Three.js stage */
#logoStage {
  max-width: 96vw;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden; /* ensure Three.js content does not bleed over divider */
}
@media (min-width: 768px) {
  #logoStage {
    max-width: min(900px, 60vw); /* ~64% of 1400px */
  }
}
#threeContainer, #threeContainer canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: auto;
}

/* Ensure canvas sits behind overlay controls regardless of filter stacking contexts */
#threeContainer { position: absolute; inset: 0; z-index: 0; }
#threeContainer canvas { position: absolute; inset: 0; z-index: 0; }
#logoStage .controls-mini { z-index: 50; }

/* Centered divider under the top menu */
.nav-divider {
  width: 80%;
  max-width: 960px;
  height: 3px;
  background: #000000; /* black in light mode */
  margin: 0.75rem auto 0;
  border-radius: 2px;
}
:root[data-theme='dark'] .nav-divider {
  background: #ffffff; /* white in dark mode */
}

/* About section layout */
.about-layout {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1rem !important;
}

/* Mobile: Title spans full width on row 1, images on row 2 side-by-side */
.about-layout .about-text {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  text-align: center;
  margin-bottom: 1rem;
}

.about-layout figure:first-of-type {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

.about-layout figure:last-of-type {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

/* Desktop: 3 columns with text in the middle, all on row 1 */
@media (min-width: 768px) {
  .about-layout {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 2rem !important;
    align-items: center;
  }
  
  .about-layout .about-text {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin-bottom: 0;
  }
  
  .about-layout figure:first-of-type {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  
  .about-layout figure:last-of-type {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }
}

/* Carousel controls */
.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem; height: 2.25rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--fg);
  z-index: 10;
}
.carousel-prev { left: -0.75rem; }
.carousel-next { right: -0.75rem; }
.carousel-prev:hover, .carousel-next:hover { background: var(--bg-3); }

/* Typewriter base */
.typewriter { font-family: var(--tw-font-typewriter, 'Special Elite', 'Courier New', monospace); }

/* Optional caret for typewriter effect */
.typewriter-caret::after {
  content: '▌';
  display: inline-block;
  margin-left: 2px;
  opacity: 0.75;
  animation: caretBlink 1s steps(1, end) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* Icon visibility per theme */
#iconSun { display: none; }
:root[data-theme='light'] #iconSun { display: block; }
:root[data-theme='light'] #iconMoon { display: none; }

/* Reduced motion considerations */
@media (prefers-reduced-motion: reduce) {
  .carousel-inner { transition: none !important; }
}
