:root {
  color-scheme: dark;
  --ink: #07070c;
  --ink-soft: #0f0f18;
  --panel: #151420;
  --paper: #f0ede5;
  --text: #f7f6fa;
  --muted: #aaa8b5;
  --line: rgba(255, 255, 255, 0.13);
  --violet: #9419d5;
  --magenta: #d20fab;
  --cyan: #16d4dc;
  --focus: #58eef3;
  --max: 1180px;
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--ink);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--ink); color: var(--text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .8rem 1rem; background: var(--paper); color: var(--ink); }
.skip-link:focus { top: 1rem; }

.site-header { height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 0 clamp(1rem, 4vw, 3.5rem); border-bottom: 1px solid var(--line); background: rgba(7, 7, 12, .94); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: .35rem; text-decoration: none; letter-spacing: .08em; }
.brand-logo { display: block; width: 60px; height: 60px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .91rem; }
.brand small { color: var(--muted); font-size: .56rem; margin-top: .12rem; letter-spacing: .18em; }
nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.3rem); }
nav a { position: relative; color: var(--muted); font-weight: 700; font-size: .82rem; text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }
.signout-form { margin: 0; }
.signout-form button { border: 0; padding: 0; background: none; color: var(--muted); font-weight: 700; font-size: .82rem; cursor: pointer; }
.signout-form button:hover { color: var(--text); }
nav a[aria-current="page"]::after { content: ""; position: absolute; height: 2px; left: 0; right: 0; bottom: -.8rem; background: linear-gradient(90deg, var(--magenta), var(--cyan)); }
.menu-button { display: none; border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 6px; padding: .55rem .75rem; }

.hero { min-height: 620px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .95fr); align-items: center; gap: 4rem; max-width: var(--max); margin: 0 auto; padding: clamp(4rem, 9vw, 7.5rem) clamp(1.25rem, 4vw, 2rem); overflow: hidden; }
.eyebrow { color: var(--cyan); font-weight: 800; text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; margin: 0 0 1rem; }
.hero h1 { margin: 0; max-width: 760px; font-size: clamp(3.1rem, 7vw, 6.5rem); line-height: .91; letter-spacing: -.055em; }
.lede { max-width: 630px; margin: 1.7rem 0 2rem; color: #d0cdd7; font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.6; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: .75rem 1.15rem; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: transparent; font-weight: 800; text-decoration: none; cursor: pointer; }
.button.primary { border-color: transparent; background: linear-gradient(110deg, #7116c5, var(--magenta)); box-shadow: 0 12px 35px rgba(148, 25, 213, .25); }
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.hero-art { min-height: 470px; position: relative; isolation: isolate; display: grid; place-items: center; }
.hero-art::before { content: ""; position: absolute; inset: -15% -28% -8% -16%; background: url("/assets/violet-cobalt-inkburst.webp") center right / cover no-repeat; z-index: -2; }
.hero-art::after { content: ""; position: absolute; inset: -15% -28% -8% -16%; background: linear-gradient(90deg, var(--ink) 0%, transparent 28%, transparent 78%, rgba(7,7,12,.2) 100%); z-index: -1; }
.hero-logo { width: min(390px, 78%); height: auto; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,.55)); }

.section-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5rem clamp(1.25rem, 5vw, 4rem) 7rem; background: linear-gradient(180deg, rgba(13,12,20,.95), rgba(9,9,14,.72)), url("/assets/midnight-ink-horizon.webp") center bottom / cover no-repeat; }
.section-heading, .folder-grid, .letter-preview, .archive-page { max-width: var(--max); margin-inline: auto; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.section-heading h2, .letter-preview h2, .page-heading h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.04em; }
.section-heading > a { color: var(--cyan); font-weight: 800; text-decoration: none; }
.folder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.folder-card { min-height: 170px; padding: 1.4rem; border: 0; color: var(--text); background: var(--ink-soft); text-align: left; cursor: pointer; }
.folder-card:hover { background: linear-gradient(145deg, rgba(148,25,213,.24), rgba(22,212,220,.08)), var(--ink-soft); }
.folder-card span { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 2.8rem; }
.folder-card strong { display: block; font-size: 1.12rem; line-height: 1.25; }
.folder-card b { display: block; margin-top: .5rem; color: var(--cyan); font-size: .74rem; }

