@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;700&family=Inter:wght@400;500;700&display=swap');

:root {
  --bg: #100f14;
  --panel: rgba(255,255,255,.075);
  --panel-strong: rgba(255,255,255,.12);
  --text: #f7efe6;
  --muted: #cbbfb7;
  --line: rgba(255,255,255,.16);
  --accent: #d7a85a;
  --accent-2: #9b6cff;
  --shadow: 0 24px 80px rgba(0,0,0,.45);
  --radius: 28px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(155,108,255,.26), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(215,168,90,.18), transparent 32%),
    linear-gradient(135deg, #0d0c10 0%, #17111e 46%, #0d1018 100%);
  font-family: Inter, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.hidden { display: none !important; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(215,168,90,.12), transparent 35%),
    rgba(10, 9, 13, .94);
  backdrop-filter: blur(14px);
}

.gate-card {
  width: min(520px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  box-shadow: var(--shadow);
}

.gate-card h1, .hero h1, .section h2, .reader h2 {
  font-family: "Cormorant Garamond", serif;
  line-height: .95;
}

.gate-card h1 {
  margin: 8px 0 14px;
  font-size: clamp(2.3rem, 8vw, 4.6rem);
}

.gate-card form {
  display: grid;
  gap: 10px;
  margin: 28px 0 12px;
}

label { color: var(--muted); font-size: .9rem; }

input, textarea {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.24);
  padding: 14px 16px;
  outline: none;
}

textarea { resize: vertical; }

input:focus, textarea:focus { border-color: var(--accent); }

button, .cta {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 13px 19px;
  color: #17100a;
  background: linear-gradient(135deg, var(--accent), #ffe1a3);
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(215,168,90,.18);
}

.ghost {
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  box-shadow: none;
}

.error { color: #ffb4b4; min-height: 1.2em; }

.hero {
  min-height: 84vh;
  display: grid;
  align-content: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.topbar {
  position: absolute;
  top: 22px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.hero-inner {
  width: min(980px, 100%);
  margin: 0 auto;
  padding-top: 80px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .74rem;
  font-weight: 800;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(4rem, 11vw, 9rem);
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.65;
  margin: 26px 0 36px;
}

.section, .reader {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 82px 0;
}

.section-head {
  display: grid;
  gap: 4px;
  margin-bottom: 26px;
}

.section h2, .reader h2 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6rem);
}

.section-head p:last-child, .story-meta p {
  color: var(--muted);
  line-height: 1.7;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}

.filter {
  color: var(--text);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
}

.filter.active {
  color: #17100a;
  background: var(--accent);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--image);
  background-position: center;
  background-size: cover;
  filter: saturate(.85);
  transform: scale(1.02);
  transition: transform .35s ease;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(0,0,0,.82));
}

.card:hover::before { transform: scale(1.08); }

.card-content {
  position: relative;
  z-index: 1;
}

.card h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.2rem;
  line-height: 1;
  margin: 8px 0;
}

.card p {
  color: var(--muted);
  line-height: 1.55;
}

.story-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.story-meta {
  position: sticky;
  top: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.back { margin-bottom: 20px; }

.music-card {
  margin-top: 26px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--line);
}

audio { width: 100%; margin: 10px 0; }

.story-content {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  box-shadow: var(--shadow);
}

.story-image {
  display: block;
  width: 100%;
  height: min(520px, 55vw);
  object-fit: cover;
}

.prose {
  padding: clamp(24px, 5vw, 62px);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.55;
}

.prose p { margin: 0 0 1.15em; }

.chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}

.chat-window {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 11;
  width: min(390px, calc(100vw - 44px));
  max-height: min(680px, calc(100vh - 130px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(20, 17, 26, .94);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.chat-window header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.chat-window small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.chat-window header button {
  width: 36px;
  height: 36px;
  padding: 0;
}

.chat-messages {
  padding: 18px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}

.message {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.08);
}

.message strong {
  display: block;
  margin-bottom: 4px;
}

.message time {
  color: var(--muted);
  font-size: .75rem;
}

.chat-form {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

footer {
  color: var(--muted);
  text-align: center;
  padding: 40px 22px 96px;
}

@media (max-width: 900px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-layout { grid-template-columns: 1fr; }
  .story-meta { position: static; }
  .card { min-height: 360px; }
}


.login-page {
  min-height: 100vh;
}

.public-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.login-form {
  display: grid;
  gap: 10px;
  margin: 28px 0 12px;
}
