/* ==========================================================================
   Name Generator Theme — Global CSS
   Version: 1.0.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  --color-primary:        #6D5DFB;
  --color-primary-hover:  #5647e8;
  --color-primary-light:  #EEF2FF;
  --color-primary-dark:   #4c3ed9;
  --color-secondary:      #14B8A6;
  --color-secondary-light:#F0FDFA;
  --color-accent:         #F59E0B;
  --color-dark:           #172033;
  --color-dark-hover:     #1e293b;
  --color-muted:          #667085;
  --color-bg:             #F8FAFC;
  --color-surface:        #FFFFFF;
  --color-border:         #E5E7EB;
  --color-border-focus:   #6D5DFB;
  --color-success:        #16A34A;
  --color-error:          #DC2626;
  --color-warning:        #D97706;
  --color-info:           #0284C7;

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(23,32,51,.06), 0 1px 2px rgba(23,32,51,.04);
  --shadow-md:  0 4px 12px rgba(23,32,51,.08), 0 2px 6px rgba(23,32,51,.04);
  --shadow-lg:  0 10px 30px rgba(23,32,51,.10), 0 4px 12px rgba(23,32,51,.06);
  --shadow-xl:  0 20px 50px rgba(23,32,51,.12), 0 8px 20px rgba(23,32,51,.08);
  --shadow-primary: 0 8px 25px rgba(109,93,251,.25);
  --shadow-glow:    0 0 40px rgba(109,93,251,.15);

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  --font-heading: "Manrope", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono:    ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;

  --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:  2rem;
  --text-4xl:  2.5rem;
  --text-5xl:  3.5rem;

  --max-content: 1200px;
  --max-wide:    1400px;
  --max-narrow:  760px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:      #0f1623;
    --color-surface: #1a2235;
    --color-border:  #2d3748;
    --color-dark:    #f1f5f9;
    --color-muted:   #94a3b8;
    --color-primary-light: rgba(109,93,251,.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
  }
}

/* --------------------------------------------------------------------------
   CSS Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* {
  margin: 0;
  padding: 0;
}

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

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

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

img { height: auto; }

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-dark);
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-hover); }

ul, ol { list-style: none; }

table { border-collapse: collapse; }

/* --------------------------------------------------------------------------
   Skip Link (Accessibility)
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Focus Styles
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Screen Reader 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;
}

/* --------------------------------------------------------------------------
   Container / Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.container--wide   { max-width: var(--max-wide); }
.container--narrow { max-width: var(--max-narrow); }

/* --------------------------------------------------------------------------
   Grid Utilities
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* --------------------------------------------------------------------------
   Flex Utilities
   -------------------------------------------------------------------------- */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-center  { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* --------------------------------------------------------------------------
   Text Utilities
   -------------------------------------------------------------------------- */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.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); }
.text-center  { text-align: center; }
.text-muted   { color: var(--color-muted); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-error   { color: var(--color-error); }
.font-heading { font-family: var(--font-heading); }
.font-bold    { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium  { font-weight: 500; }

/* --------------------------------------------------------------------------
   Spacing Utilities
   -------------------------------------------------------------------------- */
.mt-4  { margin-top: 1rem; }
.mt-8  { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-8  { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.py-4  { padding-block: 1rem; }
.py-8  { padding-block: 2rem; }
.py-12 { padding-block: 3rem; }
.py-16 { padding-block: 4rem; }
.py-20 { padding-block: 5rem; }
.py-24 { padding-block: 6rem; }

/* --------------------------------------------------------------------------
   Section Defaults
   -------------------------------------------------------------------------- */
.section { padding-block: 5rem; }
.section--sm { padding-block: 3rem; }
.section--lg { padding-block: 7rem; }

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 3.5rem;
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  font-weight: 800;
  color: var(--color-dark);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.section-desc {
  font-size: var(--text-lg);
  color: var(--color-muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Badge / Tag
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-heading);
  border-radius: var(--radius-full);
  line-height: 1.5;
}
.badge--primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge--secondary { background: var(--color-secondary-light); color: var(--color-secondary); }
.badge--accent { background: #FEF3C7; color: #92400E; }
.badge--new { background: #DCFCE7; color: #15803D; }
.badge--fan { background: #FEF9C3; color: #854D0E; }

/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: 2rem;
}

/* --------------------------------------------------------------------------
   Prose (Long-form content)
   -------------------------------------------------------------------------- */
.prose {
  max-width: 72ch;
  line-height: 1.75;
}
.prose h2 { font-size: var(--text-3xl); margin-top: 2.5rem; margin-bottom: 1rem; }
.prose h3 { font-size: var(--text-2xl); margin-top: 2rem; margin-bottom: 0.75rem; }
.prose h4 { font-size: var(--text-xl); margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose p  { margin-bottom: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; list-style: revert; }
.prose li { margin-bottom: 0.5rem; }
.prose blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1.25rem;
  margin-left: 0;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 1.25rem;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.prose strong { font-weight: 700; color: var(--color-dark); }
.prose a { font-weight: 500; }

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .no-print, nav, .ng-hero, .ng-cta-section { display: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
