/* ══════════════════════════════════════════════════════════════
   OwnIt — global.css
   Brand system, theme tokens, typography, nav, footer, buttons, orbs
══════════════════════════════════════════════════════════════ */

/* ── Elms Sans (locally installed / bundled) ── */
@font-face {
  font-family: 'Elms Sans';
  src: url('/fonts/ElmsSans-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --mid:      #14110F;
  --mid2:     #1C1814;
  --mid3:     #2A241E;
  --strike:   #E4B84A;
  --strike-bright: #F3D078;
  --strike-deep:   #C49A32;
  --ignite:   #E05A3C;
  --clarity:  #6A9B96;
  --parch:    #F4EDE4;
  --growth:   #3D9B74;
  --ink:      #14110F;
  --strike-rgb: 228, 184, 74;
  --ignite-rgb: 224, 90, 60;
  --ink-rgb:    20, 17, 15;

  --fh: 'Elms Sans', sans-serif;
  --fb: 'Elms Sans', sans-serif;

  /* ── Surfaces ── */
  --bg-app: var(--mid);
  --bg-elevated: var(--mid2);
  --bg-ambient: radial-gradient(ellipse 70% 50% at 88% -10%, rgba(var(--strike-rgb), 0.16), transparent 58%);

  /* ── Liquid glass (hierarchy: subtle → regular → strong) ── */
  --glass-subtle: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  --glass:        linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.08) 100%);
  --glass-strong: linear-gradient(155deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.06) 48%, rgba(255,255,255,0.10) 100%);
  --glass-border: rgba(255,255,255,0.16);
  --glass-border-strong: rgba(255,255,255,0.24);
  --glass-highlight: inset 0 1px 0 rgba(255,255,255,0.38);
  --glass-blur:   blur(28px) saturate(160%);
  --glass-blur-strong: blur(40px) saturate(180%);
  --glass-spec:   inset 0 1.5px 0 rgba(255,255,255,0.4), inset 1px 0 0 rgba(255,255,255,0.1), inset -1px 0 0 rgba(255,255,255,0.04), inset 0 -1.5px 0 rgba(0,0,0,0.08);
  --glass-shadow: 0 18px 48px rgba(0,0,0,0.32), 0 4px 12px rgba(0,0,0,0.18);
  --shadow-card: 0 12px 32px rgba(0,0,0,0.22);
  --shadow-float: 0 20px 56px rgba(0,0,0,0.36);
  --shadow-modal: 0 32px 80px rgba(0,0,0,0.5);
  --radius-card: 20px;
  --radius-panel: 24px;
  --radius-btn: 12px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --motion-fast: 140ms;
  --motion-std: 220ms;
  --motion-sheet: 300ms;

  /* semantic text tokens */
  --t1: #ffffff;
  --t2: rgba(255,255,255,0.68);
  --t3: rgba(255,255,255,0.46);
  --t4: rgba(255,255,255,0.28);
  --surface:  rgba(255,255,255,0.06);
  --surface2: rgba(255,255,255,0.10);
  --surface-solid: #1C1814;
  --border:   rgba(255,255,255,0.1);
  --accent:   var(--strike);
  --type-display: clamp(36px, 6vw, 64px);
  --type-page: 28px;
  --type-section: 18px;
  --type-card: 16px;
  --type-body: 15px;
  --type-secondary: 13px;
  --type-caption: 12px;
}

[data-theme="light"] {
  --mid:  #F4EFE6;
  --mid2: #FFFBF4;
  --mid3: #EBE3D6;
  --bg-app: #F4EFE6;
  --bg-elevated: #FFFBF4;
  --bg-ambient: radial-gradient(ellipse 80% 55% at 88% -8%, rgba(243, 208, 120, 0.38), transparent 58%);
  --glass-subtle: linear-gradient(145deg, rgba(255,255,255,0.72) 0%, rgba(255,251,244,0.5) 100%);
  --glass: linear-gradient(145deg, rgba(255,255,255,0.78) 0%, rgba(255,251,244,0.58) 50%, rgba(255,255,255,0.7) 100%);
  --glass-strong: linear-gradient(155deg, rgba(255,255,255,0.9) 0%, rgba(255,251,244,0.72) 100%);
  --glass-border: rgba(20,17,15,0.08);
  --glass-border-strong: rgba(20,17,15,0.12);
  --glass-highlight: inset 0 1px 0 rgba(255,255,255,0.95);
  --glass-blur:   blur(22px) saturate(140%);
  --glass-blur-strong: blur(32px) saturate(150%);
  --glass-spec:   inset 0 1px 0 rgba(255,255,255,0.92), inset 1px 0 0 rgba(255,255,255,0.35), inset -1px 0 0 rgba(20,17,15,0.04), inset 0 -1px 0 rgba(20,17,15,0.05);
  --glass-shadow: 0 16px 40px rgba(20,17,15,0.08), 0 4px 12px rgba(20,17,15,0.04);
  --shadow-card: 0 10px 28px rgba(20,17,15,0.07);
  --shadow-float: 0 18px 48px rgba(20,17,15,0.12);
  --shadow-modal: 0 28px 72px rgba(20,17,15,0.18);
  --surface-solid: #FFFBF4;
  --t1: #1A1612;
  --t2: rgba(20,17,15,0.65);
  --t3: rgba(20,17,15,0.5);
  --t4: rgba(20,17,15,0.38);
  --surface:  rgba(255, 255, 255, 0.82);
  --surface2: #FFF8EE;
  --border:   rgba(20, 17, 15, 0.1);
  --accent:   var(--ignite);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--fb);
  background-color: var(--mid);
  background-image: var(--bg-ambient);
  color: var(--t1);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}