.letter-preview { display: grid; grid-template-columns: 1fr 1.15fr auto; gap: 3rem; align-items: center; padding: 6rem clamp(1.25rem, 4vw, 2rem); position: relative; }
.letter-preview::before { content: ""; position: absolute; inset: 0 55% 0 -50vw; background: url("/assets/midnight-ink-horizon.webp") right bottom / auto 68% no-repeat; opacity: .22; pointer-events: none; z-index: -1; }
.letter-preview > p { color: #d0cdd7; line-height: 1.75; }
.text-button { border: 0; padding: 0; background: none; color: var(--cyan); font-weight: 800; cursor: pointer; }

.archive-page { min-height: calc(100vh - 170px); padding: clamp(4rem, 8vw, 6rem) clamp(1.25rem, 4vw, 2rem); position: relative; isolation: isolate; }
.archive-page::before { content: ""; position: fixed; inset: 82px 0 0; pointer-events: none; z-index: -1; opacity: .22; }
[data-page="files"]::before { background: url("/assets/quiet-corner-ink.webp") center / cover no-repeat; }
[data-page="updates"]::before { background: url("/assets/midnight-ink-horizon.webp") center bottom / cover no-repeat; opacity: .16; }
[data-page="notes"]::before { background: url("/assets/quiet-corner-ink.webp") center / cover no-repeat; opacity: .18; }
[data-page="people"]::before { background: url("/assets/asymmetric-violet-ink.webp") right center / auto 120% no-repeat; opacity: .21; }
.page-heading { max-width: 760px; margin-bottom: 3rem; }
.page-heading > p:last-child { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.archive-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(190px, .35fr) auto; gap: 1rem; align-items: end; padding: 1rem; border: 1px solid var(--line); background: var(--ink-soft); }
.archive-toolbar label { display: grid; gap: .45rem; color: var(--muted); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.archive-toolbar input, .archive-toolbar select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 4px; padding: .75rem; background: #09090f; color: var(--text); text-transform: none; letter-spacing: normal; }
.new-filter { display: flex; gap: .65rem; align-items: center; margin-top: 1rem; color: var(--text); font-size: .95rem; cursor: pointer; }
.new-filter input { width: 1.2rem; height: 1.2rem; accent-color: #16d4dc; }
.results-status { min-height: 1.5rem; margin: 1.2rem 0; color: var(--muted); }
.record-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.record-card { min-width: 0; min-height: 320px; display: flex; flex-direction: column; align-items: flex-start; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: linear-gradient(145deg, rgba(148,25,213,.08), transparent 45%), var(--panel); text-align: left; cursor: pointer; }
.record-card:hover { border-color: rgba(22,212,220,.5); transform: translateY(-2px); }
.record-thumbnail { width: 100%; height: 180px; display: grid; place-items: center; overflow: hidden; margin-bottom: 1.25rem; border: 1px solid var(--line); border-radius: 3px; background: #22212a; }
.record-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; }
.record-thumbnail-empty { color: var(--ink); background: var(--paper); font-size: 1rem; font-weight: 900; letter-spacing: .18em; }
.record-card small { color: var(--cyan); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.new-badge { display: inline-block; margin-top: .55rem; padding: .2rem .55rem; border-radius: 999px; background: var(--cyan); color: #07070c; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.reading-kicker .new-badge { margin: 0 0 0 .5rem; }
.record-card strong { margin: .7rem 0 1rem; font-size: 1.05rem; line-height: 1.35; overflow-wrap: anywhere; }
.record-card .card-formats { margin-top: auto; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.empty-state { padding: 4rem 1rem; border: 1px dashed var(--line); text-align: center; color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.timeline time { color: var(--cyan); font-weight: 800; }
.timeline h2 { margin: 0 0 .5rem; }.timeline p { margin: 0; color: var(--muted); line-height: 1.65; }
.reading-section { max-width: 850px; margin: 0 0 4.5rem; }
.reading-section-heading h2 { margin: 0 0 .7rem; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.035em; }
.reading-intro { color: var(--muted); line-height: 1.6; }
.reading-intro a { color: var(--cyan); }
.reading-list { display: grid; gap: .8rem; margin-top: 1.5rem; }
.reading-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.reading-card summary { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: center; padding: 1.4rem 1.5rem; list-style: none; cursor: pointer; }
.reading-card summary::-webkit-details-marker { display: none; }
.reading-card summary:hover { background: rgba(148,25,213,.12); }
.reading-card summary strong { font-size: 1.2rem; line-height: 1.3; }
.reading-kicker { grid-column: 1 / -1; color: var(--cyan); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.reading-toggle { color: var(--cyan); font-size: .8rem; font-weight: 800; }
.reading-card[open] .reading-toggle { color: var(--muted); }
.reading-body { max-width: 72ch; padding: .2rem clamp(1.4rem, 4vw, 2.6rem) 1.5rem; }
.reading-body p { margin: 0 0 1.2em; }
.news-body { max-width: none; margin: 0 1.2rem 1.2rem; padding-top: 1.8rem; border-radius: 3px; background: var(--paper); color: #28252a; font-family: Georgia, "Times New Roman", serif; font-size: 1.06rem; line-height: 1.75; }
.news-subheading { font-weight: bold; }
.news-byline { font-family: system-ui, sans-serif; font-size: .83rem; font-weight: 700; }
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.person-card { display: flex; min-height: 215px; flex-direction: column; align-items: flex-start; padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.person-initial { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 1.6rem; border-radius: 50%; background: linear-gradient(135deg, var(--magenta), var(--violet)); font-weight: 900; }
.person-card h2 { margin: 0; font-size: 1.18rem; }.person-card p { color: var(--muted); line-height: 1.5; }
.person-card a { margin-top: auto; color: var(--cyan); font-weight: 800; text-decoration: none; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 3rem clamp(1.25rem, 5vw, 4rem); border-top: 1px solid var(--line); color: #d0cdd7; font-size: .78rem; background: linear-gradient(180deg, rgba(7,7,12,.28), rgba(7,7,12,.78)), url("/assets/midnight-ink-horizon.webp") center bottom / cover no-repeat; }
.modal { width: min(680px, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: var(--text); background: #111019; box-shadow: 0 40px 100px rgba(0,0,0,.72); }
.modal::backdrop { background: rgba(3,3,8,.84); backdrop-filter: blur(7px); }
.modal h2 { margin: 0 3rem 1.5rem 0; font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1; }
.modal-close { position: absolute; right: 1rem; top: 1rem; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); font-size: 1.7rem; cursor: pointer; }
.letter { white-space: pre-line; color: #dedce4; font-family: Georgia, serif; font-size: 1.06rem; line-height: 1.75; }
.record-modal { width: min(1060px, calc(100% - 2rem)); overflow-y: auto; }
.record-modal h2 { max-width: 850px; margin-bottom: .6rem; overflow-wrap: anywhere; }
.record-modal .eyebrow { color: var(--cyan); }
.record-added { margin: 0 0 1.6rem; color: var(--muted); font-size: .85rem; }
.record-view-options { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0 0 1rem; }
.view-option { display: inline-flex; align-items: center; min-height: 42px; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 4px; background: #1d1b27; color: var(--text); font: inherit; font-size: .83rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.view-option:hover, .view-option[aria-pressed="true"] { border-color: var(--cyan); background: rgba(22,212,220,.12); }
.record-viewer { min-height: 120px; border: 1px solid var(--line); background: #1c1b24; }
.image-tools { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.image-tools a { text-decoration: none; }
.record-image-scroll { max-height: 68vh; overflow: auto; display: grid; place-items: center; background: #25252b; }
.record-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 68vh; object-fit: contain; }
.record-image-scroll.is-zoomed { display: block; }
.record-image-scroll.is-zoomed .record-image { max-width: none; max-height: none; }
.record-text { max-height: 68vh; overflow: auto; margin: 0; padding: clamp(1.1rem, 3vw, 2.5rem); background: var(--paper); color: #28252a; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1rem, 1.5vw, 1.13rem); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.record-pdf-hint { margin: 0; padding: 2rem; color: var(--muted); }
.record-view-status { margin: .6rem 0; color: var(--cyan); }
.record-view-status:empty { display: none; }
.record-copies { margin-top: 1.5rem; border-top: 1px solid var(--line); }
.record-copies h3 { margin: 1.1rem 0 .3rem; font-size: 1rem; }
.record-copy-row { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.record-copy-row > div { min-width: 0; display: grid; gap: .3rem; }
.record-copy-row strong { color: var(--cyan); font-size: .75rem; letter-spacing: .1em; }
.record-copy-row span { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.record-copy-row a { flex: none; color: var(--cyan); font-size: .85rem; font-weight: 800; text-decoration: none; }
.record-copy-row a:hover { text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; z-index: 40; transform: translateX(-50%); width: min(580px, calc(100% - 2rem)); padding: 1rem; border: 1px solid var(--line); border-radius: 7px; background: #1a1824; box-shadow: 0 20px 40px rgba(0,0,0,.45); text-align: center; }

.login-body { min-height: 100vh; background: linear-gradient(110deg, rgba(7,7,12,.93), rgba(7,7,12,.7)), url("/assets/midnight-ink-horizon.webp") center / cover fixed; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.login-panel { width: min(100%, 490px); padding: clamp(2rem, 6vw, 3.2rem); border: 1px solid var(--line); border-radius: 10px; background: rgba(15,15,24,.94); box-shadow: 0 25px 80px rgba(0,0,0,.55); }
.login-mark { width: 66px; height: 66px; object-fit: contain; margin-bottom: 1.2rem; }
.login-panel h1 { font-size: clamp(2.5rem, 8vw, 3.7rem); line-height: .98; letter-spacing: -.045em; margin: 0; }
.login-intro { color: #d0cdd7; line-height: 1.6; margin: 1.4rem 0 2rem; }
.login-panel form { display: grid; gap: .8rem; }
.login-panel label { color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.login-panel input { width: 100%; min-height: 52px; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 5px; background: #09090f; color: var(--text); }
.login-panel button { margin-top: .55rem; width: 100%; }
.login-message { padding: .85rem 1rem; margin: 0 0 1.5rem; border-left: 3px solid var(--cyan); background: rgba(22,212,220,.09); line-height: 1.5; }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; gap: 1rem; padding-top: 5rem; }
  .hero-art { min-height: 420px; }
  .folder-grid { grid-template-columns: repeat(2, 1fr); }
  .letter-preview { grid-template-columns: 1fr 1fr; }.letter-preview .text-button { grid-column: 2; justify-self: start; }
  .record-grid, .people-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-toolbar { grid-template-columns: 1fr 1fr; }.package-button { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  .site-header { height: 70px; }
  .menu-button { display: block; }
  nav { display: none; position: absolute; left: 0; right: 0; top: 70px; padding: 1rem; border-bottom: 1px solid var(--line); background: #0c0b12; flex-direction: column; align-items: stretch; }
  nav[data-open="true"] { display: flex; }
  nav a { padding: .75rem; } nav a[aria-current="page"]::after { display: none; }
  .signout-form button { width: 100%; text-align: left; padding: .75rem; }
  .hero { min-height: auto; padding-top: 4rem; }.hero h1 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .brand-logo { width: 52px; height: 52px; }.brand-type { display: none; }
  .hero-art { min-height: 340px; }.hero-art::before, .hero-art::after { inset: -10% -45% -10% -30%; }.hero-logo { width: min(310px, 74%); }
  .folder-grid, .record-grid, .people-grid, .archive-toolbar { grid-template-columns: 1fr; }
  .letter-preview { grid-template-columns: 1fr; gap: 1.5rem; }.letter-preview .text-button { grid-column: auto; }
  .timeline li { grid-template-columns: 1fr; gap: .5rem; }
  .record-modal { width: calc(100% - 1rem); max-height: calc(100% - 1rem); padding: 1.4rem; }
  .record-modal h2 { margin-right: 2rem; }
  .record-image-scroll, .record-text { max-height: 58vh; }
  .record-image { max-height: 58vh; }
  .record-copy-row { align-items: flex-start; flex-direction: column; gap: .5rem; }
  footer { flex-direction: column; }
}

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

