/* Arzudahn: the shared look. A quiet, bookish site on comic-book paper where the art does the shouting, once per page.
   Rules: Cormorant for headings, Inter for text, Cinzel only in the logo. One accent (ember) for the main action;
   gold for small labels, at most one per section. Flat cards with a 1px border. One content width, one rhythm.
   The timeline (generated from timeline/viewer-template.html) carries its own copy of these rules. */
:root {
  color-scheme: light;
  /* white page, warm neutral greys: no purple anywhere but in the paintings */
  /* the page: comic-book paper, a cool off-white (not cream), with a fine grain; cards are white panels on it */
  --ink: #F2F2EF; --surface: #FFFFFF; --surface-2: #FFFFFF; --border: rgba(0,0,0,.11); --border-2: rgba(0,0,0,.22);
  --paper-rgb: 242,242,239; --note-paper: #FFFEFB; --track: #FBFBF9; --pencil: #4A4436;
  --text: #141414; --text-2: #3F3F3F; --text-3: #636363;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
  --ember: #F07A3A; --ember-2: #FF9457; --ember-ink: #B4501C; --gold: #8C621D; --gold-on-dark: #E3C48E; --night: #0A0A0A;
  --f-logo: "Cinzel", "Trajan Pro", Georgia, serif;
  --f-head: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
  --bar: 72px; --max: 1160px; --gutter: clamp(20px, 4vw, 40px); --section: clamp(72px, 10vw, 120px); --pad: clamp(24px, 2.6vw, 36px);
}
/* ===== Dark mode: the same paper at night, warm near-black with off-white type. It follows the system unless the
   reader picks one with the switch in the bar (site.js; remembered as arz.theme, set in each page's head first). ===== */
