/* ═══════════════════════════════════════════════════════
   ImpactGrid Group — Shared Design System
   Version: 5.0 — Design system locked
   Default theme: Light. Dark available via data-theme="dark".

   LOCKED CLASSES — always use these, never override:
     Typography : .h1  .h2  .h3  .text  .text-sm
     Layout     : .section  .section-sm  .section-full  .container
     Buttons    : .btn + .btn-primary / .btn-secondary / .btn-ghost / .btn-danger
     Cards      : .card  .card-sm
   If it's not using these classes → refactor it.
═══════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@400;500&display=swap');

/* ════════════════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:    #faf7f2;
  --bg2:   #f3ede3;
  --bg3:   #ece4d6;
  --card:  #ffffff;
  --card2: #fdf9f4;

  /* Borders */
  --border:  rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.13);

  /* Text */
  --text:  #0d0d0d;
  --text2: #2b2b2b;   /* was #555555 — dark text in light mode */
  --text3: #4a4a4a;   /* was #9a9a9a */

  /* Accent — monochrome (was gold) */
  --gold:     #161616;
  --gold2:    #000000;
  --gold-dim: rgba(0,0,0,0.06);
  --gold-glo: rgba(0,0,0,0.18);

  /* Blue */
  --blue:     #2d6edb;
  --blue2:    #1a52b0;
  --blue-dim: rgba(45,110,219,0.08);

  /* Green */
  --green:     #0fa876;
  --green-dim: rgba(15,168,118,0.10);

  /* Red */
  --red:     #d94f3b;
  --red-dim: rgba(217,79,59,0.08);

  /* Purple (Creator Studio) */
  --purple:     #7c3aed;
  --purple-dim: rgba(124,58,237,0.08);

  /* Brand */
  --brand-primary: #161616;
  --brand-dark:    #080808;

  /* Typography */
  --fd: 'Bricolage Grotesque', sans-serif;
  --fb: 'DM Sans', sans-serif;
  --fm: 'DM Mono', monospace;

  /* Layout */
  --nav-h:       64px;
  --max-w:       1220px;
  --container-w: 1100px;   /* canonical page content width */
  --r:           12px;
  --r2:          20px;

  /* Spacing scale — base 4/8px rhythm. Use these instead of ad-hoc values. */
  --s1:  4px;
  --s2:  8px;
  --s3:  12px;
  --s4:  16px;
  --s5:  24px;
  --s6:  32px;
  --s7:  48px;
  --s8:  64px;
  --s9:  96px;

  --sh:      0 4px 24px rgba(0,0,0,0.06);
  --sh2:     0 16px 48px rgba(0,0,0,0.10);
  --sh-gold: 0 8px 28px rgba(0,0,0,0.20);
  --sh-gold-sm: 0 4px 14px rgba(0,0,0,0.14);

  /* Ink — raw RGB triplet for text/border rgba() overlays that need a
     theme-aware base colour (used on blog.html). Light mode: dark ink. */
  --ink: 40,32,18;

  /* Surface — raw RGB triplet for translucent card/panel backgrounds
     (e.g. blurred sticky bars) that need to sit opposite --ink. */
  --surface: 255,255,255;
}

[data-theme="dark"] {
  --bg:    #17140f;
  --bg2:   #1d1810;
  --bg3:   #241e15;
  --card:  #1e1912;
  --card2: #262019;

  --border:  rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.11);

  --text:  #ffffff;
  --text2: #ffffff;   /* was #a3a3a3 — pure white in dark mode */
  --text3: #ffffff;   /* was #5c5c5c */

  --gold:     #f2f2f2;
  --gold2:    #ffffff;
  --gold-dim: rgba(255,255,255,0.08);
  --gold-glo: rgba(255,255,255,0.20);

  --blue:     #4f8ef7;
  --blue2:    #7eb3ff;
  --blue-dim: rgba(79,142,247,0.10);

  --green:     #2dd4a0;
  --green-dim: rgba(45,212,160,0.10);

  --red:     #f75f4f;
  --red-dim: rgba(247,95,79,0.10);

  --purple:     #a855f7;
  --purple-dim: rgba(168,85,247,0.10);

  /* Brand colours intentionally unchanged in dark mode */

  --sh:      0 4px 24px rgba(0,0,0,0.45);
  --sh2:     0 16px 64px rgba(0,0,0,0.65);
  --sh-gold: 0 8px 28px rgba(255,255,255,0.14);
  --sh-gold-sm: 0 4px 14px rgba(255,255,255,0.10);

  /* Dark mode: flip ink to a light tone so blog.html text/borders
     built from rgba(var(--ink),alpha) stay legible. */
  --ink: 255,255,255;

  /* Dark mode: flip surface to a dark tone so translucent panels
     built from rgba(var(--surface),alpha) don't stay white. */
  --surface: 17,17,17;
}

