/* ============================================================
   GG Codes — Design System  (v2: premium, green, restrained)
   Near-black surfaces · single green accent · crisp geometry.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

/* ---------- Tokens: Dark (default) ---------- */
:root {
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --bg:        #07090A;
  --bg-2:      #0A0D0E;
  --surface:   #0F1314;
  --surface-2: #151A1B;
  --surface-3: #1C2224;
  --border:    #1B2122;
  --border-2:  #283032;

  --text:       #ECF1EF;
  --text-muted: #97A2A0;
  --text-dim:   #626C6A;

  --primary:        #2BE08A;
  --primary-bright: #4FF0A4;
  --primary-deep:   #12AF69;
  --on-primary:     #03130B;

  --active:     #2BE08A;
  --active-bg:  rgba(43,224,138,.10);
  --active-bd:  rgba(43,224,138,.28);
  --expired:    #E0697A;
  --expired-bg: rgba(224,105,122,.08);
  --expired-bd: rgba(224,105,122,.24);

  --shadow-card: 0 1px 0 rgba(255,255,255,.02) inset, 0 16px 40px -28px rgba(0,0,0,.85);
  --grad-primary: linear-gradient(135deg, #34E892 0%, #12AF69 100%);
  --grad-hero: radial-gradient(900px 460px at 80% -16%, rgba(43,224,138,.10), transparent 60%);
  --ring: 0 0 0 3px rgba(43,224,138,.16);

  --radius:    12px;
  --radius-sm: 9px;
  --radius-lg: 18px;
  --maxw: 1240px;
  --header-h: 66px;
}

/* ---------- Tokens: Light ---------- */
[data-theme="light"] {
  --bg:        #F4F6F5;
  --bg-2:      #FBFCFB;
  --surface:   #FFFFFF;
  --surface-2: #F2F5F3;
  --surface-3: #E8EDEA;
  --border:    #E2E8E5;
  --border-2:  #D2DAD6;

  --text:       #0C1311;
  --text-muted: #56605D;
  --text-dim:   #8B9591;

  --primary:        #0F9D5F;
  --primary-bright: #0B8A52;
  --primary-deep:   #0B8A52;
  --on-primary:     #FFFFFF;

  --active:     #0F9D5F;
  --active-bg:  rgba(15,157,95,.09);
  --active-bd:  rgba(15,157,95,.26);
  --expired:    #C9415A;
  --expired-bg: rgba(201,65,90,.06);
  --expired-bd: rgba(201,65,90,.20);

  --shadow-card: 0 1px 2px rgba(12,19,17,.04), 0 18px 38px -28px rgba(11,138,82,.28);
  --grad-hero: radial-gradient(900px 460px at 80% -16%, rgba(15,157,95,.09), transparent 60%);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 18px); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--primary); color: var(--on-primary); }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); display: inline-flex; align-items: center; gap: 9px;
}
.h-section { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand .glyph { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.brand .word {
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em;
  color: var(--text);
}
.brand .word .gg { color: var(--primary); }
.brand .word .tld { color: var(--text-dim); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 4px; }
.nav a {
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  color: var(--text-muted); padding: 8px 13px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.hsearch {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 12px; width: 210px; color: var(--text-dim);
  transition: border-color .15s, box-shadow .15s, width .2s;
}
.hsearch:focus-within { border-color: var(--primary); box-shadow: var(--ring); width: 240px; }
.hsearch input { background: none; border: none; outline: none; color: var(--text); font-size: 14px; width: 100%; font-family: var(--font-body); }
.hsearch svg { flex-shrink: 0; }

/* ---- Search dropdown (header + hero searchbar) ---- */
.search-wrap { position: relative; }
.search-dropdown {
  position: absolute; top: calc(100% + 7px); left: 0; min-width: 280px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 12px; box-shadow: 0 16px 40px -8px rgba(0,0,0,.55);
  z-index: 300; overflow: hidden; display: none;
}
[data-theme="light"] .search-dropdown { box-shadow: 0 8px 24px -4px rgba(0,0,0,.2); }
.search-dropdown.open { display: block; }
.search-dropdown .sd-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px;
  color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background .1s;
}
.search-dropdown .sd-row:hover,
.search-dropdown .sd-row.sd-active { background: var(--surface-2); }
.search-dropdown .sd-logo {
  width: 28px; height: 28px; border-radius: 7px; overflow: hidden; flex-shrink: 0;
  background: #0F1314; display: grid; place-items: center; border: 1px solid var(--border);
}
[data-theme="light"] .search-dropdown .sd-logo { background: var(--surface-2); }
.search-dropdown .sd-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.search-dropdown .sd-name { flex: 1; }
.search-dropdown .sd-arr { color: var(--text-dim); flex-shrink: 0; }
.sd-empty { padding: 12px 14px; font-size: 13px; color: var(--text-dim); text-align: center; }
/* Hero searchbar dropdown spans full width */
.searchbar .search-dropdown { right: 0; min-width: unset; top: calc(100% + 4px); }

.theme-toggle {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text-muted);
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-2); }
.theme-toggle .moon { display: none; }
.theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: block; }
[data-theme="light"] .theme-toggle .sun { display: none; }

.btn {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 17px; border-radius: 9px; transition: transform .15s, box-shadow .2s, filter .2s, background .15s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset; }
.btn-primary:hover { background: var(--primary-bright); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-2); background: var(--surface-2); }

/* ---------- Copy button (shared) ---------- */
.copy-btn {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 600; font-size: 13px;
  padding: 9px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text);
  transition: border-color .15s, color .15s, background .15s; flex-shrink: 0; white-space: nowrap;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--active-bg); }
.copy-btn.copied { background: var(--active-bg); border-color: var(--active-bd); color: var(--active); }
.copy-btn svg { width: 14px; height: 14px; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 11.5px; letter-spacing: .01em;
  padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border-2);
  color: var(--text-muted); background: var(--surface-2);
}
.pill.active { color: var(--active); background: var(--active-bg); border-color: var(--active-bd); }
.pill.expired { color: var(--expired); background: var(--expired-bg); border-color: var(--expired-bd); }
.pill.new {
  color: var(--text); background: transparent; border-color: var(--border-2);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 32%, transparent);} 50% { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 0%, transparent);} }

/* ---------- Ad slots ---------- */
.ad {
  border: 1px dashed var(--border-2); border-radius: var(--radius-sm);
  background: var(--bg-2);
  display: grid; place-items: center; color: var(--text-dim);
  font-family: var(--font-display); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
}
.ad span { opacity: .8; }
.ad.leaderboard { min-height: 100px; }
.ad.rail { min-height: 600px; }
.ad.inline { min-height: 120px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: 84px; }
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 40px; padding: 56px 0 40px; }
.footer-grid h4 { font-family: var(--font-display); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; }
.footer-grid ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.footer-grid a:hover { color: var(--primary); }
.footer-blurb { color: var(--text-dim); font-size: 13.5px; max-width: 340px; margin-top: 16px; line-height: 1.7; }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--text-dim); font-size: 12.5px; }

/* ---------- Responsive base ---------- */
@media (max-width: 900px) {
  .nav, .hsearch { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
