:root {
  --color-bg-deep: var(--bg);
  --color-bg-card: var(--card);
  --color-bg-card-border: var(--line-2);
  --color-bg-input: var(--glass);
  --color-bg-input-focus: var(--glass-2);
  --color-border-subtle: var(--line);
  --color-border-focus: rgba(183, 148, 255, 0.62);
  --color-text-primary: var(--ink);
  --color-text-secondary: var(--ink-soft);
  --color-text-tertiary: var(--ink-dim);
  --color-accent-1: var(--violet);
  --color-accent-2: var(--gold);
  --color-accent-purple: var(--violet-2);
  --color-result-glow: rgba(232, 194, 117, 0.24);
  --font-sans: var(--sans);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-tertiary: var(--ink-dim);
  --accent: var(--gold);
}

html[data-theme="light"] {
  --bg: #fff8ea;
  --bg-2: #f4e7d2;
  --ink: #21172e;
  --ink-soft: #5e536c;
  --ink-dim: #82768f;
  --line: rgba(54, 35, 76, 0.12);
  --line-2: rgba(54, 35, 76, 0.18);
  --gold: #9c641d;
  --gold-2: #7b4b11;
  --violet: #6f46d8;
  --violet-2: #5b36b7;
  --magenta: #bd2f75;
  --teal: #118a76;
  --danger: #c72f48;
  --good: #197c45;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-2: rgba(255, 255, 255, 0.82);
  --card: rgba(255, 252, 245, 0.82);
  --shadow: 0 30px 80px -36px rgba(54, 35, 76, 0.38);
  --shadow-sm: 0 14px 38px -24px rgba(54, 35, 76, 0.28);
}

body {
  font-family: var(--sans);
  background: var(--bg);
}