/* ════════════════════════════════════════════════════
   RESET
════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(ellipse 70% 35% at 50% 0%,   rgba(170,152,3,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 45% 28% at 100% 100%, rgba(170,152,3,0.04) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--fb);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--fb); border: none; background: none; }
h1, h2, h3, h4, h5 {
  font-family: var(--fd);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
img { display: block; max-width: 100%; }

/* Subtle grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::after { opacity: 0.35; }

/* ════════════════════════════════════════════════════
   NAVIGATION — Left-side vertical rail
   Collapsed : logo strip only (--nav-w-collapsed wide)
   Expanded  : full panel overlays content (no push)
   Toggle    : click the logo mark
════════════════════════════════════════════════════ */

/* ── Layout tokens ── */
:root {
  --nav-w:           220px;  /* expanded overlay width  */
  --nav-w-collapsed: 52px;   /* logo-strip visible width */
}

/* ── Left-side nav rail ── */
.nav {
  position: fixed; top: 0; left: 0; bottom: 0; right: auto;
  width: var(--nav-w-collapsed); height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 0 24px;
  background: var(--card);
  border-right: 1px solid var(--border2);
  z-index: 1000;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s;
  box-shadow: none;
}
[data-theme="dark"] .nav { background: #111008; }

/* Expanded — overlays content, shows full panel + backdrop */
.nav.expanded {
  width: var(--nav-w);
  box-shadow: 4px 0 32px rgba(0,0,0,0.14);
}
[data-theme="dark"] .nav.expanded { box-shadow: 4px 0 48px rgba(0,0,0,0.55); }

/* Nav backdrop — sits between nav and page, click to collapse */
.nav-backdrop {
  display: none;
  position: fixed; inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
.nav-backdrop.open { display: block; }

/* No handle tab needed — logo IS the toggle */
.nav-handle { display: none; }

/* .nav-in not used in side-rail layout */
.nav-in { display: none; }

/* Logo — acts as the nav toggle */
.logo {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--fd); font-weight: 800; font-size: 15px;
  letter-spacing: -0.03em; flex-shrink: 0;
  margin-bottom: 32px; text-decoration: none; white-space: nowrap;
  padding: 0 11px;
  cursor: pointer;
  /* logo-text hidden until expanded */
}
.logo .logo-text {
  opacity: 0;
  transition: opacity 0.2s ease 0.05s;
  pointer-events: none;
}
.nav.expanded .logo .logo-text {
  opacity: 1;
  pointer-events: auto;
}
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
}
[data-theme="dark"] .logo-mark { color: #07090f; }
.logo-img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.logo-text { white-space: nowrap; }

/* Nav links */
.nav-links {
  display: flex; flex-direction: column;
  list-style: none; gap: 2px; flex: 1;
  padding: 0 8px;
}
.nav-links li { width: 100%; }
.nav-links a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; width: 100%;
  color: var(--text2); transition: all 0.18s; white-space: nowrap;
  overflow: hidden;
}
.nav-links a:hover {
  color: var(--text); background: var(--bg2);
}
.nav-links a.active {
  color: var(--gold); background: var(--gold-dim);
  font-weight: 600;
}
[data-theme="dark"] .nav-links a:hover { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .nav-links a { color: var(--text); opacity: 1; }
[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active { opacity: 1; }

/* Link labels hidden in collapsed state */
.nav-links a .nav-label {
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.nav.expanded .nav-links a .nav-label {
  opacity: 1;
  pointer-events: auto;
}

/* Link icons — always visible */
.nav-links a .nav-icon {
  font-size: 17px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

/* Bottom section */
.nav-bottom {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 8px 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  overflow: hidden;
}
/* Hide bottom content in collapsed state — only show when expanded */
.nav-bottom > * {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.nav.expanded .nav-bottom > * {
  opacity: 1;
  pointer-events: auto;
}
.nav-guest { display: flex; flex-direction: column; gap: 7px; }
.nav-guest .btn-ghost-sm,
.nav-guest .btn-gold-sm { width: 100%; text-align: center; }

/* Theme button */
.theme-btn {
  width: 100%; height: 34px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all 0.2s; gap: 6px; color: var(--text2);
}
.theme-btn:hover { border-color: var(--text3); color: var(--text); }
[data-theme="dark"] .theme-btn { color: var(--text); opacity: 1; }
[data-theme="dark"] .theme-btn:hover { opacity: 1; }

.btn-ghost-sm {
  padding: 7px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--text2); border: 1px solid var(--border2);
  transition: all 0.2s; white-space: nowrap; display: block;
}
.btn-ghost-sm:hover { color: var(--text); }

.btn-gold-sm {
  padding: 7px 16px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, #000000 0%, var(--gold) 45%, var(--gold2) 100%);
  color: #fff; white-space: nowrap; transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--sh-gold-sm), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative; overflow: hidden;
}
[data-theme="dark"] .btn-gold-sm { color: #07090f; }
.btn-gold-sm:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-gold), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* User auth button + dropdown */
.user-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 4px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border2);
  cursor: pointer; transition: all 0.2s; position: relative;
}
.user-btn:hover { border-color: var(--text3); }
.u-av {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  flex-shrink: 0; font-family: var(--fd);
}
[data-theme="dark"] .u-av { color: #07090f; }
.u-name { font-size: 12px; font-weight: 600; color: var(--text); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-chev { font-size: 9px; color: var(--text3); }
.u-drop {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 6px; min-width: 176px;
  box-shadow: 0 14px 44px rgba(0,0,0,0.12);
  z-index: 1100; display: none; flex-direction: column; gap: 2px;
}
[data-theme="dark"] .u-drop { box-shadow: 0 14px 44px rgba(0,0,0,0.45); }
.u-drop.open { display: flex; }
.u-drop a, .u-drop button {
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text2);
  text-align: left; width: 100%; display: block;
  transition: all 0.2s; background: none; border: none;
  cursor: pointer; font-family: var(--fb);
}
.u-drop a:hover, .u-drop button:hover { background: var(--bg2); color: var(--text); }
[data-theme="dark"] .u-drop a, [data-theme="dark"] .u-drop button { color: var(--text); opacity: 1; }
[data-theme="dark"] .u-drop a:hover, [data-theme="dark"] .u-drop button:hover { opacity: 1; }
.u-drop .dd-div { height: 1px; background: var(--border); margin: 4px 0; }
.u-drop .dd-email { padding: 8px 12px; font-size: 11px; color: var(--text3); font-family: var(--fm); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  padding: 8px; margin-left: 4px; cursor: pointer;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text2); border-radius: 2px; transition: all 0.3s;
}

/* ════════════════════════════════════════════════════
   MOBILE SIDEBAR
   Fixed: added -webkit-backdrop-filter for Mobile Safari
════════════════════════════════════════════════════ */
.mob-overlay {
  display: none; position: fixed; inset: 0; z-index: 1050;
  background: rgba(0,0,0,0.4);
}
.mob-overlay.open { display: block; }

.mob-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 1060;
  width: min(286px, 82vw); background: var(--bg2);
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto; box-shadow: 8px 0 40px rgba(0,0,0,0.12);
}
[data-theme="dark"] .mob-sidebar { box-shadow: 8px 0 56px rgba(0,0,0,0.6); }
.mob-sidebar.open { transform: translateX(0); }

.mob-head {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.mob-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--fd); font-weight: 800; font-size: 14px; color: var(--text);
}
.mob-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text2); cursor: pointer; transition: all 0.2s;
}
.mob-close:hover { border-color: var(--text3); color: var(--text); }

