@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,500&family=Inter:wght@400;500;600&display=swap");

:root {
  --ink: #080910;
  --ink-2: #0f1019;
  --paper: #eee2c8;
  --paper-muted: #b9ad95;
  --gold: #d9a856;
  --gold-bright: #f0ce85;
  --copper: #8e4e35;
  --line: rgba(217, 168, 86, .32);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 18% 8%, rgba(78, 48, 40, .3), transparent 29rem),
    radial-gradient(circle at 85% 30%, rgba(17, 54, 66, .25), transparent 36rem),
    var(--ink);
  font-family: var(--serif);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
a { color: inherit; }
button { color: inherit; }
img { max-width: 100%; }

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 100;
  background: rgba(255,255,255,.04);
}
.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7a3b2d, var(--gold-bright));
  box-shadow: 0 0 18px var(--gold);
}
.ambient-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background-image:
    radial-gradient(circle at 13% 17%, var(--gold-bright) 0 1px, transparent 1.5px),
    radial-gradient(circle at 79% 12%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 48% 72%, var(--gold) 0 1px, transparent 1.5px),
    radial-gradient(circle at 91% 63%, #fff 0 1px, transparent 1.5px);
  background-size: 29rem 31rem, 37rem 41rem, 43rem 47rem, 53rem 59rem;
  animation: starDrift 34s linear infinite;
}

