@font-face { font-family: "Cormorant Garamond"; src: url("/brand/fonts/CormorantGaramond.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/brand/fonts/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }

:root {
  --ink: #102F38;
  --night: #081C24;
  --deep: #0C252E;
  --paper: #F4EBDD;
  --brass: #D6B477;
  --glass: #86BEB0;
  --ember: #D88058;
  --muted: #B5C7C5;
  --line: rgba(214, 180, 119, 0.22);
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Manrope", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--paper); font: 400 16px/1.6 var(--body); overflow-x: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; margin: 0; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
.sr, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brass); color: var(--night); padding: 8px 14px; border-radius: 6px; text-decoration: none; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); font-weight: 400; }

.eyebrow { font: 650 11px/1.7 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--brass); margin: 0 0 20px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; line-height: 1.02; }
h2 em { font-style: italic; color: var(--brass); }

/* Buttons & links */
.btn { display: inline-flex; align-items: center; gap: 18px; padding: 13px 20px; border-radius: 2px; font-weight: 700; font-size: 14px; letter-spacing: .02em; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .2s, border-color .2s, color .2s; }
.btn-brass { background: var(--brass); color: var(--ink); }
.btn-brass:hover { background: #E4C68E; }
.btn-ghost { border-color: rgba(214, 180, 119, .45); background: transparent; color: var(--paper); font-weight: 600; }
.btn-ghost:hover { border-color: var(--brass); background: rgba(214, 180, 119, .1); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.text-link { display: inline-flex; gap: 35px; padding: 10px 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); text-decoration: none; border-bottom: 1px solid rgba(214, 180, 119, .47); transition: gap .3s var(--ease); }
.text-link:hover { gap: 48px; }

/* Top bar */
.topbar { position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; gap: 24px; height: 72px; padding: 0 5%; transition: background .35s, border-color .35s; border-bottom: 1px solid transparent; }
.topbar.solid { background: rgba(8, 28, 36, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--line); }
.topbar-brand img { height: 34px; width: auto; opacity: 0; transition: opacity .35s; }
.topbar.solid .topbar-brand img { opacity: 1; }
.topbar-nav { margin-left: auto; display: flex; gap: 28px; }
.topbar-nav a { text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: .06em; padding: 6px 0; color: rgba(244, 235, 221, .8); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; white-space: nowrap; }
.topbar-nav a:hover, .topbar-nav a.active { color: var(--brass); }
.topbar-nav a.active { border-bottom-color: var(--brass); }
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 2px; border: 1px solid var(--line); background: rgba(8, 28, 36, .7); cursor: pointer; place-items: center; }
.menu-lines, .menu-lines::before, .menu-lines::after { display: block; width: 18px; height: 1.5px; background: var(--paper); position: relative; transition: transform .25s; }
.menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
.menu-lines::before { top: -6px; } .menu-lines::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-lines { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-lines::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-lines::after { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 1000px) {
  .menu-btn { display: grid; }
  .topbar-nav { position: fixed; inset: 72px 0 auto; flex-direction: column; gap: 0; padding: 8px 5% 16px; background: rgba(8, 28, 36, .98); border-bottom: 1px solid var(--line); opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity .25s, transform .25s; }
  .topbar-nav.open { opacity: 1; pointer-events: auto; transform: none; }
  .topbar-nav a { padding: 15px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
  .topbar-nav a.active { border-bottom-color: var(--line); }
}

/* Hero */
.hero { position: relative; min-height: max(640px, min(100svh, 1100px)); display: flex; align-items: center; overflow: hidden; isolation: isolate; background: var(--ink); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: -2; animation: drift 40s ease-in-out infinite alternate; transform-origin: 70% 40%; }
.hero-veil { position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(90deg, rgba(8, 28, 36, .93) 0%, rgba(8, 28, 36, .67) 30%, rgba(8, 28, 36, .13) 67%, transparent),
  linear-gradient(0deg, rgba(8, 28, 36, .8), transparent 35%); }
.hero-copy { padding: 110px 0 110px 7%; width: 57%; max-width: 850px; animation: rise 1.4s var(--ease) both .1s; }
.hero h1 { margin: 0 0 6px; max-width: 630px; }
.hero-wordmark { width: 100%; height: auto; }
.tagline { font: italic 400 clamp(34px, 3vw, 47px)/1.3 var(--display); color: var(--brass); margin: 12px 0 22px; }
.hero-lede { font-size: 15px; line-height: 1.9; color: #E0E5DF; margin: 0 0 26px; }
.hero-foot { position: absolute; bottom: 26px; left: 7%; right: 5%; display: flex; justify-content: space-between; gap: 24px; font-size: 9px; letter-spacing: .17em; text-transform: uppercase; color: #E4D9BF; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translate3d(-1%, -.6%, 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (max-width: 1000px) { .hero-copy { width: 70%; padding-left: 5%; } .hero-foot { left: 5%; } }
@media (max-width: 680px) {
  .hero { align-items: flex-end; }
  .hero-art { object-position: 66% center; }
  .hero-veil { background: linear-gradient(90deg, rgba(8, 28, 36, .93), rgba(8, 28, 36, .46) 75%), linear-gradient(0deg, rgba(8, 28, 36, .9), transparent 60%); }
  .hero-copy { width: 100%; padding: 120px 6% 96px; }
  .tagline { font-size: 34px; }
  .hero-lede { font-size: 14px; }
  .hero-foot { font-size: 8px; left: 6%; right: 6%; }
}

/* Sections share the brand-book rhythm */
.invite, .pillars, .chapter, .outro { padding: clamp(64px, 8vw, 100px) max(6%, calc((100% - 1560px) / 2)); }

.invite { background: var(--paper); color: var(--ink); }
.invite-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10%; }
.invite .eyebrow { color: #70552C; }
.invite h2 { font-size: clamp(42px, 4.7vw, 70px); margin: 0; }
.invite h2 em { color: #7C633C; }
.invite .lead { font: 400 clamp(20px, 1.7vw, 23px)/1.5 var(--body); margin: 28px 0 18px; }
.invite p { margin: 0 0 18px; }
.how { margin-top: 30px; padding: 22px 24px; border: 1px solid rgba(16, 47, 56, .22); background: rgba(255, 255, 255, .35); }
.how .eyebrow { margin-bottom: 10px; }
.how p:last-child { margin: 0; font-size: 15px; color: #33494F; }
.inline-heart { color: #B85F3A; }
@media (max-width: 800px) { .invite-grid { grid-template-columns: 1fr; gap: 0; } }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 35px; padding-top: 65px; padding-bottom: 65px; border-bottom: 1px solid var(--line); }
.pillars article > span { font: italic 27px var(--display); color: var(--brass); }
.pillars h3 { font-size: 28px; margin: 18px 0 12px; }
.pillars p { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 0; }
@media (max-width: 1000px) { .pillars { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; } }
@media (max-width: 460px) { .pillars { grid-template-columns: 1fr; } }

/* Chapters */
.world { }
.loading { text-align: center; color: var(--muted); padding: 80px 0; font-family: var(--display); font-size: 22px; font-style: italic; }
.chapter.tone-0 { background: var(--night); }
.chapter.tone-1 { background: #102B34; }
.chapter.tone-2 { background: #0D2730; }
.chapter-head { display: flex; align-items: end; justify-content: space-between; gap: 24px 40px; margin-bottom: 40px; }
.chapter-head h2 { font-size: clamp(42px, 4.7vw, 70px); margin: 0; }
.chapter-aside { max-width: 400px; }
.chapter-aside p { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.chapter-meta { font-size: 10px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
@media (max-width: 800px) { .chapter-head { display: block; } .chapter-aside { margin-top: 22px; } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 26px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 2px; padding: 8px 14px; font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; color: rgba(244, 235, 221, .85); transition: all .2s; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { border-color: var(--brass); color: var(--brass); }
.chip[aria-pressed="true"] { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.dot { width: 8px; height: 8px; border-radius: 50%; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(12px, 1.4vw, 18px); }
.grid.feature > .tile:not(.hidden):first-child { grid-column: span 2; grid-row: span 2; }
@media (max-width: 720px) { .grid.feature > .tile:not(.hidden):first-child { grid-column: auto; grid-row: auto; } }

.tile { position: relative; display: block; width: 100%; border: 1px solid rgba(255, 255, 255, .07); background: var(--ink); border-radius: 2px; overflow: hidden; aspect-ratio: 16 / 9; opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease), border-color .3s, box-shadow .3s; }
.tile.in { opacity: 1; transform: none; }
.tile.hidden { display: none; }
.tile.sheet { aspect-ratio: 3 / 2; }
.tile-open { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tile:hover img { transform: scale(1.04); }
.tile:hover { border-color: rgba(214, 180, 119, .6); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.tile-cap { position: absolute; inset: auto 0 0; padding: 48px 18px 15px; background: linear-gradient(0deg, rgba(8, 28, 36, .94), rgba(8, 28, 36, 0)); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tile-title { font: 600 22px/1.1 var(--display); }
.tile-tag { display: block; font: 650 9px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--brass); margin-bottom: 7px; }
.tile-badge { flex: none; font-size: 9px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; padding: 5px 9px; border: 1px solid rgba(214, 180, 119, .5); color: var(--brass); background: rgba(8, 28, 36, .7); }
.tile-heart { position: absolute; z-index: 2; top: 10px; right: 10px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(244, 235, 221, .25); background: rgba(8, 28, 36, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.tile-heart svg { width: 20px; height: 20px; fill: none; stroke: var(--paper); stroke-width: 1.8; transition: fill .2s, stroke .2s; }
.tile-heart:hover { border-color: var(--ember); background: rgba(8, 28, 36, .85); transform: scale(1.06); }
.tile-heart:hover svg { stroke: var(--ember); }
.tile-heart[aria-pressed="true"] { border-color: var(--ember); background: rgba(8, 28, 36, .85); }
.tile-heart[aria-pressed="true"] svg { fill: var(--ember); stroke: var(--ember); }
.tile-heart.pop svg { animation: pop .45s var(--ease); }
.tile.stack { overflow: visible; margin-top: 10px; }
.tile.stack::before, .tile.stack::after { content: ""; position: absolute; inset: 0; border-radius: 2px; background: var(--ink); border: 1px solid rgba(214, 180, 119, .3); z-index: -1; transition: transform .6s var(--ease); }
.tile.stack::before { transform: translate(8px, -8px); }
.tile.stack::after { transform: translate(4px, -4px); background: #16404A; }
.tile.stack:hover::before { transform: translate(14px, -14px); }
.tile.stack:hover::after { transform: translate(7px, -7px); }
.tile.stack .tile-frame { position: absolute; inset: 0; overflow: hidden; border-radius: 2px; }

.more { display: flex; justify-content: center; margin-top: 36px; }
.more:empty { display: none; }

/* Outro & footer */
.outro { text-align: center; background: var(--paper); color: var(--ink); }
.outro img { margin: 0 auto 26px; }
.outro .eyebrow { color: #70552C; }
.outro h2 { font-size: clamp(42px, 4.7vw, 70px); margin-bottom: 22px; }
.outro h2 em { color: #7C633C; }
.outro p:not(.eyebrow) { color: #3F575C; margin: 0 auto 28px; max-width: 34em; }
.outro .text-link { color: #70552C; border-bottom-color: rgba(112, 85, 44, .45); }
.footer { padding: 30px 5% calc(30px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 30px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.footer img { width: 36px; }
.footer > span:last-child { margin-left: auto; }
@media (max-width: 600px) { .footer > span:last-child { margin-left: 0; } }

/* Viewer */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(5, 18, 24, .97); color: var(--paper); }
.viewer::backdrop { background: rgba(5, 18, 24, .85); }
.viewer[open] { animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; } }
.viewer-shell { display: grid; grid-template-columns: 1fr 380px; height: 100%; }
.viewer-stage { position: relative; display: grid; place-items: center; padding: 24px 72px; min-height: 0; touch-action: pan-y; }
.viewer-stage img { max-width: 100%; max-height: calc(100dvh - 48px); object-fit: contain; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); transition: opacity .25s; border-radius: 2px; }
.viewer-stage img.swap { opacity: .15; }
.nav-btn, .close-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: rgba(16, 47, 56, .75); cursor: pointer; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.nav-btn:hover, .close-btn:hover { border-color: var(--brass); background: var(--ink); }
.nav-btn svg, .close-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--paper); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); }
.nav-btn.prev { left: 14px; } .nav-btn.next { right: 14px; }
.viewer-panel { position: relative; border-left: 1px solid var(--line); background: var(--deep); padding: 72px 30px 30px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.close-btn { position: absolute; top: 16px; right: 16px; }
.viewer-panel h2 { font-size: 40px; }
.viewer-panel .eyebrow { margin: 0; }
.viewer-desc { margin: 0; color: rgba(244, 235, 221, .85); }
.views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.views:empty { display: none; }
.view-thumb { padding: 0; border: 2px solid transparent; border-radius: 2px; overflow: hidden; cursor: pointer; background: var(--night); aspect-ratio: 16 / 9; position: relative; }
.view-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .7; transition: opacity .2s; }
.view-thumb:hover img, .view-thumb[aria-current="true"] img { opacity: 1; }
.view-thumb[aria-current="true"] { border-color: var(--brass); }
.view-thumb .mini-heart { position: absolute; top: 3px; right: 5px; color: var(--ember); font-size: 12px; text-shadow: 0 1px 3px #000; }
.heart-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 2px; border: 1px solid var(--line); background: rgba(216, 128, 88, .06); cursor: pointer; font-weight: 600; transition: all .25s; }
.heart-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ember); stroke-width: 1.8; transition: transform .35s var(--ease), fill .2s; }
.heart-btn:hover { border-color: var(--ember); }
.heart-btn[aria-pressed="true"] { background: rgba(216, 128, 88, .18); border-color: var(--ember); }
.heart-btn[aria-pressed="true"] svg { fill: var(--ember); }
.heart-btn.pop svg { animation: pop .45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35); } }
.note-form { display: flex; flex-direction: column; gap: 10px; }
.note-form label { font-size: 11px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.note-form label .muted { letter-spacing: .08em; }
.note-form textarea { width: 100%; resize: vertical; min-height: 92px; border-radius: 2px; border: 1px solid var(--line); background: var(--night); color: var(--paper); padding: 12px 14px; font: inherit; font-size: 15px; }
.note-form textarea:focus { outline: none; border-color: var(--brass); }
.note-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-status { font-size: 13px; color: var(--glass); }
.note-status.err { color: var(--ember); }
.viewer-count { margin: auto 0 0; font-size: 13px; color: var(--muted); }

.viewer-stage img { cursor: zoom-in; }
.zoom-hint { display: none; position: absolute; left: 20px; bottom: 18px; align-items: center; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border-radius: 999px; background: rgba(8, 28, 36, .72); border: 1px solid rgba(244, 235, 221, .2); font-size: 12px; font-weight: 600; letter-spacing: .04em; pointer-events: none; }
.zoom-hint svg { width: 16px; height: 16px; fill: none; stroke: var(--paper); stroke-width: 1.8; stroke-linecap: round; }
.zoom { position: fixed; inset: 0; z-index: 5; overflow: auto; background: #04121A; cursor: zoom-out; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.zoom[hidden] { display: none; }
.zoom img { max-width: none; display: block; }
.zoom-close { position: fixed; top: 14px; right: 14px; z-index: 6; }

@media (max-width: 900px) {
  .zoom-hint { display: inline-flex; }
  .viewer-shell { display: block; overflow-y: auto; }
  .viewer-stage { padding: 72px 0 64px; }
  .viewer-stage img { max-height: 56dvh; border-radius: 0; }
  .nav-btn { top: auto; bottom: 8px; transform: none; width: 44px; height: 44px; }
  .nav-btn.prev { left: auto; right: 72px; } .nav-btn.next { right: 20px; }
  .viewer-panel { border-left: 0; padding: 36px 20px calc(24px + env(safe-area-inset-bottom)); overflow: visible; }
  .close-btn { position: fixed; top: 12px; right: 12px; z-index: 2; }
  .viewer-panel h2 { font-size: 30px; padding-right: 100px; }
}

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