/* =========================================================
   SAMIZDAAT · design tokens
   Every page on the site draws from these. Change a value
   here and the whole site changes with it.
   ========================================================= */
:root {
  color-scheme: dark;   /* the press is dark by design */
  /* color */
  --void:       #0a0806;   /* page background, warm black */
  --vault:      #120e0a;   /* raised surfaces */
  --rule:       #2a2119;   /* hairlines */
  --parchment:  #e9dcc6;   /* primary text */
  --ash:        #9a8b76;   /* secondary text */
  --smoke:      #5e5345;   /* tertiary / metadata */
  --ember:      #cc5a1e;   /* burnt orange: the one accent */
  --ember-hot:  #e8742f;   /* hover */
  --ember-dim:  rgba(204, 90, 30, .14);

  /* type */
  --display: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --text:    "Spectral", "Frank Ruhl Libre", Georgia, serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;
  --hebrew:  "Frank Ruhl Libre", "David", serif;

  /* rhythm */
  --measure: 34rem;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--parchment);
  font: 300 19px/1.75 var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* film grain over everything */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* a faint ember glow at the top of every page */
body::after {
  content: ""; position: fixed; inset: -20vh 0 auto; height: 60vh; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(204,90,30,.10), transparent 70%);
}
a { color: inherit; text-decoration-color: var(--ember); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ember-hot); }
::selection { background: var(--ember); color: var(--void); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.site {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 28px 0; border-bottom: 1px solid var(--rule);
}
.mark { display: flex; align-items: center; gap: 14px; text-decoration: none; }
/* the aleph: one mark, colored by the theme. Source shape lives in aleph.svg */
.aleph { display: inline-block; flex: none; width: 26px; aspect-ratio: 682 / 915; background: var(--ember);
  -webkit-mask: url(aleph.png) center / contain no-repeat; mask: url(aleph.png) center / contain no-repeat; }
.mark:hover .aleph { background: var(--ember-hot); }
.mark span { font: 500 15px/1 var(--mono); letter-spacing: .42em; }
.mark span b { color: var(--ember); font-weight: 500; }
.mark-he { font: 300 19px/1 var(--hebrew); font-style: normal; color: var(--ash); padding-left: 14px; border-left: 1px solid var(--rule); }
.mark-he b { color: var(--ember); font-weight: 300; }
@media (max-width: 420px) { .mark-he { display: none; } }
.site nav { display: flex; gap: 28px; flex-wrap: wrap; }
.site nav a { font: 400 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ash); text-decoration: none; }
.site nav a:hover { color: var(--ember-hot); }

/* ---------- shared atoms ---------- */
.label { font: 400 11px/1.4 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--smoke); }
.label.ember { color: var(--ember); }
.he { font-family: var(--hebrew); direction: rtl; unicode-bidi: isolate; }
.rule-glyph { display: flex; align-items: center; gap: 18px; color: var(--ember); margin: 56px 0; }
.rule-glyph::before, .rule-glyph::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--rule), transparent); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); margin-top: 96px; padding: 32px 0 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot p { font: 400 12px/1.6 var(--mono); color: var(--smoke); letter-spacing: .06em; }

@media (max-width: 720px) {
  body { font-size: 18px; }
  .site nav { gap: 18px; }
}

