/* Shared styles for the free library pages of The Desmic Lattice.
   Same navy and gold world as the home page; a single quiet lattice motif. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy-deep: #080B1C; --navy-mid: #101632; --navy-panel: #0C1228;
  --hairline: #2A3A60; --gold: #E8AA40; --gold-light: #F5D18A;
  --dusk: #8FA3D6; --ink: #ECF1FC; --ink-muted: rgba(236,241,252,.6);
  --ink-faint: rgba(236,241,252,.38);
  --danger: #E89A8E; --ok: #8FD3A8;
  --font-heading: 'Crimson Pro', Georgia, serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-label: 'Julius Sans One', sans-serif;
  --max-w: 1080px; --gutter: clamp(20px, 5vw, 60px);
  --ease: cubic-bezier(.22,.61,.36,1);
}
html { scroll-behavior: smooth; }
body {
  background: var(--navy-deep); color: var(--ink); font-family: var(--font-body);
  font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; min-height: 100dvh;
  display: flex; flex-direction: column;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(143,163,214,.10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(232,170,64,.06), transparent 70%);
}
body > * { position: relative; z-index: 1; }
[hidden] { display: none !important; }
a { color: var(--gold-light); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.container { max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); width: 100%; }
.narrow { max-width: 720px; }
.label { font-family: var(--font-label); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Nav */
.site-nav { position: fixed; inset-inline: 0; top: 0; z-index: 200; background: rgba(8,11,28,.92); backdrop-filter: blur(16px); border-bottom: 1px solid var(--hairline); }
.nav-inner { max-width: var(--max-w); margin-inline: auto; padding: 18px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-logo { font-family: var(--font-label); font-size: 15px; color: var(--ink); letter-spacing: .22em; text-decoration: none; }
.nav-logo:hover { color: var(--gold-light); }
.nav-links { display: flex; gap: 30px; list-style: none; align-items: center; }
.nav-links a, .nav-mobile a { font-family: var(--font-label); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--gold-light); }
.nav-toggle { display: none; background: none; border: 1px solid var(--hairline); border-radius: 3px; width: 42px; height: 42px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; width: 18px; height: 1px; background: var(--ink); transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-mobile { display: none; border-top: 1px solid var(--hairline); padding: 10px var(--gutter) 22px; flex-direction: column; }
.nav-mobile a { padding: 13px 0; font-size: 12px; border-bottom: 1px solid rgba(42,58,96,.5); }
.nav-mobile a[aria-current] { color: var(--gold-light); }
.site-nav.open .nav-mobile { display: flex; }
@media (max-width: 760px) { .nav-links { display: none; } .nav-toggle { display: inline-flex; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; padding: 13px 28px; border-radius: 3px; transition: background .2s, border-color .2s, color .2s, transform .25s var(--ease); cursor: pointer; border: 1px solid transparent; }
.btn-gold { background: var(--gold); color: #0D0A00; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); }
.btn[disabled] { opacity: .55; cursor: wait; transform: none; }
.text-link { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); text-decoration: none; border-bottom: 1px solid var(--hairline); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.text-link:hover { color: var(--gold-light); border-color: var(--gold); }

/* Layout */
main { padding: 140px 0 100px; flex: 1; }
.page-header { margin-bottom: clamp(44px, 7vw, 76px); }
.page-header.center { text-align: center; }
.page-title { font-family: var(--font-heading); font-weight: 300; font-size: clamp(38px, 6vw, 62px); line-height: 1.1; margin-top: 16px; letter-spacing: -.01em; }
.page-title em { color: var(--gold-light); font-style: italic; }
.page-sub { color: var(--ink-muted); max-width: 580px; margin-top: 18px; font-weight: 300; font-size: 18px; }
.center .page-sub { margin-inline: auto; }
.lattice-rule { height: 1px; border: 0; margin: 60px 0; background: linear-gradient(90deg, transparent, var(--hairline) 20%, var(--hairline) 80%, transparent); }

/* Library hub */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 960px) { .shelf { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .shelf { grid-template-columns: 1fr; } }
.volume { display: flex; flex-direction: column; background: var(--navy-panel); border: 1px solid var(--hairline); border-radius: 6px; padding: 26px 26px 28px; transition: border-color .3s, transform .3s var(--ease); }
.volume:hover { border-color: rgba(232,170,64,.4); transform: translateY(-3px); }
.volume-cover { display: block; width: 100%; aspect-ratio: 612 / 792; object-fit: contain; border-radius: 3px; border: 1px solid var(--hairline); margin-bottom: 24px; }
.volume-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--dusk); }
.volume-name { font-family: var(--font-heading); font-weight: 400; font-size: 26px; line-height: 1.2; margin-top: 4px; }
.volume-name a { color: inherit; text-decoration: none; }
.volume-name a:hover { color: var(--gold-light); }
.volume-access { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; color: var(--gold-light); margin-top: 8px; }
.volume-desc { color: var(--ink-muted); font-size: 15px; font-weight: 300; margin-top: 14px; flex-grow: 1; }
.volume-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.volume-actions .btn { width: 100%; }
.volume-actions .text-link { align-self: flex-start; }
.skeleton { background: var(--navy-panel); border: 1px solid var(--hairline); border-radius: 6px; min-height: 560px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .5; } 50% { opacity: .9; } }
.notice { padding: 16px 20px; border: 1px solid var(--hairline); border-left: 2px solid var(--dusk); border-radius: 4px; background: var(--navy-panel); color: var(--ink-muted); font-size: 15px; }
.notice strong { color: var(--ink); font-weight: 500; }

