/* FoundryMate site — matches the desktop app's dark theme (see app base.css). */

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

:root {
  --bg: #05060b;
  --bg-elevated: #0b0f1a;
  --bg-soft: #101524;
  --accent-rgb: 104, 221, 255;
  --accent: rgb(var(--accent-rgb));
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --border: rgba(var(--accent-rgb), 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --fg: #e6edf6;
  --fg-muted: #a9b4c4;
  --fg-faint: #8590a2;
  --heading-2: #93c5fd;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-glow: 0 0 40px rgba(var(--accent-rgb), 0.12);
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Audiowide', var(--font-body);
  --font-mono: 'Cascadia Code', Consolas, 'SFMono-Regular', Menlo, monospace;
  --max: 1160px;
  --max-prose: 760px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(var(--accent-rgb), 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(59, 130, 246, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
}

main { flex: 1; }

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #a5ecff; }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #03141b;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ─────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 6, 11, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}
.brand:hover { color: var(--fg); }
.brand img { width: 36px; height: 36px; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.94rem;
}
.site-nav a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.05); }
.site-nav a[aria-current='page'] { color: var(--accent); background: var(--accent-soft); }

/* ── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #03141b;
  box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.25);
}
.btn-primary:hover { background: #8fe6ff; color: #03141b; transform: translateY(-1px); }
.btn-secondary {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
}
.btn-secondary:hover { background: rgba(var(--accent-rgb), 0.16); color: #a5ecff; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.btn-icon { width: 20px; height: 20px; flex: none; }

/* ── Hero ───────────────────────────────────────────── */

.hero { padding: 72px 0 40px; }
.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.hero .tagline {
  margin: 0 0 18px;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.35;
  color: var(--accent);
  font-weight: 600;
}
.hero .lede { margin: 0 0 28px; color: var(--fg-muted); font-size: 1.08rem; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { margin: 16px 0 0; color: var(--fg-faint); font-size: 0.88rem; }

.hero-shot {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-glow), 0 30px 80px rgba(0, 0, 0, 0.55);
}
.hero-shot button { display: block; width: 100%; }

/* ── Sections ───────────────────────────────────────── */

.section { padding: 56px 0; }
.section-head { max-width: 680px; margin: 0 0 32px; }
.section-head h2, .prose h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  line-height: 1.2;
}
.section-head p { margin: 0; color: var(--fg-muted); font-size: 1.05rem; }

.feature-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
}
.card h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--fg);
}
.card-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
}
.card-icon svg { width: 20px; height: 20px; }
.card p { margin: 0 0 10px; color: var(--fg-muted); }
.feature-list { margin: 0; padding: 0; list-style: none; }
.feature-list li {
  position: relative;
  padding: 7px 0 7px 18px;
  color: var(--fg-muted);
  border-top: 1px solid var(--border-subtle);
}
.feature-list li:first-child { border-top: 0; }
.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}
.feature-list strong { color: var(--fg); }
.card-wide { grid-column: 1 / -1; }

/* ── Gallery ────────────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery li { grid-column: span 2; }
.gallery li:nth-child(1), .gallery li:nth-child(2) { grid-column: span 3; }
.shot {
  margin: 0;
}
.shot-link {
  display: block;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.shot-link:hover { border-color: rgba(var(--accent-rgb), 0.5); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.shot-link img { width: 100%; aspect-ratio: 2560 / 1400; object-fit: cover; }
.shot figcaption { margin-top: 8px; color: var(--fg-muted); font-size: 0.92rem; }
.shot figcaption strong { color: var(--fg); font-weight: 600; }

/* ── Lightbox (native <dialog>) ─────────────────────── */

.lightbox {
  width: min(96vw, 1600px);
  max-width: none;
  max-height: 96vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--fg);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(2, 4, 8, 0.86); }
.lightbox figure { margin: 0; }
.lightbox img { width: 100%; max-height: calc(96vh - 56px); object-fit: contain; background: #000; }
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 12px 8px 16px;
}
.lightbox-bar figcaption { flex: 1; min-width: 0; color: var(--fg-muted); font-size: 0.95rem; }
.lightbox-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}
.lightbox-btn:hover { border-color: var(--border); color: var(--accent); }

