/* ============================================================
   base.css — shared foundation loaded on every page
   Design tokens, reset, typography, header/nav, buttons,
   footer, shared components (download cards, FAQ), utilities.
   ============================================================ */

@font-face {
  font-family: 'Poppins';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../assets/fonts/Poppins-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Poppins';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('../assets/fonts/Poppins-Medium.ttf') format('truetype');
}

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

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

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

:root {
  --bg: #ffffff;
  --surface: #faf8fd;
  --surface-strong: #f4edf9;
  --elev: rgba(18, 25, 49, 0.05);
  --fg: #240f4f;
  --muted: #74778f;
  --faint: #a7b0bc;
  --border: rgba(137, 144, 164, 0.3);
  --primary: #863ed5;
  --primary-deep: #672cbc;
  --primary-bright: #a44aff;
  --warm: #f98091;
  --green: #058f50;
  --cyan: #087c8f;
  --shadow: 0 24px 70px rgba(45, 19, 86, 0.14);
  --radius: 12px;
  --radius-lg: 20px;
  --max: 1180px;
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #040c23;
  --surface: #081027;
  --surface-strong: #121931;
  --elev: #121931;
  --fg: #ffffff;
  --muted: #a19cc5;
  --faint: #7b80ad;
  --border: rgba(123, 128, 173, 0.22);
  --primary: #a44aff;
  --primary-deep: #ffffff;
  --primary-bright: #c37aff;
  --warm: #ff8798;
  --green: #18b563;
  --cyan: #4dbcd4;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    'Poppins',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    system-ui,
    sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: '';
  background:
    radial-gradient(60% 50% at 80% 0%, rgba(164, 74, 255, 0.1), transparent 70%),
    radial-gradient(50% 40% at 0% 20%, rgba(249, 128, 145, 0.08), transparent 70%);
}

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

img,
svg {
  display: block;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-140%);
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  padding: 0.7rem 1rem;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.site-header[data-elevated='true'] {
  border-color: var(--border);
}

/* Centered content width shared by every top-level section wrapper. */
.nav,
.hero,
.feature-band,
.split-section,
.download-band,
.faq-section,
.showcase,
.privacy-callout,
.footer,
.page-main {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.nav {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: max-content;
  font-weight: 700;
  color: var(--primary-deep);
}

[data-theme='dark'] .brand {
  color: var(--fg);
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
}

.nav-links a:hover,
.nav-links a[aria-current='page'] {
  background: var(--elev);
  color: var(--fg);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  padding: 0.78rem 1.2rem;
  text-align: center;
  box-shadow: 0 12px 26px rgba(134, 62, 213, 0.24);
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

.button-small {
  min-height: 38px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
}

.button-ghost {
  border-color: var(--border);
  background: var(--elev);
  color: var(--fg);
  box-shadow: none;
}

.button[aria-disabled='true'] {
  border-color: var(--border);
  background: var(--surface-strong);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--elev);
  color: var(--fg);
  cursor: pointer;
}

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

[data-theme='light'] .moon-icon,
[data-theme='dark'] .sun-icon {
  display: none;
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  color: var(--primary-deep);
  font-size: clamp(2.7rem, 5vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

[data-theme='dark'] h1 {
  color: var(--fg);
}

h2 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-lede,
.section-heading p,
.split-section p,
.download-note,
.faq-list p,
.footer p,
.page-hero p,
.policy-content p,
.support-grid p,
.privacy-callout p,
.updated {
  color: var(--muted);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 2.4rem;
}

.section-heading p {
  max-width: 60ch;
}

/* Vertical rhythm shared by the main content bands. */
.feature-band,
.split-section,
.download-band,
.faq-section,
.showcase {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

/* Bare links get a primary tint; buttons keep their own color. */
.text-link,
.download-note a,
.footer a:hover,
.page-main a,
.policy-content a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.text-link {
  display: inline-flex;
  margin-top: 0.9rem;
}

.page-main a.button {
  color: #fff;
}

.page-main a.button-ghost {
  color: var(--fg);
}

/* ---------- Download cards (home + downloads page) ---------- */

.download-band {
  border-block: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.page-download-band {
  width: 100%;
  border-top: 0;
  background: transparent;
  padding-top: 0;
}

.download-group + .download-group {
  margin-top: 2.2rem;
}

.download-group-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.download-group-heading h2,
.download-group-heading h3,
.download-group-heading p {
  margin: 0;
}

.download-group-heading p {
  color: var(--muted);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

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

.download-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 80%, var(--surface));
  padding: 1.5rem;
}

.download-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.download-card.is-detected {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 16px 40px rgba(134, 62, 213, 0.14);
}

.download-icon {
  display: grid;
  min-width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--primary);
}

.download-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.download-link {
  width: 100%;
  margin-top: auto;
}

.download-note {
  margin: 1.4rem 0 0;
  font-size: 0.9rem;
}

/* ---------- FAQ (home + support page) ---------- */

.faq-list {
  display: grid;
  gap: 0.8rem;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 80%, var(--surface));
  padding: 1.1rem 1.2rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-list p {
  margin: 0.65rem 0 0;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
}

.footer p {
  max-width: 42ch;
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.studio-link {
  color: var(--primary);
}

.footer .studio-link:hover {
  text-decoration: underline;
  font-weight: 400;
}

/* ---------- Subpage scaffolding (downloads / support / privacy) ---------- */

.page-main {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.page-hero {
  max-width: 820px;
  margin-bottom: 2.4rem;
}

.page-hero h1 {
  font-size: clamp(2.6rem, 5vw, 4rem);
}

.page-hero p {
  max-width: 65ch;
  font-size: 1.05rem;
}

.updated {
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* ---------- Responsive (shared) ---------- */

@media (max-width: 980px) {
  .nav-links {
    display: none;
  }

  .download-grid,
  .download-grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav,
  .hero,
  .feature-band,
  .split-section,
  .download-band,
  .faq-section,
  .showcase,
  .privacy-callout,
  .footer,
  .page-main {
    width: min(100% - 28px, var(--max));
  }

  .nav {
    min-height: 66px;
  }

  .button-small {
    display: none;
  }

  h1 {
    font-size: clamp(2.5rem, 11vw, 3.6rem);
  }

  .download-group-heading,
  .footer {
    align-items: start;
    flex-direction: column;
  }

  .footer nav {
    justify-content: start;
  }
}

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