/* ============================================================
   JYOTVIRA — Design System
   main.css: tokens, reset, typography, layout, utilities
   ============================================================ */

/* ---- Google Fonts ----
   NOTE: Loaded via <link> in HTML head with preconnect hints.
   @import is intentionally removed — it causes a render-blocking
   secondary request and duplicates the HTML <link> tag. */

/* ---- Design Tokens ---- */
:root {
  /* Colors — Light Premium Theme (logo-aligned: navy + royal blue + gold) */
  --color-bg:           #F2F6FF;   /* Cool blue-white — logo blue family base */
  --color-surface:      #FFFFFF;   /* Pure white — cards & raised surfaces */
  --color-surface-2:    #E8F0FF;   /* Pale royal blue — section washes */
  --color-surface-dark: #0B1D3A;   /* Deep navy — footer, CTA, contrast */
  --color-border:       #D4E2F8;   /* Blue-grey border — less beige, more brand */
  --color-border-glow:  #A07800;   /* Gold hover border — decorative, not text */

  /* Colors — Text (dark on light) */
  --color-text-primary:   #0B1D3A;   /* Deep navy — headings */
  --color-text-secondary: #3D4B5C;   /* Slate — body copy */
  --color-text-muted:     #7A8898;   /* Muted — labels, captions */

  /* Colors — Gold (WCAG AA compliant on all site backgrounds) */
  /* #8C6300 = 4.70:1 on #E8F0FF (hardest bg) — passes AA normal+large text */
  --color-gold:        #8C6300;   /* Accessible dark amber-gold — text/borders/accents */
  --color-gold-bright: #9A6E00;   /* Slightly lighter for large headlines (3.98:1+ on blue) */
  --color-gold-light:  #8C6300;   /* Hover state — same as base for consistency */
  --color-gold-glow:   rgba(140,99,0,0.15);
  --color-gold-subtle: rgba(140,99,0,0.09);

  /* Colors — Blue CTA (logo royal blue bars) */
  --color-cta:         #1A62D4;   /* Richer royal blue — matches logo bar vibrancy */
  --color-cta-hover:   #1450BC;   /* Deeper hover */
  --color-cta-glow:    rgba(26,98,212,0.22);

  /* Colors — On-dark surface overrides (footer, CTA banner) */
  --color-dark-text-primary:   #F0F4FF;
  --color-dark-text-secondary: #8090B0;
  --color-dark-text-muted:     #445570;
  --color-dark-border:         #1A2E50;
  --color-dark-border-glow:    #254070;

  /* Colors — Status */
  --color-ai:       #059669;   /* Green — less neon on light bg */
  --color-ai-glow:  rgba(5,150,105,0.10);
  --color-success:  #059669;
  --color-warning:  #D97706;
  --color-info:     #2563EB;
  --color-research: #7C3AED;

  /* Typography */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Type Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Letter Spacing */
  --tracking-tight:  -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.05em;
  --tracking-wider:   0.1em;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-7:  1.75rem;  /* bridges gap between space-6 cards and space-8 feature blocks */
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --max-width:       1280px;
  --max-width-text:  680px;
  --nav-height:      72px;
  --section-py:      clamp(2.5rem, 9vw, 9rem);

  /* Borders */
  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   500ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
}

p {
  line-height: 1.7;
}

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

@media (min-width: 640px) {
  .container { padding-inline: var(--space-8); }
}
@media (min-width: 1024px) {
  .container { padding-inline: var(--space-12); }
}

.section {
  padding-block: var(--section-py);
}

.section--alt {
  background-color: var(--color-surface-2);
}

/* ---- Typography Utilities ---- */
.accent         { color: var(--color-gold); }
.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-accent    { color: var(--color-accent); }
.text-ai        { color: var(--color-ai); }

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

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

.tracking-wide   { letter-spacing: var(--tracking-wide); }
.tracking-wider  { letter-spacing: var(--tracking-wider); }
.tracking-tight  { letter-spacing: var(--tracking-tight); }

.uppercase { text-transform: uppercase; }
.font-600  { font-weight: 600; }
.font-700  { font-weight: 700; }

/* ---- Section Header ---- */
.section-header {
  margin-bottom: var(--space-12);
}
.section-header--center {
  text-align: center;
}
.section-header--center .section-subheading {
  margin-inline: auto;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}

.section-heading {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-4xl));
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
}

.section-subheading {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 520px;
  margin-top: var(--space-4);
  line-height: 1.65;
}

/* ---- Grid ---- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
/* Prevent grid blowout — grid items can shrink below content min-size */
.grid-2 > *,
.grid-3 > *,
.grid-4 > * {
  min-width: 0;
}

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

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

/* ---- Reveal Animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }
.reveal-delay-5 { transition-delay: 400ms; }
.reveal-delay-6 { transition-delay: 480ms; }

/* ---- Accessibility ---- */
.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;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ---- Selection ---- */
::selection {
  background: rgba(26,94,200,0.12);
  color: var(--color-text-primary);
}

/* ---- Scrollbar (webkit) ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface-2); }
::-webkit-scrollbar-thumb { background: var(--color-border-glow); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold); }
