:root {
  --bg: #050814;
  --bg-lift: #0c1528;
  --ink: #f2eee6;
  --muted: #a8b4c4;
  --soft: #6f7f94;
  --line: rgba(242, 238, 230, 0.14);
  --accent: #3d7ea6;
  --glow: rgba(61, 126, 166, 0.28);
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --body: "Source Sans 3", "Helvetica Neue", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 45% at 70% 8%, rgba(61, 126, 166, 0.18), transparent 55%),
    radial-gradient(ellipse 55% 40% at 15% 90%, rgba(20, 48, 78, 0.45), transparent 60%),
    linear-gradient(180deg, #03060f 0%, #07101f 48%, #050814 100%);
}

/* Gate */
body.site-locked > :not(.site-gate):not(script) {
  visibility: hidden;
  pointer-events: none;
}

.site-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 60% 40% at 50% 20%, rgba(61, 126, 166, 0.2), transparent 60%),
    #050814;
}

body.site-locked .site-gate {
  display: grid;
}

.site-gate-card {
  width: min(100%, 26rem);
  padding: 2rem 1.75rem;
  border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.88);
  backdrop-filter: blur(10px);
  text-align: center;
}

.site-gate-eyebrow,
.eyebrow,
.card-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
}

.site-gate-title {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.05;
}

.site-gate-copy,
.card-note,
.footer-muted,
.section-lead {
  color: var(--muted);
}

.site-gate-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.site-gate-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: #070d1a;
  color: var(--ink);
  font: inherit;
}

.site-gate-form button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.2rem;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.site-gate-form button,
.btn-primary {
  background: var(--ink);
  color: #081018;
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.site-gate-error {
  margin: 0.85rem 0 0;
  color: #d98a7a;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid transparent;
  background: rgba(5, 8, 20, 0.72);
  backdrop-filter: blur(12px);
}

.topbar-brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
}

.topbar-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.topbar-nav a {
  text-decoration: none;
  color: var(--muted);
}

.topbar-nav a:hover {
  color: var(--ink);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
  min-height: calc(100vh - 4.5rem);
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem) 3rem;
}

.hero-brand {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3.4rem, 9vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.hero-lead {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-visual {
  margin: 0;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.hero-visual img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Sections */
.library,
.saga,
.about {
  padding: 4.5rem clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 42rem;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.05;
}

.section-lead {
  margin: 0;
  font-size: 1.08rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  padding: 1.4rem 1.35rem 1.5rem;
  border: 1px solid var(--line);
  background: rgba(12, 21, 40, 0.55);
}

.card h3 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
}

.card p {
  margin: 0 0 0.7rem;
}

.card-note {
  margin: 0;
  font-size: 0.92rem;
}

.saga-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1.5rem;
}

.saga-list li {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 1.2rem;
}

.saga-list span {
  color: var(--soft);
  font-family: var(--body);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.footer {
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
}

.footer-muted {
  margin-top: 0.35rem !important;
  font-family: var(--body) !important;
  font-size: 0.92rem !important;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    order: -1;
  }

  .grid,
  .saga-list {
    grid-template-columns: 1fr;
  }

  .topbar-nav {
    display: none;
  }
}