:root[data-theme="dark"] { color-scheme: dark; --ink: #141312; --surface: #1C1B19; --surface-2: #22211E; --border: rgba(255,255,255,.10); --border-2: rgba(255,255,255,.22); --text: #ECE9E2; --text-2: #C3BFB6; --text-3: #9A968D; --gold: #D6B072; --ember-ink: #F29360; --paper-rgb: 20,19,18; --note-paper: #201F1C; --track: #1A1917; --pencil: #CFC7B4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; --ink: #141312; --surface: #1C1B19; --surface-2: #22211E; --border: rgba(255,255,255,.10); --border-2: rgba(255,255,255,.22); --text: #ECE9E2; --text-2: #C3BFB6; --text-3: #9A968D; --gold: #D6B072; --ember-ink: #F29360; --paper-rgb: 20,19,18; --note-paper: #201F1C; --track: #1A1917; --pencil: #CFC7B4; } }
#theme { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; margin-left: 6px; padding: 0; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; transition: border-color .2s; }
#theme:hover { border-color: rgba(255,255,255,.6); }
#theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#theme .sun { display: none; }
:root[data-theme="dark"] #theme .sun { display: block; } :root[data-theme="dark"] #theme .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #theme .sun { display: block; } :root:not([data-theme="light"]) #theme .moon { display: none; } }
@media (max-width: 900px) { #theme { margin: 0 8px 0 0; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 24px); -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
html, body { margin: 0; background: var(--ink) var(--grain); color: var(--text); font: 400 18px/1.65 var(--f-body); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--gold); color: #1A1206; padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== Layout: one width, one rhythm ===== */
.wrap { position: relative; z-index: 1; width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: calc(var(--section) / 2) 0; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-8-4 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-8-4 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
/* three items on two columns: the third spans the row, so nothing is left alone */
@media (max-width: 1000px) and (min-width: 641px) { .g3 > :nth-child(3):last-child { grid-column: 1 / -1; } }

/* ===== Type ===== */
.label { display: block; margin: 0 0 14px; font: 600 13px/1.3 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
h1, .h1 { font: 600 clamp(46px, 6vw, 84px)/.98 var(--f-head); letter-spacing: -.01em; margin: 0 0 20px; color: var(--text); }
h2, .h2 { font: 600 clamp(36px, 4.2vw, 56px)/1.02 var(--f-head); letter-spacing: -.005em; margin: 0 0 14px; color: var(--text); }
h3, .h3 { font: 600 clamp(26px, 2.4vw, 32px)/1.1 var(--f-head); margin: 0 0 10px; color: var(--text); }
h1 em, h2 em { font-style: italic; font-weight: 500; color: var(--gold); }
p { margin: 0 0 16px; }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; color: var(--text-2); max-width: 60ch; margin: 0; }
.muted { color: var(--text-2); }
.small { font-size: 15px; color: var(--text-3); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 40px; flex-wrap: wrap; margin: 0 0 36px; }
.sec-head > div { max-width: 720px; }
.sec-head .lead { margin: 0; }
.page-head { padding: calc(var(--bar) + clamp(56px, 10vh, 112px)) 0 clamp(36px, 5vh, 56px); }

/* ===== One card style: a flat dark surface with a 1px border ===== */
.card { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: var(--pad); background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; text-decoration: none; color: inherit; overflow: hidden; transition: border-color .22s var(--ease), transform .22s var(--ease); }
a.card:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.card p { color: var(--text-2); }
.card .meta { font-size: 15px; color: var(--text-3); margin: 0; }
.card .go { margin-top: auto; padding-top: 12px; font: 600 16px var(--f-body); color: var(--ember-ink); }
.card.quiet { background: transparent; border-style: dashed; }
.card.quiet h3 { color: var(--text-2); }
.kind { font: 600 14px/1.3 var(--f-body); color: var(--gold); margin: 0 0 10px; }
.kind span { color: var(--text-3); font-weight: 500; }
.kind span::before { content: " · "; }

/* ===== Art: small crops of the paintings, one per section ===== */
.art { aspect-ratio: 4 / 3; border-radius: 10px; background-color: #0A0A0A; border: 1px solid var(--border); }
.card > .art.top { width: calc(100% + 2 * var(--pad)); margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) var(--pad); border-radius: 0; border: 0; aspect-ratio: 16 / 7; }

/* ===== Marq: faint single-line ink sketches of objects, drawn in the margins of the page ===== */
.has-marq { position: relative; }
.has-marq > :not(.marq) { position: relative; z-index: 1; }
.marq { position: absolute; z-index: 0; pointer-events: none; color: var(--text); fill: none; stroke: currentColor; stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round; opacity: .14; overflow: visible; }
.marq text { fill: currentColor; stroke: none; font: 600 12px var(--f-body); }
@media (max-width: 760px) { .marq:not(.keep) { display: none; } }
.marq .sway { transform-box: fill-box; transform-origin: center; animation: m-sway 7s ease-in-out infinite alternate; }
.marq .spin { transform-box: fill-box; transform-origin: center; animation: m-spin 180s linear infinite; }
.marq .flick { transform-box: fill-box; transform-origin: 50% 100%; animation: m-flick 1.7s ease-in-out infinite alternate; }
.marq .bob { transform-box: fill-box; transform-origin: 8% 92%; animation: m-bob 6s ease-in-out infinite alternate; }
.marq .drip { stroke-dasharray: 3 6; animation: m-drip 1.1s linear infinite; }
@keyframes m-sway { from { transform: rotate(-16deg); } to { transform: rotate(12deg); } }
@keyframes m-spin { to { transform: rotate(360deg); } }
@keyframes m-flick { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.9, 1.1) skewX(4deg); } 100% { transform: scale(1.05, .93) skewX(-3deg); } }
@keyframes m-bob { to { transform: rotate(-5deg) translateY(-4px); } }
@keyframes m-drip { to { stroke-dashoffset: -9; } }

/* ===== Buttons: one accent for the main action ===== */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border-radius: 999px; text-decoration: none; cursor: pointer;
  font: 600 16px/1 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; border: 1px solid transparent; transition: background .22s, border-color .22s; }
.btn.primary { background: var(--ember); color: #1C0C03; }
.btn.primary:hover { background: var(--ember-2); }
.btn.secondary { color: var(--text); border-color: var(--border-2); background: transparent; }
.btn.secondary:hover { border-color: var(--text-3); }
.link { font: 600 16px var(--f-body); color: var(--text); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 5px; display: inline-flex; align-items: center; min-height: 44px; }
.link:hover { text-decoration-color: var(--gold); }

/* ===== The painting, far behind (blurred once at load by site.js) ===== */
#backdrop { display: none; }
#backdrop canvas { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
#backdrop canvas.on { opacity: .28; }
#backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(11,10,16,.5), var(--ink) 70%); }

/* ===== Navbar ===== */
/* the bar is black glass. Under the pointer a light opens and chases the dark away; inside it the type turns
   dark (the type blends by "difference", so white on black becomes black on paper) */
@property --r { syntax: '<length>'; inherits: true; initial-value: 0px; }
#bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--bar); view-transition-name: bar; background: var(--bar-glass, rgba(10,9,8,.86));
  -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1); border-bottom: 1px solid rgba(255,255,255,.08);
  --mx: 50%; --my: 50%; --r: 0px; transition: --r .55s cubic-bezier(.2,.7,.2,1); }
