/* trapgod4 — global design tokens + shared UI (data-theme: dark | light | metal) */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --header-h: 64px;
  --maxw: 1120px;
  --trap-green: #53AD6E;
}

/* ---- Dark (default) ---- */
[data-theme="dark"] {
  --bg: #0C0C17;
  --surface: #14141F;
  --surface-2: #1B1B29;
  --text: #EAF2EC;
  --muted: #8A9A8E;
  --primary: #53AD6E;
  --primary-ink: #04140A;
  --accent: #53AD6E;
  --border: #242433;
  --glow: rgba(83, 173, 110, .35);
  --hero-grid: rgba(83, 173, 110, .08);
}

/* ---- Light ---- */
[data-theme="light"] {
  --bg: #EEF0F1;
  --surface: #FFFFFF;
  --surface-2: #F3F5F6;
  --text: #12181C;
  --muted: #5B6B72;
  --primary: #2F7D52;
  --primary-ink: #FFFFFF;
  --accent: #2F7D52;
  --border: #D9DEE1;
  --glow: rgba(47, 125, 82, .22);
  --hero-grid: rgba(47, 125, 82, .06);
}

/* ---- Metal ---- */
[data-theme="metal"] {
  --bg: #040407;
  --surface: linear-gradient(145deg, #181A20, #101116);
  --surface-2: #1B1E25;
  --text: #F2F3F5;
  --muted: #9BA0A8;
  --primary: #D0D0D3;
  --primary-ink: #101116;
  --accent: #53AD6E;
  --border: #33363F;
  --glow: rgba(208, 208, 211, .25);
  --hero-grid: rgba(208, 208, 211, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }

img { max-width: 100%; display: block; }

.tg4-container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- Top nav ---- */
.tg4-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.tg4-nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
}
.tg4-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: .04em; color: var(--text);
  text-decoration: none; font-size: 1.05rem;
}
.tg4-brand i { color: var(--primary); }
.tg4-brand-logo {
  width: 34px; height: 34px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 0 10px var(--glow));
}
.tg4-footer-logo {
  width: 28px; height: 28px; object-fit: contain; flex-shrink: 0;
}
.tg4-nav-links { display: flex; gap: 18px; margin-left: 12px; }
.tg4-nav-links a { color: var(--muted); font-size: .9rem; font-weight: 500; }
.tg4-nav-links a:hover { color: var(--text); text-decoration: none; }
.tg4-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.tg4-theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.tg4-theme-btn {
  width: 30px; height: 30px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 700; font-size: .72rem;
}
.tg4-theme-btn[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }

/* ---- Buttons ---- */
.tg4-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, filter .2s ease, background .2s ease;
}
.tg4-btn:hover { text-decoration: none; }
.tg4-btn:active { transform: translateY(1px); }
.tg4-btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 22px -8px var(--glow); }
.tg4-btn-primary:hover { filter: brightness(1.06); }
.tg4-btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.tg4-btn-ghost:hover { background: var(--surface-2); }
.tg4-btn-gold { background: linear-gradient(135deg, #FBBF24, #F59E0B); color: #1a1204; }
.tg4-btn-block { width: 100%; }
.tg4-btn-sm { padding: 7px 12px; font-size: .82rem; }

/* ---- Cards / surfaces ---- */
.tg4-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ---- Forms ---- */
.tg4-field { margin-bottom: 14px; }
.tg4-label {
  display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 6px; font-weight: 600;
}
.tg4-input, .tg4-textarea, .tg4-select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: .95rem;
}
.tg4-input:focus, .tg4-textarea:focus, .tg4-select:focus { outline: none; border-color: var(--primary); }
.tg4-input::placeholder, .tg4-textarea::placeholder { color: var(--muted); }
.tg4-textarea { min-height: 92px; resize: vertical; }
input[type="color"].tg4-input { height: 44px; padding: 4px; cursor: pointer; }

/* ---- Alerts ---- */
.tg4-alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 14px; border: 1px solid transparent; }
.tg4-alert-error { background: rgba(248, 113, 113, .12); color: #f87171; border-color: rgba(248, 113, 113, .3); }
.tg4-alert-ok { background: rgba(74, 222, 128, .12); color: #4ade80; border-color: rgba(74, 222, 128, .3); }

/* ---- Footer ---- */
.tg4-footer { border-top: 1px solid var(--border); margin-top: 60px; background: var(--surface); }
.tg4-footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 20px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
.tg4-footer-brand { font-weight: 800; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.tg4-footer-brand i { color: var(--primary); }
.tg4-footer-brand span { color: var(--muted); font-weight: 500; font-size: .85rem; margin-left: 4px; }
.tg4-footer-links { display: flex; gap: 16px; }
.tg4-footer-links a { color: var(--muted); font-size: .88rem; }
.tg4-footer-note { color: var(--muted); font-size: .82rem; margin: 0 0 0 auto; }

/* ---- Helpers ---- */
.tg4-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font-size: .72rem; font-weight: 600;
}
.tg4-muted { color: var(--muted); }

@media (max-width: 760px) {
  .tg4-nav-links { display: none; }
  .tg4-footer-note { margin: 0; width: 100%; }
}
