/* Sursum site styles. Colors come from the app icon: navy, gold, bone, and slate.
   Change the palette in :root (light) and the dark-mode block below; everything else
   reads the tokens. */

:root {
  --navy: #253a6b;
  --gold: #e8b85c;
  --bone: #dad8d1;
  --slate: #8e96a8;

  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #eeebe2;
  --text: #1b2238;
  --text-muted: #5b6377;
  --border: #dedad0;
  --accent: var(--navy);
  --accent-text: #ffffff;
  --link: #2c4a8f;
  --highlight: #b07a14;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;

  --radius: 18px;
  --radius-sm: 10px;
  --max: 1080px;
  --narrow: 720px;
  --gutter: clamp(16px, 4vw, 32px);
  --shadow: 0 1px 2px rgb(20 28 50 / 6%), 0 12px 32px rgb(20 28 50 / 8%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141b2e;
    --surface: #1c2540;
    --surface-2: #222c4a;
    --text: #ecebe6;
    --text-muted: #a5acbd;
    --border: #2e3a5c;
    --accent: var(--gold);
    --accent-text: #1b2238;
    --link: #f0c97c;
    --highlight: var(--gold);
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 30%);
  }
}

:root[data-theme="dark"] {
  --bg: #141b2e;
  --surface: #1c2540;
  --surface-2: #222c4a;
  --text: #ecebe6;
  --text-muted: #a5acbd;
  --border: #2e3a5c;
  --accent: var(--gold);
  --accent-text: #1b2238;
  --link: #f0c97c;
  --highlight: var(--gold);
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 30%);
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

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

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px;
  z-index: 10;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Header & footer ---------- */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-family: var(--font-serif); font-weight: 600; font-size: 1.25rem;
}
.brand img { border-radius: 8px; }

.site-header nav ul, .site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-header nav a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }

@media (max-width: 420px) {
  .site-header nav ul { gap: 4px 14px; }
  .brand span { display: none; }
}

.site-footer { margin-top: 96px; border-top: 1px solid var(--border); padding: 40px 0 32px; color: var(--text-muted); font-size: 0.95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-brand p { margin: 8px 0 0; }
.site-footer nav a { color: var(--text-muted); }
.site-footer nav a:hover { color: var(--text); }
.footer-legal { margin-top: 28px; font-size: 0.82rem; }

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

.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent;
}
.button-primary { background: var(--accent); color: var(--accent-text); }
.button-primary:hover { filter: brightness(1.08); }
.button-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button-secondary:hover { background: var(--surface-2); }
.button.is-disabled { opacity: 0.85; cursor: default; }
.button.is-disabled:hover { filter: none; }

/* ---------- Home: hero ---------- */

.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 80px); }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: clamp(32px, 6vw, 72px); }
.hero-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: var(--shadow); margin-bottom: 28px; }
.hero h1 { margin-bottom: 0.35em; }
.hero .lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--text-muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.hero-meta { margin-top: 16px; font-size: 0.9rem; color: var(--text-muted); }

.hero-art { position: relative; display: flex; justify-content: center; }
.hero-art::before {
  content: ""; position: absolute; inset: 8% 4%;
  background:
    radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--gold) 40%, transparent) 0 16%, transparent 17%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--navy) 22%, transparent), transparent 70%);
  filter: blur(8px);
  z-index: 0;
}

.device {
  position: relative; z-index: 1;
  width: min(300px, 78vw);
  padding: 10px;
  border-radius: 44px;
  background: #0e1426;
  box-shadow: var(--shadow), 0 0 0 1px rgb(255 255 255 / 6%) inset;
}
.device img { border-radius: 34px; width: 100%; }

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: 2; }
}

/* ---------- Home: sections ---------- */

.section { padding: clamp(48px, 8vw, 88px) 0; }
.section-header { max-width: 40em; margin-bottom: 40px; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }
.eyebrow {
  display: inline-block; margin-bottom: 10px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--highlight);
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px;
}
.feature h3 { margin: 14px 0 6px; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.98rem; }
.feature-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in srgb, var(--navy) 10%, var(--surface)); color: var(--navy);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .feature-icon { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); color: var(--gold); }
}
:root[data-theme="dark"] .feature-icon { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); color: var(--gold); }

.gallery {
  display: flex; gap: 24px; overflow-x: auto; padding: 8px 4px 24px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.gallery figure { flex: 0 0 auto; width: min(260px, 70vw); margin: 0; scroll-snap-align: start; }
.gallery .device { width: 100%; border-radius: 38px; padding: 8px; }
.gallery .device img { border-radius: 30px; }
.gallery figcaption { margin-top: 14px; text-align: center; color: var(--text-muted); font-size: 0.95rem; }

.promise {
  background: var(--navy); color: #f3f1ea; border-radius: calc(var(--radius) + 8px);
  padding: clamp(32px, 6vw, 64px);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: start;
}
.promise h2 { color: #fff; }
.promise .eyebrow { color: var(--gold); }
.promise p { color: #cfd3de; }
.promise a { color: var(--gold); }
.promise ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.promise li { display: flex; gap: 12px; align-items: flex-start; }
.promise li::before {
  content: ""; flex: 0 0 10px; height: 10px; margin-top: 0.55em; border-radius: 50%; background: var(--gold);
}
@media (max-width: 760px) { .promise { grid-template-columns: 1fr; } }

.cta { text-align: center; }
.cta p { color: var(--text-muted); }
.cta .hero-actions { justify-content: center; }

/* ---------- Text pages (Markdown) ---------- */

.page-header { padding: clamp(40px, 7vw, 72px) 0 12px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.page-header .lede { font-size: 1.2rem; color: var(--text-muted); }
.meta { color: var(--text-muted); font-size: 0.9rem; }

.prose h2 { font-size: 1.55rem; margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--gold);
  color: var(--text-muted);
}
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-weight: 600; }
.prose code { font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; }
.prose img { border-radius: var(--radius-sm); margin: 1.5em auto; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

.callout {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin: 1.5em 0;
}
.callout > :last-child { margin-bottom: 0; }

.prose details {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  padding: 14px 18px; margin: 0 0 12px;
}
.prose summary { cursor: pointer; font-weight: 600; }
.prose details[open] summary { margin-bottom: 8px; }
.prose details > :last-child { margin-bottom: 0; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin: 1.5em 0; }
.asset {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; text-decoration: none; color: var(--text); display: grid; gap: 10px; justify-items: center; text-align: center;
}
.asset img { margin: 0; max-height: 160px; width: auto; border-radius: 12px; }
.asset span { font-size: 0.9rem; color: var(--text-muted); }
.asset:hover { border-color: var(--slate); }