/* ── CTA band ───────────────────────────────────────── */

.cta-band {
  margin: 24px 0 64px;
  padding: 40px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(600px 220px at 20% 0%, rgba(var(--accent-rgb), 0.14), transparent 70%),
    var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; }
.cta-band p { margin: 0; color: var(--fg-muted); }

/* ── Prose pages (privacy / terms / support) ────────── */

.page { padding: 48px 0 64px; }
.prose { max-width: var(--max-prose); margin: 0 auto; padding: 0 20px; }
.prose h1 { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.prose h2 { margin: 2.2em 0 0.5em; font-size: 1.3rem; color: var(--heading-2); line-height: 1.3; }
.prose h3 { margin: 1.6em 0 0.4em; font-size: 1.05rem; color: var(--fg); }
.prose p, .prose li { color: #cdd5e1; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose strong { color: var(--fg); }
.meta { color: var(--fg-faint); font-size: 0.92rem; margin-top: 0; }
.note { color: var(--fg-faint); font-size: 0.92rem; }
.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.callout p { margin: 0.3em 0; }

.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
tr:last-child td { border-bottom: 0; }
th { background: rgba(var(--accent-rgb), 0.07); color: var(--heading-2); font-weight: 600; }

kbd {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.86em;
  white-space: nowrap;
}
code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.faq details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  margin: 10px 0;
}
.faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--fg);
  list-style-position: inside;
}
.faq summary:hover { color: var(--accent); }
.faq details[open] summary { border-bottom: 1px solid var(--border-subtle); }
.faq .faq-body { padding: 4px 18px 14px; }

.hotkeys th:first-child, .hotkeys td:first-child { width: 34%; }

/* ── Uninstall survey ───────────────────────────────── */

.survey { max-width: 600px; }
.survey fieldset {
  margin: 22px 0;
  padding: 16px 18px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.survey legend { padding: 0 8px; color: var(--heading-2); font-weight: 600; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #cdd5e1;
}
.option:hover { background: rgba(255, 255, 255, 0.04); }
.option input { margin: 0.3em 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.survey textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font: inherit;
  resize: vertical;
}
.survey textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.char-count { margin: 6px 0 0; text-align: right; color: var(--fg-faint); font-size: 0.85rem; }
.form-status { min-height: 1.6em; margin: 12px 0 0; color: #fca5a5; }
.thanks[hidden], [hidden] { display: none !important; }
.thanks h1 { border-bottom: 0; }

/* ── 404 ────────────────────────────────────────────── */

.not-found { text-align: center; padding: 96px 20px; }
.not-found img { margin: 0 auto 24px; width: 96px; height: 96px; }
.not-found h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 8px; }
.not-found p { color: var(--fg-muted); margin: 0 0 28px; }
.not-found .hero-actions { justify-content: center; }

/* ── Footer ─────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(5, 6, 11, 0.6);
  padding: 32px 0 40px;
  color: var(--fg-faint);
  font-size: 0.9rem;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--fg-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 4px 0; }

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 960px) {
  .hero { padding-top: 48px; }
  .hero .container { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .feature-groups { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery li, .gallery li:nth-child(1), .gallery li:nth-child(2) { grid-column: span 1; }
  .gallery li:nth-child(1) { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .prose { padding: 0 16px; }
  .site-header { position: static; }
  .site-header .container { justify-content: center; }
  .site-nav ul { justify-content: center; }
  .site-nav a { padding: 6px 10px; font-size: 0.9rem; }
  .hero { padding: 32px 0 24px; }
  .hero-actions .btn { width: 100%; }
  .section { padding: 40px 0; }
  .card { padding: 20px 18px 16px; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery li:nth-child(n) { grid-column: 1 / -1; }
  .cta-band { padding: 28px 20px; }
  .cta-band .btn { width: 100%; }
  .lightbox-bar figcaption { font-size: 0.85rem; }
}