.mob-user {
  margin: 12px 12px 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px;
  display: none; align-items: center; gap: 10px;
}
.mob-user.show { display: flex; }
.mob-u-info { flex: 1; min-width: 0; }
.mob-u-name { font-size: 13px; font-weight: 700; color: var(--text); }
.mob-u-email { font-size: 10px; color: var(--text3); font-family: var(--fm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mob-nav { padding: 10px 10px 4px; flex: 1; }
.mob-nav a {
  display: flex; align-items: center; padding: 11px 12px;
  border-radius: var(--r); font-size: 14px; font-weight: 500;
  color: var(--text2); transition: all 0.2s;
  border: 1px solid transparent; margin-bottom: 2px; text-decoration: none;
}
.mob-nav a:hover, .mob-nav a.active {
  background: var(--card); color: var(--text); border-color: var(--border);
}

.mob-div { height: 1px; background: var(--border); margin: 6px 12px; }

.mob-auth { padding: 10px 12px 16px; flex-shrink: 0; display: flex; flex-direction: column; gap: 7px; }
.mob-out { display: flex; flex-direction: column; gap: 7px; }
.mob-in { display: none; flex-direction: column; gap: 7px; }
.mob-in.show { display: flex; }
.mob-out.hide { display: none; }

.mob-alink {
  display: block; padding: 11px 14px; border-radius: var(--r);
  font-size: 14px; font-weight: 600; text-align: center;
  border: 1px solid var(--border2); color: var(--text2);
}
.mob-acta {
  display: block; padding: 11px 14px; border-radius: var(--r);
  font-size: 14px; font-weight: 700; text-align: center;
  background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #fff;
}
[data-theme="dark"] .mob-acta { color: #07090f; }
.mob-adash {
  display: block; padding: 11px 14px; border-radius: var(--r);
  font-size: 14px; font-weight: 700; text-align: center;
  background: var(--gold-dim); border: 1px solid var(--gold-glo); color: var(--gold);
}
.mob-asignout {
  display: block; width: 100%; padding: 11px 14px; border-radius: var(--r);
  font-size: 14px; font-weight: 500; text-align: center;
  background: none; border: 1px solid var(--border2); color: var(--text2);
  cursor: pointer; font-family: var(--fb);
}
.mob-theme-row {
  padding: 10px 12px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.mob-theme-row span { font-size: 13px; color: var(--text2); }
.mob-tbtn {
  padding: 6px 14px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border2);
  font-size: 12px; color: var(--text2); cursor: pointer; font-family: var(--fb);
}

/* ════════════════════════════════════════════════════
   PAGE WRAPPER
════════════════════════════════════════════════════ */
.page-wrap {
  padding-left: var(--nav-w-collapsed);
  padding-right: 0;
  padding-top: 0;
  transition: padding-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ════════════════════════════════════════════════════
   SECTIONS
════════════════════════════════════════════════════ */
/* ── Core layout primitives (design-system locked) ── */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
}

.section {
  padding: 88px 20px;
  max-width: var(--container-w);
  margin: 0 auto;
}
.section-sm   { padding: 56px 20px; max-width: var(--container-w); margin: 0 auto; }
.section-full { padding: 88px 20px; }

/* ════════════════════════════════════════════════════
   TYPOGRAPHY UTILITIES (design-system locked)
   Use .h1 / .h2 / .h3 / .text everywhere — no raw sizes.
   .sec-h = alias for .h2 (landing page section headings)
════════════════════════════════════════════════════ */
.h1 {
  font-family: var(--fd);
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.h2, .sec-h {
  font-family: var(--fd);
  font-size: clamp(28px, 3.8vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}
.h3 {
  font-family: var(--fd);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.text {
  color: var(--text2);
  font-size: 15px;
  line-height: 1.72;
  max-width: 640px;
}
.text-sm {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.65;
  max-width: 640px;
}

.label-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--fm); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}
.label-tag::before { content: ''; width: 20px; height: 1px; background: var(--gold); }

/* .sec-h is now an alias of .h2 — see Typography section above */
.sec-p {
  font-size: 17px; color: var(--text2);
  max-width: 520px; margin-top: 14px; line-height: 1.72;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border2), transparent);
  margin: 0 20px;
}

/* ════════════════════════════════════════════════════
   BUTTONS (design-system locked)
   Canonical names: .btn-primary  .btn-secondary  .btn-ghost
   Aliases kept for backwards compat: .btn-gold = .btn-primary, .btn-outline = .btn-secondary
════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: var(--r);
  font-size: 15px; font-weight: 700; letter-spacing: 0.01em;
  font-family: var(--fb); transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer; white-space: nowrap; position: relative; overflow: hidden;
}

/* Primary / Gold — the ONE gold button. Use .btn-primary everywhere.
   Legacy aliases (.btn-gold, .btn-hero-gold, .btn-cta-gold) kept for
   backwards compat — refactor pages to .btn-primary over time. */
.btn-primary, .btn-gold,
.btn-hero-gold, .btn-cta-gold {
  background: linear-gradient(135deg, #000000 0%, #161616 45%, #2b2b2b 100%);
  color: #ffffff; border: none;
  box-shadow: 0 2px 0 rgba(0,0,0,0.22), var(--sh-gold-sm), inset 0 1px 0 rgba(255,255,255,0.15);
}
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-gold,
[data-theme="dark"] .btn-hero-gold,
[data-theme="dark"] .btn-cta-gold {
  color: #0a0a0a;
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 50%, #e0e0e0 100%);
  box-shadow: 0 2px 0 rgba(0,0,0,0.40), var(--sh-gold-sm), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover, .btn-gold:hover,
.btn-hero-gold:hover, .btn-cta-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.22), var(--sh-gold), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:active, .btn-gold:active,
.btn-hero-gold:active, .btn-cta-gold:active {
  transform: translateY(0);
  box-shadow: var(--sh-gold-sm), inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Secondary / Outline */
.btn-secondary, .btn-outline {
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.06);
}
.btn-secondary:hover, .btn-outline:hover {
  border-color: var(--text3);
  background: var(--bg2);
  transform: translateY(-1px);
}
.btn-secondary:active, .btn-outline:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Ghost */
.btn-ghost {
  background: none; border: none;
  color: var(--text2); opacity: 0.75;
  letter-spacing: 0;
}
.btn-ghost:hover { opacity: 1; color: var(--text); }

/* Danger */
.btn-danger {
  background: var(--red-dim); border: 1px solid rgba(217,79,59,0.25);
  color: var(--red);
  box-shadow: 0 1px 4px rgba(217,79,59,0.1);
}
.btn-danger:hover {
  background: rgba(217,79,59,0.14);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217,79,59,0.2);
}

/* ════════════════════════════════════════════════════
   CARDS (design-system locked)
════════════════════════════════════════════════════ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh2);
  border-color: var(--gold-glo);
  background: linear-gradient(to bottom, var(--card), var(--card2));
}
.card-sm { padding: 20px; border-radius: var(--r); }

/* ════════════════════════════════════════════════════
   GRID UTILITIES
════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }

/* ════════════════════════════════════════════════════
   FORMS
════════════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 8px; letter-spacing: 0.02em;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r); color: var(--text);
  font-family: var(--fb); font-size: 15px;
  transition: all 0.2s; outline: none;
}
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea { background: var(--bg3); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--text3); box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); opacity: .6; }
.form-select {
  appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239099b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form-textarea { resize: vertical; min-height: 100px; }

/* ════════════════════════════════════════════════════
   ALERTS
════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px; border-radius: var(--r);
  font-size: 14px; margin-bottom: 16px; display: none;
}
.alert.show { display: block; }
.alert-error {
  background: var(--red-dim); border: 1px solid rgba(217,79,59,0.2); color: var(--red);
}
[data-theme="dark"] .alert-error { color: #fca5a5; }
.alert-success {
  background: var(--green-dim); border: 1px solid rgba(15,168,118,0.2); color: var(--green);
}
[data-theme="dark"] .alert-success { color: #86efac; }
.alert-info {
  background: var(--blue-dim); border: 1px solid rgba(45,110,219,0.2); color: var(--blue);
}

/* ════════════════════════════════════════════════════
   BADGES / CHIPS / TAGS
════════════════════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 100px;
  font-family: var(--fm); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.chip-gold { background: var(--gold-dim); border: 1px solid var(--gold-glo); color: var(--gold); }
.chip-green { background: var(--green-dim); border: 1px solid rgba(15,168,118,0.2); color: var(--green); }
[data-theme="dark"] .chip-green { border-color: rgba(45,212,160,0.25); }
.chip-blue { background: var(--blue-dim); border: 1px solid rgba(45,110,219,0.2); color: var(--blue); }
.chip-purple { background: var(--purple-dim); border: 1px solid rgba(124,58,237,0.2); color: var(--purple); }
.chip-new  { background: var(--gold-dim); border: 1px solid var(--gold-glo); color: var(--gold); }
.chip-live { background: var(--green-dim); border: 1px solid rgba(15,168,118,0.2); color: var(--green); }
.chip-soon { background: var(--blue-dim); border: 1px solid rgba(45,110,219,0.2); color: var(--blue); }

/* ════════════════════════════════════════════════════
   PAGE HERO
════════════════════════════════════════════════════ */
.page-hero {
  padding: 72px 20px 72px;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, var(--gold-dim) 0%, transparent 65%), var(--bg);
  position: relative; overflow: hidden;
}
[data-theme="dark"] .page-hero {
  background: radial-gradient(ellipse 90% 60% at 50% 0%, var(--gold-dim) 0%, transparent 65%), var(--bg);
}
.page-hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(0,0,0,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 20%, transparent 100%);
}
[data-theme="dark"] .page-hero-grid {
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
}
.page-hero-inner {
  max-width: var(--max-w); margin: 0 auto;
  position: relative; z-index: 1;
}
.page-hero-title {
  font-size: clamp(32px, 5.5vw, 64px);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 18px;
}
.page-hero-title em { color: var(--gold); font-style: normal; }
.page-hero-sub {
  font-size: clamp(15px, 2vw, 18px); color: var(--text2);
  max-width: 560px; line-height: 1.72; margin-bottom: 36px;
}