/* Landing pages */
.landing { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 6vw, 80px); align-items: start; }
@media (max-width: 820px) { .landing { grid-template-columns: 1fr; } }
.landing-cover { width: 100%; max-width: 420px; aspect-ratio: 612 / 792; object-fit: contain; border-radius: 4px; border: 1px solid var(--hairline); box-shadow: 0 30px 70px -30px rgba(0,0,0,.7); }
.facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--dusk); list-style: none; }
.prose { margin-top: 26px; color: var(--ink-muted); font-weight: 300; }
.prose p + p { margin-top: 14px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose h2 { font-family: var(--font-heading); font-weight: 400; font-size: 26px; color: var(--ink); margin: 40px 0 10px; }
.prose ul { margin: 10px 0 0 18px; }
.prose li { margin-top: 6px; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; align-items: center; }
.next-read { margin-top: 70px; padding: 28px; border: 1px solid var(--hairline); border-radius: 6px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.next-read h3 { font-family: var(--font-heading); font-weight: 400; font-size: 23px; }
.next-read p { color: var(--ink-muted); font-size: 15px; }

/* Access + support forms */
.panel { background: var(--navy-panel); border: 1px solid var(--hairline); border-radius: 6px; padding: clamp(22px, 4vw, 32px); }
.field-label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 8px; }
.input { width: 100%; min-height: 48px; background: var(--navy-deep); color: var(--ink); border: 1px solid var(--hairline); border-radius: 3px; padding: 11px 14px; font-family: var(--font-body); font-size: 16px; transition: border-color .2s; }
.input:focus { outline: none; border-color: var(--gold); }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .input { flex: 1 1 220px; }
.form-hint { font-size: 13.5px; color: var(--ink-faint); margin-top: 12px; }
.form-hint a { color: var(--ink-muted); }
.form-msg { font-size: 14.5px; margin-top: 12px; min-height: 1px; }
.form-msg.err { color: var(--danger); }
.access-success { animation: rise .45s var(--ease) both; }
.access-success h3 { font-family: var(--font-heading); font-weight: 400; font-size: 24px; }
.access-success p { color: var(--ink-muted); font-size: 15px; margin-top: 6px; }
.access-success .btn { margin-top: 18px; }
.quiet-support { margin-top: 18px; font-size: 13.5px; color: var(--ink-faint); }
.quiet-support a { color: var(--ink-muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 520px) { .amounts { grid-template-columns: repeat(2, 1fr); } }
.amount { position: relative; }
.amount input { position: absolute; opacity: 0; inset: 0; }
.amount span { display: flex; align-items: center; justify-content: center; min-height: 52px; border: 1px solid var(--hairline); border-radius: 3px; font-family: var(--font-heading); font-size: 22px; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.amount input:checked + span { border-color: var(--gold); color: var(--gold-light); background: rgba(232,170,64,.07); }
.amount input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.custom-amount { position: relative; margin-top: 16px; }
.custom-amount .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-family: var(--font-heading); font-size: 20px; }
.custom-amount .input { padding-left: 32px; }
.status-card { text-align: center; padding: 34px 26px; }
.status-card h2 { font-family: var(--font-heading); font-weight: 300; font-size: 32px; }
.status-card p { color: var(--ink-muted); margin-top: 10px; }

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); padding: 40px 0; }
.footer-inner { max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.footer-logo { font-family: var(--font-label); letter-spacing: .22em; font-size: 13px; }
.footer-links { display: flex; gap: 10px 22px; list-style: none; flex-wrap: wrap; }
.footer-links a { color: var(--ink-muted); text-decoration: none; font-size: 13px; transition: color .2s; }
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { color: var(--ink-faint); font-size: 12.5px; }

.fade-in { animation: rise .6s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 820px) { .landing-cover { max-width: 240px; } }

/* Plate Collection: library entry */
.plate-entry { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(26px, 5vw, 56px); align-items: center; margin-top: 26px; background: var(--navy-panel); border: 1px solid var(--hairline); border-radius: 6px; padding: clamp(22px, 4vw, 34px); transition: border-color .3s; }
.plate-entry:hover { border-color: rgba(232,170,64,.4); }
.plate-entry-art { display: block; overflow: hidden; border-radius: 3px; border: 1px solid var(--hairline); aspect-ratio: 16 / 10; }
.plate-entry-art img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 1.2s var(--ease); }
.plate-entry:hover .plate-entry-art img { transform: scale(1.035); }
.plate-entry .volume-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
.plate-entry .volume-actions .btn { width: auto; }
@media (max-width: 820px) { .plate-entry { grid-template-columns: 1fr; } }
.shelf-divider { display: flex; align-items: center; gap: 18px; margin-top: 56px; color: var(--dusk); }
.shelf-divider::before, .shelf-divider::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }

