/* =========================================================================
   Heuxil's Studio. Shared stylesheet
   -------------------------------------------------------------------------
   This file contains tokens, reset, typography, navigation, buttons, hero,
   footer, and other UI primitives used across:
     - index.html              (Heuxil's Studio landing page, gold theme)
     - cpvpevent-plus.html     (CPVPEvent+ docs, gold + blue accent overlay)
     - 404.html                (Not-found page)

   Per-page color theming is done by overriding tokens at the :root level
   (CPVPEvent+ docs sets --accent to blue; studio page leaves it gold).
   Page-specific layouts (docs sidebar, plugin cards, etc.) live inline
   in their own page <style> blocks.
   ========================================================================= */


/* =========================================================================
   1. Design tokens
   ========================================================================= */
:root {
  /* Surfaces */
  --bg:            #0c0a08;
  --surface:       #161310;
  --surface-2:     #1d1916;
  --surface-3:     #25201b;
  --border:        #2c2620;
  --border-strong: #3a332b;

  /* Studio brand: warm beige/gold */
  --gold:          #EAD09D;
  --gold-dark:     #C9A968;   /* darker beige/gold, used for button hover */
  --gold-deep:     #A88746;
  --gold-soft:     #f5e3bd;
  --gold-warn:     #ffcc00;   /* reserved for warning callouts only */

  /* Default accent (overridden on the CPVPEvent+ docs page) */
  --accent:        var(--gold);
  --accent-dark:   var(--gold-dark);
  --accent-deep:   var(--gold-deep);

  /* CPVPEvent+ blue (used on the studio page's CPVPEvent+ card highlight) */
  --plugin-blue:   #A9D9FF;

  /* Status colors */
  --green:         #57FF4E;
  --red:           #FF3939;

  /* Text */
  --text:          #f5efe4;
  --text-muted:    #a89c89;
  --text-subtle:   #6b6051;

  /* Type */
  --font-display:  'Fraunces', 'Times New Roman', serif;
  --font-body:     'Geist', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', 'Courier New', monospace;

  /* Geometry */
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;

  /* Motion */
  --transition:    180ms cubic-bezier(.4, 0, .2, 1);
}


/* =========================================================================
   2. Reset
   ========================================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }


/* =========================================================================
   3. Body, base
   ========================================================================= */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-weight: 400;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;

  /* Default warm gradients. Pages with blue accent override these via
     a body[data-theme="blue"] selector below. */
  background-image:
    radial-gradient(900px 600px at 85% -10%, rgba(234, 208, 157, .08), transparent 60%),
    radial-gradient(900px 600px at -10% 40%, rgba(234, 208, 157, .04), transparent 60%);
  background-attachment: fixed;
}

body[data-theme="blue"] {
  background-image:
    radial-gradient(900px 600px at 85% -10%, rgba(169, 217, 255, .07), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(169, 217, 255, .035), transparent 60%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--gold); color: var(--bg); }


/* =========================================================================
   4. Typography
   ========================================================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
  font-weight: 500;
}

h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  font-weight: 400;
  margin-bottom: 1.25rem;
  letter-spacing: -.025em;
}

h3 {
  font-size: 1.5rem;
  margin: 0 0 .5rem;
  font-weight: 500;
  letter-spacing: -.015em;
}

h4 {
  font-family: var(--font-body);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .75rem;
}

p {
  margin-bottom: 1.1rem;
  color: var(--text-muted);
  max-width: 60ch;
}
p strong { color: var(--text); font-weight: 600; }

.accent {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  color: var(--accent);
}

code {
  font-family: var(--font-mono);
  font-size: .87em;
  background: var(--surface-2);
  color: var(--accent);
  padding: .14em .42em;
  border-radius: 4px;
  border: 1px solid var(--border);
}


/* =========================================================================
   5. Top navigation (fixed)
   ========================================================================= */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(12, 10, 8, .72);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.topnav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(12, 10, 8, .9);
}