.library-header {
  position: relative;
  z-index: 50;
  min-height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  padding: 16px clamp(20px, 4vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 16, .88);
  backdrop-filter: blur(18px);
}
.library-brand { text-decoration: none; width: max-content; }
.library-brand small {
  display: block;
  font: 500 8px/1 var(--sans);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold);
}
.library-brand strong {
  font-size: clamp(27px, 2.5vw, 42px);
  line-height: .9;
  font-weight: 500;
  letter-spacing: .03em;
}
.library-header > p {
  margin: 0;
  color: var(--paper-muted);
  font: 500 9px/1.2 var(--sans);
  letter-spacing: .22em;
  text-align: center;
  text-transform: uppercase;
}
.library-header > p span { margin: 0 .7rem; color: var(--gold); }
.library-header > nav { display: flex; justify-content: flex-end; gap: 1.35rem; align-items: center; }
.cabinet-toggle, .atlas-return {
  border: 0;
  padding: 10px 0;
  background: none;
  text-decoration: none;
  cursor: pointer;
  font: 500 9px/1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cabinet-toggle i, .atlas-return i {
  width: 13px;
  height: 13px;
  margin-right: 8px;
  display: inline-block;
  vertical-align: -2px;
}
.cabinet-toggle i { border: 1px solid var(--gold); transform: rotate(45deg); box-shadow: inset 0 0 0 3px var(--ink); background: var(--gold); }
.atlas-return { color: var(--paper-muted); }
.atlas-return i { border-radius: 50%; border: 1px solid var(--line); position: relative; }
.atlas-return i::after { content: ""; position: absolute; width: 4px; height: 4px; border-left: 1px solid var(--gold); border-bottom: 1px solid var(--gold); transform: rotate(45deg); left: 4px; top: 3px; }

.story-cabinet {
  position: fixed;
  top: 0;
  right: 0;
  width: min(510px, 93vw);
  height: 100dvh;
  z-index: 90;
  padding: 30px clamp(24px, 4vw, 52px);
  background: linear-gradient(145deg, rgba(24,22,28,.99), rgba(8,9,16,.99));
  border-left: 1px solid var(--gold);
  box-shadow: -40px 0 100px rgba(0,0,0,.7);
  transform: translateX(105%);
  transition: transform .55s cubic-bezier(.77,0,.18,1);
  overflow-y: auto;
}
.story-cabinet.is-open { transform: translateX(0); }
body.menu-open::after { content: ""; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.58); backdrop-filter: blur(2px); }
.cabinet-heading { display: flex; justify-content: space-between; align-items: start; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.cabinet-heading small { display: block; color: var(--gold); font: 500 8px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.cabinet-heading strong { display: block; margin-top: 7px; font-size: 28px; font-weight: 500; }
.cabinet-close { width: 38px; height: 38px; border: 1px solid var(--line); background: transparent; border-radius: 50%; cursor: pointer; position: relative; }
.cabinet-close::before, .cabinet-close::after { content: ""; position: absolute; width: 15px; height: 1px; background: var(--gold); left: 11px; top: 18px; transform: rotate(45deg); }
.cabinet-close::after { transform: rotate(-45deg); }
.story-cabinet nav { display: grid; }
.story-cabinet nav a { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 3px 10px; padding: 17px 10px; text-decoration: none; border-bottom: 1px solid rgba(217,168,86,.14); transition: background .25s, padding-left .25s; }
.story-cabinet nav a:hover, .story-cabinet nav a:focus-visible, .story-cabinet nav a.is-active { background: rgba(217,168,86,.08); padding-left: 17px; }
.story-cabinet nav a > span { grid-row: 1 / 3; color: var(--gold); font: 500 9px/1.6 var(--sans); }
.story-cabinet nav strong { font-size: 18px; font-weight: 500; }
.story-cabinet nav small { color: var(--paper-muted); font: 400 9px/1.4 var(--sans); letter-spacing: .08em; }

.correspondence-room {
  width: min(1460px, 100%);
  min-height: calc(100vh - 88px);
  margin: auto;
  padding: clamp(44px, 7vw, 110px) clamp(20px, 6vw, 90px) clamp(70px, 9vw, 130px);
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(480px, 1.2fr);
  gap: clamp(42px, 7vw, 115px);
  align-items: start;
  position: relative;
}
.correspondence-room::before {
  content: "";
  position: absolute;
  inset: 7% 48% 10% -12%;
  border: 1px solid rgba(217,168,86,.12);
  border-radius: 50%;
  transform: rotate(-18deg);
  pointer-events: none;
}
.room-copy { position: sticky; top: 130px; min-height: 700px; z-index: 2; }
.eyebrow {
  margin: 0 0 24px;
  color: var(--paper-muted);
  font: 500 9px/1.5 var(--sans);
  letter-spacing: .17em;
  text-transform: uppercase;
}
.eyebrow span { color: var(--gold); margin-right: 16px; }
h1 {
  margin: 0;
  font-size: clamp(52px, 6.3vw, 106px);
  line-height: .8;
  font-weight: 400;
  letter-spacing: -.045em;
  text-wrap: balance;
}
h1 em { color: var(--gold-bright); font-weight: 400; }
.seal-stage {
  --rx: 0deg;
  --ry: 0deg;
  width: min(420px, 86vw);
  aspect-ratio: 1;
  margin: 35px 0 0 -28px;
  position: relative;
  display: grid;
  place-items: center;
  transform: perspective(800px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .18s ease-out;
}
.seal-stage::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,168,86,.15), transparent 68%);
  filter: blur(12px);
}
.seal-stage img { width: 63%; filter: drop-shadow(0 24px 25px rgba(0,0,0,.68)); animation: artFloat 7s ease-in-out infinite; }
.seal-stage b { position: absolute; width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; color: #21120c; background: radial-gradient(circle at 35% 30%, #f4bd75, #8a3629 70%); box-shadow: 0 0 0 5px #5b251f, 0 0 0 6px rgba(237,196,115,.55), 0 12px 28px #000; font-size: 25px; font-weight: 600; font-style: italic; left: 8%; bottom: 18%; transform: rotate(-12deg); }
.seal-rings, .seal-rings span { position: absolute; inset: 5%; border-radius: 50%; border: 1px solid rgba(217,168,86,.25); }
.seal-rings { animation: orbit 28s linear infinite; }
.seal-rings::before, .seal-rings::after { content: "✦"; color: var(--gold); position: absolute; left: 50%; top: -6px; text-shadow: 0 0 12px var(--gold); }
.seal-rings::after { top: auto; bottom: -8px; }
.seal-rings span:nth-child(1) { inset: 8%; border-style: dashed; animation: orbit 18s linear infinite reverse; }
.seal-rings span:nth-child(2) { inset: 20%; }
.seal-rings span:nth-child(3) { inset: 35%; border-color: rgba(217,168,86,.48); }
.studio-fragment { position: absolute; right: -8%; bottom: 4%; width: 164px; padding: 8px; background: #d5c6a7; color: #34261e; box-shadow: 0 18px 40px rgba(0,0,0,.55); transform: rotate(5deg); animation: cardFloat 8s ease-in-out infinite; }
.studio-fragment img { display: block; width: 100%; filter: sepia(.2) contrast(1.08); }
.studio-fragment span { display: block; padding: 7px 4px 2px; text-align: center; font: 600 8px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; }

.form-panel {
  position: relative;
  z-index: 3;
  min-height: 680px;
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid rgba(217,168,86,.5);
  border-radius: 170px 170px 4px 4px;
  background: linear-gradient(180deg, rgba(23,24,35,.96), rgba(12,12,19,.98));
  box-shadow: 0 40px 100px rgba(0,0,0,.6), inset 0 0 70px rgba(217,168,86,.035);
  overflow: hidden;
}
.form-panel::before, .form-panel::after { content: ""; position: absolute; inset: 15px; pointer-events: none; border: 1px solid rgba(217,168,86,.11); border-radius: 150px 150px 2px 2px; }
.form-panel::after { inset: 29px; border-style: dotted; }
.panel-ornament { height: 98px; display: flex; align-items: center; justify-content: center; gap: 14px; position: relative; z-index: 1; }
.panel-ornament span { width: 27%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.panel-ornament span:last-child { transform: scaleX(-1); }
.panel-ornament i { width: 26px; height: 26px; border: 1px solid var(--gold); transform: rotate(45deg); position: relative; }
.panel-ornament i::after { content: ""; position: absolute; inset: 6px; background: var(--gold); box-shadow: 0 0 18px var(--gold); }
.form-status { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 8px; margin: -8px 0 34px; color: var(--paper-muted); font: 500 8px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.form-status span { width: 6px; height: 6px; border-radius: 50%; background: #81ad7a; box-shadow: 0 0 10px #81ad7a; animation: statusPulse 2.4s ease-in-out infinite; }
.cognito-form-shell { position: relative; z-index: 3; min-height: 500px; padding: clamp(2px, 1.4vw, 18px); color-scheme: dark; }
.cognito-form-shell iframe { width: 100% !important; min-height: 620px; border: 0 !important; }
.form-loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 15px; justify-items: center; color: var(--paper-muted); font: 500 9px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; transition: opacity .4s, visibility .4s; }
.form-loading i { width: 45px; height: 45px; border: 1px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: orbit 1.2s linear infinite; }
.cognito-form-shell.is-loaded .form-loading { opacity: 0; visibility: hidden; }

.bookshelf { position: relative; padding: clamp(80px, 10vw, 150px) clamp(20px, 7vw, 110px); border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(29,18,16,.38), transparent 36%); }
.section-heading { width: min(1160px, 100%); margin: 0 auto 52px; }
.section-heading p { color: var(--paper-muted); margin: 0 0 10px; font: 500 9px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.section-heading p span { color: var(--gold); margin-right: 15px; }
.section-heading h2 { margin: 0; font-size: clamp(44px, 6vw, 82px); line-height: .95; font-weight: 400; }
.book-grid { width: min(1160px, 100%); margin: auto; display: grid; gap: 28px; }
.book-card { display: grid; grid-template-columns: 180px 1fr; gap: clamp(26px, 4vw, 56px); align-items: center; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); background: rgba(13,14,22,.72); transition: transform .35s, border-color .35s, background .35s; }
.book-card:hover { transform: translateY(-5px); border-color: var(--gold); background: rgba(23,20,24,.9); }
.book-cover { position: relative; perspective: 700px; }
.book-cover::after { content: ""; position: absolute; inset: 7% -14px -10% 20%; background: #000; filter: blur(18px); z-index: -1; opacity: .7; }
.book-cover img { display: block; width: 100%; box-shadow: 0 16px 40px #000; transform: rotateY(7deg); transition: transform .35s; }
.book-card:hover .book-cover img { transform: rotateY(0) scale(1.02); }
.book-copy p { margin: 0 0 14px; color: var(--paper-muted); font-size: 18px; line-height: 1.45; }
.wind-card .book-copy p { font-size: 15px; }
.book-copy h3 { margin: 24px 0 5px; color: var(--paper); font-size: clamp(27px, 3vw, 42px); line-height: 1; font-weight: 500; }
.book-copy > span { display: block; color: var(--gold); font: 500 9px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.book-copy a { display: inline-block; margin-top: 24px; padding: 13px 24px; border: 1px solid var(--gold); text-decoration: none; color: var(--gold-bright); font: 600 9px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; transition: color .25s, background .25s, box-shadow .25s; }
.book-copy a:hover, .book-copy a:focus-visible { color: var(--ink); background: var(--gold-bright); box-shadow: 0 0 25px rgba(217,168,86,.3); }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(20px, 6vw, 90px); border-top: 1px solid rgba(217,168,86,.16); color: #716b61; font: 500 8px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.site-footer p { margin: 0; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes starDrift { to { background-position: 29rem 31rem, -37rem 41rem, 43rem -47rem, -53rem -59rem; } }
@keyframes artFloat { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1.5deg); } }
@keyframes cardFloat { 0%,100% { transform: translateY(0) rotate(5deg); } 50% { transform: translateY(-9px) rotate(3deg); } }
@keyframes statusPulse { 50% { opacity: .45; transform: scale(.8); } }

@media (max-width: 1050px) {
  .library-header { grid-template-columns: 1fr auto; }
  .library-header > p { display: none; }
  .correspondence-room { grid-template-columns: 1fr; }
  .room-copy { position: relative; top: 0; min-height: 570px; }
  .seal-stage { width: 370px; }
  .studio-fragment { right: auto; left: 330px; bottom: 12%; }
}

@media (max-width: 680px) {
  .library-header { min-height: 76px; padding: 13px 17px; }
  .library-brand small, .atlas-return { display: none; }
  .library-brand strong { font-size: 27px; }
  .cabinet-toggle { font-size: 8px; }
  .correspondence-room { padding-top: 48px; }
  h1 { font-size: clamp(45px, 15vw, 70px); }
  .room-copy { min-height: 510px; }
  .seal-stage { width: 310px; margin-left: -18px; }
  .studio-fragment { width: 120px; left: auto; right: -5px; bottom: 9%; }
  .form-panel { min-height: 600px; padding: 25px 12px; border-radius: 92px 92px 3px 3px; }
  .form-panel::before { border-radius: 82px 82px 2px 2px; }
  .form-panel::after { display: none; }
  .panel-ornament { height: 64px; }
  .form-status { margin-bottom: 20px; letter-spacing: .13em; }
  .cognito-form-shell { padding: 0; }
  .book-card { grid-template-columns: 110px 1fr; gap: 20px; align-items: start; }
  .book-copy p { font-size: 15px; }
  .wind-card .book-copy p { font-size: 13px; }
  .book-copy h3 { font-size: 24px; margin-top: 16px; }
  .site-footer { display: grid; text-align: center; justify-content: center; }
}

@media (max-width: 460px) {
  .book-card { grid-template-columns: 1fr; }
  .book-cover { width: 145px; }
}

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