/* ============================================
   Stick ID — Website Design System
   Matches iOS app dark fantasy RPG aesthetic
   ============================================ */

/* Palette mirrors iOS DesignSystem/Colors.swift (warm amber-brown, wood
 * tones — no greens). Keep hex values in sync when AppColors changes. */

/* Dark theme (default) */
:root,
[data-theme="dark"] {
  --bg-deep: #0A0A0F;
  --bg-card: #12131A;
  --bg-card-inner: #1A1B25;
  --bg-section: #161722;
  --bg-elevated: #1E1F2C;
  --text-primary: #E8E4D9;
  --text-secondary: #9A978C;
  --text-dim: #5A584F;
  --text-inverse: #0A0A0F;
  --accent-gold: #C4944A;
  --accent-green: #8B7355;
  --accent-moss: #A08060;
  --accent-ember: #B85C3A;
  --accent-purple: #7A5C8F;
  --nav-bg: rgba(10, 10, 15, 0.88);
  --border-accent: rgba(196, 148, 74, 0.12);
  --border-accent-light: rgba(196, 148, 74, 0.08);
  --border-row: rgba(255, 255, 255, 0.03);
  --grad-tl: rgba(196, 148, 74, 0.05);
  --grad-br: rgba(160, 128, 96, 0.04);
  --screen-padding: 16px;
  --card-padding: 20px;
  --radius-medium: 10px;
  --radius-large: 14px;
}

/* Light theme */
[data-theme="light"] {
  --bg-deep: #F5F3EE;
  --bg-card: #FFFFFF;
  --bg-card-inner: #F0EDE6;
  --bg-section: #F8F6F1;
  --bg-elevated: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-dim: #ABABAB;
  --text-inverse: #FFFFFF;
  --accent-gold: #C4944A;
  --accent-green: #8B7355;
  --accent-moss: #A08060;
  --accent-ember: #B85C3A;
  --accent-purple: #7A5C8F;
  --nav-bg: rgba(245, 243, 238, 0.92);
  --border-accent: rgba(196, 148, 74, 0.22);
  --border-accent-light: rgba(196, 148, 74, 0.15);
  --border-row: rgba(0, 0, 0, 0.04);
  --grad-tl: rgba(196, 148, 74, 0.05);
  --grad-br: rgba(160, 128, 96, 0.03);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Crimson Pro', Georgia, serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 17px;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 10%, var(--grad-tl) 0%, transparent 60%),
    radial-gradient(ellipse at 90% 90%, var(--grad-br) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.3s;
}

/* ---- Layout ---- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-accent);
  transition: background 0.3s, border-color 0.3s;
}

.nav-inner {
  max-width: 100%;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.nav-logo-text {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  justify-self: center;
}

/* Right-side nav slot holding the theme toggle (and the mobile hamburger).
 * On desktop the 3-column grid cell would leave the toggle left-aligned
 * inside an empty 1fr column; `justify-self: end` pushes the whole flex
 * row to the right edge so the toggle sits flush with the nav edge. */
.nav-right-mobile {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

/* ---- Theme Toggle ---- */
/* iOS-style switch: the track colour flips between bg-card (dark mode) and
 * accent-gold (light mode); the knob slides across. No icons inside — they
 * used to leak through behind the knob on small sizes. */
.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  width: 48px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, background 0.3s;
}

[data-theme="light"] .theme-toggle {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

[data-theme="light"] .theme-toggle::after {
  transform: translateX(20px);
  background: #fff;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: 0.3px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-gold);
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 72px 0 48px;
}

.hero-icon {
  display: block;
  margin: 0 auto 28px;
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(196, 148, 74, 0.15), 0 0 0 1px rgba(196, 148, 74, 0.1);
}

.hero-badge {
  display: inline-block;
  font-family: 'Crimson Pro', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
  background: rgba(196, 148, 74, 0.08);
  border: 1px solid rgba(196, 148, 74, 0.12);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 46px;
  line-height: 1.12;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.65;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-green));
  color: var(--text-inverse);
  text-decoration: none;
  border-radius: 12px;
  font-family: 'Crimson Pro', serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(196, 148, 74, 0.25);
}

.hero-cta svg {
  width: 20px;
  height: 20px;
}

/* ---- Section Title ---- */
.section-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-accent);
  margin-bottom: 24px;
  margin-top: 56px;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent-light);
  border-radius: var(--radius-large);
  padding: var(--card-padding);
  margin-bottom: 12px;
  transition: background 0.3s, border-color 0.3s;
}

/* ---- Features Grid ---- */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent-light);
  border-radius: var(--radius-large);
  padding: 28px 20px;
  text-align: center;
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(196, 148, 74, 0.15);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 14px;
  display: block;
}

.feature-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

/* ---- How It Works ---- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 20px;
  position: relative;
}

.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-row);
}

.step:last-child { border-bottom: none; }

.step-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: rgba(196, 148, 74, 0.1);
  border: 1px solid rgba(196, 148, 74, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-gold);
}

.step-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.step-content p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ---- Rarity Table ---- */
.rarity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-row);
}

