/* ===========================================================
   balthaser.com — site styles
   Ground: deep Chagall night-sky navy. Covers carry color.
   Type: Playfair Display (display) + Source Sans 3 (body).
   =========================================================== */

:root {
  /* Palette pulled from the SSS star-field */
  --ink:        #07102e;   /* deepest night   */
  --night:      #0b1840;   /* primary ground  */
  --night-2:    #10224f;   /* raised surface  */
  --night-3:    #16305f;   /* hover / inset   */
  --star:       #ffe9a8;   /* warm glow (moon)*/
  --flame:      #ff6a3d;   /* title coral     */
  --lilac:      #b39cff;   /* soft accent     */
  --text:       #eaf0ff;   /* body on dark    */
  --muted:      #bcc7dd;   /* secondary text (cool silver — legible on navy)  */
  --line:       rgba(179,156,255,.22);
  --maxw: 1080px;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(255,233,168,.10), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(179,156,255,.12), transparent 55%),
    linear-gradient(180deg, var(--ink), var(--night));
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* faint starfield sprinkled across the whole page */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 75% 20%, rgba(255,255,255,.35), transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,233,168,.5), transparent),
    radial-gradient(1px 1px at 33% 82%, rgba(179,156,255,.45), transparent),
    radial-gradient(1px 1px at 88% 55%, rgba(255,255,255,.3), transparent),
    radial-gradient(1.2px 1.2px at 12% 60%, rgba(255,255,255,.4), transparent);
  opacity: .7;
}

.wrap { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(7,16,46,.85), rgba(7,16,46,.55));
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: .01em; color: var(--text); text-decoration: none; }
.brand b { color: var(--star); font-weight: 600; }
nav.main { display: flex; gap: 4px; }
nav.main a {
  color: var(--muted); text-decoration: none; font-size: .98rem;
  padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s;
}
nav.main a:hover { color: var(--text); background: var(--night-2); }
nav.main a.active { color: var(--ink); background: var(--star); }

/* mobile nav */
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 12px; font-size: 1rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(28px, 5vw, 56px); }
.hero .kicker { color: var(--lilac); letter-spacing: .32em; text-transform: uppercase; font-size: .8rem; margin: 0 0 18px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.02; margin: 0 0 20px;
  letter-spacing: -.01em;
}
.hero h1 em { font-style: normal; color: var(--flame); }
.hero .lede { max-width: 60ch; color: var(--muted); font-size: 1.16rem; margin: 0 0 34px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  padding: 13px 22px; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--star); color: var(--ink); box-shadow: 0 8px 30px rgba(255,233,168,.18); }
.btn-primary:hover { box-shadow: 0 12px 40px rgba(255,233,168,.3); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--lilac); background: var(--night-2); }
.btn svg { width: 18px; height: 18px; flex: none; }
/* universal guard: no inline SVG may ever outgrow its button */
svg { max-width: 1em; height: auto; }

/* ---------- Sections ---------- */
section { padding: clamp(40px, 7vw, 84px) 0; }
.section-head { margin-bottom: 36px; }
.section-head .kicker { color: var(--lilac); letter-spacing: .3em; text-transform: uppercase; font-size: .78rem; margin: 0 0 10px; }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 4.5vw, 3rem); margin: 0; letter-spacing: -.01em; }
.section-head p { color: var(--muted); max-width: 58ch; margin: 14px 0 0; }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); border: 0; }

/* ---------- Books grid ---------- */
.book {
  display: grid; grid-template-columns: 200px 1fr; gap: 30px;
  background: linear-gradient(180deg, var(--night-2), rgba(11,24,64,.35));
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  margin-bottom: 26px; align-items: center;
}
.book.featured { grid-template-columns: 260px 1fr; }
.book .cover { position: relative; background: #050a1c; overflow: hidden; border-radius: 10px; }
.book .cover-stack { display: grid; gap: 12px; }
.cover .back-caption { display: block; margin-top: 8px; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.book .cover img { width: 100%; height: auto; display: block; }   /* natural ratio = never clipped */
.book .body { padding: 8px 12px 8px 0; }
.badge { display: inline-block; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); background: var(--star); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; font-weight: 700; }
.badge.soon { background: var(--lilac); }
.book h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; margin: 0 0 6px; line-height: 1.1; }
.book .sub { color: var(--muted); margin: 0 0 14px; font-size: 1rem; }
.book .blurb { color: var(--text); opacity: .82; margin: 0 0 18px; max-width: 62ch; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; }
.buy-row .btn { padding: 9px 16px; font-size: .92rem; }

/* coming-soon tiles */
.coming-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.coming-tile { background: linear-gradient(180deg, var(--night-2), rgba(11,24,64,.3)); border: 1px dashed var(--line); border-radius: 16px; padding: 26px; }
.coming-tile h3 { font-family: var(--font-display); font-size: 1.4rem; margin: 10px 0 6px; }
.coming-tile .note { color: var(--muted); font-size: .95rem; }

/* ---------- Channels (video) ---------- */
.channel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.channel { background: linear-gradient(180deg, var(--night-2), rgba(11,24,64,.35)); border: 1px solid var(--line); border-radius: 18px; padding: 30px; display: flex; flex-direction: column; }
.channel .logo { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-bottom: 18px; }
.channel .logo.red { background: linear-gradient(135deg,#ff3d2e,#ff6a3d); color: #fff; }
.channel .logo.blue { background: linear-gradient(135deg,#3d6bff,#7b5cff); color: #fff; }
.channel h3 { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 8px; }
.channel p { color: var(--muted); margin: 0 0 22px; }
.channel .btn { align-self: flex-start; }

/* ---------- Legacy / 1995 archive ---------- */
.legacy-figure { margin: 0; }
.legacy-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 320px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--night-2); }
.legacy-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.legacy-figure figcaption { color: var(--muted); font-size: .85rem; margin-top: 14px; max-width: 68ch; }
.legacy-figure figcaption a { color: var(--lilac); text-decoration: underline; text-underline-offset: 3px; }
.legacy-figure figcaption a:hover { color: var(--star); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 160px 1fr; gap: 36px; align-items: start; }
.portrait { width: 160px; height: 200px; border-radius: 16px; background: var(--night-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; }
.about-text p { color: var(--text); opacity: .9; max-width: 62ch; }
.about-text .pull { font-family: var(--font-display); font-size: 1.4rem; color: var(--star); border-left: 3px solid var(--flame); padding-left: 20px; margin: 24px 0; line-height: 1.4; }

/* ---------- Contact ---------- */
.contact-inner { text-align: center; max-width: 56ch; margin: 0 auto; }
.contact-inner p { color: var(--muted); }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--line); padding: 40px 0 60px; margin-top: 20px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
footer.site .meta { color: var(--muted); font-size: .92rem; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--text); }
.foot-links { display: flex; gap: 18px; }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .book, .book.featured { grid-template-columns: 1fr; gap: 18px; }
  .book .cover, .book .cover-stack .cover { max-height: 340px; aspect-ratio: auto; }
  .channel-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { width: 120px; height: 150px; }
}
@media (max-width: 680px) {
  nav.main { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--night); border-bottom: 1px solid var(--line); padding: 10px 24px; gap: 2px; display: none; }
  nav.main.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  body { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}