#bar.lit { --r: 170px; }
/* the light is fluid, not a shape: six very soft glows, the first following the pointer and the rest trailing it at
   their own pace (site.js), so it pours after the pointer when it moves and gathers and breathes when it rests.
   Its colour is --bar-light (r, g, b); a book's pages can tint it, and the glass (--bar-glass). */
#bar { --x0: 50%; --y0: 50%; --x1: 50%; --y1: 50%; --x2: 50%; --y2: 50%; --x3: 50%; --y3: 50%; --x4: 50%; --y4: 50%; --x5: 50%; --y5: 50%; }
#bar::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle calc(var(--r) * 0.62) at var(--x0) var(--y0), rgba(var(--bar-light, 242,242,239), 0.62) 0%, rgba(var(--bar-light, 242,242,239), 0.341) 38%, rgba(var(--bar-light, 242,242,239), 0.112) 68%, rgba(var(--bar-light, 242,242,239), 0) 100%),
    radial-gradient(circle calc(var(--r) * 0.56) at var(--x1) var(--y1), rgba(var(--bar-light, 242,242,239), 0.5) 0%, rgba(var(--bar-light, 242,242,239), 0.275) 38%, rgba(var(--bar-light, 242,242,239), 0.09) 68%, rgba(var(--bar-light, 242,242,239), 0) 100%),
    radial-gradient(circle calc(var(--r) * 0.5) at var(--x2) var(--y2), rgba(var(--bar-light, 242,242,239), 0.42) 0%, rgba(var(--bar-light, 242,242,239), 0.231) 38%, rgba(var(--bar-light, 242,242,239), 0.076) 68%, rgba(var(--bar-light, 242,242,239), 0) 100%),
    radial-gradient(circle calc(var(--r) * 0.44) at var(--x3) var(--y3), rgba(var(--bar-light, 242,242,239), 0.34) 0%, rgba(var(--bar-light, 242,242,239), 0.187) 38%, rgba(var(--bar-light, 242,242,239), 0.061) 68%, rgba(var(--bar-light, 242,242,239), 0) 100%),
    radial-gradient(circle calc(var(--r) * 0.38) at var(--x4) var(--y4), rgba(var(--bar-light, 242,242,239), 0.26) 0%, rgba(var(--bar-light, 242,242,239), 0.143) 38%, rgba(var(--bar-light, 242,242,239), 0.047) 68%, rgba(var(--bar-light, 242,242,239), 0) 100%),
    radial-gradient(circle calc(var(--r) * 0.32) at var(--x5) var(--y5), rgba(var(--bar-light, 242,242,239), 0.2) 0%, rgba(var(--bar-light, 242,242,239), 0.11) 38%, rgba(var(--bar-light, 242,242,239), 0.036) 68%, rgba(var(--bar-light, 242,242,239), 0) 100%); }
#bar .wrap { position: relative; z-index: auto; }
/* inside the light the type turns dark: a dark copy of the bar's type (site.js makes it) shows only where the
   light is, through a mask made of the same glows. Real dark type, whatever colour the glass is. */
#bar .barink { position: absolute; inset: 0; pointer-events: none;   /* (full width, so the mask lines up with the light) */
  -webkit-mask-image:
    radial-gradient(circle calc(var(--r) * 0.496) at var(--x0) var(--y0), rgba(0,0,0,1.00) 0%, rgba(0,0,0,0.68) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.448) at var(--x1) var(--y1), rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.55) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.400) at var(--x2) var(--y2), rgba(0,0,0,0.71) 0%, rgba(0,0,0,0.46) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.352) at var(--x3) var(--y3), rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.37) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.304) at var(--x4) var(--y4), rgba(0,0,0,0.44) 0%, rgba(0,0,0,0.29) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.256) at var(--x5) var(--y5), rgba(0,0,0,0.34) 0%, rgba(0,0,0,0.22) 45%, transparent 100%);
  mask-image:
    radial-gradient(circle calc(var(--r) * 0.496) at var(--x0) var(--y0), rgba(0,0,0,1.00) 0%, rgba(0,0,0,0.68) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.448) at var(--x1) var(--y1), rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.55) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.400) at var(--x2) var(--y2), rgba(0,0,0,0.71) 0%, rgba(0,0,0,0.46) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.352) at var(--x3) var(--y3), rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.37) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.304) at var(--x4) var(--y4), rgba(0,0,0,0.44) 0%, rgba(0,0,0,0.29) 45%, transparent 100%),
    radial-gradient(circle calc(var(--r) * 0.256) at var(--x5) var(--y5), rgba(0,0,0,0.34) 0%, rgba(0,0,0,0.22) 45%, transparent 100%); }