.rarity-row:last-child { border-bottom: none; }

.rarity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 10px;
  display: inline-block;
  flex-shrink: 0;
}

.rarity-name {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  font-size: 15px;
}

.rarity-desc {
  color: var(--text-dim);
  font-size: 14px;
}

/* ---- Contact Card ---- */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-large);
  padding: 36px;
  text-align: center;
  margin-top: 48px;
  transition: background 0.3s, border-color 0.3s;
}

.contact-card h2 {
  margin-top: 0;
  font-size: 20px;
}

.contact-email {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 28px;
  background: rgba(196, 148, 74, 0.08);
  border: 1px solid rgba(196, 148, 74, 0.15);
  border-radius: 10px;
  color: var(--accent-gold);
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.contact-email:hover {
  background: rgba(196, 148, 74, 0.14);
}

/* ---- Page Header ---- */
.page-header {
  padding: 56px 0 28px;
  text-align: center;
  border-bottom: 1px solid var(--border-accent);
  margin-bottom: 36px;
}

.page-header-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(196, 148, 74, 0.1);
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 34px;
}

.page-header .subtitle {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  margin-top: 6px;
}

/* ---- Content Typography ---- */
h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 22px;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 18px;
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

p {
  margin-bottom: 14px;
  color: var(--text-secondary);
}

ul, ol {
  margin-bottom: 14px;
  padding-left: 24px;
  color: var(--text-secondary);
}

li { margin-bottom: 6px; }

strong {
  color: var(--text-primary);
  font-weight: 600;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover { opacity: 0.8; }

/* ---- Legal Content ---- */
.legal-content { padding-bottom: 40px; }
.legal-content h2:first-child { margin-top: 0; }

.legal-content > ul {
  list-style: none;
  padding-left: 0;
}

.legal-content > ul > li {
  position: relative;
  padding-left: 18px;
}

.legal-content > ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-gold);
  opacity: 0.4;
}

/* ---- Table ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
}

th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-accent);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-row);
  color: var(--text-secondary);
}

/* ---- FAQ Cards ---- */
.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent-light);
  border-radius: var(--radius-large);
  padding: 20px 24px;
  margin-bottom: 10px;
  transition: background 0.3s, border-color 0.3s;
}

.faq-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--accent-gold);
}

.faq-card p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Footer ---- */
.footer {
  margin-top: 64px;
  padding: 28px 0 32px;
  border-top: 1px solid var(--border-accent-light);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}

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

.footer-copy {
  color: var(--text-dim);
  font-size: 13px;
}

/* ---- Light mode card shadow ---- */
[data-theme="light"] .card,
[data-theme="light"] .feature-card,
[data-theme="light"] .faq-card,
[data-theme="light"] .contact-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .hero-icon {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .hero h1 {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .step-number {
  background: rgba(196, 148, 74, 0.08);
  border-color: rgba(196, 148, 74, 0.15);
}

[data-theme="light"] .hero-badge {
  background: rgba(196, 148, 74, 0.06);
  border-color: rgba(196, 148, 74, 0.12);
}

[data-theme="light"] .contact-email {
  background: rgba(196, 148, 74, 0.06);
  border-color: rgba(196, 148, 74, 0.15);
}

[data-theme="light"] .contact-email:hover {
  background: rgba(196, 148, 74, 0.1);
}

/* ---- Hamburger Button ---- */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 28px;
  height: 28px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Mobile Menu Overlay ---- */
.nav-mobile-menu {
  display: none;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .hero { padding: 48px 0 36px; }
  .hero-icon { width: 72px; height: 72px; border-radius: 18px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .page-header { padding: 40px 0 24px; }
  .page-header h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  .contact-card { padding: 28px 20px; }

  /* Nav: logo left, hamburger+toggle right */
  .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
  }

  .nav-logo img { width: 28px; height: 28px; border-radius: 6px; }
  .nav-logo-text { font-size: 16px; }
  .nav-logo { gap: 8px; }

  /* Hide desktop links */
  .nav-links { display: none; }

  /* Show hamburger */
  .nav-hamburger { display: flex; }

  .theme-toggle { width: 42px; height: 24px; }
  .theme-toggle::after { width: 18px; height: 18px; top: 2px; left: 2px; }
  [data-theme="light"] .theme-toggle::after { transform: translateX(18px); }

  /* Mobile dropdown menu */
  .nav-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-accent);
    padding: 8px 0;
    z-index: 99;
  }

  .nav-mobile-menu.open {
    display: block;
  }

  .nav-mobile-menu a {
    display: block;
    padding: 14px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Crimson Pro', serif;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
    border-bottom: 1px solid var(--border-row);
  }

  .nav-mobile-menu a:last-child {
    border-bottom: none;
  }

  .nav-mobile-menu a:hover,
  .nav-mobile-menu a.active {
    color: var(--accent-gold);
    background: rgba(196, 148, 74, 0.04);
  }
}