/* =================== HOMEPAGE =================== */
/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 48px; align-items: center; padding: 72px 0 56px; }
.hero-side { justify-self: center; width: 100%; max-width: 420px; text-align: center; }
.seal { margin-top: -18px; position: relative; }
.seal .name { font: 300 54px/1 var(--hebrew); letter-spacing: .02em; color: var(--parchment); }
.seal .name b { color: var(--ember); font-weight: 300; }
.seal .tagline { font: italic 300 21px/1.4 var(--display); color: var(--ash); margin-top: 10px; letter-spacing: .02em; }
.hero-art { position: relative; width: 100%; max-width: 420px; aspect-ratio: 4 / 5; justify-self: center; }
.hero-art .fire { position: absolute; inset: 0; background: url(img/hero-fire.jpg) center 30% / cover;
  -webkit-mask: radial-gradient(ellipse 52% 54% at 50% 50%, #000 35%, transparent 100%); mask: radial-gradient(ellipse 52% 54% at 50% 50%, #000 35%, transparent 100%);
  opacity: .9; animation: flicker 7s ease-in-out infinite; }
@keyframes flicker { 0%,100% { opacity: .9; } 45% { opacity: .78; } 60% { opacity: .95; } }
@media (prefers-reduced-motion: reduce) { .hero-art .fire { animation: none; } }
.hero-art .sigil { position: absolute; left: 50%; top: 44%; width: 46%; transform: translate(-50%, -50%); aspect-ratio: 682 / 915; background: var(--void);
  -webkit-mask: url(aleph.png) center / contain no-repeat; mask: url(aleph.png) center / contain no-repeat; }
.hero-art .glow { position: absolute; left: 50%; top: 44%; width: 46%; transform: translate(-50%, -50%) scale(1.06); aspect-ratio: 682 / 915; background: var(--ember-hot);
  -webkit-mask: url(aleph.png) center / contain no-repeat; mask: url(aleph.png) center / contain no-repeat; filter: blur(10px); opacity: .9; }

/* ---------- broadsides ---------- */
.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.wall a { display: block; position: relative; overflow: hidden; border: 1px solid var(--rule); background: var(--vault); }
.wall img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; filter: grayscale(.55) sepia(.35) brightness(.62) contrast(1.05); transition: filter .5s, transform .8s; }
.wall a:hover img, .wall a:focus img { filter: none; transform: scale(1.03); }
.wall a::after { content: attr(data-n); position: absolute; left: 10px; bottom: 8px; font: 400 10px var(--mono); letter-spacing: .16em; color: var(--ash); }
.verse .he { display: block; font-size: 30px; line-height: 1.5; color: var(--ember); font-weight: 300; margin-bottom: 10px; text-align: left; }
.verse .en { font: italic 300 18px/1.6 var(--display); color: var(--ash); }
.verse .src { margin-top: 10px; }
.verse .cite { font-size: 15px; color: var(--smoke); letter-spacing: .04em; }
.hero h1 { font: 300 clamp(44px, 6vw, 76px)/1.02 var(--display); letter-spacing: -.01em; margin: 48px 0 28px; }
.hero h1 em { color: var(--ember); font-style: italic; }
.hero .intro { max-width: 30rem; color: var(--ash); }
.hero .intro strong { color: var(--parchment); font-weight: 400; }

/* ---------- tree ---------- */
.tree-section { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 80px; align-items: start; }
.tree-section > .tree-wrap { position: sticky; top: 24px; }
.tree { width: 100%; height: auto; display: block; overflow: visible; }
.tree .path { stroke: var(--rule); stroke-width: 1.2; transition: stroke .35s, stroke-width .35s; }
.tree .path.lit { stroke: var(--ember); stroke-width: 1.6; }
.tree .node { cursor: pointer; }
.tree .node circle.halo { fill: var(--ember); opacity: 0; transition: opacity .35s; }
.tree .node circle.body { fill: var(--void); stroke: var(--smoke); stroke-width: 1; transition: stroke .3s, fill .3s; }
.tree .node text { fill: var(--ash); font: 300 19px var(--hebrew); text-anchor: middle; dominant-baseline: central; pointer-events: none; transition: fill .3s; }
.tree .node:hover circle.body, .tree .node.on circle.body, .tree .node:focus circle.body { stroke: var(--ember); fill: #1a100a; }
.tree .node:hover circle.halo, .tree .node.on circle.halo { opacity: .18; }
.tree .node:hover text, .tree .node.on text { fill: var(--ember-hot); }
.tree .node:focus { outline: none; }
.tree .daat circle.body { stroke-dasharray: 2 4; }
.tree .daat circle.halo { animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .03; } 50% { opacity: .16; } }
@media (prefers-reduced-motion: reduce) { .tree .daat circle.halo { animation: none; } }

/* ---------- readout beside the tree ---------- */
.readout { min-height: 340px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.readout .no { font: 300 84px/1 var(--display); color: var(--ember); display: flex; align-items: baseline; gap: 22px; }
.readout .no .he { font: 300 52px/1 var(--hebrew); color: var(--parchment); }
.readout .name { font: 300 52px/1.05 var(--display); margin: 14px 0 12px; letter-spacing: -.01em; }
.readout .sub { color: var(--ash); letter-spacing: .16em; margin-bottom: 18px; }
.readout p { font-size: 19px; line-height: 1.65; color: var(--ash); max-width: 34rem; }
.readout .enter { display: inline-block; margin-top: 18px; text-decoration: none; }
.readout .enter:hover { color: var(--ember-hot); }
.legend { list-style: none; margin-top: 4px; }
.legend li { display: grid; grid-template-columns: 30px 64px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--rule); cursor: pointer; color: var(--ash); transition: color .25s, padding .25s; outline: none; }
.legend .n { font: 400 11px var(--mono); color: var(--smoke); }
.legend .h { font: 300 19px var(--hebrew); text-align: right; }
.legend .t { font: 400 21px/1.2 var(--display); }
.legend .s { font: 400 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--smoke); }
.legend li:hover, .legend li.on { color: var(--parchment); padding-left: 8px; }
.legend li.on .n, .legend li.on .h, .legend li.on .s { color: var(--ember); }

