/* Work catalogue (projects.html): the portfolio as a book. */
:root {
  --paper: #F4EFE4; --paper-2: #EAE3D3; --ink: #141A2B; --ink-soft: #3E4558; --muted: #7A7568;
  --sapphire: #0A1633; --gold: #C9A961; --gold-dp: #94742F; --rule: #D9CFBA; --desk: #17161A;
  --display: 'Fraunces', Georgia, serif;
  --text: 'Source Serif 4', Georgia, serif;
  --label: 'Inter Tight', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--desk); color: var(--ink); font-family: var(--text); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* The book: a horizontal strip of full-screen pages */
.book { height: 100vh; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.book::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100vw; height: 100vh; scroll-snap-align: start; position: relative; display: grid; place-items: center; padding: 4.5rem 6vw 4.6rem; }

.runhead { position: absolute; top: 1.7rem; left: 6vw; right: 6vw; display: flex; justify-content: space-between; font-family: var(--label); font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.folio { position: absolute; bottom: 1.6rem; left: 0; right: 0; text-align: center; font-family: var(--display); font-style: italic; font-size: .95rem; color: var(--muted); }

/* Cover */
.cover { background: var(--sapphire); color: var(--paper); text-align: center; }
.cover::before, .cover::after { content: ""; position: absolute; pointer-events: none; border: 1px solid rgba(201,169,97,.35); inset: 2.2rem; }
.cover::after { inset: 2.7rem; border-color: rgba(201,169,97,.14); }
.cover .vol { font-family: var(--label); font-size: .7rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.cover h1 { font-family: var(--display); font-weight: 300; font-size: clamp(3.2rem, 8vw, 7.5rem); line-height: .95; letter-spacing: -.02em; margin: 1.6rem 0 1.3rem; }
.cover h1 em { font-style: italic; color: var(--gold); }
.cover .rule { width: 64px; height: 1px; background: var(--gold); margin: 0 auto 1.4rem; }
.cover .by { font-style: italic; font-size: 1.15rem; color: #C3C8D4; max-width: 36ch; margin: 0 auto; }
.cover .hint { position: absolute; bottom: 3.8rem; left: 0; right: 0; font-family: var(--label); font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; color: rgba(244,239,228,.45); }

/* Paper pages */
.paper { background: var(--paper); }
.paper::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 62%, rgba(120,100,60,.08)); }

/* Contents */
.contents { width: min(980px, 100%); }
.contents h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 4.2vw, 3.4rem); letter-spacing: -.01em; margin-bottom: 1.6rem; }
.contents h2 em { font-style: italic; color: var(--gold-dp); }
.toc-cols { columns: 2; column-gap: 4rem; }
.toc-ch { break-inside: avoid; margin-bottom: 1.4rem; }
.toc-ch .n { font-family: var(--label); font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-dp); }
.toc-ch .t { font-family: var(--display); font-style: italic; font-size: 1.25rem; margin: .15rem 0 .35rem; }
.toc-row { display: flex; align-items: baseline; gap: .6rem; padding: .22rem 0; text-decoration: none; font-size: 1rem; color: var(--ink-soft); }
.toc-row .dots { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-.3em); }
.toc-row .pg { font-family: var(--display); font-style: italic; color: var(--muted); }
.toc-row:hover { color: var(--ink); }
.toc-row:hover .pg { color: var(--gold-dp); }

/* Chapter opener */
.opener { background: var(--sapphire); color: var(--paper); text-align: center; }
.opener .num { font-family: var(--display); font-style: italic; font-weight: 300; font-size: clamp(5rem, 14vw, 11rem); line-height: 1; color: var(--gold); }
.opener h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 3.2rem); margin-top: .5rem; }
.opener p { font-style: italic; color: #B9BFCC; max-width: 44ch; margin: 1.2rem auto 0; font-size: 1.1rem; line-height: 1.6; }
.opener .runhead, .opener .folio { color: rgba(244,239,228,.4); }

/* The spread */
.spread { display: grid; grid-template-columns: 1.15fr 1fr; width: min(1320px, 100%); height: min(78vh, 760px); background: var(--paper); box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }
.spread .left { position: relative; background: var(--paper-2); display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; padding: 2.4rem 2.4rem 3rem; border-right: 1px solid var(--rule); overflow: hidden; }
.spread .left::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 40px; background: linear-gradient(90deg, transparent, rgba(80,60,30,.10)); pointer-events: none; }
.shot { display: block; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 18px 40px -18px rgba(20,26,43,.45); border: 1px solid var(--rule); }
.shot.phone { border-radius: 22px; height: 100%; width: auto; }
.plate-type { text-align: center; color: var(--muted); }
.plate-type .big { font-family: var(--display); font-style: italic; font-weight: 300; font-size: clamp(2.4rem, 4vw, 3.6rem); color: var(--sapphire); }
.plate-type .small { font-family: var(--label); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; margin-top: .8rem; }
.cap { position: absolute; bottom: 1rem; left: 2.4rem; font-family: var(--label); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.spread .right { position: relative; padding: 3.2rem 3.4rem; display: flex; flex-direction: column; overflow: hidden; }
.spread .right::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40px; background: linear-gradient(270deg, transparent, rgba(80,60,30,.07)); pointer-events: none; }
.kicker { font-family: var(--label); font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-dp); }
.spread h3 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 3.4vw, 3.2rem); letter-spacing: -.015em; line-height: 1.02; margin: .6rem 0 1.2rem; }
.body { font-size: 1.04rem; line-height: 1.68; color: var(--ink-soft); max-width: 48ch; }
.body::first-letter { font-family: var(--display); float: left; font-size: 4.1em; line-height: .82; padding: .06em .1em 0 0; color: var(--sapphire); }
.facts { display: grid; grid-template-columns: .8fr 1.4fr 1.4fr; gap: 1rem; margin-top: auto; padding-top: 1.3rem; border-top: 1px solid var(--rule); }
.facts dt { font-family: var(--label); font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-family: var(--display); font-style: italic; font-size: .98rem; margin-top: .2rem; line-height: 1.3; }
.live { align-self: flex-start; margin-top: 1.3rem; font-family: var(--label); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--gold); padding-bottom: .3rem; }
.live:hover { color: var(--gold-dp); }
.live.quiet { color: var(--muted); border-bottom-color: var(--rule); }