.topnav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 600;
  letter-spacing: -.01em;
  font-size: 1.02rem;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: .95rem;
  color: #1a1408;
  box-shadow: 0 0 0 1px rgba(234, 208, 157, .15), 0 6px 20px -6px rgba(234, 208, 157, .35);
}
/* Blue brand mark variant for the docs page */
body[data-theme="blue"] .brand-mark {
  background: linear-gradient(135deg, #DCEEFF 0%, #A9D9FF 50%, #4F8FBE 100%);
  color: #0a1a2a;
  box-shadow: 0 0 0 1px rgba(169, 217, 255, .18), 0 6px 20px -6px rgba(169, 217, 255, .4);
}

.brand-text small {
  display: block;
  font-size: .68rem;
  font-weight: 400;
  color: var(--text-subtle);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}
.nav-links a {
  font-size: .9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); }


/* =========================================================================
   6. Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .88rem;
  padding: .65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: -.005em;
  text-decoration: none;
}
.btn-primary {
  background: var(--gold);
  color: #1a1408;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(201, 169, 104, .55);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--gold-dark);
  color: var(--gold-dark);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: .55rem .85rem;
}
.btn-ghost:hover { color: var(--text); }


/* =========================================================================
   7. Hero (shared between landing page, docs, 404)
   ========================================================================= */
.hero {
  position: relative;
  padding: 9rem 2rem 6rem;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, black 30%, transparent 75%);
  opacity: .35;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: 800px;
  height: 800px;
  top: -360px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(234, 208, 157, .14) 0%, transparent 60%);
  pointer-events: none;
  filter: blur(40px);
}
body[data-theme="blue"] .hero-glow {
  background: radial-gradient(circle, rgba(169, 217, 255, .14) 0%, transparent 60%);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .76rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  padding: .42rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  background: var(--surface);
  margin-bottom: 2rem;
  font-weight: 500;
}
.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

h1.hero-title {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  font-size: clamp(3rem, 8.5vw, 7rem);
  font-weight: 350;
  line-height: .98;
  letter-spacing: -.04em;
  margin-bottom: 1.5rem;
  color: var(--text);
}
h1.hero-title .accent {
  display: block;
  font-style: italic;
  font-weight: 350;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.hero-tagline {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: .85rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4.5rem;
}
.hero-actions .btn { padding: .85rem 1.45rem; font-size: .94rem; }


/* =========================================================================
   8. Footer
   ========================================================================= */
footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 2rem 2.5rem;
  position: relative;
  z-index: 2;
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}
.footer-brand p {
  font-size: .88rem;
  color: var(--text-subtle);
  margin-top: .85rem;
  max-width: 380px;
}

.footer-logo {
  width: 180px;
  max-width: 60%;
  height: auto;
  display: block;
  margin-left: -.5rem;   /* nudge to align with text below since logo has internal padding */
  filter: drop-shadow(0 0 24px rgba(255, 195, 130, .2));
}
.footer-meta {
  text-align: right;
  font-size: .82rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}
.footer-meta a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-meta a:hover { color: var(--accent); }


/* =========================================================================
   9. Reveal-on-load animation
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal .8s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes reveal {
  to { opacity: 1; transform: none; }
}
.d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; }
.d3 { animation-delay: .25s; } .d4 { animation-delay: .35s; }
.d5 { animation-delay: .45s; }


/* =========================================================================
   10. Responsive shared
   ========================================================================= */
@media (max-width: 920px) {
  .nav-links { display: none; }
  .topnav-inner { padding: .85rem 1.25rem; }
  .hero { padding: 7rem 1.5rem 4rem; }
  footer { padding: 2.5rem 1.5rem 2rem; }
  .footer-inner { grid-template-columns: 1fr; text-align: left; }
  .footer-meta { text-align: left; }
}

@media (max-width: 540px) {
  h2 { font-size: 1.95rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
}
