/* ===================================================================
   AI NSFW Guide — Design System v2
   Premium dark-theme with glassmorphism, gradient accents & micro-motion
   =================================================================== */

/* --- Google Fonts (Inter 400–900) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===================================================================
   1. Design Tokens
   =================================================================== */
:root {
  color-scheme: dark;

  /* Backgrounds — 4-layer depth */
  --bg-deep:     #08090b;
  --bg-base:     #0d0f12;
  --bg-raised:   #13161b;
  --bg-elevated: #1a1e25;

  /* Accent — Primary (gold → amber) */
  --accent-start: #f7c948;
  --accent-end:   #f59e0b;
  --accent:       #f7c948;

  /* Accent — Secondary (teal → cyan) */
  --accent2-start: #2dd4bf;
  --accent2-end:   #06b6d4;
  --accent2:       #2dd4bf;

  /* Accent — Tertiary */
  --accent3: #a78bfa;

  /* Text hierarchy */
  --text-primary:   #f5f3ef;
  --text-secondary: #b8b2a8;
  --text-muted:     #7a756d;

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong:  rgba(255, 255, 255, 0.16);

  /* Glow & shadow */
  --glow-gold:  rgba(247, 201, 72, 0.15);
  --glow-teal:  rgba(45, 212, 191, 0.12);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.08);

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  --gradient-teal: linear-gradient(135deg, var(--accent2-start), var(--accent2-end));
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));

  /* Layout */
  --max: 1140px;

  /* Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================================================================
   2. Reset & Base
   =================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-secondary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease-out-expo);
}

img,
svg {
  max-width: 100%;
  display: block;
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===================================================================
   3. Typography
   =================================================================== */
h1, h2, h3 {
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(48px, 7vw, 80px);
  font-weight: 900;
  line-height: 1.05;
  max-width: 880px;
  margin-top: 16px;
}

h2 {
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
}

h3 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  line-height: 1.2;
}

p {
  margin: 0;
  color: var(--text-secondary);
}

.lead {
  margin-top: 22px;
  font-size: 19px;
  line-height: 1.7;
  max-width: 720px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ===================================================================
   4. Layout
   =================================================================== */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===================================================================
   5. Navigation
   =================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 17px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient-gold);
  display: grid;
  place-items: center;
  color: var(--bg-deep);
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 0 16px var(--glow-gold);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.nav-links > a:not(.button) {
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-links > a:not(.button):hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ===================================================================
   6. Buttons
   =================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.25s var(--ease-spring),
              box-shadow 0.25s var(--ease-out-expo),
              background 0.25s,
              border-color 0.25s;
}

.button:not(.secondary) {
  background: var(--gradient-gold);
  color: var(--bg-deep);
  box-shadow: 0 0 20px var(--glow-gold),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.button:not(.secondary):hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px var(--glow-gold),
              0 4px 16px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.button:not(.secondary):active {
  transform: translateY(0);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  backdrop-filter: blur(8px);
}

.button.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ===================================================================
   7. Hero Section
   =================================================================== */
.hero {
  position: relative;
  padding: 88px 0 72px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-base);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 75% 15%, rgba(247, 201, 72, 0.07), transparent),
    radial-gradient(ellipse 50% 40% at 15% 75%, rgba(45, 212, 191, 0.05), transparent),
    radial-gradient(ellipse 35% 25% at 90% 80%, rgba(167, 139, 250, 0.04), transparent);
  pointer-events: none;
  animation: hero-drift 25s ease-in-out infinite alternate;
}

@keyframes hero-drift {
  0% {
    opacity: 1;
    transform: scale(1) translate(0, 0);
  }
  100% {
    opacity: 0.7;
    transform: scale(1.1) translate(-3%, 5%);
  }
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 40px;
  align-items: center;
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ===================================================================
   8. Sections
   =================================================================== */
.section {
  padding: 72px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 32px;
}

.section-head p {
  max-width: 580px;
}

/* ===================================================================
   9. Grid
   =================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ===================================================================
   10. Cards
   =================================================================== */
.card,
.article-card {
  background: var(--gradient-glass);
  background-color: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-spring),
              border-color 0.3s,
              box-shadow 0.3s;
}

.card:hover,
.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-elevated);
}

.card h3 {
  margin-bottom: 4px;
}

.card p,
.article-card p {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
}

.article-card h3 {
  margin-top: 12px;
}

/* ===================================================================
   11. Panels (Glass)
   =================================================================== */
.panel {
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px;
}

/* ===================================================================
   12. Metric List (Hero sidebar)
   =================================================================== */
.metric-list {
  display: grid;
  gap: 0;
  margin-top: 20px;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  transition: background 0.2s;
}

.metric:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric:first-child {
  padding-top: 0;
}

.metric b {
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
}

.metric span {
  color: var(--text-secondary);
}

/* ===================================================================
   13. Tags
   =================================================================== */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px 13px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.card:hover .tag,