/* Plates page */
.plates-hero { text-align: center; }
.plates-hero .page-sub { margin-inline: auto; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 30px); margin-top: clamp(40px, 6vw, 64px); }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }
.compare-fig { position: relative; margin: 0; }
.compare-frame { display: block; position: relative; overflow: hidden; border-radius: 4px; border: 1px solid var(--hairline); background: var(--navy-panel); aspect-ratio: 700 / 1244; box-shadow: 0 30px 70px -34px rgba(0,0,0,.75); transition: border-color .35s, transform .45s var(--ease); }
.compare-frame img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 1.4s var(--ease); }
.compare-fig:hover .compare-frame { border-color: rgba(232,170,64,.45); transform: translateY(-3px); }
.compare-fig:hover .compare-frame img { transform: none; }
.compare-tag { position: absolute; top: 14px; left: 14px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; padding: 5px 10px; border-radius: 2px; background: rgba(8,11,28,.82); color: var(--gold-light); border: 1px solid rgba(232,170,64,.3); }
.compare-fig figcaption { margin-top: 14px; font-size: 14px; color: var(--ink-muted); font-weight: 300; }
.compare-fig figcaption strong { color: var(--ink); font-weight: 500; font-family: var(--font-heading); font-size: 19px; display: block; }
.compare-note { text-align: center; margin-top: 22px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; color: var(--dusk); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 60px; }
@media (max-width: 760px) { .choices { grid-template-columns: 1fr; } }
.choice { position: relative; display: flex; flex-direction: column; background: var(--navy-panel); border: 1px solid var(--hairline); border-radius: 6px; padding: clamp(24px, 4vw, 34px); transition: border-color .3s, transform .3s var(--ease); scroll-margin-top: 110px; }
.choice::before { content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--gold), transparent); transform: scaleX(.18); transform-origin: left; transition: transform .6s var(--ease); }
.choice:hover { border-color: rgba(232,170,64,.4); transform: translateY(-2px); }
.choice:hover::before, .choice:target::before { transform: scaleX(1); }
.choice h2 { font-family: var(--font-heading); font-weight: 400; font-size: 30px; line-height: 1.15; margin-top: 6px; }
.choice .facts { margin-top: 12px; }
.choice p.choice-desc { color: var(--ink-muted); font-weight: 300; font-size: 15.5px; margin-top: 14px; flex-grow: 1; }
.choice .btn { margin-top: 24px; width: 100%; }
.choice .form-hint { margin-top: 10px; }
.plates-help { margin-top: 56px; }
.plates-help h2 { font-family: var(--font-heading); font-weight: 400; font-size: 26px; }
.plates-help p { color: var(--ink-muted); font-size: 15px; font-weight: 300; margin-top: 10px; }
.plate-index { list-style: none; margin-top: 18px; columns: 2; column-gap: 32px; font-size: 14.5px; color: var(--ink-muted); }
.plate-index li { padding: 7px 0; border-bottom: 1px solid rgba(42,58,96,.5); break-inside: avoid; }
.plate-index span { font-family: var(--font-mono); font-size: 11px; color: var(--dusk); margin-right: 10px; }
.updates-opt-in { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0 10px; font-size: 14px; line-height: 1.6; cursor: pointer; }
.updates-opt-in input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--gold); }
@media (max-width: 520px) { .plate-index { columns: 1; } }
