/* ============================================
   SIGN — Design System v2
   Aesthetic: Warm Amber Neutral
   Fonts: Outfit (display) + DM Sans (body)
   Single theme — soft stone surfaces with orange icons
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── Design tokens ─────────────────────────── */
:root {
  /* Warm neutral palette */
  --bg:          #f4efe6;
  --surface:     #fffaf2;
  --surface-2:   #f7efe3;
  --surface-3:   #eadcc9;
  --surface-hover: #f0e2ce;

  --border:      rgba(93, 67, 42, 0.14);
  --border-2:    rgba(93, 67, 42, 0.08);
  --border-focus: rgba(217, 120, 30, 0.42);

  --text:        #2d261f;
  --text-2:      #6f6255;
  --text-3:      #9a8a78;

  --accent:      #d9781e;
  --accent-hover: #b96117;
  --accent-subtle: rgba(217, 120, 30, 0.13);
  --accent-glow:  rgba(217, 120, 30, 0.18);
  --accent-ink:  #2d1f13;

  --danger:      #c94e42;
  --danger-subtle: rgba(201, 78, 66, 0.12);
  --success:     #3f8f68;
  --success-subtle: rgba(63, 143, 104, 0.12);
  --info:        #4a7f9f;
  --info-subtle: rgba(74, 127, 159, 0.12);
  --warning:     #c48728;
  --warning-subtle: rgba(196, 135, 40, 0.14);

  --shadow-sm: 0 8px 18px rgba(66, 45, 26, 0.08);
  --shadow-md: 0 16px 36px rgba(66, 45, 26, 0.11);
  --shadow-lg: 0 26px 68px rgba(66, 45, 26, 0.16);

  --header-h:      56px;
  --header-offset: 56px;

  --font-display: 'Outfit', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Scrollbar */
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;

  --dc-bg: var(--bg);
  --dc-surface: var(--surface);
  --dc-surface-alt: var(--surface-2);
  --dc-surface-soft: var(--surface-3);
  --dc-border: var(--border);
  --dc-text: var(--text);
  --dc-muted: var(--text-2);
  --dc-accent: var(--accent);
  --dc-accent-hover: var(--accent-hover);
  --dc-danger: var(--danger);
  --dc-danger-hover: #a83e35;

  scrollbar-color: var(--surface-3) transparent;
}

/* ── Reset & base ──────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

*::-webkit-scrollbar        { width: 4px; height: 4px; }
*::-webkit-scrollbar-track  { background: transparent; }
*::-webkit-scrollbar-thumb  { background: var(--surface-3); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  background: linear-gradient(180deg, var(--bg) 0%, #eee3d5 100%) fixed;
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  padding-top: var(--header-offset);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.home-page {
  padding-top: 0;
}

main {
  width: 100%;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--text);
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

a, button {
  touch-action: manipulation;
}

code {
  word-break: break-all;
}

/* ============================================
   HEADER — Clean, minimal, no glassmorphism
   ============================================ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 900;
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s var(--ease);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: 0 20px;
}

/* ── Logo ── */
.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1;
}

.logo img {
  display: block;
  height: 32px;
  transition: opacity 0.15s;
}

.logo:hover img {
  opacity: 0.7;
}

/* ── Mobile hamburger ── */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
  z-index: 1;
}

.mobile-menu-toggle:hover,
html.mobile-nav-open .mobile-menu-toggle {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-focus);
}

.mobile-menu-toggle i {
  font-size: 13px;
  transition: transform 0.25s var(--ease-out);
}

html.mobile-nav-open .mobile-menu-toggle i {
  transform: rotate(90deg);
}

/* ============================================
   NAVIGATION — Dropdown (mobile)
   ============================================ */

.site-nav {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: min(280px, calc(100vw - 32px));
  z-index: 1100;
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);

  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);

  max-height: calc(100dvh - var(--header-h) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

html.mobile-nav-open .site-nav {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.site-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-nav-primary,
.site-nav-account {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
}

.site-nav-account {
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.site-nav li {
  display: block;
}

.site-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.12s var(--ease);
}

.site-nav a:hover {
  color: var(--text);
  background: var(--accent-subtle);
}

.nav-icon {
  width: 16px;
  text-align: center;
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
  opacity: 0.8;
}

/* Backdrop */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(45, 38, 31, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

html.mobile-nav-open .mobile-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   NAVIGATION — Desktop (≥ 860px)
   ============================================ */

@media (min-width: 860px) {
  .mobile-menu-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    width: auto;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 0 0 8px;
    max-height: none;
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    transition: none;
    border-radius: 0;
  }

  .site-nav-groups {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
  }

  .site-nav-primary,
  .site-nav-account {
    flex-direction: row;
    align-items: center;
    gap: 1px;
  }

  .site-nav-account {
    padding-top: 0;
    border-top: none;
    margin-top: 0;
  }

  .site-nav a {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .mobile-nav-backdrop {
    display: none !important;
  }
}

/* ============================================
   NAV EXTRAS
   ============================================ */

.nav-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

/* ============================================
   AUTH TOAST
   ============================================ */

.auth-required-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
}

.auth-required-toast-card {
  width: min(320px, calc(100vw - 32px));
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-required-toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-required-toast-head strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.auth-required-toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.12s;
}

.auth-required-toast-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.auth-required-toast p {
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}

.auth-required-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  transition: all 0.15s var(--ease);
}

.auth-required-login-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ============================================
   FOOTER — Minimal, grounded
   ============================================ */

footer {
  width: 100%;
  background: var(--surface);
  color: var(--text-2);
  text-align: center;
  padding: 40px 20px 28px;
  border-top: 1px solid var(--border);
}

footer .social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

footer .social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  font-size: 15px;
  transition: all 0.15s var(--ease);
}

footer .social a:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
}

.footer-legal-links span[aria-hidden] {
  color: var(--text-3);
}

.footer-legal-links a {
  color: var(--text-2);
  font-weight: 500;
  transition: color 0.12s;
}

.footer-legal-links a:hover {
  color: var(--accent);
}

footer p {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
}

/* ============================================
   LEGAL PAGES
   ============================================ */

.legal-page {
  padding: 48px 20px 80px;
}

.legal-shell {
  width: min(860px, 100%);
  margin: 0 auto;
}

.legal-eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.legal-page h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--text);
}

.legal-updated {
  margin: 0 0 24px;
  color: var(--text-2);
  font-size: 14px;
}

.legal-card {
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
}

.legal-section + .legal-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.legal-section h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  color: var(--text);
  font-size: 18px;
}

.legal-section p,
.legal-section li {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.8;
}

.legal-section ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

/* ============================================
   ENTRANCE ANIMATION
   ============================================ */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

main > * {
  animation: fadeSlideUp 0.4s var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  main > * { animation: none; }
}
