/* PanoRyse website. Plain CSS, no build step. Colours follow the PanoRyse Default theme
   (docs/PANORYSE.md section 3.9): slate panels, sky-blue accent. Dark by default; a light theme
   follows prefers-color-scheme. */

:root {
  --canvas: #080c16;
  --panel: #0f172a;
  --card: #1e293b;
  --border: #1e2d4b;
  --rule: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --heading: #f8fafc;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-ink: #04111d;
  --success: #10b981;
  --warning: #f59e0b;
  --astro: #a78bfa;
  --code-bg: #0b1222;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --max: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --canvas: #f8fafc;
    --panel: #ffffff;
    --card: #f1f5f9;
    --border: #cbd5e1;
    --rule: #e2e8f0;
    --text: #1e293b;
    --muted: #475569;
    --heading: #0f172a;
    --accent: #0369a1;
    --accent-strong: #0284c7;
    --accent-ink: #ffffff;
    --success: #047857;
    --warning: #b45309;
    --astro: #6d28d9;
    --code-bg: #eef2f7;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    color-scheme: light;
  }
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}

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

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

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

h1, h2, h3, h4 { color: var(--heading); line-height: 1.2; margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -0.02em; margin-top: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: 0.05em 0.35em; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1em; overflow-x: auto; line-height: 1.45; }
pre code { background: none; border: 0; padding: 0; }
kbd { background: var(--card); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 0.05em 0.4em; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.6em 1em; z-index: 100; }
.skip-link:focus { left: 1em; top: 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--heading); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.nav a { color: var(--text); text-decoration: none; padding: 0.45em 0.75em; border-radius: 8px; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--card); color: var(--heading); }
.nav .btn { margin-left: 0.4rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 0.4em 0.7em; font: inherit; cursor: pointer; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--panel); border-bottom: 1px solid var(--border); padding: 0.5rem 1rem 1rem; }
  .nav.open { display: flex; }
  .nav .btn { margin: 0.5rem 0 0; text-align: center; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.7em 1.25em; border-radius: 10px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600;
}
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--rule); color: var(--heading); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: 0.45em 0.9em; font-size: 0.9rem; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(8, 12, 22, 0.25) 0%, rgba(8, 12, 22, 0.75) 70%, var(--canvas) 100%),
    url("../images/hero/hero-milky-way-panorama.jpg") center 45% / cover no-repeat,
    url("../images/hero.jpg") center 40% / cover no-repeat,
    radial-gradient(ellipse at 70% 20%, #1e3a5f 0%, #0f172a 55%, #080c16 100%);
  background-color: #0f172a;
  color: #f8fafc;
  padding: clamp(4rem, 12vw, 9rem) 0 clamp(3rem, 8vw, 6rem);
}
.hero h1 { color: #fff; max-width: 15ch; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5); }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 40rem; color: #e2e8f0; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1rem; }
.hero .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.hero .note { font-size: 0.95rem; color: #cbd5e1; }
.pill { display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.3em 0.75em; border-radius: 999px; border: 1px solid rgba(56, 189, 248, 0.6); color: #7dd3fc; background: rgba(15, 23, 42, 0.6); margin-bottom: 1rem; }

/* Sections */
.section { padding: clamp(3rem, 8vw, 6rem) 0; border-top: 1px solid var(--border); }
.section:first-of-type { border-top: 0; }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 0 1.25rem; align-items: baseline; margin-bottom: 2rem; }
.section-num { font-family: var(--mono); color: var(--accent); font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 700; }
.section-head h2 { margin: 0; }
.section-head p { grid-column: 2; color: var(--muted); margin: 0.6rem 0 0; max-width: 46rem; }
@media (max-width: 600px) { .section-head { grid-template-columns: 1fr; } .section-head p { grid-column: 1; } }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 900px) { .split, .split.reverse { grid-template-columns: 1fr; } .split.reverse > :first-child { order: 0; } }

.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.feature-list li { padding-left: 1.6rem; position: relative; }
.feature-list li::before { content: ""; position: absolute; left: 0.2rem; top: 0.6em; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); }
.feature-list strong { color: var(--heading); }

.shot { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--panel); overflow: hidden; }
.shot img { width: 100%; }
figure { margin: 0; }
figcaption { font-size: 0.9rem; color: var(--muted); padding: 0.6rem 0.2rem 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card.link-card { text-decoration: none; color: var(--text); display: block; transition: border-color 0.15s, transform 0.15s; }
.card.link-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.15em 0.6em; border-radius: 999px; vertical-align: middle; border: 1px solid; }
.badge-free { color: var(--success); border-color: var(--success); }
.badge-pro { color: var(--accent); border-color: var(--accent); }
.badge-astro { color: var(--astro); border-color: var(--astro); }
.badge-soon { color: var(--warning); border-color: var(--warning); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.gallery a { display: block; text-decoration: none; color: var(--muted); }
.gallery img { border-radius: 10px; border: 1px solid var(--border); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--panel); }
.gallery a:hover img { border-color: var(--accent); }

/* Image slots (WEB-2): a picture Jim fills later. The <img> removes itself when the file is
   missing (onerror) and the slot then shows its gradient and label instead. */