#bar .barink #brand b, #bar .barink #links a, #bar .barink #menu { color: #15130F; }
#bar .barink #brand span { color: var(--gold); }
#bar .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
/* over the painting the bar is see-through, so its text is white (desktop links; the phone menu itself stays white) */
#brand { text-decoration: none; display: flex; flex-direction: column; justify-content: center; min-height: 44px; line-height: 1; margin-right: auto; }
#brand b { font: 700 20px/1 var(--f-logo); letter-spacing: .24em; color: #fff; }
#brand span { font: 500 11px/1 var(--f-body); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-on-dark); margin-top: 6px; }
#links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
#links a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; font: 500 16px/1 var(--f-body); color: var(--text-2); white-space: nowrap; transition: color .2s; }
#links a:hover, #links a[aria-current="page"] { color: var(--text); }
#links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ember); }
@media (min-width: 901px) {
  #links a { color: rgba(255,255,255,.8); }
  #links a:hover, #links a[aria-current="page"] { color: #fff; }
}
#menu { display: none; align-items: center; min-height: 44px; background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 999px; padding: 0 18px; font: 600 15px var(--f-body); cursor: pointer; }
@media (max-width: 900px) {
  #menu { display: inline-flex; position: relative; z-index: 2; }
  #links { position: fixed; inset: 0 0 0 auto; height: 100vh; width: min(84vw, 340px); flex-direction: column; gap: 0; padding: 96px 24px 24px;
    background: #0b0a09; border-left: 1px solid rgba(255,255,255,.08); transform: translateX(100%); visibility: hidden; transition: transform .35s ease, visibility 0s .35s; }
  #links.open { transform: none; visibility: visible; transition: transform .35s ease; }
  #links a { font-size: 18px; min-height: 56px; border-bottom: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.82); }
  #links a:hover, #links a[aria-current="page"] { color: #fff; }
  #links a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--ember); padding-left: 14px; }
}

/* ===== Footer ===== */
.foot { position: relative; z-index: 1; background: transparent; border-top: 1px solid var(--border); margin-top: calc(var(--section) / 2); padding: 40px 0 56px; color: var(--text-3); font-size: 15px; }
.foot .wrap { display: flex; gap: 14px 28px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.foot b { font: 700 16px var(--f-logo); letter-spacing: .3em; color: var(--text); margin-right: 10px; }
.foot nav { display: flex; flex-wrap: wrap; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text-2); text-decoration: none; font: 500 15px var(--f-body); }
.foot nav a:hover { color: var(--text); }

/* ===== Things rise into place as they come into view, the way Apple's pages do: up from 48px lower, a touch
   smaller and soft, settling over about a second, one after another (--i). Which things: site.js. Once risen,
   the rise styling is taken off, so a card's own hover motion is its own again. ===== */
.js .reveal { opacity: 0; }
.js .reveal.in { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .rise { transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform 1.1s cubic-bezier(.16,.84,.24,1), filter .9s cubic-bezier(.2,.7,.2,1);
    transition-delay: calc(var(--i, 0) * 110ms); }
  .js .rise:not(.up) { opacity: 0; transform: translateY(48px) scale(.985); filter: blur(6px); }
  .js .rise.up { opacity: 1; transform: none; filter: none; }
}

/* ===== Page to page: soft blur; the navbar holds still; named panels grow into the page they open ===== */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .34s var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in .42s var(--ease) both; }
  ::view-transition-group(bar) { animation-duration: .2s; }
  ::view-transition-group(chronicle), ::view-transition-group(portal), ::view-transition-group(library) { animation-duration: .46s; animation-timing-function: var(--ease); }
  ::view-transition-old(chronicle), ::view-transition-new(chronicle), ::view-transition-old(portal), ::view-transition-new(portal),
  ::view-transition-old(library), ::view-transition-new(library) { animation-duration: .46s; width: 100%; height: 100%; object-fit: cover; }
}
@keyframes vt-out { to { opacity: 0; filter: blur(6px); } }
@keyframes vt-in { from { opacity: 0; filter: blur(6px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
