/* ==========================================================================
   SnagQue Design System & Site Styles
   ========================================================================== */

/* --- Fonts (Self-hosted) --- */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Nunito-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Nunito-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Nunito-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/Nunito-ExtraBold.ttf') format('truetype');
}

/* --- Theme Variables --- */
:root {
  --indigo: #4F46E5;
  --indigo-dark: #3730A3;
  --violet: #5B5BD6;
  --deep-indigo: #3B2FA8;
  --coral: #FF7A59;
  --coral-hover: #F26744;
  --teal: #2EC4B6;
  --cloud: #F8F7FF;
  --cloud-card: #FFFFFF;
  --ink: #1E1B4B;
  --ink-secondary: #4B4678;
  --ink-muted: #6B6794;
  --border-light: rgba(30, 27, 75, 0.08);
  --border-card: rgba(79, 70, 229, 0.12);
  --card-shadow: 0 10px 30px rgba(30, 27, 75, 0.05);
  --hero-bg: linear-gradient(145deg, #5B5BD6 0%, #3B2FA8 100%);

  /* Intent tag chips (Light mode) */
  --tag-read-bg: #E8E6FB; --tag-read-text: #3B2FA8;
  --tag-watch-bg: #FFE3DA; --tag-watch-text: #B23A1A;
  --tag-try-bg: #D6F5F1; --tag-try-text: #0B5E56;
  --tag-buy-bg: #FFF0CC; --tag-buy-text: #7A4B00;
  --tag-idea-bg: #EFE3FF; --tag-idea-text: #5B21B6;
  --tag-learn-bg: #DCEBFF; --tag-learn-text: #0B4A8F;

  --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-card: 20px;
  --radius-btn: 16px;
  --radius-pill: 9999px;
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --night: #14122B;
    --cloud: #14122B;
    --cloud-card: #1C1A38;
    --ink: #ECEAFF;
    --ink-secondary: #B9B4E3;
    --ink-muted: #8E8AA8;
    --border-light: rgba(236, 234, 255, 0.1);
    --border-card: rgba(142, 151, 232, 0.18);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --hero-bg: linear-gradient(145deg, #2A246B 0%, #171536 100%);

    /* Intent tag chips (Dark mode) */
    --tag-read-bg: rgba(59, 47, 168, 0.3); --tag-read-text: #B6ADFB;
    --tag-watch-bg: rgba(178, 58, 26, 0.3); --tag-watch-text: #FFA58E;
    --tag-try-bg: rgba(11, 94, 86, 0.3); --tag-try-text: #5EEAD4;
    --tag-buy-bg: rgba(122, 75, 0, 0.3); --tag-buy-text: #FDE047;
    --tag-idea-bg: rgba(91, 33, 182, 0.3); --tag-idea-text: #D8B4FE;
    --tag-learn-bg: rgba(11, 74, 143, 0.3); --tag-learn-text: #93C5FD;
  }
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--cloud);
  color: var(--ink);
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--indigo);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Accessibility: Skip link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--coral);
  color: #1E1B4B;
  padding: 12px 20px;
  font-weight: 700;
  border-radius: var(--radius-btn);
  z-index: 1000;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* Layout container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 20px;
}

/* --- Header --- */
.site-header {
  padding-block: 20px;
  background-color: var(--cloud);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo-light { display: block; height: 32px; width: auto; }
.brand-logo-dark { display: none; height: 32px; width: auto; }

@media (prefers-color-scheme: dark) {
  .brand-logo-light { display: none; }
  .brand-logo-dark { display: block; }
}

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

.nav-link {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--indigo);
}

/* --- Hero Section --- */
.hero-section {
  padding-block: 40px 60px;
}

.hero-card {
  background: var(--hero-bg);
  border-radius: 28px;
  padding: 48px 36px;
  color: #FFFFFF;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 40px;
  box-shadow: 0 20px 40px rgba(59, 47, 168, 0.25);
}

.hero-content h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-subhead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--coral);
  color: #1E1B4B !important;
  box-shadow: 0 4px 14px rgba(255, 122, 89, 0.35);
}

.btn-primary:hover {
  background-color: var(--coral-hover);
  opacity: 1;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.25);
  opacity: 1;
}

.store-status {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-soon {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #FFFFFF;
}

/* --- Pure CSS Phone Mockup --- */
.mockup-container {
  display: flex;
  justify-content: center;
}

.phone-mockup {
  width: 100%;
  max-width: 320px;
  background-color: #1A1938;
  border: 10px solid #28254E;
  border-radius: 40px;
  padding: 16px 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: #FFFFFF;
  position: relative;
}

.phone-speaker {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 12px;
}

.phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.phone-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFFFFF;
}

.phone-logo svg {
  width: 20px;
  height: 20px;
}