.slot { position: relative; margin: 0; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; aspect-ratio: var(--ar, 16 / 9); box-shadow: var(--shadow);
  background: radial-gradient(ellipse at 75% 15%, rgba(56, 189, 248, 0.28) 0%, rgba(56, 189, 248, 0) 55%), linear-gradient(160deg, #1e293b 0%, #0f172a 55%, #080c16 100%); }
.slot.astro { background: radial-gradient(ellipse at 40% 45%, rgba(167, 139, 250, 0.35) 0%, rgba(167, 139, 250, 0) 50%), radial-gradient(ellipse at 65% 60%, rgba(14, 165, 233, 0.25) 0%, rgba(14, 165, 233, 0) 45%), #05080f; }
.slot.warm { background: linear-gradient(180deg, #1e3a5f 0%, #475569 45%, #b45309 75%, #1e293b 100%); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .slot-label { position: absolute; left: 0.8rem; bottom: 0.7rem; right: 0.8rem; font-size: 0.82rem; color: #cbd5e1; font-family: var(--mono); display: none; }
.slot.slot-empty .slot-label { display: block; }
.slot-cap { font-size: 0.9rem; color: var(--muted); padding: 0.6rem 0.2rem 0; margin: 0; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.slot-grid.wide { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
@media (max-width: 500px) { .slot-grid.wide { grid-template-columns: 1fr; } }
.slot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.page-head.press-head { background: url("../images/press/press-background.jpg") center / cover no-repeat, linear-gradient(135deg, #0f172a 0%, #080c16 70%, #0c2a3d 100%); background-color: #0f172a; color: #e2e8f0; }
.page-head.press-head h1 { color: #fff; }
.page-head.press-head p { color: #cbd5e1; }

.lightbox { position: fixed; inset: 0; background: rgba(2, 6, 16, 0.92); display: none; align-items: center; justify-content: center; z-index: 200; padding: 2rem; flex-direction: column; gap: 0.8rem; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 85vh; width: auto; border-radius: 8px; }
.lightbox p { color: #cbd5e1; margin: 0; text-align: center; }
.lightbox button { position: absolute; top: 1rem; right: 1rem; }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; align-items: stretch; }
.plan { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); }
.plan h3 { margin: 0 0 0.25rem; }
.price { font-size: 2.2rem; font-weight: 800; color: var(--heading); margin: 0.4rem 0 0; }
.price small { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.plan ul { padding-left: 1.1rem; margin: 1rem 0; flex: 1; }
.plan li { margin-bottom: 0.35rem; }
.plan .btn { margin-top: auto; }

.callout { border-left: 4px solid var(--accent); background: var(--panel); border-radius: 0 10px 10px 0; padding: 1rem 1.25rem; margin: 1.25rem 0; }
.callout.warn { border-left-color: var(--warning); }
.callout.soon { border-left-color: var(--warning); }
.callout p:last-child { margin-bottom: 0; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--heading); background: var(--panel); }
.table-scroll { overflow-x: auto; }

details { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1.2rem; margin-bottom: 0.75rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--heading); }
details[open] summary { margin-bottom: 0.6rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--panel); padding: 2.5rem 0; margin-top: 3rem; font-size: 0.92rem; color: var(--muted); }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; }
.site-footer h4 { margin: 0 0 0.6rem; font-size: 0.95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }

.page-head { padding: clamp(2.5rem, 7vw, 4.5rem) 0 1.5rem; background: linear-gradient(180deg, var(--panel), var(--canvas)); border-bottom: 1px solid var(--border); }
.page-head p { color: var(--muted); max-width: 44rem; font-size: 1.1rem; }
.prose { max-width: 48rem; }

/* Docs layout */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2.5rem; padding-top: 2rem; padding-bottom: 2rem; }
.docs-sidebar { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 0.5rem; }
.docs-sidebar h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.4rem 0 0.4rem; }
.docs-sidebar ol, .docs-sidebar ul { list-style: none; margin: 0; padding: 0; }
.docs-sidebar a { display: block; padding: 0.35em 0.7em; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 0.95rem; }
.docs-sidebar a:hover { background: var(--card); }
.docs-sidebar a[aria-current="page"] { background: var(--card); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.docs-content { min-width: 0; }
.docs-content h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
.docs-content .lede { font-size: 1.12rem; color: var(--muted); }
.docs-content h2 { border-top: 1px solid var(--border); padding-top: 1.2rem; }
.docs-content ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
.docs-content ol.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 1rem; }
.docs-content ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0.05em; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--card); border: 1px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; }
.docs-content figure.shot { margin: 1.25rem 0 1.75rem; }
.docs-content figure.shot figcaption { padding: 0.6rem 0.9rem; }
.ui { font-weight: 600; color: var(--heading); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pager a { display: block; padding: 0.9rem 1.1rem; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; background: var(--panel); }
.pager a:hover { border-color: var(--accent); }
.pager span { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pager .next { text-align: right; grid-column: 2; }

.search { position: relative; margin-bottom: 0.5rem; }
.search input { width: 100%; padding: 0.6em 0.8em; border-radius: 8px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); font: inherit; font-size: 0.95rem; }
.search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.search-results { list-style: none; margin: 0.4rem 0 0; padding: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; max-height: 50vh; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 0.55em 0.8em; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 0.9rem; }
.search-results a:hover, .search-results a:focus { background: var(--card); }
.search-results small { display: block; color: var(--muted); }
.search-results .none { padding: 0.55em 0.8em; color: var(--muted); font-size: 0.9rem; }

.docs-toggle { display: none; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: 1rem; }
  .docs-sidebar { position: static; max-height: none; border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem; background: var(--panel); }
  .docs-toggle { display: inline-block; margin-bottom: 0.5rem; }
  .docs-sidebar nav.collapsed { display: none; }
}

.placeholder { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem; border: 2px dashed var(--warning); border-radius: 10px; color: var(--warning); background: var(--panel); font-weight: 600; }

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

.h3 { font-size: 1.2rem; }
.gallery span { display: block; font-size: 0.88rem; padding-top: 0.45rem; }
.gallery figure figcaption { padding-top: 0.45rem; }