/* Colophon */
.colophon { width: min(640px, 100%); text-align: center; }
.colophon .portrait { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gold); padding: 3px; margin: 0 auto 1.5rem; display: block; }
.colophon h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 3.6vw, 2.8rem); }
.colophon p { line-height: 1.7; color: var(--ink-soft); margin-top: 1rem; }
.colophon .sig { font-family: var(--display); font-style: italic; font-size: 1.6rem; }
.colophon .contact { display: flex; flex-wrap: wrap; gap: 1.2rem 2rem; justify-content: center; margin-top: 1.8rem; font-family: var(--label); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }
.colophon .contact a { text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: .25rem; }

/* Reading chrome */
.progress { position: fixed; left: 0; bottom: 0; height: 2px; background: var(--gold); width: 0; transition: width .35s ease; z-index: 5; }
.turn { position: fixed; top: 50%; transform: translateY(-50%); z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(201,169,97,.5); background: rgba(20,26,43,.55); color: var(--gold); font-size: 1.1rem; cursor: pointer; }
.turn.prev { left: 1rem; }
.turn.next { right: 1rem; }
.turn[disabled] { opacity: .2; cursor: default; }
.toc-btn { position: fixed; bottom: 1.1rem; right: 1.2rem; z-index: 5; font-family: var(--label); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; background: rgba(20,26,43,.65); color: var(--gold); border: 1px solid rgba(201,169,97,.4); padding: .5rem .85rem; cursor: pointer; }

/* Content settles in as each page arrives */
.settle { opacity: 0; transform: translateX(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.here .settle { opacity: 1; transform: none; }
.here .d2 { transition-delay: .12s; }
.here .d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .book { scroll-behavior: auto; }
  .settle { opacity: 1; transform: none; transition: none; }
  .progress { transition: none; }
}

/* Phones and small tablets: the book reads top to bottom */
@media (max-width: 860px) {
  body { overflow: auto; }
  .book { height: auto; flex-direction: column; overflow: visible; scroll-snap-type: none; }
  .page { flex: none; width: 100%; min-height: 100svh; height: auto; padding: 4.2rem 16px 4rem; }
  .runhead { left: 16px; right: 16px; }
  .cover::before { inset: 1rem; }
  .cover::after { inset: 1.4rem; }
  .toc-cols { columns: 1; }
  .spread { grid-template-columns: 1fr; height: auto; }
  .spread .left { height: auto; padding: 1.2rem 1.2rem 2.4rem; border-right: 0; border-bottom: 1px solid var(--rule); }
  .shot.phone { height: 62svh; }
  .runhead span + span { display: none; }
  .cap { left: 1.2rem; }
  .spread .right { padding: 1.8rem 1.4rem 2rem; }
  .facts { grid-template-columns: 1fr 1fr; }
  .turn, .progress { display: none; }
  .settle { opacity: 1; transform: none; }
}

/* Way back to the rest of the site */
.home-link { position: fixed; bottom: 1.1rem; left: 1.2rem; z-index: 5; display: inline-flex; align-items: center; gap: .55rem; font-family: var(--label); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; background: rgba(20,26,43,.65); color: var(--gold); border: 1px solid rgba(201,169,97,.4); padding: .5rem .85rem; }
.home-link .mk { font-family: var(--display); font-size: .9rem; line-height: .7; letter-spacing: 0; text-transform: none; }
.home-link:hover, .toc-btn:hover { background: rgba(20,26,43,.9); }
.site-nav { position: absolute; top: 3.6rem; left: 0; right: 0; display: flex; justify-content: center; gap: 2rem; font-family: var(--label); font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; }
.site-nav a { color: rgba(244,239,228,.6); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--gold); }
@media (max-width: 860px) {
  .site-nav { gap: 1.1rem; top: 2.6rem; flex-wrap: wrap; padding: 0 2rem; }
}

.links { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.6rem; margin-top: 1.3rem; }
.links .live { margin-top: 0; }

/* Phones: Home and Contents become a solid bar so they never cover the text */
@media (max-width: 860px) {
  .home-link, .toc-btn { bottom: 0; width: 50%; height: 46px; justify-content: center; background: var(--sapphire); border: 0; border-top: 1px solid rgba(201,169,97,.35); padding: 0; }
  .home-link { left: 0; border-right: 1px solid rgba(201,169,97,.2); }
  .toc-btn { right: 0; }
  .book { padding-bottom: 46px; }
}
