/* ==========================================================
   TOASTLYTICS — legal.css
   Shared styles for Privacy Policy + Terms & Conditions pages.
   Extends the main design system (same tokens, fonts, nav, footer).

   Sections:
   1. Fonts & Tokens
   2. Reset & Base
   3. Animations & Utilities
   4. NAV
   5. MOBILE NAV
   6. LEGAL PAGE LAYOUT
   7. LEGAL CONTENT TYPOGRAPHY
   8. FOOTER
   9. RESPONSIVE
   ========================================================== */

/* ==========================================================
   1. FONTS & TOKENS
   ========================================================== */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,700;0,9..144,900;1,9..144,400;1,9..144,700;1,9..144,900&family=DM+Mono:wght@300;400;500&family=DM+Sans:wght@300;400;500;600&display=swap");

:root {
  --bg: #0c0a08;
  --surface: #131109;
  --surface2: #1a1710;
  --surface3: #252219;
  --border: rgba(245, 200, 66, 0.08);
  --border2: rgba(245, 200, 66, 0.16);
  --accent: #f5c842;
  --accent2: #ff8c42;
  --accent3: #42c9a0;
  --red: #ff5c5c;
  --text: #f0e8d8;
  --text2: #9a8f78;
  --text3: #5a5240;
  --ff: "Fraunces", serif;
  --fm: "DM Mono", monospace;
  --fs: "DM Sans", sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

/* ==========================================================
   2. RESET & BASE
   ========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fs);
  overflow-x: hidden;
  line-height: 1.6;
}

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

::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 2px;
}

/* ==========================================================
   3. ANIMATIONS & UTILITIES
   ========================================================== */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes b-rise1 {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0);
  }
  20% {
    opacity: 0.85;
  }
  80% {
    opacity: 0.15;
    transform: translateY(-12px);
  }
}
@keyframes b-rise3 {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0);
  }
  20% {
    opacity: 0.75;
  }
  80% {
    opacity: 0.15;
    transform: translateY(-14px);
  }
}
@keyframes chart-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 3px rgba(0, 229, 160, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 9px rgba(0, 229, 160, 0.9));
  }
}
@keyframes flute-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 2px rgba(245, 200, 66, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(245, 200, 66, 0.7));
  }
}

.flute-b1 {
  animation: b-rise1 3s ease-in-out infinite;
}
.flute-b3 {
  animation: b-rise3 2.8s ease-in-out infinite 1.2s;
}
.flute-chart {
  animation: chart-glow 4s ease-in-out infinite;
}
.flute-body {
  animation: flute-glow 5s ease-in-out infinite;
}

.logo-shimmer {
  background: linear-gradient(135deg, #f5c842, #ff8c42, #f5c842);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}
.logo-serif {
  color: var(--text);
  font-style: italic;
}

.page-enter {
  animation: fadeUp 0.5s ease forwards;
}

/* ==========================================================
   4. NAV  (identical to main site nav)
   ========================================================== */
nav#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 clamp(20px, 5vw, 60px);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(12, 10, 8, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo-text {
  font-family: var(--ff);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.5px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  transition: all 0.2s;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-cta {
  padding: 9px 20px;
  border-radius: 10px;
  margin-left: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0c0a08;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  font-family: var(--ff);
  font-style: italic;
  transition: all 0.2s;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(245, 200, 66, 0.3);
}

.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  padding: 4px;
  line-height: 1;
}

/* ==========================================================
   5. MOBILE NAV
   ========================================================== */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 8, 0.98);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.mobile-nav.open {
  display: flex;
  animation: fadeUp 0.25s ease;
}

.mobile-nav-link {
  color: var(--text);
  text-decoration: none;
  font-family: var(--ff);
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  transition: color 0.2s;
}
.mobile-nav-link:hover {
  color: var(--accent);
}

.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

/* ==========================================================
   6. LEGAL PAGE LAYOUT
   ========================================================== */

/* Hero banner at top of each legal page */
.legal-hero {
  padding: 120px clamp(20px, 5vw, 60px) 60px;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    160deg,
    rgba(245, 200, 66, 0.04) 0%,
    var(--bg) 60%
  );
}
.legal-hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.legal-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
  border: 1px solid var(--border2);
  background: rgba(245, 200, 66, 0.06);
  font-family: var(--fm);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.legal-tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent3);
}