[data-theme="light"] body {
  background-color: #F4EFE6;
  background-image:
    radial-gradient(ellipse 80% 55% at 88% -8%, rgba(243, 208, 120, 0.42), transparent 58%),
    radial-gradient(ellipse 45% 40% at 0% 100%, rgba(224, 90, 60, 0.08), transparent 55%);
}
/* Grain texture — one full-viewport sheet (no 300px tile seam) */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2000' height='2000'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='2000' height='2000' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.028; pointer-events: none; z-index: 1;
}
[data-theme="light"] body::after { opacity: 0.028; mix-blend-mode: multiply; }

/* Dark aurora reads as mud on parchment — use the CSS wash instead. */
[data-theme="light"] .aurora-root {
  opacity: 0;
  visibility: hidden;
}

.hidden { display: none !important; }

/* ── Background orbs ── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(120px);
  opacity: 0.1;
  animation: orb-drift 36s infinite alternate ease-in-out;
}
.orb-1 {
  width: 820px; height: 820px; background: var(--strike);
  top: -280px; right: -180px;
  animation-duration: 24s;
}
.orb-2 {
  width: 640px; height: 640px; background: var(--clarity);
  bottom: 10%; left: -200px;
  animation-duration: 28s; animation-delay: -10s;
}
.orb-3 {
  width: 400px; height: 400px; background: var(--ignite);
  bottom: 0; right: 10%;
  opacity: 0.12;
  animation-duration: 18s; animation-delay: -5s;
}

@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-50px, 35px) scale(1.06); }
}

[data-theme="light"] .orb { opacity: 0.22; }
[data-theme="light"] .orb-3 { opacity: 0.15; }

/* ── Liquid glass utility ── */
.glass {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  position: relative;
}
.glass-subtle {
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
}
.glass-strong {
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--glass-highlight), var(--shadow-float);
}
.surface-solid {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: none;
}

.btn-primary:disabled, .btn-secondary:disabled, .btn-ghost:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none; pointer-events: none;
}
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-ghost:focus-visible, .icon-btn:focus-visible {
  outline: 2px solid var(--strike);
  outline-offset: 3px;
}
.btn-danger {
  font-family: var(--fb); font-size: 14px; font-weight: 600; color: #fff;
  padding: 11px 22px; border: none; border-radius: var(--radius-btn);
  background: var(--ignite); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) ease;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(var(--ignite-rgb),0.35); }
.btn-danger:active { transform: scale(0.98); }

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

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
section { position: relative; z-index: 1; }

/* ── Top Nav (landing) ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 70px; padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(20,17,15,0.52) 0%, rgba(15,13,11,0.42) 100%);
  backdrop-filter: blur(52px) saturate(200%) brightness(1.05);
  -webkit-backdrop-filter: blur(52px) saturate(200%) brightness(1.05);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -1px 0 rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.2);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
[data-theme="light"] .nav {
  background: linear-gradient(180deg, rgba(255,255,255,0.78) 0%, rgba(245,243,255,0.68) 100%);
  border-bottom-color: rgba(255,255,255,0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), inset 0 -1px 0 rgba(20,17,15,0.05), 0 8px 32px rgba(20,17,15,0.1);
}
.nav.scrolled {
  background: linear-gradient(180deg, rgba(15,13,11,0.88) 0%, rgba(10,9,8,0.82) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 12px 48px rgba(0,0,0,0.3);
}
[data-theme="light"] .nav.scrolled {
  background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(248,246,255,0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.98), 0 8px 32px rgba(20,17,15,0.12);
}

.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
.nav-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, var(--strike-bright) 0%, var(--strike) 55%, var(--strike-deep) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(var(--strike-rgb),0.45), inset 0 1px 0 rgba(255,255,255,0.5);
}
.nav-wordmark { font-family: var(--fh); font-size: 20px; font-weight: 800; color: var(--t1); letter-spacing: -0.3px; }
.nav-wordmark span { color: var(--strike); }
[data-theme="light"] .nav-wordmark span { color: #9A6B12; }

.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav-links a { font-family: var(--fb); font-size: 14px; color: var(--t2); text-decoration: none; transition: color 0.2s; cursor: pointer; }
.nav-links a:hover { color: var(--t1); }
.nav-cta { display: flex; gap: 10px; align-items: center; }

.nav-theme-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 4px 12px rgba(0,0,0,0.2);
  color: var(--t2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  transition: all 0.22s var(--ease-spring);
}
[data-theme="light"] .nav-theme-btn {
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(245,243,255,0.7));
  border-color: rgba(255,255,255,0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.98), 0 4px 12px rgba(20,17,15,0.08);
}
.nav-theme-btn:hover { color: var(--t1); transform: rotate(15deg) scale(1.08); border-color: var(--t3); }

/* ── Buttons ── */
.btn-ghost {
  font-family: var(--fb); font-size: 13px; color: var(--t2);
  padding: 8px 18px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.28); color: var(--t1); background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05)); }

