/* ============================================
   LUMINATA — Base / Reset / Typography
   ============================================ */

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

a, button, [role="button"], input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- Selection --- */
::selection {
  background: rgba(232, 146, 74, 0.25);
  color: var(--text-primary);
}

/* --- Scrollbar (webkit) --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* --- Links --- */
a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-orange);
}

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
}
h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.25;
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
}
h4 {
  font-size: var(--text-lg);
  font-weight: 600;
}

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

/* --- Monospace / Tech labels --- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
}

/* --- Syntax-highlighted text spans --- */
.hl-orange { color: var(--accent-orange); }
.hl-blue { color: var(--accent-blue); }
.hl-green { color: var(--accent-green); }
.hl-purple { color: var(--accent-purple); }
.hl-cyan { color: var(--accent-cyan); }
.hl-rose { color: var(--accent-rose); }
.hl-yellow { color: var(--accent-yellow); }

/* Light theme: WCAG-safe accent text */
[data-theme="light"] .hl-orange { color: var(--accent-orange-text); }
[data-theme="light"] .hl-blue { color: var(--accent-blue-text); }
[data-theme="light"] .hl-green { color: var(--accent-green-text); }
[data-theme="light"] .hl-purple { color: var(--accent-purple-text); }
[data-theme="light"] .hl-cyan { color: var(--accent-cyan-text); }
[data-theme="light"] .hl-rose { color: var(--accent-rose-text); }
[data-theme="light"] .hl-yellow { color: var(--accent-yellow-text); }

/* --- Gradient text --- */
.gradient-text {
  color: var(--accent-orange);
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
.container-wide {
  max-width: var(--container-wide);
}

/* --- Section spacing --- */
.section {
  padding: var(--space-5xl) 0;
}

/* --- Utility --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-center .section-desc { margin-left: auto; margin-right: auto; }
.text-left { text-align: left; }

img, svg {
  display: block;
  max-width: 100%;
}

/* --- Dot grid background --- */
.dot-bg {
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* --- Section label (tech) — trailing line --- */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--accent-orange);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--accent-orange);
  border-radius: 1px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-subtle), transparent);
}
.section-label--center {
  justify-content: center;
}
.section-label--center::before {
  display: none;
}
.section-label--center::after {
  display: none;
}

/* Light theme: section-label accent */
[data-theme="light"] .section-label {
  color: var(--accent-orange-text);
}
[data-theme="light"] .section-label::before {
  background: var(--accent-orange-text);
}

/* --- Section description --- */
.section-desc {
  color: var(--text-secondary);
  font-size: var(--text-lg);
  line-height: 1.75;
  max-width: 640px;
  margin-top: var(--space-md);
}

/* --- Scroll indicator (hero) --- */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}
.scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: scrollBounce 2s ease-in-out infinite;
  z-index: 2;
}
.scroll-indicator svg { width: 24px; height: 24px; }

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color var(--transition-fast); }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb-separator { opacity: 0.4; }

/* --- Fade in animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Media queries: typography scale --- */
@media (max-width: 768px) {
  html { font-size: 15px; }
  .container { padding: 0 var(--space-lg); }
  .section { padding: var(--space-3xl) 0; }
  .form-input, .form-textarea { font-size: 16px; }
}

/* Skip link */
.skip-link {
  position: fixed;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--accent-orange);
  color: #fff;
  font-size: var(--text-sm);
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top var(--transition-fast);
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

.direction-block:focus-visible,
.card:focus-visible {
  outline-offset: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .page {
    animation: none;
  }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Firefox scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) var(--bg-primary);
}

/* Spacing utilities */
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mx-auto { margin-left: auto; margin-right: auto; }
.bg-alt { background: var(--bg-secondary); }

/* Extended utilities */
.inline-flex { display: inline-flex; }
.flex-gap-xl { display: flex; gap: var(--space-xl); flex-wrap: wrap; }
.flex-gap-md { display: flex; gap: var(--space-md); }
.section-cta-desc { margin: var(--space-lg) auto var(--space-2xl); }
.section-cta-desc-sm { margin: var(--space-md) auto var(--space-xl); }
.no-decoration { text-decoration: none; }
.product-desc { font-size: var(--text-lg); margin-bottom: var(--space-xl); }
.metric-inline { font-size: var(--text-3xl); }
.metric-inline-sm { font-size: var(--text-2xl); }
.max-w-700 { max-width: 700px; }
.opacity-50 { opacity: 0.5; }
