/* ==========================================================================
   Starium — Author site of David Teixeira
   Palette taken from the book cover: deep space navy + electric blue.
   ========================================================================== */

:root {
  --bg: #04081a;
  --bg-2: #080f2a;
  --bg-3: #0d1740;
  --panel: rgba(10, 18, 50, 0.72);
  --line: rgba(120, 160, 255, 0.18);
  --text: #e8eeff;
  --muted: #9fb0d8;
  --accent: #4f8dff;
  --accent-2: #8fc1ff;
  --accent-glow: rgba(79, 141, 255, 0.45);
  --white: #ffffff;
  --radius: 14px;
  --maxw: 1120px;
  --font-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--white); }

.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0.04em; line-height: 1.15; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); text-transform: uppercase; }
h3 { font-size: 1.1rem; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

/* Accessible hiding */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Skip link */
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------------- Header ---------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: 0.9rem 0;
  background: transparent;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(4, 8, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: relative; }
.brand { font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--white); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text); letter-spacing: 0.04em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.nav-links a:hover { color: var(--white); }
.lang { display: inline-flex; border: 1px solid rgba(143, 193, 255, 0.35); border-radius: 999px; overflow: hidden; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; background: rgba(4, 8, 26, 0.5); }
.lang a, .lang span { padding: 0.35rem 0.8rem; color: var(--text); text-shadow: none; }
.lang [aria-current="page"] { background: var(--accent); color: #041028; }
.nav-toggle { display: none; background: rgba(4, 8, 26, 0.5); border: 1px solid rgba(143, 193, 255, 0.35); border-radius: 8px; color: var(--white); padding: 0.45rem 0.6rem; cursor: pointer; }
.nav-toggle svg { display: block; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: calc(100% + 0.7rem); right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 0.6rem; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 0.55rem 0.8rem; }
  .nav-links li:last-child { padding-top: 0.8rem; border-top: 1px solid var(--line); }
}

/* ---------------- Hero ----------------
   Desktop: the titled banner artwork is the hero; the h1 keeps the full title
   for assistive tech and search engines, but only the subtitle is painted.
   Mobile: the textless panorama becomes the background and the title is
   rendered as text so it stays legible on a narrow screen.                  */
.hero { position: relative; text-align: center; overflow: hidden; isolation: isolate; padding-bottom: 3.5rem; }
.hero-banner-wrap { position: relative; line-height: 0; }
.hero-banner { width: 100%; height: auto; }
.hero-banner-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: linear-gradient(to bottom, rgba(4, 8, 26, 0) 0%, rgba(4, 8, 26, 0.55) 55%, var(--bg) 100%);
}
.hero-bg { display: none; }
.hero-content { position: relative; margin-top: -4vw; }
.hero-title { margin: 0 0 1.4rem; color: var(--white); }
.hero-title .t1 {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.hero-title .t2 {
  display: block;
  font-size: clamp(1.3rem, 3.2vw, 2.3rem); font-weight: 700;
  letter-spacing: 0.26em; text-transform: uppercase;
  text-shadow: 0 0 24px rgba(79, 141, 255, 0.55);
}
.hero-title .t2::before { content: "\2014\00a0"; color: var(--accent); }
.hero-title .t2::after { content: "\00a0\2014"; color: var(--accent); }
.tagline {
  max-width: 36ch; margin: 0 auto 2.2rem;
  font-family: var(--font-display); font-size: clamp(0.85rem, 1.7vw, 1.02rem);
  letter-spacing: 0.14em; line-height: 1.85; color: var(--text); text-transform: uppercase;
}
.tagline strong { color: var(--white); font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }
@keyframes drift { from { transform: scale(1.06) translateX(-1%); } to { transform: scale(1.06) translateX(1%); } }

@media (max-width: 899px) {
  .hero { min-height: 100svh; display: grid; place-items: center; padding: 7rem 0 5rem; }
  .hero-banner-wrap { display: none; }
  .hero-bg {
    display: block; position: absolute; inset: 0; z-index: -2;
    background: url("../images/space-900.jpg") center / cover no-repeat;
    transform: scale(1.06);
    animation: drift 40s ease-in-out infinite alternate;
  }
  .hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
      radial-gradient(ellipse at center, rgba(4, 8, 26, 0.1) 0%, rgba(4, 8, 26, 0.7) 75%),
      linear-gradient(to bottom, rgba(4, 8, 26, 0.45), rgba(4, 8, 26, 0.15) 45%, var(--bg) 100%);
  }
  .hero-content { margin-top: 0; }
  .hero-title .t1 {
    position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal;
    display: block; font-size: clamp(2.8rem, 15vw, 5rem); font-weight: 800; letter-spacing: 0.12em; line-height: 1.05;
    text-shadow: 0 0 18px rgba(143, 193, 255, 0.55), 0 0 60px rgba(79, 141, 255, 0.35);
  }
  .hero-title .t2 { font-size: clamp(0.95rem, 4.2vw, 1.4rem); margin-top: 0.5rem; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.03em;
  border: 1px solid transparent; transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #041028; box-shadow: 0 0 0 0 var(--accent-glow); }
.btn-primary:hover { background: var(--accent-2); color: #041028; box-shadow: 0 8px 30px var(--accent-glow); }
.btn-ghost { border-color: rgba(143, 193, 255, 0.45); color: var(--white); background: rgba(4, 8, 26, 0.35); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--accent-2); background: rgba(79, 141, 255, 0.12); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------------- Sections ---------------- */
.section { padding: 6rem 0; position: relative; }
.section-alt { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%); }
.section-head { max-width: 60ch; margin-bottom: 3rem; }

/* Book */
.book-grid { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 4rem; align-items: start; }
.book-cover { position: relative; margin: 0; }
.book-cover img {
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(79, 141, 255, 0.18);
  transform: perspective(1200px) rotateY(6deg);
  transition: transform 0.5s ease;
}
.book-cover:hover img { transform: perspective(1200px) rotateY(0deg); }
.book-cover::before {
  content: ""; position: absolute; inset: 10% -10% -10% 10%; z-index: -1;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%); filter: blur(30px);
}
.book-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.6rem; padding: 0; list-style: none; }
.book-meta li { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.8rem; }
.synopsis p { margin: 0 0 1.1rem; color: var(--text); }
.synopsis p.lead { font-size: 1.12rem; color: var(--white); }
.buy { margin-top: 2.2rem; }
.buy h3 { margin-bottom: 1rem; }
.buy-list { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); padding: 0; margin: 0; list-style: none; }
.buy-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.2rem; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; color: var(--text);
}
.buy-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); color: var(--white); }
.buy-card .flag {
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; line-height: 1;
  padding: 0.45rem 0.55rem; border-radius: 8px; background: rgba(79, 141, 255, 0.16); color: var(--accent-2);
}
.buy-card .txt { flex: 1; }
.buy-card .label { display: block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.buy-card .store { display: block; font-weight: 600; }
.buy-card .go { color: var(--accent); flex: none; width: 20px; height: 20px; }
.buy-note { margin-top: 0.9rem; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 860px) {
  .book-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .book-cover { max-width: 320px; margin-inline: auto; }
}

/* Universe / highlights */
.cards { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card {
  padding: 1.6rem; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  transition: transform 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(79, 141, 255, 0.5); }
.card .icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: rgba(79, 141, 255, 0.14); color: var(--accent-2); margin-bottom: 1rem; }
.card .icon svg { width: 22px; height: 22px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Quote band (textless panorama as backdrop) */
.quote-band { position: relative; padding: 7rem 0; text-align: center; isolation: isolate; overflow: hidden; border-block: 1px solid var(--line); }
.quote-band-bg { position: absolute; inset: 0; z-index: -2; background: url("../images/space-900.jpg") center / cover no-repeat; }
@media (min-width: 900px) { .quote-band-bg { background-image: url("../images/space-1600.jpg"); } }
.quote-band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, var(--bg), rgba(4, 8, 26, 0.55) 30%, rgba(4, 8, 26, 0.55) 70%, var(--bg)); }
.quote-band blockquote { margin: 0 auto; max-width: 40ch; font-family: var(--font-display); font-size: clamp(1.1rem, 2.6vw, 1.7rem); letter-spacing: 0.1em; line-height: 1.6; color: var(--white); text-transform: uppercase; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8); }
.quote-band blockquote span { display: block; margin-top: 1rem; font-size: 0.7rem; letter-spacing: 0.3em; color: var(--accent-2); }