/* ---------- index ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.section-head h2 { font: 300 34px/1.1 var(--display); }
.entries { list-style: none; }
.entry { display: grid; grid-template-columns: 76px minmax(0, 1fr) 170px 70px; gap: 20px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background .3s, padding .3s; }
.entry:hover { background: linear-gradient(90deg, var(--ember-dim), transparent 60%); padding-left: 14px; color: inherit; }
.entry .num { font: 300 22px/1 var(--hebrew); color: var(--ember); }
.entry .num small { display: block; font: 400 10px/1 var(--mono); color: var(--smoke); letter-spacing: .1em; margin-top: 6px; }
.entry .ttl { font: 400 25px/1.25 var(--display); }
.entry .ttl .dek { display: block; font: italic 300 15px/1.5 var(--text); color: var(--ash); margin-top: 4px; }
.entry .typ { text-align: right; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 8px; }
  .hero-side { grid-row: 1; max-width: 300px; margin-bottom: 24px; }
  .seal .name { font-size: 44px; } .seal .tagline { font-size: 19px; }
  .verse .he { font-size: clamp(18px, 6vw, 30px); white-space: nowrap; }
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tree-section { grid-template-columns: 1fr; gap: 28px; }
  .tree-section > .tree-wrap { position: static; max-width: 360px; margin: 0 auto; width: 100%; }
  .readout { min-height: 0; }
  .readout .no { font-size: 56px; } .readout .no .he { font-size: 38px; }
  .readout .name { font-size: 38px; }
  .legend .s { display: none; }
}
@media (max-width: 640px) {
  .entry { grid-template-columns: 52px minmax(0, 1fr); }
  .entry .dom, .entry .typ { display: none; }
  .entry .ttl { font-size: 22px; }
}

/* =================== READING =================== */
/* Dense, book-like prose: the words are the point. */
.essay-head { max-width: 46rem; margin: 0 auto; padding: 44px 0 26px; text-align: center; border-bottom: 1px solid var(--rule); }
.essay-head .room { text-decoration: none; }
.essay-head .room:hover { color: var(--ember-hot); }
.essay-head .numeral { font: 300 40px/1 var(--hebrew); color: var(--ember); margin: 14px 0 4px; }
.essay-head h1 { font: 300 clamp(38px, 5.6vw, 64px)/1.04 var(--display); letter-spacing: -.012em; margin: 6px 0 10px; }
.essay-head .sub { font: italic 300 21px/1.4 var(--display); color: var(--ash); max-width: 36rem; margin: 0 auto; }
.essay-head .meta { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 18px; }