html[data-theme="light"] .aurora {
  background:
    radial-gradient(1000px 620px at 85% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(780px 520px at 0% 100%, rgba(232, 194, 117, 0.22), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 64%, #fffaf1);
}

html[data-theme="light"] .orb {
  opacity: 0.32;
}

.site-container {
  width: min(1180px, calc(100% - 36px));
  padding: clamp(34px, 5vw, 72px) 0 clamp(54px, 7vw, 96px);
}

.topbar {
  width: 100%;
  min-height: 72px;
  padding: 0 clamp(18px, 5vw, 64px);
  background: rgba(10, 7, 18, 0.88);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 34px -28px rgba(0, 0, 0, 0.9);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 248, 234, 0.9);
  box-shadow: 0 14px 34px -30px rgba(54, 35, 76, 0.45);
}

.topbar .header-inner {
  width: 100%;
  max-width: 1280px;
  min-height: 72px;
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand.header-brand {
  color: var(--ink);
}

.brand.header-brand svg,
.footer-brand svg {
  width: auto;
  height: auto;
}

.brand.header-brand span,
.footer-brand span {
  font-size: inherit;
}

.brand.header-brand .brand-text {
  font-size: 1.05rem;
}

.topnav.header-nav {
  gap: 18px;
}

.topnav.header-nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 2px;
  white-space: nowrap;
}

.header-controls,
.mobile-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-select-label {
  display: inline-flex;
  align-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.language-select,
.theme-toggle {
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.language-select {
  min-width: 118px;
  max-width: 168px;
  padding: 0 30px 0 13px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  appearance: auto;
  /* Make the native option popup render with dark chrome by default. */
  color-scheme: dark;
}

/* The open dropdown popup is drawn by the OS — style its options so they are
   readable in dark theme (white-on-white faded text otherwise). */
.language-select option {
  background: #1a1525;
  color: #f4f0ff;
  font-weight: 600;
}

html[data-theme="light"] .language-select {
  color-scheme: light;
}

html[data-theme="light"] .language-select option {
  background: #fff8ea;
  color: #2a1c3a;
}

.theme-toggle {
  width: 40px;
  display: inline-grid;
  place-items: center;
}

.theme-toggle:hover,
.language-select:hover {
  background: var(--glass-2);
  border-color: rgba(183, 148, 255, 0.5);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-icon-moon {
  display: block;
}

.stage {
  padding-top: clamp(28px, 5vw, 58px);
}

.stage-head {
  width: 100%;
  padding-top: 0;
}

.hero-title {
  font-size: clamp(2.3rem, 4.8vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-title .grad {
  display: inline-block;
  padding-bottom: 0.06em;
}

.eyebrow {
  margin-top: 0;
}

.mobile-toggle {
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}

.mobile-nav {
  border-top: 1px solid var(--line);
}

.mobile-nav .btn {
  width: max-content;
}

.site-footer {
  background: rgba(10, 7, 18, 0.54);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .site-footer {
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.92), rgba(246, 234, 213, 0.96));
  border-top-color: rgba(54, 35, 76, 0.14);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.site-footer .footer-grid {
  text-align: left;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 52px);
}

.site-footer .footer-brand {
  justify-content: flex-start;
  color: var(--ink-soft);
  text-decoration: none;
}

html[data-theme="light"] .site-footer .footer-brand {
  color: var(--ink);
}

html[data-theme="light"] .site-footer .brand-mark {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(54, 35, 76, 0.16);
  color: var(--gold-2);
  box-shadow: 0 10px 24px -18px rgba(54, 35, 76, 0.35);
}

.site-footer .footer-desc {
  max-width: 34rem;
  color: var(--ink-dim);
  line-height: 1.7;
}

html[data-theme="light"] .site-footer .footer-desc {
  color: #5f526d;
}

.footer-links-multi {
  columns: 1;
}

.footer-social-link {
  width: auto;
  padding: 0 12px;
  color: var(--ink-soft);
}

.footer-heading {
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

html[data-theme="light"] .footer-heading {
  color: #7b4b11;
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 9px;
}

.footer-links a,
.footer-langs a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-langs a {
  color: #51445e;
}

.footer-links a:hover,
.footer-langs a:hover,
.footer-langs a.active {
  color: var(--gold);
  border-color: var(--gold);
  text-decoration: none;
}

html[data-theme="light"] .footer-links a:hover,
html[data-theme="light"] .footer-langs a:hover,
html[data-theme="light"] .footer-langs a.active {
  color: #7b4b11;
  border-color: #9c641d;
  background: rgba(156, 100, 29, 0.08);
}

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-langs a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

html[data-theme="light"] .footer-langs a {
  border-color: rgba(54, 35, 76, 0.16);
  background: rgba(255, 255, 255, 0.42);
}

.footer-copy {
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

html[data-theme="light"] .footer-copy {
  color: #6b5f78;
  border-top-color: rgba(54, 35, 76, 0.14);
}

.glass-card,
.interactive-box,
.tool-card,
.blog-card {
  border-radius: var(--r);
  background: var(--card);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px) saturate(140%);
}

.page-title,
.section-title,
.hero h1,
.article-prose h1,
.article-prose h2,
.section-head h2,
.cta-inner h2 {
  font-family: var(--serif);
  letter-spacing: 0;
}

.page-section,
.content-section,
.hero {
  position: relative;
  width: 100%;
}

.page-section {
  max-width: 920px;
  margin: 0 auto;
}

.hero {
  max-width: 780px;
  margin: 0 auto clamp(26px, 5vw, 46px);
  text-align: center;
}

.hero::before,
.page-section::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.hero h1,
.page-title {
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
  margin: 0 0 16px;
}

.hero p,
.page-section > p,
.blog-card-desc,
.article-prose p,
.page-content p,
.content-text p,
.faq-item p {
  color: var(--ink-soft);
}

.page-section > p {
  font-size: 1.06rem;
  line-height: 1.7;
}

.page-content,
.article-prose,
.contact-form,
.faq-item,
.calc-card {
  padding: clamp(22px, 3vw, 34px);
}

.page-content h2,
.article-prose h2,
.content-section .section-title {
  color: var(--gold-2);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.15;
}

.page-content h3,
.article-prose h3 {
  color: var(--ink);
}

.page-content a,
.article-prose a,
.breadcrumb a {
  color: var(--gold);
  text-decoration: none;
}

.page-content a:hover,
.article-prose a:hover,
.breadcrumb a:hover {
  color: var(--gold-2);
  text-decoration: none;
}

.content-section {
  margin: clamp(44px, 7vw, 82px) auto 0;
}

.content-section .section-title {
  margin-bottom: 18px;
  text-align: center;
}

.content-grid {
  display: block;
}

.content-text {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
}

.content-text p + p {
  margin-top: 1rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.blog-card {
  display: block;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  border-color: rgba(183, 148, 255, 0.5);
  text-decoration: none;
}

.blog-card-body {
  padding: 20px;
}

.blog-card-cat {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(232, 194, 117, 0.12);
  color: var(--gold-2);
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blog-card-title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.blog-card-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--gold);
  font-weight: 800;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 30px;
}

.pagination a,
.pagination span {
  min-width: 38px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink-soft);
  text-align: center;
  text-decoration: none;
}

.pagination a:hover,
.pagination .active-page {
  color: #1a0f2e;
  background: var(--grad-main);
  border-color: transparent;
}

.pagination .disabled {
  opacity: 0.45;
}

.gradient-text,
.brand-accent,
.article-prose h2,
.blog-card:hover .blog-card-title {
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.calc-input,
.calc-select,
.contact-form input,
.contact-form textarea {
  background: var(--glass);
  border-color: var(--line-2);
  color: var(--ink);
}

.tool-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(224, 72, 143, 0.08));
}

.tool-card:hover {
  border-color: rgba(183, 148, 255, 0.5);
  box-shadow: 0 12px 34px -18px rgba(139, 92, 246, 0.75);
}

.back-to-top {
  background: var(--card);
  border-color: var(--line-2);
  color: var(--gold);
}

@media (min-width: 768px) {
  .site-footer .footer-grid {
    grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(110px, 0.8fr));
    align-items: start;
  }

  .footer-links-multi {
    columns: 2;
    column-gap: 28px;
  }

  .footer-links-multi li {
    break-inside: avoid;
  }
}

@media (min-width: 520px) and (max-width: 767px) {
  .site-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .topbar .header-inner {
    height: 66px;
    min-height: 66px;
  }

  /* Collapse the desktop nav into the hamburger (mockup's base .topnav
     display:flex loads after global.css and otherwise keeps it visible). */
  .topnav.header-nav {
    display: none !important;
  }

  .mobile-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
  }

  .mobile-nav {
    top: 66px;
    background: rgba(10, 7, 18, 0.96);
  }

  html[data-theme="light"] .mobile-nav {
    background: rgba(255, 248, 234, 0.96);
  }

  .mobile-nav.is-open {
    align-items: stretch;
    gap: 18px;
  }

  .mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
  }

  .mobile-controls {
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .mobile-controls .language-select {
    min-width: 110px;
  }
}

@media (max-width: 640px) {
  .brand.header-brand .brand-text {
    display: inline;
    font-size: 0.86rem;
    line-height: 1.15;
  }

  /* Show the full "Imposter Game Word Generator" wordmark on mobile. */
  .brand.header-brand .brand-text b {
    display: inline;
  }
}

@media (max-width: 380px) {
  .brand.header-brand .brand-text {
    font-size: 0.78rem;
  }
}