/* Author */
.author-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 3.5rem; align-items: center; }
.author-photo {
  aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 50px rgba(79, 141, 255, 0.15);
  background: radial-gradient(circle at 50% 40%, rgba(79, 141, 255, 0.25), transparent 60%), linear-gradient(160deg, var(--bg-3), var(--bg));
  border: 1px solid var(--line); display: grid; place-items: center;
}
.author-photo img { width: 100%; height: 100%; object-fit: cover; }
.author-photo svg { width: 38%; height: auto; opacity: 0.9; }
.author-text p { color: var(--text); }
.author-links { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
@media (max-width: 860px) { .author-grid { grid-template-columns: 1fr; } .author-photo { max-width: 320px; } }

/* Contact */
.contact { text-align: center; }
.contact p { max-width: 52ch; margin-inline: auto; color: var(--muted); }
.social { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.social a, .social button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.2rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font: inherit; font-size: 0.92rem; font-weight: 500; background: none; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.social a:hover, .social button:hover { border-color: var(--accent); background: rgba(79, 141, 255, 0.1); color: var(--white); }
.social svg { width: 18px; height: 18px; flex: none; }
.social .email-shown { border-color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; font-size: 0.85rem; color: var(--muted); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1.2rem; }
.site-footer a, .site-footer .linklike { color: var(--muted); }
.site-footer a:hover, .site-footer .linklike:hover { color: var(--white); }
.linklike { background: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg { animation: none; }
  html { scroll-behavior: auto; }
}

/* Stars background decoration */
.stars { position: fixed; inset: 0; z-index: -10; pointer-events: none; background: var(--bg); overflow: hidden; }
.stars::before, .stars::after {
  content: ""; position: absolute; inset: -50%;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 80% 20%, rgba(143,193,255,0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 85%, rgba(255,255,255,0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,0.4) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 10% 75%, rgba(143,193,255,0.7) 50%, transparent 51%);
  background-size: 420px 420px, 560px 560px, 700px 700px, 380px 380px, 640px 640px, 500px 500px;
  opacity: 0.55;
}
.stars::after { background-size: 300px 300px, 460px 460px, 520px 520px, 280px 280px, 740px 740px, 600px 600px; opacity: 0.35; }