.phone-resurface-card {
  background: rgba(79, 70, 229, 0.35);
  border: 1px solid rgba(79, 70, 229, 0.5);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.resurface-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #A5B4FC;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.resurface-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

.phone-snag-card {
  background: #25224D;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

.snag-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.mini-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.tag-read { background: var(--tag-read-bg); color: var(--tag-read-text); }
.tag-watch { background: var(--tag-watch-bg); color: var(--tag-watch-text); }
.tag-try { background: var(--tag-try-bg); color: var(--tag-try-text); }

.snag-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}

.snag-card-source {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
}

.phone-fab {
  width: 44px;
  height: 44px;
  background-color: var(--coral);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-top: 10px;
  box-shadow: 0 4px 10px rgba(255, 122, 89, 0.4);
}

.phone-fab svg {
  width: 20px;
  height: 20px;
  fill: #1E1B4B;
}

/* --- Queue Motif (Three Teal Dots) --- */
.queue-motif {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-block: 24px;
}

.queue-dot {
  background-color: var(--teal);
  border-radius: 50%;
}

.queue-dot:nth-child(1) { width: 14px; height: 14px; }
.queue-dot:nth-child(2) { width: 10px; height: 10px; opacity: 0.8; }
.queue-dot:nth-child(3) { width: 6px; height: 6px; opacity: 0.5; }

/* --- Section Styling --- */
.section {
  padding-block: 60px;
}

.section-alt {
  background-color: rgba(79, 70, 229, 0.03);
}

@media (prefers-color-scheme: dark) {
  .section-alt {
    background-color: rgba(255, 255, 255, 0.02);
  }
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 48px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-subhead {
  font-size: 1.1rem;
  color: var(--ink-secondary);
}

/* --- How It Works --- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.step-card {
  background-color: var(--cloud-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  box-shadow: var(--card-shadow);
  position: relative;
}

.step-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--indigo);
  background: var(--tag-read-bg);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.step-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-card p {
  color: var(--ink-secondary);
  font-size: 1rem;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background-color: var(--cloud-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--indigo);
}

.feature-card p {
  color: var(--ink-secondary);
  font-size: 0.98rem;
}

/* --- Intent Tags Strip --- */
.tags-strip-wrap {
  text-align: center;
  padding-block: 40px;
}

.tags-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.tag-chip {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-read { background: var(--tag-read-bg); color: var(--tag-read-text); }
.chip-watch { background: var(--tag-watch-bg); color: var(--tag-watch-text); }
.chip-try { background: var(--tag-try-bg); color: var(--tag-try-text); }
.chip-buy { background: var(--tag-buy-bg); color: var(--tag-buy-text); }
.chip-idea { background: var(--tag-idea-bg); color: var(--tag-idea-text); }
.chip-learn { background: var(--tag-learn-bg); color: var(--tag-learn-text); }

/* --- Callout Card (Dictionary & Privacy) --- */
.callout-box {
  background-color: var(--cloud-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 40px;
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .callout-box.with-preview {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
  }
}

.callout-box h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.callout-box p {
  color: var(--ink-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.dictionary-preview-card {
  background: var(--cloud);
  border: 2px solid var(--border-card);
  border-radius: 16px;
  padding: 20px;
}

.dict-headword {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--indigo);
  margin-bottom: 4px;
}

.dict-translation {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.dict-definition {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.dict-example {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  padding-left: 10px;
  border-left: 3px solid var(--indigo);
}

/* --- FAQ Details --- */
.faq-list {
  max-width: 800px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background-color: var(--cloud-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item summary {
  padding: 20px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

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

.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--indigo);
  font-weight: 400;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-content {
  padding: 0 24px 20px 24px;
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

/* --- Final CTA Band --- */
.cta-band {
  background: var(--hero-bg);
  border-radius: 28px;
  padding: 48px 32px;
  text-align: center;
  color: #FFFFFF;
  margin-block: 40px;
}

.cta-band h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 24px;
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  background-color: var(--cloud);
  border-top: 1px solid var(--border-light);
  padding-block: 40px 24px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  list-style: none;
}

.footer-nav a {
  color: var(--ink-secondary);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--indigo);
  text-decoration: underline;
}

.footer-copy {
  color: var(--ink-muted);
}

/* --- Legal / Content Pages Layout --- */
.legal-page {
  padding-block: 40px 80px;
}

.legal-article {
  background-color: var(--cloud-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 48px 40px;
  max-width: 820px;
  margin-inline: auto;
  box-shadow: var(--card-shadow);
}

.legal-article h1 {
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink);
}

.legal-meta {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.legal-article h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--indigo);
}

.legal-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-article p, .legal-article ul, .legal-article ol {
  margin-bottom: 16px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.legal-article ul, .legal-article ol {
  padding-left: 24px;
}

.legal-article li {
  margin-bottom: 6px;
}

.legal-article strong {
  color: var(--ink);
}

.todo-owner {
  background: rgba(255, 122, 89, 0.15);
  color: #B23A1A;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-family: monospace;
}

@media (prefers-color-scheme: dark) {
  .todo-owner {
    background: rgba(255, 122, 89, 0.25);
    color: #FFA58E;
  }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 860px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 36px 24px;
  }
  .hero-content {
    text-align: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .store-status {
    justify-content: center;
  }
  .mockup-container {
    margin-top: 20px;
  }
  .legal-article {
    padding: 32px 20px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 14px;
    font-size: 0.85rem;
  }
  .btn {
    width: 100%;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