/* ════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════ */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 52px 20px 30px;
}
.footer-in { max-width: var(--max-w); margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
.f-brand p {
  color: var(--text2); font-size: 14px;
  line-height: 1.72; margin-top: 12px; max-width: 240px;
}
.fc h4 {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 13px;
}
.fc a { display: block; font-size: 14px; color: var(--text2); margin-bottom: 8px; transition: color 0.2s; }
.fc a:hover { color: var(--text); }
.footer-bot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 22px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text3); flex-wrap: wrap; gap: 12px;
}
.footer-legal { display: flex; gap: 16px; }
.footer-legal a { font-size: 12.5px; color: var(--text3); transition: color 0.2s; }
.footer-legal a:hover { color: var(--text); }
.footer-tbtn {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 8px; padding: 5px 12px;
  font-size: 12px; color: var(--text2); cursor: pointer;
}

/* ════════════════════════════════════════════════════
   SCROLL ANIMATIONS
════════════════════════════════════════════════════ */
.anim {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.anim.visible { opacity: 1; transform: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.anim-fade-up { animation: fadeUp 0.6s ease both; }
.anim-fade-in { animation: fadeIn 0.4s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

/* ── Mobile: nav collapses to icon-only strip; hamburger opens mob sidebar ── */
@media (max-width: 768px) {
  body { padding-left: 0 !important; padding-top: 56px !important; }
  .page-wrap { padding-left: 0 !important; }
  .nav { width: 0 !important; padding: 0 !important; border-right: none !important; box-shadow: none !important; }
  .nav * { opacity: 0 !important; pointer-events: none !important; }
  /* ── Mobile top bar with hamburger ── */
  #ig-mob-topbar {
    display: flex !important;
    position: fixed; top: 0; left: 0; right: 0; z-index: 1080;
    height: 56px; align-items: center; justify-content: space-between;
    padding: 0 16px;
    background: var(--bg2); border-bottom: 1px solid var(--border);
  }
  #ig-mob-topbar .mob-topbar-logo {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--fd); font-weight: 800; font-size: 15px; color: var(--text);
    text-decoration: none;
  }
  #ig-mob-topbar .mob-topbar-logo img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }
  #ig-mob-topbar .mob-topbar-ham {
    display: flex !important; flex-direction: column; gap: 5px;
    padding: 8px; cursor: pointer; background: none; border: none;
  }
  #ig-mob-topbar .mob-topbar-ham span {
    display: block; width: 22px; height: 2px;
    background: var(--text2); border-radius: 2px;
  }
  .section, .section-full { padding: 56px 16px; }
  .section-sm { padding: 40px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bot { flex-direction: column; align-items: flex-start; }
  .page-hero { padding-top: 48px; padding-bottom: 48px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
/* ═══════════════════════════════════
   APP MODE (Creator Studio / Dashboard)
═══════════════════════════════════ */

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-sidebar {
  width: 240px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.app-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  padding: 20px 24px;
}

.app-header {
  margin-bottom: 20px;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

@media (max-width: 1000px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  /* Sidebar visibility on mobile is controlled per-page
     (e.g. creator-studio.css handles the slide-in). */
}

/* Image save/drag deterrent — scoped to pages with class "protect-page"
   (currently: homepage, portfolio). This is a deterrent for casual
   right-click/drag/long-press saving only; it cannot block screenshots
   or screen recording, which happen outside the browser's control. */
body.protect-page img {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none; /* disables iOS long-press "Save Image" menu */
  pointer-events: auto; /* keep clicks (e.g. lightbox) working */
}
