:root {
  --ink: #303253;
  --muted: #727491;
  --cream: #f1effb;
  --paper: #f9fcff;
  --coral: #9a7bd6;
  --coral-dark: #7c5fbc;
  --blue: #4e9fc9;
  --yellow: #c9b7ee;
  --green: #9dd6ed;
  --line: rgba(48, 50, 83, 0.12);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: min(1180px, calc(100% - 48px));
  height: 92px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50% 50% 47% 53%;
  background: var(--coral);
  color: white;
  font: 700 13px var(--serif);
  transform: rotate(-3deg);
}
.brand strong, .brand small { display: block; }
.brand strong { font: 700 19px/1.1 var(--serif); }
.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-header nav {
  display: flex;
  gap: 32px;
  color: #646787;
  font-size: 13px;
  font-weight: 650;
}
.site-header nav a { position: relative; }
.site-header nav a::after {
  content: '';
  position: absolute;
  right: 50%;
  bottom: -8px;
  left: 50%;
  height: 2px;
  background: var(--coral);
  transition: left 180ms ease, right 180ms ease;
}
.site-header nav a:hover::after { right: 0; left: 0; }
.site-header > .button { justify-self: end; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.button:hover { transform: translateY(-2px); }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover {
  background: #202344;
  box-shadow: 0 8px 22px rgba(48, 50, 83, 0.18);
}
.button-coral {
  background: var(--coral);
  color: white;
  box-shadow: 0 10px 22px rgba(154, 123, 214, 0.22);
}
.button-coral:hover { background: var(--coral-dark); }
.button-cream { background: var(--cream); color: var(--ink); }
.text-button, .read-link {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.hero {
  width: min(1180px, calc(100% - 48px));
  min-height: 600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 70px;
  padding: 58px 0 70px;
}
.hero-copy { padding-left: clamp(0px, 3vw, 42px); }
.eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 640px;
  margin: 0;
  font: 500 clamp(54px, 6.3vw, 86px)/0.97 var(--serif);
  letter-spacing: -0.055em;
}
.hero-copy > p {
  max-width: 560px;
  margin: 28px 0 0;
  color: var(--muted);
  font: 18px/1.65 var(--serif);
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
}
.hero-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 12px;
}
.hero-note strong { color: var(--ink); }
.avatars { display: flex; }
.avatars i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font: 700 11px var(--serif);
  font-style: normal;
}
.avatars i + i { margin-left: -9px; background: var(--coral); }

.featured-book {
  position: relative;
  justify-self: center;
  width: min(370px, 80vw);
  aspect-ratio: 0.77;
  padding: 58px 46px 40px;
  overflow: visible;
  border: 0;
  border-radius: 5px 18px 18px 5px;
  background: linear-gradient(145deg, #72c5e8 0%, #8873ca 92%);
  color: white;
  cursor: pointer;
  text-align: left;
  box-shadow: -12px 12px 0 #c9b7ee, 0 34px 70px rgba(67, 63, 115, 0.22);
  transform: rotate(2.5deg);
  transition: transform 250ms ease, box-shadow 250ms ease;
}
.featured-book:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: -9px 12px 0 #c9b7ee, 0 42px 80px rgba(67, 63, 115, 0.25);
}