.btn-primary {
  font-family: var(--fh); font-size: 14px; font-weight: 700; color: var(--ink);
  padding: 11px 22px; border: none; border-radius: 11px;
  background: linear-gradient(145deg, var(--strike-bright) 0%, var(--strike) 50%, var(--strike-deep) 100%);
  box-shadow: 0 8px 28px rgba(var(--strike-rgb),0.45), inset 0 1.5px 0 rgba(255,255,255,0.5), inset 0 -1px 0 rgba(0,0,0,0.12);
  cursor: pointer; transition: all 0.25s var(--ease-spring);
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(var(--strike-rgb),0.55), inset 0 1.5px 0 rgba(255,255,255,0.5);
}
[data-theme="light"] .btn-primary {
  box-shadow: 0 8px 24px rgba(var(--strike-rgb),0.28), inset 0 1.5px 0 rgba(255,255,255,0.55);
}
.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-secondary {
  font-family: var(--fb); font-size: 14px; color: var(--t1);
  padding: 11px 22px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.28), inset 0 -1px 0 rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.2);
  cursor: pointer; transition: all 0.2s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-secondary:hover {
  border-color: rgba(255,255,255,0.3);
  background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.07));
  transform: translateY(-1px);
}
[data-theme="light"] .btn-secondary {
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(245,243,255,0.75));
  border-color: rgba(255,255,255,0.92);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.98), 0 8px 24px rgba(20,17,15,0.1);
  color: var(--t1);
}

.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 15px 30px; font-size: 15px; border-radius: 13px; }

/* ── Section headings ── */
.s-label { font-family: var(--fb); font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.s-h2 { font-family: var(--fh); font-size: clamp(32px, 4vw, 52px); font-weight: 800; line-height: 1.1; letter-spacing: -1px; margin-bottom: 16px; color: var(--t1); }
.s-sub { font-family: var(--fb); font-size: 16px; color: var(--t3); line-height: 1.72; max-width: 540px; }

/* ── Footer ── */
footer { border-top: 1px solid var(--border); padding: 64px 0 40px; position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 56px; margin-bottom: 52px; }
.footer-brand-desc { font-family: var(--fb); font-size: 13px; color: var(--t3); line-height: 1.72; max-width: 240px; margin-top: 16px; }
.footer-col-head { font-family: var(--fh); font-size: 12px; font-weight: 700; color: var(--t2); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 18px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer-links a { font-family: var(--fb); font-size: 13px; color: var(--t3); text-decoration: none; transition: color 0.2s; cursor: pointer; }
.footer-links a:hover { color: var(--t1); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; border-top: 1px solid var(--border); }
.footer-copy { font-family: var(--fb); font-size: 12px; color: var(--t4); }
.footer-tag { font-family: var(--fh); font-size: 12px; font-weight: 700; color: var(--accent); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  backdrop-filter: blur(48px) saturate(220%);
  -webkit-backdrop-filter: blur(48px) saturate(220%);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 12px 22px; border-radius: 16px;
  font-family: var(--fb); font-size: 13px; color: var(--t1);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.4), 0 24px 60px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease-spring);
  z-index: 3000; display: flex; align-items: center; gap: 10px;
}
[data-theme="light"] .toast {
  background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(248,246,255,0.82));
  border-color: rgba(255,255,255,0.95);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.98), 0 24px 60px rgba(20,17,15,0.18);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { color: var(--accent); font-size: 16px; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .nav { padding: 0 24px; }
  .nav-links { display: none; }
  .container { padding: 0 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 600px) {
  .nav-cta .btn-ghost { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 14px; text-align: center; }
}