.prose { max-width: 37rem; margin: 30px auto 0; font: 300 20px/1.62 var(--text); color: var(--parchment); text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.prose p { margin: 0; }
.prose p + p { text-indent: 1.5em; }
.prose > p:first-child::first-letter { float: left; font: 400 4.1em/.74 var(--display); color: var(--ember); margin: .07em .09em 0 0; }
.prose h2 { font: 400 29px/1.18 var(--display); text-align: left; margin: 1.5em 0 .35em; color: var(--parchment); }
.prose h2::before { content: ""; display: block; width: 36px; height: 1px; background: var(--ember); margin-bottom: 12px; }
.prose h3 { font: italic 400 22px/1.3 var(--display); text-align: left; margin: 1.1em 0 .2em; color: var(--ember); }
.prose .orn { text-align: center; color: var(--ember); margin: .7em 0; text-indent: 0; letter-spacing: .5em; }
.prose strong { font-weight: 400; }
.masthead { max-width: 37rem; margin: 28px auto 0; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.masthead span { font: 400 11px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--smoke); }
.masthead span:first-child { color: var(--ash); }

.paths-out { max-width: 46rem; margin: 48px auto 0; }
.paths-out h2 { margin-bottom: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.cards a { background: var(--void); padding: 16px 18px; text-decoration: none; display: block; transition: background .3s; }
.cards a:hover { background: var(--vault); color: inherit; }
.cards .from { display: flex; align-items: baseline; gap: 10px; }
.cards .from .he { color: var(--ember); font-size: 18px; }
.cards .t { font: 400 21px/1.25 var(--display); margin-top: 6px; }
.pager { max-width: 46rem; margin: 22px auto 0; display: flex; justify-content: space-between; gap: 16px; }
.pager a { text-decoration: none; max-width: 48%; }
.pager a .t { display: block; font: 400 19px/1.3 var(--display); color: var(--parchment); margin-top: 4px; }
.pager a:last-child { text-align: right; margin-left: auto; }

/* =================== REPOSITORY =================== */
.room-head { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; padding: 44px 0 30px; border-bottom: 1px solid var(--rule); }
.room-head .no { font: 300 64px/1 var(--display); color: var(--ember); display: flex; align-items: baseline; gap: 18px; }
.room-head .no .he { font: 300 46px/1 var(--hebrew); color: var(--parchment); }
.room-head h1 { font: 300 clamp(40px, 6vw, 68px)/1.02 var(--display); margin: 10px 0 10px; letter-spacing: -.012em; }
.room-head .sub { color: var(--ash); letter-spacing: .16em; margin-bottom: 16px; }
.room-head p { font-size: 19px; line-height: 1.62; color: var(--ash); max-width: 36rem; }
.room-head .poster { display: block; border: 1px solid var(--rule); }
.room-head .poster img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; filter: grayscale(.4) sepia(.3) brightness(.7); transition: filter .5s; }
.room-head .poster:hover img { filter: none; }
.flagship { padding: 26px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; }
.flagship h2 { font: 300 40px/1.08 var(--display); margin: 4px 0 4px; }
.flagship h2 a { text-decoration: none; }
.flagship .sub { font: italic 300 19px/1.4 var(--display); color: var(--ash); }
.flagship .excerpt { margin-top: 12px; font-size: 18px; line-height: 1.6; color: var(--parchment); max-width: 40rem; }
.flagship .read { display: inline-block; margin-top: 12px; text-decoration: none; }
.archive-note { padding: 22px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; color: var(--ash); }
.archive-note b { font: 300 34px/1 var(--display); color: var(--parchment); }

/* =================== COLOPHON =================== */
.colophon { max-width: 37rem; margin: 0 auto; padding: 44px 0 0; }
.colophon h1 { font: 300 56px/1 var(--display); margin-bottom: 6px; }
.colophon .masthead-line { font: italic 300 22px/1.4 var(--display); color: var(--ember); margin-bottom: 26px; }
.colophon p { margin: 0 0 .9em; font-size: 19px; line-height: 1.62; }
.colophon .sig { margin-top: 26px; }

@media (max-width: 900px) {
  .room-head { grid-template-columns: 1fr; gap: 24px; }
  .room-head .poster { max-width: 220px; }
  .flagship, .archive-note { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  .prose { font-size: 18.5px; text-align: left; hyphens: manual; }
  .essay-head { padding-top: 32px; }
  .pager { flex-direction: column; } .pager a { max-width: none; } .pager a:last-child { text-align: left; margin-left: 0; }
}

/* =================== ARCHIVE =================== */
.archive { padding-top: 30px; }
.archive .section-head a { color: var(--ember); text-decoration: none; }
.archive-list { list-style: none; border-top: 1px solid var(--rule); }
.archive-list a { display: grid; grid-template-columns: 104px minmax(0, 1fr) 56px; gap: 16px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background .25s, padding .25s; }
.archive-list a:hover { background: linear-gradient(90deg, var(--ember-dim), transparent 60%); padding-left: 8px; color: inherit; }
.archive-list .d { font: 400 11px/1.4 var(--mono); letter-spacing: .08em; color: var(--smoke); text-transform: uppercase; }
.archive-list .t { font: 400 19px/1.3 var(--display); color: var(--parchment); min-width: 0; }
.archive-list .m { font: 400 11px var(--mono); color: var(--smoke); text-align: right; }
.more-note { margin-top: 16px; color: var(--ash); font-size: 17px; }
.pieces { max-width: 37rem; margin: 0 auto; }
.piece { padding: 30px 0 26px; border-bottom: 1px solid var(--rule); scroll-margin-top: 16px; }
.piece .meta { display: flex; justify-content: space-between; gap: 12px; }
.piece .meta a { text-decoration: none; }
.piece h2 { font: 400 30px/1.15 var(--display); margin: 8px 0 12px; text-wrap: balance; }
.piece .prose { margin: 0; max-width: none; }
.piece .prose > p:first-child::first-letter { float: none; font: inherit; color: inherit; margin: 0; }
.piece:target h2 { color: var(--ember-hot); }
@media (max-width: 640px) {
  .archive-list a { grid-template-columns: 1fr; gap: 2px; }
  .archive-list .m { display: none; }
}
