/* Base Styles - Reset + Typography */

/* Orbitron font is loaded via a <link> in index.html for better performance. */

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

html {
  scroll-behavior: smooth;
  -webkit-scroll-snap-type: y proximity;
  -ms-scroll-snap-type: y proximity;
  scroll-snap-type: y proximity;
  scroll-padding-top: 60px;
  /* Account for sticky nav height */
  font-size: 16px;
  height: 100%;
  width: 100%;
  /* Disable iOS double-tap zoom while preserving scroll and pinch-zoom */
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

body {
  font-family: 'Orbitron', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #000000;
  background-color: var(--bg-primary, #000000);
  color: #ffffff;
  color: var(--text-primary, #ffffff);
  line-height: 1.6;
  min-height: 100vh;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  /* manipulation: allows pan/pinch but disables double-tap zoom */
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: #ffffff;
  color: var(--heading-color, var(--text-primary, #ffffff));
  transition: color var(--transition-normal);
}

h1 {
  font-size: 3.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.5rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.75rem;
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

/* Utility Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
  min-height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  position: relative;
  z-index: 1;
  background: #000000;
  background: var(--bg-primary, #000000);
  -webkit-scroll-snap-align: start;
  -ms-scroll-snap-align: start;
  scroll-snap-align: start;
  -webkit-scroll-snap-stop: always;
  -ms-scroll-snap-stop: always;
  scroll-snap-stop: always;
}

.section-left {
  justify-content: flex-start;
  align-items: stretch;
}

.section-left>.container {
  width: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

#hero-section {
  position: relative;
  z-index: auto;
  /* Allow button shadows to render outside the hero area */
  overflow: visible;
  padding: 0;
  background: var(--bg-primary, #000000);
  min-height: 50vh;
  height: 50vh;
  gap: 2rem;
  touch-action: none;
}

/* Grid pattern - hidden in dark mode, visible in light mode (see theme-toggle.css) */
#hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: none;
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 0% 0%, black 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 80% 80% at 0% 0%, black 0%, transparent 70%);
}

.hero-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  z-index: 2;
  background: #000000;
}

body.header-stuck .hero-background {
  position: fixed;
  width: 100vw;
  height: 100vh;
  clip-path: inset(0 0 calc(100% - var(--hero-clip-height, 64px)) 0);
  -webkit-clip-path: inset(0 0 calc(100% - var(--hero-clip-height, 64px)) 0);
  transition: clip-path var(--transition-normal);
}

.hero-content {
  position: relative;
  z-index: 5;
  width: 100%;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.2rem, 3.5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: clamp(0.16em, 1vw, 0.22em);
  text-transform: uppercase;
  line-height: 1;
  color: var(--text-primary, #ffffff);
  user-select: none;
  margin: 0;
  white-space: nowrap;
  max-width: 90vw;
}

.hero-nav {
  z-index: 20;
  pointer-events: auto;
  position: absolute;
  left: 0.15rem;
  bottom: 0;
  width: calc(100% - 0.3rem);
  padding: 0.35rem 0 1.0rem 0;
  transition: background-color var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.hero-nav.is-stuck {
  position: fixed;
  top: 0;
  bottom: auto;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2000;
  /* Fallback for browsers without backdrop-filter */
  background: rgba(10, 10, 12, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}

/* Enhanced transparency for browsers with backdrop-filter */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .hero-nav.is-stuck {
    background: rgba(10, 10, 12, 0.35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

.hero-nav-inner {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
}

.hero-nav .btn {
  height: 28px;
  padding: 0 0.55rem;
  min-width: 88px;
  font-size: 0.68rem;
}

.hero-nav .theme-toggle {
  margin-left: auto;
}

.about-panel {
  background: #111111;
  border: 1px solid #1f1f1f;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.section-title {
  font-size: clamp(1.2rem, 3.5vw, 2.6rem);
  margin-bottom: var(--spacing-sm);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  /* Fallback color for browsers without gradient text support */
  color: var(--heading-color, var(--text-primary, #ffffff));
  width: 100%;
}

/* Gradient text for modern browsers */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .section-title {
    background: var(--heading-gradient, var(--accent-gradient));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .section {
    min-height: auto;
    padding: var(--spacing-lg) 0;
  }

  #hero-section {
    min-height: 50vh;
    height: 50vh;
    padding: 0;
  }
}