.featured-visual {
  position: relative;
  justify-self: center;
  width: min(500px, 44vw);
  aspect-ratio: 1.45;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  background: #8071c7;
  box-shadow: 0 30px 80px rgba(67, 63, 115, .24), -10px 12px 0 #d8c9f4;
  cursor: pointer;
  transform: rotate(1.3deg);
  transition: transform .25s ease, box-shadow .25s ease;
}
.featured-visual:hover { transform: rotate(0) translateY(-6px); box-shadow: 0 38px 90px rgba(67, 63, 115, .3), -10px 12px 0 #d8c9f4; }
.featured-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visual-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  padding: 15px 18px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 16px;
  background: rgba(47, 42, 91, .58);
  color: white;
  text-align: left;
  backdrop-filter: blur(9px);
}
.visual-caption small { display: block; margin-bottom: 4px; font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.visual-caption strong { font: 500 25px/1.05 var(--serif); }
.featured-book::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 18px;
  width: 1px;
  background: rgba(255,255,255,.2);
  box-shadow: 4px 0 0 rgba(48,50,83,.08);
}
.featured-book .moon {
  position: absolute;
  top: 46px;
  right: 42px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: -13px 6px 0 #83b8de;
  transform: rotate(-18deg);
}
.star-field {
  position: absolute;
  top: 118px;
  right: 30px;
  color: rgba(255,255,255,.8);
  font-size: 15px;
  line-height: 2.2;
}
.book-label {
  display: block;
  margin-top: 40%;
  margin-bottom: 17px;
  color: #f2f4ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.featured-book strong {
  display: block;
  font: 500 clamp(37px, 4vw, 54px)/.98 var(--serif);
  letter-spacing: -.04em;
}
.featured-book small {
  position: absolute;
  bottom: 38px;
  left: 46px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.book-shadow {
  position: absolute;
  right: 12%;
  bottom: -62px;
  left: 4%;
  z-index: -1;
  height: 32px;
  border-radius: 50%;
  background: rgba(48,50,83,.16);
  filter: blur(18px);
}

.library {
  padding: 92px max(24px, calc((100vw - 1180px) / 2)) 110px;
  background: var(--cream);
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}
.section-heading .eyebrow { margin-bottom: 12px; }
.section-heading h2, .inspiration h2 {
  margin: 0;
  font: 500 clamp(42px, 5vw, 64px)/1 var(--serif);
  letter-spacing: -.045em;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(290px, 100%);
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 34px 0 38px;
}
.filters button {
  min-height: 35px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.filters button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 32px;
}
.story-card {
  display: grid;
  grid-template-columns: 115px 1fr;
  gap: 22px;
  min-width: 0;
}
.cover {
  position: relative;
  width: 115px;
  height: 160px;
  padding: 0;
  border: 0;
  border-radius: 3px 10px 10px 3px;
  cursor: pointer;
  color: white;
  box-shadow: -5px 5px 0 rgba(48,50,83,.08), 0 14px 25px rgba(48,50,83,.13);
  transition: transform 180ms ease;
}
.cover:hover { transform: translateY(-5px) rotate(-1deg); }
.cover::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 1px;
  background: rgba(255,255,255,.24);
}
.cover-coral { background: var(--coral); }
.cover-blue { background: var(--blue); }
.cover-yellow { background: var(--yellow); color: #4a426e; }
.cover-green { background: var(--green); }
.cover > span {
  display: block;
  font: 38px/1 var(--serif);
}
.cover > small {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 18px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.story-info { min-width: 0; }
.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.story-info h3 {
  margin: 0;
  font: 500 23px/1.08 var(--serif);
  letter-spacing: -.025em;
}
.story-info > p {
  display: -webkit-box;
  margin: 11px 0 15px;
  overflow: hidden;
  color: var(--muted);
  font: 12px/1.55 var(--serif);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.story-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.read-link { font-size: 10px; }
.favorite {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 17px;
}
.favorite.selected {
  border-color: rgba(154,123,214,.3);
  background: rgba(154,123,214,.12);
  color: var(--coral);
}
.empty-state {
  padding: 70px 24px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  text-align: center;
}
.empty-state > span { font-size: 34px; }
.empty-state h3 { margin: 14px 0 7px; font: 24px var(--serif); }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

.inspiration {
  width: min(1180px, calc(100% - 48px));
  margin: 84px auto;
  padding: 58px 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  border-radius: 24px;
  background: linear-gradient(135deg, #8870c9 0%, #58add4 100%);
  color: white;
  box-shadow: 0 22px 60px rgba(96,86,157,.22);
}
.eyebrow.light { margin-bottom: 12px; color: #eff5f7; }
.inspiration h2 { font-size: clamp(36px, 4.2vw, 56px); }
.inspiration p { margin: 18px 0 0; color: #eef5f7; font: 17px var(--serif); }
.inspiration-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.dice {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: white;
  font-size: 23px;
  transition: transform 180ms ease, background 180ms ease;
}
.dice:hover { background: rgba(255,255,255,.12); transform: rotate(20deg); }

footer {
  width: min(1180px, calc(100% - 48px));
  min-height: 100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
footer > span { color: var(--ink); font: 700 18px var(--serif); }
footer p span { margin-left: 5px; color: var(--coral); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow-y: auto;
  background: rgba(35,35,68,.72);
  backdrop-filter: blur(8px);
  animation: fade-in 180ms ease both;
}
.reader, .writer {
  position: relative;
  width: min(740px, 100%);
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 40px 100px rgba(35,35,68,.36);
  animation: rise 220ms ease both;
}
.reader { padding: clamp(46px, 7vw, 78px) clamp(28px, 8vw, 92px); }
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
}
.reader-kicker {
  margin-bottom: 18px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.reader h2, .writer h2 {
  margin: 0;
  font: 500 clamp(42px, 7vw, 68px)/.98 var(--serif);
  letter-spacing: -.05em;
}
.reader-byline { margin: 17px 0 0; color: var(--muted); font-size: 11px; }
.reader-ornament { margin: 32px 0; color: var(--coral); font-size: 14px; }
.reader-content { font: clamp(17px, 2vw, 19px)/1.85 var(--serif); }
.reader-content p { margin: 0 0 1.25em; }
.reader-content p:first-child::first-letter {
  float: left;
  margin: 10px 8px 0 0;
  color: var(--coral);
  font-size: 62px;
  line-height: .7;
}
.reader-end {
  margin-top: 42px;
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
.reader-end > span { font: italic 18px var(--serif); }
.reader-end button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--coral);
  font-size: 12px;
  font-weight: 750;
}
.writer { padding: clamp(36px, 6vw, 64px); }
.writer > .eyebrow { margin-bottom: 13px; }
.writer h2 { font-size: clamp(38px, 6vw, 58px); }
.writer > p { margin: 15px 0 28px; color: var(--muted); font: 15px var(--serif); }
.writer form {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
}
.writer label {
  display: grid;
  gap: 8px;
  color: #646787;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.writer input, .writer select, .writer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: white;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}
.writer input, .writer select { height: 46px; padding: 0 14px; }
.writer textarea {
  min-height: 250px;
  padding: 16px;
  resize: vertical;
  font: 16px/1.65 var(--serif);
}
.writer input:focus, .writer select:focus, .writer textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(118,190,226,.18);
}
.full-field { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr .8fr; gap: 35px; }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspiration { padding: 50px; }
}

@media (max-width: 720px) {
  .site-header { width: min(100% - 32px, 1180px); height: 80px; }
  .brand small { display: none; }
  .site-header > .button { min-height: 40px; padding: 0 14px; font-size: 11px; }
  .hero {
    width: min(100% - 36px, 1180px);
    grid-template-columns: 1fr;
    gap: 58px;
    padding: 62px 0 95px;
    text-align: center;
  }
  .hero-copy { padding: 0; }
  .hero-copy > p { margin-right: auto; margin-left: auto; }
  .hero-actions, .hero-note { justify-content: center; }
  .featured-book { width: min(300px, 76vw); }
  .featured-visual { width: min(520px, 92vw); }
  .library { padding-top: 70px; padding-bottom: 80px; }
  .section-heading { align-items: start; flex-direction: column; }
  .search { width: 100%; }
  .story-grid { grid-template-columns: 1fr; }
  .story-card { grid-template-columns: 100px 1fr; }
  .cover { width: 100px; height: 142px; }
  .inspiration {
    width: min(100% - 32px, 1180px);
    margin: 50px auto;
    padding: 42px 30px;
    align-items: flex-start;
    flex-direction: column;
  }
  footer {
    min-height: 125px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
  }
  footer p { margin: 0; }
  .modal-backdrop { padding: 0; align-items: end; }
  .reader, .writer { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .writer form { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
}

@media (max-width: 420px) {
  .site-header > .button span { display: none; }
  .hero h1 { font-size: 48px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .text-button { align-self: center; }
  .story-card { grid-template-columns: 86px 1fr; gap: 17px; }
  .cover { width: 86px; height: 126px; }
  .story-info h3 { font-size: 21px; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  box-shadow: 0 12px 36px rgba(48,50,83,.24);
  font-size: 12px;
  font-weight: 700;
  animation: rise 220ms ease both;
}