.tag:hover {
  border-color: rgba(247, 201, 72, 0.3);
  color: var(--accent);
  background: rgba(247, 201, 72, 0.06);
}

/* ===================================================================
   14. Score Badge
   =================================================================== */
.score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(247, 201, 72, 0.12), rgba(247, 201, 72, 0.04));
  border: 1px solid rgba(247, 201, 72, 0.18);
  border-radius: 8px;
  padding: 6px 14px;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* ===================================================================
   15. Tables
   =================================================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  background: var(--bg-raised);
}

th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-primary);
  background: var(--bg-elevated);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td {
  color: var(--text-secondary);
  font-size: 15px;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.2s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ===================================================================
   16. Article Layout
   =================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.article {
  max-width: 780px;
}

.article > * + * {
  margin-top: 24px;
}

.article h2 {
  font-size: clamp(22px, 3vw, 32px);
  margin-top: 40px;
}

.article ul,
.article ol {
  color: var(--text-secondary);
  padding-left: 20px;
}

.article li + li {
  margin-top: 8px;
}

.article a {
  color: var(--accent2);
  text-decoration: underline;
  text-decoration-color: rgba(45, 212, 191, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.article a:hover {
  text-decoration-color: var(--accent2);
}

.sidebar {
  position: sticky;
  top: 88px;
}

/* ===================================================================
   17. Notice / Alert
   =================================================================== */
.notice {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(247, 201, 72, 0.06), transparent 70%);
  padding: 20px 24px;
  border-radius: 0 14px 14px 0;
}

.notice p {
  font-size: 15px;
  line-height: 1.65;
}

/* ===================================================================
   18. FAQ Accordion
   =================================================================== */
.faq details {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0;
  background: var(--bg-raised);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq details[open] {
  border-color: var(--border-default);
}

.faq details + details {
  margin-top: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 18px 22px;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.faq summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.faq summary::before {
  content: '▸';
  font-size: 14px;
  color: var(--accent);
  transition: transform 0.2s var(--ease-out-expo);
  flex-shrink: 0;
}

.faq details[open] > summary::before {
  transform: rotate(90deg);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq p {
  padding: 0 22px 18px;
  margin-top: 0;
  font-size: 15px;
  line-height: 1.65;
}

/* ===================================================================
   19. Footer
   =================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
  color: var(--text-muted);
  background: var(--bg-deep);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-links a {
  padding: 4px 10px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.footer-links a:hover {
  color: var(--accent2);
  background: rgba(45, 212, 191, 0.06);
}

/* ===================================================================
   20. Age Gate
   =================================================================== */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.age-gate[hidden] {
  display: none;
}

.age-modal {
  width: min(520px, 100%);
  padding: 32px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: 18px;
  box-shadow: var(--shadow-elevated);
  animation: modal-in 0.35s var(--ease-spring) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
}

.age-modal .eyebrow {
  margin-bottom: 8px;
}

.age-modal h2 {
  font-size: 28px;
  margin-bottom: 4px;
}

.age-modal p {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.65;
}

.age-modal .actions {
  margin-top: 24px;
}

/* ===================================================================
   21. Scroll-Driven Entry Animations
   =================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* CSS Scroll-driven (Chrome 115+, Safari 26+) */
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes fade-up {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
    }

    .card,
    .article-card {
      animation: fade-up auto var(--ease-out-expo) backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }

    .section > .container > .panel {
      animation: fade-up auto var(--ease-out-expo) backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 25%;
    }
  }

  /* Fallback: simple entrance for non-supporting browsers */
  @supports not ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes simple-fade-in {
      from {
        opacity: 0;
        transform: translateY(16px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .card,
    .article-card {
      animation: simple-fade-in 0.5s var(--ease-out-expo) both;
    }

    .card:nth-child(2) { animation-delay: 0.08s; }
    .card:nth-child(3) { animation-delay: 0.16s; }
    .card:nth-child(4) { animation-delay: 0.24s; }
    .card:nth-child(5) { animation-delay: 0.32s; }
    .card:nth-child(6) { animation-delay: 0.40s; }
  }
}

/* ===================================================================
   22. Responsive — Tablet (≤ 960px)
   =================================================================== */
@media (max-width: 960px) {
  .hero-grid,
  .article-layout,
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 64px 0 56px;
  }

  .nav {
    height: auto;
    padding: 16px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .sidebar {
    position: static;
  }

  .section {
    padding: 56px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ===================================================================
   23. Responsive — Mobile (≤ 600px)
   =================================================================== */
@media (max-width: 600px) {
  .hero {
    padding: 48px 0 40px;
  }

  h1 {
    font-size: 40px;
  }

  .lead {
    font-size: 17px;
  }

  .button {
    width: 100%;
  }

  .hero-actions,
  .actions {
    flex-direction: column;
  }

  .panel {
    padding: 22px;
  }

  .card,
  .article-card {
    padding: 20px;
  }

  .section {
    padding: 44px 0;
  }

  .footer-grid {
    flex-direction: column;
    gap: 16px;
  }
}
