/* ==========================================================================
   TAVRICON DESIGN SYSTEM — ROYAL COBALT & NEON CYAN BASE & RESET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: dark;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-void);
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Atmospheric Royal Velvet Depth Layer (Electric Cobalt, Neon Cyan & Ultra-Violet Caustics) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background: 
    radial-gradient(circle at 18% 12%, rgba(0, 242, 254, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 82% 20%, rgba(37, 99, 235, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 50% 75%, rgba(139, 92, 246, 0.12) 0%, transparent 52%),
    radial-gradient(circle at 85% 90%, rgba(2, 132, 199, 0.18) 0%, transparent 45%);
  pointer-events: none;
  z-index: var(--z-negative);
}

/* Fine Stardust / Cyber Matrix Grid */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  background-image: radial-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 0);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: var(--z-negative);
  opacity: 0.6;
}

/* Interactive Cursor Ambient Light Orb */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.14) 0%, rgba(37, 99, 235, 0.08) 45%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: var(--z-base);
  transition: opacity 0.3s ease;
  filter: blur(45px);
}

@media (hover: none) or (max-width: 768px) {
  #cursor-glow {
    display: none !important;
  }
}

/* Main Content Container */
main {
  flex: 1 0 auto;
  position: relative;
  z-index: 2;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--cyan-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

.text-display {
  font-size: var(--text-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.text-lead {
  font-size: var(--text-lead);
  line-height: 1.6;
  color: var(--text-secondary);
  font-weight: 400;
}

.text-mono {
  font-family: var(--font-mono);
}

/* Royal & Cyan Color Classes */
.text-cyan {
  color: var(--cyan-primary);
}

.text-royal {
  color: var(--royal-light);
}

.text-gold {
  color: var(--cyan-primary); /* Alias to ensure zero gold */
}

.text-gradient-aurora,
.text-gradient-gold {
  background: var(--aurora-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-royal {
  background: linear-gradient(135deg, #FFFFFF 20%, #38BDF8 60%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #FFFFFF 0%, #00F2FE 60%, #0284C7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Links & Media */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img, svg, picture, video, canvas, iframe {
  max-width: 100%;
  display: block;
  height: auto;
}

/* Word-wrap safety across all text elements */
h1, h2, h3, h4, h5, h6, p, a, span, label {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: clamp(16px, 4.5vw, var(--space-6));
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: clamp(16px, 4.5vw, var(--space-6));
}

.section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
  position: relative;
}

.section-tight {
  padding-block: clamp(var(--space-8), 4vw, var(--space-12));
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-16));
}

.section-header.text-left {
  text-align: left;
  margin-inline: 0;
}

/* Grid & Flex Helpers */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

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

/* Custom Scrollbar in Cyan & Obsidian */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-2);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-void);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-primary);
}

/* Selection Highlight */
::selection {
  background: var(--cyan-primary);
  color: #030712;
}