.legal-title {
  font-family: var(--ff);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 16px;
}
.legal-title em {
  font-style: italic;
  color: var(--accent);
}

.legal-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--fm);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 1px;
  margin-top: 20px;
}
.legal-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legal-meta-item span {
  color: var(--text2);
}

/* Main content + sidebar layout */
.legal-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 60px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 60px clamp(20px, 5vw, 60px) 160px;
  position: relative;
  z-index: 1;
  align-items: start;
}

/* Sticky sidebar — table of contents */
.legal-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 12px;
}
/* Hide scrollbar for clean look but keep functionality */
.legal-toc::-webkit-scrollbar {
  width: 2px;
}
.legal-toc::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 10px;
}
.legal-toc-title {
  font-family: var(--fm);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.legal-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.legal-toc-list a {
  display: block;
  font-family: var(--fm);
  font-size: 12px;
  color: var(--text3);
  text-decoration: none;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  transition: all 0.2s;
  line-height: 1.4;
}
.legal-toc-list a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(245, 200, 66, 0.05);
}
.legal-toc-list a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(245, 200, 66, 0.06);
}

/* Main article */
.legal-article {
  min-width: 0;
}

/* ==========================================================
   7. LEGAL CONTENT TYPOGRAPHY
   ========================================================== */

/* Section block */
.legal-section {
  margin-bottom: 52px;
}
.legal-section:last-child {
  margin-bottom: 0;
}

/* Section heading with number badge */
.legal-h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--ff);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 96px;
}
.legal-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(245, 200, 66, 0.1);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fm);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  font-style: normal;
}

.legal-h3 {
  font-family: var(--ff);
  font-weight: 700;
  font-style: italic;
  font-size: 17px;
  color: var(--text);
  margin: 24px 0 10px;
}

/* Body paragraphs */
.legal-p {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.85;
  margin-bottom: 14px;
}
.legal-p:last-child {
  margin-bottom: 0;
}
.legal-p a {
  color: var(--accent);
  text-decoration: none;
}
.legal-p a:hover {
  text-decoration: underline;
}
.legal-p strong {
  color: var(--text);
  font-weight: 600;
}

/* Bulleted list */
.legal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 14px;
}
.legal-list li {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  padding-left: 20px;
  position: relative;
}
.legal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.legal-list li a {
  color: var(--accent);
  text-decoration: none;
}

/* Highlight callout box */
.legal-callout {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 20px;
  margin: 20px 0;
}
.legal-callout p {
  font-family: var(--fm);
  font-size: 13px;
  color: var(--text2);
  line-height: 1.75;
  margin: 0;
}
.legal-callout p strong {
  color: var(--accent);
}

/* Contact box */
.legal-contact {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  margin-top: 24px;
  position: relative;
  overflow: hidden;
}
.legal-contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.legal-contact-title {
  font-family: var(--ff);
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  margin-bottom: 10px;
}
.legal-contact p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 8px;
}
.legal-contact p:last-child {
  margin-bottom: 0;
}
.legal-contact a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--fm);
  font-size: 13px;
}
.legal-contact a:hover {
  text-decoration: underline;
}

/* ==========================================================
   8. FOOTER
   ========================================================== */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 52px clamp(20px, 5vw, 60px) 32px;
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.footer-brand {
  max-width: 280px;
}
.footer-brand-name {
  font-family: var(--ff);
  font-weight: 900;
  font-size: 22px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 0;
}
.footer-brand-text {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
}

.footer-links {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.footer-col h4 {
  font-family: var(--fm);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.footer-copy {
  font-family: var(--fm);
  font-size: 11px;
  color: var(--text3);
}
.footer-email {
  font-family: var(--fm);
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
}
.footer-email:hover {
  text-decoration: underline;
}
.footer-tagline {
  font-family: var(--fm);
  font-size: 11px;
  color: var(--text3);
}

/* ==========================================================
   9. RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-menu-btn {
    display: block;
  }

  /* Collapse sidebar below content on mobile */
  .legal-body {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .legal-toc {
    position: static;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px 24px;
    margin-bottom: 40px;
  }

  .footer-top {
    flex-direction: column;
  }
  .footer-links {
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .legal-hero {
    padding-top: 100px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
