@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@600;700&family=Inter:wght@400;500&family=JetBrains+Mono:wght@400;500&family=Noto+Sans+Devanagari:wght@600;700&display=swap');

:root {
  color-scheme: dark;
  /* Core Color Tokens */
  --bg: #08080A;
  --surface: #101013;
  --surface-2: #18181C;
  --white: #FFFFFF;
  --label: #9A9AA3;
  --text-muted: #9A9AA3;
  --red: #E11D2E;
  --red-hover: #F5233A;
  --red-soft: rgba(225, 29, 46, 0.12);
  --ok: #3BE08C;

  /* HUD & Border Tokens */
  --border: rgba(255, 255, 255, 0.08);
  --hud: rgba(255, 255, 255, 0.22);
  --scan: rgba(255, 255, 255, 0.03);
  --scan-ambient: rgba(255, 255, 255, 0.012);

  /* Legacy Backward Compatibility Aliases */
  --bg-main: var(--bg);
  --bg-secondary: var(--surface);
  --bg-ember: var(--surface-2);
  --primary-accent: var(--red);
  --accent-hover: var(--red-hover);
  --text-primary: var(--white);
  --text-secondary: var(--text-muted);

  /* Typography */
  --font-display: 'Chakra Petch', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-deva: 'Noto Sans Devanagari', -apple-system, sans-serif;
  --font-heading: var(--font-display);

  /* Strict Zero Radius Hierarchy */
  --radius-0: 0px;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;

  /* Standardized Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  color-scheme: dark;
  background-color: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
}

body {
  background-color: #08080A;
  background-image:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,0.021) 0px,
      rgba(255,255,255,0.021) 1px,
      transparent 1px,
      transparent 64px),
    repeating-linear-gradient(180deg,
      rgba(255,255,255,0.016) 0px,
      rgba(255,255,255,0.016) 1px,
      transparent 1px,
      transparent 64px),
    linear-gradient(180deg,
      #08080A 0%,
      #0A0A0E 22%,
      #08080A 48%,
      #0B0B11 72%,
      #08080A 100%);
  background-repeat: repeat, repeat, no-repeat;
  background-size: auto, auto, 100% 100%;
  background-attachment: scroll, scroll, scroll;
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  overflow-y: visible;
  width: 100%;
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy - Sentence Case Display Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--white);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-transform: none;
}

p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Numeric Readouts with Tabular Digits */
.tabular-numbers,
.timer-val,
.score-number,
.price-current,
.price-original,
.picker-item,
.step-num,
.mono-readout {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Section Containers & Layout */
.section {
  position: relative;
  width: 100%;
  padding: 96px 24px;
  z-index: 10;
}

@media (max-width: 768px) {
  .section {
    padding: 56px 16px;
  }
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-family: var(--font-display);
  color: var(--white);
  margin-bottom: 14px;
  line-height: 1.15;
}

.section-desc {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 40px;
  line-height: 1.65;
}

/* Hero Background Portrait & Scrim */
.hero-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  height: clamp(220px, 72vw, 320px);
  padding: 0;
  overflow: hidden;
  z-index: 12;
  pointer-events: none;
  background-color: var(--bg);
}

/* Container-Scoped Full-Strength Scanlines (0.03 strength) */
.hero-backdrop::after,
.initial-preloader-overlay::after,
.loading-screen-modal::after,
.lang-modal-dialog::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(to bottom, var(--scan) 0 1px, transparent 1px 3px);
}

#hero-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  display: block;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform, opacity;
  mask-image:
    linear-gradient(to bottom, transparent 0%, black 10%, black 58%, transparent 94%),
    linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-composite: intersect;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, black 10%, black 58%, transparent 94%),
    linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-composite: source-in;
}

.hero-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(8, 8, 10, 0) 0%,
    rgba(8, 8, 10, 0.66) 55%,
    var(--bg) 100%);
}

.hero-lockup {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 2;
  margin: 0;
  padding: 0 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.hero-lockup__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 11vw, 46px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--white);
}

.hero-lockup__sub {
  position: relative;
  margin-top: 11px;
  padding-top: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(10px, 3vw, 12px);
  line-height: 1;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--white);
}

.hero-lockup__sub::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 2px;
  background: var(--red);
}

.hero-glow {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  width: 85%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle, rgba(225, 29, 46, 0.20) 0%, transparent 68%);
  filter: blur(70px);
  -webkit-filter: blur(70px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  opacity: 0.20;
  will-change: opacity;
}

/* Global Content Region Ambient Scanlines (0.012 opacity, 5px period to eliminate shimmer/moiré) */
.hud-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  background: repeating-linear-gradient(to bottom, var(--scan-ambient) 0 1px, transparent 1px 5px);
}

/* Global Static 3% Grain (Non-shimmering) */
.hud-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 81;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Viewfinder Frame (Corner Ticks Only) */
.hud-viewfinder {
  position: fixed;
  inset: 10px;
  pointer-events: none;
  z-index: 82;
  border: none;
}

.vf-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.vf-tl {
  top: 0;
  left: 0;
  border-top: 2px solid var(--hud);
  border-left: 2px solid var(--hud);
}

.vf-tr {
  top: 0;
  right: 0;
  border-top: 2px solid var(--hud);
  border-right: 2px solid var(--hud);
}

.vf-bl {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid var(--hud);
  border-left: 2px solid var(--hud);
}

.vf-br {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid var(--hud);
  border-right: 2px solid var(--hud);
}

/* Mobile Viewfinder: Flush to edges, render 14px corner arms at true viewport corners */
@media (max-width: 639px) {
  .hud-viewfinder {
    inset: 0;
    border: none !important;
  }

  .vf-corner {
    width: 14px;
    height: 14px;
  }

  .vf-tl {
    top: 0;
    left: 0;
  }

  .vf-tr {
    top: 0;
    right: 0;
  }

  .vf-bl {
    bottom: 0;
    left: 0;
  }

  .vf-br {
    bottom: 0;
    right: 0;
  }
}

/* Hard Opt-Out for Reduced Motion & Contrast More */
@media (prefers-reduced-motion: reduce), (prefers-contrast: more) {
  .hud-scanlines,
  .hero-backdrop::after,
  .initial-preloader-overlay::after,
  .loading-screen-modal::after,
  .lang-modal-dialog::after {
    display: none !important;
    background: none !important;
  }
}

/* Scroll Reveal Animation System (Phase 10) */
.reveal-element {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-element.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-element {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #hero-portrait {
    transform: none !important;
  }
}

/* Scrollbar Styling */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) var(--bg);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

::-webkit-scrollbar-corner {
  background: var(--bg);
}
