/* Temessek Foundation, 2026 edition.
   Parchment ground, gold-and-emerald ink line work drawn by particles (scene.js), dark ink text.
   Mamluk vocabulary: ablaq stripes, pointed arches, the eight-point star.
   Everything reads without JavaScript, in print and with reduced motion. */

:root {
  --ground: #f3ead7;
  --halo: rgba(246, 239, 224, .96);
  --emerald: #0b3a31;
  --emerald-2: #134c40;
  --ivory: #f4ead3;
  --ivory-2: #e8dbbb;
  --paper: #fbf6ea;
  --ink: #13302a;
  --gold: #b9893a;
  --gold-deep: #85590f;
  --gold-2: #ecc98a;
  --muted: rgba(19, 48, 42, .78);
  --faint: rgba(19, 48, 42, .7);
  --line: rgba(133, 89, 15, .3);
  --line-soft: rgba(19, 48, 42, .13);
  --glass: rgba(252, 248, 239, .74);
  --glass-strong: rgba(252, 248, 239, .96);
  --shadow: 0 18px 50px rgba(84, 62, 24, .12);
  --serif: "Noto Naskh Arabic", "Amiri", Georgia, serif;
  --sans: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --display: var(--serif);
  --wrap: min(1240px, calc(100% - 2 * var(--gutter)));
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 22px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --head: 76px;
  --octagram: polygon(50% 0, 64.64% 14.64%, 85.36% 14.64%, 85.36% 35.36%, 100% 50%, 85.36% 64.64%, 85.36% 85.36%, 64.64% 85.36%, 50% 100%, 35.36% 85.36%, 14.64% 85.36%, 14.64% 64.64%, 0 50%, 14.64% 35.36%, 14.64% 14.64%, 35.36% 14.64%);
  --arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100V46C0 22 24 7 50 0C76 7 100 22 100 46V100Z'/%3E%3C/svg%3E");
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  background-image:
    radial-gradient(110% 70% at 50% -10%, rgba(255, 252, 244, .95), transparent 62%),
    radial-gradient(90% 60% at 50% 115%, rgba(205, 178, 128, .32), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  line-height: 1.85;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.35; margin: 0; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.wrap { width: var(--wrap); margin-inline: auto; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 6px; }
.skip { position: fixed; inset-inline-start: 16px; top: -80px; z-index: 50; background: var(--gold); color: var(--ink); padding: 10px 18px; border-radius: 999px; font-weight: 600; text-decoration: none; transition: top .2s; }
.skip:focus { top: 16px; }

/* ---------- scene layers ---------- */
.scene-canvas, .scene-poster, .scene-veil { position: fixed; inset: 0; width: 100%; height: 100lvh; pointer-events: none; }
.scene-canvas { z-index: 0; opacity: 0; transition: opacity 1.2s var(--ease); }
.scene-ready .scene-canvas { opacity: 1; }
/* Static rendition of the portal, shown before WebGL and wherever it is unavailable. */
.scene-poster {
  z-index: 0;
  background: url("/assets/scene/poster-v3.webp") center 38% / cover no-repeat;
  opacity: .9;
  transition: opacity 1.2s var(--ease);
}
.scene-ready .scene-poster { opacity: 0; }
/* without WebGL, or after the context is lost, the poster stays */
.scene-unavailable .scene-canvas { display: none; }
.scene-unavailable .scene-poster { opacity: .9; }
.scene-veil {
  z-index: 1;
  background:
    radial-gradient(75% 65% at 50% 45%, transparent 45%, rgba(233, 220, 193, .55) 100%),
    linear-gradient(180deg, rgba(243, 234, 215, .35), transparent 18%, transparent 84%, rgba(233, 220, 193, .5));
}
main, .site-footer { position: relative; z-index: 2; }

/* ---------- header ---------- */
.site-head {
  position: fixed; z-index: 20; top: 12px; inset-inline: 0;
  width: min(1320px, calc(100% - 24px)); margin-inline: auto;
}
.head-row {
  display: flex; align-items: center; gap: 18px;
  min-height: 60px; padding: 8px 10px 8px 10px; padding-inline-start: 12px;
  border-radius: 999px;
  background: rgba(252, 248, 239, .76);
  border: 1px solid rgba(133, 89, 15, .18);
  box-shadow: 0 10px 40px rgba(84, 62, 24, .12), inset 0 1px 0 rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.brand-name { display: grid; font-family: var(--serif); font-weight: 700; font-size: 1.12rem; line-height: 1.2; }
.brand-name small { font-family: var(--sans); font-size: .58rem; letter-spacing: .24em; color: var(--gold-deep); font-weight: 500; }
.nav-links { display: flex; gap: 4px; margin-inline: auto; }
.nav-links a { text-decoration: none; font-size: .93rem; padding: 8px 14px; border-radius: 999px; color: var(--muted); transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); background: rgba(19, 48, 42, .07); }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.language-switch { display: flex; padding: 3px; border-radius: 999px; background: rgba(19, 48, 42, .05); border: 1px solid var(--line-soft); }
.language-switch a { text-decoration: none; font-size: .8rem; padding: 5px 11px; border-radius: 999px; color: var(--muted); font-family: var(--sans); }
.language-switch a[aria-current] { background: var(--emerald); color: var(--ivory); font-weight: 600; }
.head-contact { text-decoration: none; font-weight: 600; font-size: .9rem; padding: 10px 18px; border-radius: 999px; background: linear-gradient(180deg, #175a4b, var(--emerald)); color: var(--ivory); box-shadow: 0 6px 20px rgba(11, 58, 49, .22); }

/* ---------- ornaments ---------- */
.star { display: inline-block; width: .7em; height: .7em; background: var(--gold); clip-path: var(--octagram); vertical-align: middle; }
.section-index {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: .8rem; letter-spacing: .22em; color: var(--gold-deep); font-weight: 600;
}
.section-index::before { content: ""; width: 34px; height: 6px; border-radius: 1px; background: repeating-linear-gradient(90deg, var(--gold) 0 6px, var(--emerald-2) 6px 12px); box-shadow: 0 0 0 1px var(--line); }

/* ---------- hero ---------- */
/* The page opens on the foundation's name, one sentence, and its three fields of work. */
.hero {
  min-height: 100svh;
  display: grid; align-content: center; justify-items: center; text-align: center;
  gap: clamp(20px, 4.2vh, 52px);
  padding: calc(var(--head) + clamp(18px, 4vh, 56px)) var(--gutter) clamp(22px, 4vh, 56px);
  overflow-x: clip;
}
.hero-inner { position: relative; max-width: 76rem; display: grid; justify-items: center; gap: clamp(8px, 1.6vh, 18px); }
.hero-inner::before { content: ""; position: absolute; z-index: -1; inset: -14% max(-10%, calc((100% - 100vw) / 2)); background: radial-gradient(closest-side, rgba(246, 239, 224, .92), rgba(246, 239, 224, .7) 55%, rgba(246, 239, 224, 0)); pointer-events: none; }
.hero h1 { display: grid; justify-items: center; text-wrap: balance; }
.hero-name {
  font-size: clamp(2.15rem, .9rem + 3.4vw, 4.6rem);
  line-height: 1.3;
  letter-spacing: -.005em;
  text-shadow: 0 2px 34px var(--halo), 0 0 3px var(--halo), 0 0 12px var(--halo);
}
.hero-tagline {
  font-size: clamp(1.25rem, .8rem + 1.35vw, 2.1rem); font-weight: 600; line-height: 1.5;
  color: var(--gold-deep); margin-top: .15em;
  text-shadow: 0 0 18px var(--halo), 0 0 4px var(--halo);
}
.hero-tagline::before, .hero-tagline::after { content: ""; display: inline-block; width: .42em; height: .42em; margin-inline: .55em; background: var(--gold); clip-path: var(--octagram); vertical-align: .18em; }
.hero-lead { font-family: var(--serif); font-weight: 600; font-size: clamp(1.02rem, .9rem + .42vw, 1.4rem); line-height: 1.85; max-width: 52rem; text-wrap: balance; text-shadow: 0 0 18px var(--halo), 0 0 4px var(--halo); }
.arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="ltr"] .arrow { transform: scaleX(-1); }

/* activities: three arch windows onto the drawings, the image first */
.activities { width: min(1240px, 100%); display: grid; justify-items: center; gap: clamp(10px, 1.8vh, 20px); }
.activities-title {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  font-family: var(--serif); font-weight: 600; font-size: clamp(.98rem, .9rem + .3vw, 1.2rem); color: var(--gold-deep); white-space: nowrap;
  text-shadow: 0 0 12px var(--halo);
}
.activities-title::before, .activities-title::after { content: ""; flex: 0 1 140px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.activities-title::after { background: linear-gradient(90deg, var(--gold), transparent); }
.activity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 26px); width: 100%; text-align: center; }
.activity {
  position: relative; display: flex; flex-direction: column; padding: 9px 9px 16px; border-radius: 200px 200px 20px 20px / 120px 120px 20px 20px;
  background: var(--glass); border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  transition: border-color .3s, transform .4s var(--ease);
}
.activity:hover { border-color: var(--line); transform: translateY(-4px); }
.arch-window {
  margin: 0 0 10px; height: clamp(130px, 23vh, 270px); overflow: hidden;
  background: var(--paper);
  -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat;
}
.arch-window img { width: 100%; height: 100%; object-fit: cover; object-position: center 58%; mix-blend-mode: multiply; transition: transform 1.2s var(--ease); }
.activity:hover .arch-window img { transform: scale(1.04); }
.activity h3 { font-size: clamp(1.3rem, 1.05rem + .75vw, 1.85rem); line-height: 1.3; padding-inline: 12px; margin-bottom: 4px; }
.activity p { color: var(--muted); padding-inline: clamp(10px, 1.2vw, 18px); font-size: clamp(.82rem, .78rem + .14vw, .92rem); line-height: 1.75; }

/* entrance: the text is legible from the first paint; it only settles a few pixels into place */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > *, .activities { animation: rise .8s var(--ease) both; }
  .activities { animation-delay: .1s; }
}
@keyframes rise { from { transform: translateY(12px); } }

/* ---------- sections ---------- */
.section { padding-block: clamp(80px, 14vh, 160px); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(36px, 6vh, 64px); max-width: 44rem; }
/* a parchment veil behind every heading block, so its lines never sit on the ornament's strokes;
   the wide soft shadow lets the veil fade into the ground instead of showing an edge */
.section-head, .group-head {
  background: rgba(247, 241, 227, .94);
  box-shadow: 0 0 36px 26px rgba(247, 241, 227, .94);
  border-radius: 24px;
}
.section-title { font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.7rem); line-height: 1.25; text-shadow: 0 0 24px var(--halo), 0 0 6px var(--halo); }
.section-intro { color: var(--muted); text-shadow: 0 0 14px var(--halo), 0 0 4px var(--halo); font-size: clamp(1.02rem, .98rem + .25vw, 1.18rem); }
.panel {
  background: var(--glass);
  border: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

/* projects: three titled groups, each a row of cards */
.project-groups { display: grid; gap: clamp(44px, 8vh, 84px); }
.project-group { display: grid; gap: clamp(16px, 2.4vh, 24px); }
.group-head {
  position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); border-radius: 0;
}
.group-head::after { content: ""; position: absolute; bottom: -3px; inset-inline-start: 0; width: 72px; height: 5px; border-radius: 1px; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, var(--emerald-2) 8px 16px); }
.group-head h3 { font-size: clamp(1.55rem, 1.15rem + 1.25vw, 2.4rem); line-height: 1.3; text-shadow: 0 0 20px var(--halo), 0 0 5px var(--halo); }
.group-head p { color: var(--muted); font-size: clamp(.95rem, .9rem + .2vw, 1.08rem); text-shadow: 0 0 12px var(--halo); }
/* flex rather than grid so an incomplete last row sits centred */
.project-grid { --cols: 3; --gap: clamp(12px, 1.6vw, 22px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.project-grid > .project { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
.project {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: start;
  padding: 18px 18px 16px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  transition: border-color .3s, transform .4s var(--ease), background .3s;
}
.project:hover { border-color: var(--line); transform: translateY(-3px); background: rgba(255, 252, 245, .92); }
.project[hidden] { display: none; }
.project-art { margin: 0; width: clamp(72px, 5.6vw, 92px); aspect-ratio: 1; filter: drop-shadow(0 0 1px var(--gold)) drop-shadow(0 6px 16px rgba(84, 62, 24, .2)); }
.project-art img { width: 100%; height: 100%; object-fit: cover; clip-path: var(--octagram); background: var(--paper); transform: scale(1.0); transition: transform .8s var(--ease); }
.project:hover .project-art img { transform: rotate(-22.5deg) scale(1.02); }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.project-tag, .project-status { font-size: .7rem; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--muted); }
.project-status[data-status="ready"] { color: #17624b; border-color: rgba(23, 98, 75, .35); background: rgba(23, 98, 75, .08); }
.project-status[data-status="progress"] { color: var(--gold-deep); border-color: var(--line); background: rgba(185, 137, 58, .1); }
.project h4 { font-size: clamp(1.2rem, 1.05rem + .45vw, 1.5rem); line-height: 1.35; }
.project-subtitle { color: var(--gold-deep); font-size: .88rem; margin-top: 2px; line-height: 1.6; }
.project-address { display: inline-block; margin-top: 6px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .76rem; color: var(--faint); letter-spacing: .02em; }
.project-body { grid-column: 1 / -1; margin-top: 12px; color: var(--muted); }
.project-body p { margin-bottom: 12px; }
.project-scope { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.project-scope div { padding: 10px 12px; border-radius: 14px; background: rgba(19, 48, 42, .035); border: 1px solid var(--line-soft); display: flex; flex-direction: column-reverse; gap: 2px; }
.project-scope dt { font-size: .75rem; color: var(--faint); line-height: 1.5; }
.project-scope dd { margin: 0; font-family: var(--serif); font-weight: 700; color: var(--ink); line-height: 1.4; }
.project-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.project-grid .project-address { display: none; }
.project-copy { display: contents; }
.project-copy > :not(.project-body, .project-actions) { grid-column: 2; }
.project-meta { grid-row: 1; }
.project-art { grid-row: 1 / span 4; grid-column: 1; }
/* the core research projects lead: larger marks, and their description shown on the card */
.project-group[data-group="research"] .project { grid-template-rows: repeat(4, auto) 1fr auto; padding: 22px 22px 18px; }
.project-group[data-group="research"] .project-art { width: clamp(84px, 7vw, 112px); }
.project-group[data-group="research"] .project h4 { font-size: clamp(1.35rem, 1.1rem + .7vw, 1.8rem); }
@media (min-width: 901px) {
  .catalogue-ready .project-group[data-group="research"] .project .project-body { display: block; }
  .project-group[data-group="research"] .project-body { margin-top: 14px; font-size: .93rem; line-height: 1.9; }
  .project-group[data-group="research"] .project-body p { margin: 0; }
  .catalogue-ready .project-group[data-group="research"] .project-scope { display: none; }
}
.text-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--ivory); background: linear-gradient(180deg, #175a4b, var(--emerald)); padding: 8px 16px; border-radius: 999px; }
.project-grid .text-link { font-size: .84rem; padding: 6px 13px; }
.project-grid .text-link .arrow { width: 14px; height: 14px; }
.text-link .arrow { width: 16px; height: 16px; }
.project-details-button { font: inherit; font-size: .84rem; font-weight: 500; color: var(--ink); background: rgba(19, 48, 42, .04); border: 1px solid rgba(19, 48, 42, .22); padding: 5px 14px; border-radius: 999px; cursor: pointer; transition: background .2s, border-color .2s; }
.project-details-button:hover { background: rgba(19, 48, 42, .08); border-color: var(--line); }
/* With JavaScript the long description moves into the details window. */
.catalogue-ready .project .project-body { display: none; }

.project-dialog {
  width: min(880px, calc(100% - 24px)); max-height: min(88vh, 820px); padding: 0; border: 1px solid var(--line);
  border-radius: 26px; color: var(--ink); background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 40px 120px rgba(60, 42, 12, .28);
}
.project-dialog::backdrop { background: rgba(48, 36, 14, .32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.project-dialog[open] { display: grid; grid-template-rows: auto 1fr auto; }
@media (prefers-reduced-motion: no-preference) { .project-dialog[open] { animation: dialog-in .45s var(--ease); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.project-dialog-toolbar, .project-dialog-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.project-dialog-toolbar { border-bottom: 1px solid var(--line-soft); }
.project-dialog-navigation { border-top: 1px solid var(--line-soft); }
.project-dialog-status { font-size: .85rem; color: var(--gold-deep); }
.project-dialog button { font: inherit; color: var(--ink); background: rgba(19, 48, 42, .05); border: 1px solid var(--line-soft); border-radius: 999px; padding: 6px 16px; cursor: pointer; }
.project-dialog button:disabled { opacity: .35; cursor: default; }
.project-dialog-content { overflow: auto; display: grid; grid-template-columns: 200px 1fr; gap: 28px; padding: 28px; }
.project-dialog-content .project-art { width: 200px; grid-row: auto; }
.project-dialog-copy { display: grid; gap: 10px; align-content: start; }
.project-dialog-copy h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); }
.project-dialog-copy .project-body { display: block; margin-top: 6px; }
.project-dialog-copy .text-link { justify-self: start; }
.project-dialog-position { font-size: .85rem; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
html.project-dialog-open { overflow: hidden; }

/* books: three bound volumes, not links. The first leads, with its story beside it;
   the other two sit beneath it as smaller volumes, each in its own binding colour. */
.book-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(22px, 3vw, 40px) clamp(20px, 3vw, 44px); max-width: 1000px; }
.book { --cloth-a: #0f4a3d; --cloth-b: #072a22; --cloth-spine: #0d3d32; --cloth-edge: #052019;
  display: grid; grid-template-columns: 132px 1fr; gap: 24px; align-items: center; text-align: start; }
.book[data-tone="carmine"] { --cloth-a: #6b2128; --cloth-b: #3b1015; --cloth-spine: #561a20; --cloth-edge: #2a0a0e; }
.book[data-tone="lapis"] { --cloth-a: #233a6a; --cloth-b: #111e3d; --cloth-spine: #1b2f57; --cloth-edge: #0b1428; }
.book { padding: 20px 22px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); }
.book-featured { grid-column: 1 / -1; grid-template-columns: 236px 1fr; gap: clamp(28px, 4vw, 56px); padding: clamp(22px, 3vw, 36px); }
.book-stage { perspective: 1400px; width: 100%; }
/* wide screens: the leading book stands tall in the first column, the other two beside it */
@media (min-width: 901px) {
  .book-shelf { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); max-width: 1120px; }
  .book-featured { grid-column: 1; grid-row: span 2; grid-template-columns: 1fr; justify-items: center; align-content: center; text-align: center; gap: 26px; }
  .book-featured .book-stage { width: min(250px, 66%); }
  .book-featured .book-about { justify-items: center; }
  .book-featured .book-caption { max-width: 30rem; }
}

.book-about { display: grid; gap: 10px; align-content: center; }
.book-kicker { font-family: var(--serif); font-weight: 700; font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); color: var(--gold-deep); }
.book-kicker::before { content: ""; display: inline-block; width: .6em; height: .6em; margin-inline-end: 10px; background: var(--gold); clip-path: var(--octagram); vertical-align: .05em; }
.book-name { font-family: var(--serif); font-weight: 700; font-size: clamp(1.15rem, 1.05rem + .35vw, 1.35rem); color: var(--ink); line-height: 1.4; }
.book-featured .book-caption { font-size: clamp(1rem, .96rem + .2vw, 1.1rem); line-height: 1.95; max-width: 40rem; }
.book-object {
  position: relative; aspect-ratio: 2 / 3; transform-style: preserve-3d;
  transform: rotateY(var(--turn, 22deg)) rotateX(4deg);
  transition: transform .9s var(--ease);
}
[dir="ltr"] .book-object { --turn: -22deg; }
.book:hover .book-object { transform: rotateY(calc(var(--turn, 22deg) * .25)) rotateX(2deg) translateY(-6px); }
.book-cover {
  position: absolute; inset: 0; padding: 12px; border-radius: 4px 10px 10px 4px;
  background:
    radial-gradient(120% 80% at 70% 10%, rgba(255, 255, 255, .1), transparent 50%),
    linear-gradient(160deg, var(--cloth-a), var(--cloth-b) 70%);
  box-shadow: inset 0 0 0 1px rgba(214, 163, 76, .35), inset 0 0 40px rgba(0, 0, 0, .45), 0 30px 60px rgba(60, 42, 12, .32);
  transform: translateZ(14px);
}
[dir="rtl"] .book-cover { border-radius: 10px 4px 4px 10px; }
.book-frame {
  position: relative; height: 100%; padding: 26px 16px; display: grid; align-content: center; gap: 8px;
  border: 1px solid rgba(214, 163, 76, .7); outline: 1px solid rgba(214, 163, 76, .35); outline-offset: -6px; border-radius: 3px;
}
.book-ornament { justify-self: center; width: 36px; height: 36px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); clip-path: var(--octagram); margin-bottom: 8px; box-shadow: 0 0 20px rgba(214, 163, 76, .5); }
.book-frame h3 { font-size: clamp(1.25rem, 1.05rem + .7vw, 1.6rem); color: var(--gold-2); line-height: 1.4; text-wrap: balance; }
.book-subtitle { font-family: var(--serif); font-size: .86rem; color: var(--ivory-2); line-height: 1.6; }
.book-author { position: absolute; bottom: 16px; inset-inline: 10px; font-size: .72rem; color: rgba(244, 234, 211, .74); line-height: 1.6; }
.book-author span { display: block; font-size: .9em; color: rgba(244, 234, 211, .52); }
.book-spine { position: absolute; top: 0; bottom: 0; width: 28px; background: linear-gradient(90deg, var(--cloth-edge), var(--cloth-spine), var(--cloth-edge)); transform-origin: center; }
[dir="rtl"] .book-spine { right: 0; transform: translateX(14px) rotateY(90deg); }
[dir="ltr"] .book-spine { left: 0; transform: translateX(-14px) rotateY(-90deg); }
.book-pages { position: absolute; top: 6px; bottom: 6px; width: 26px; background: repeating-linear-gradient(90deg, #efe4c8 0 1px, #d9caa4 1px 2px); }
[dir="rtl"] .book-pages { left: 0; transform: translateX(-12px) rotateY(-90deg); }
[dir="ltr"] .book-pages { right: 0; transform: translateX(12px) rotateY(90deg); }
.book-caption { color: var(--muted); font-size: .95rem; line-height: 1.85; max-width: 26rem; }
/* the leading cover keeps room at its foot for the author line */
.book-featured .book-frame { display: flex; flex-direction: column; padding-bottom: 14px; }
.book-featured .book-ornament { margin-top: auto; flex: none; }
.book-featured .book-author { position: static; margin-top: auto; padding-top: 10px; }
/* cover paintings carry no lettering: the title is set over the dark sky or shadow in their upper part */
.book[data-cover] .book-cover { padding: 0; background: var(--cloth-b) center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(214, 163, 76, .3), 0 30px 60px rgba(60, 42, 12, .32); }
.book[data-cover="ajaib"] .book-cover { background-image: url("/assets/books/ajaib-cover-v2.webp"); }
.book[data-cover="kalima-sawa"] .book-cover { background-image: url("/assets/books/kalima-sawa-cover-v2.webp"); }
.book[data-cover="awdat-al-masih"] .book-cover { background-image: url("/assets/books/awdat-al-masih-cover-v2.webp"); }
.book[data-cover] .book-frame { border: 0; outline: 0; padding-inline: 13%; }
.book-cover { text-align: center; }
.book[data-cover] .book-ornament { display: none; }
.book[data-cover] .book-frame h3 { text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.book[data-cover] .book-frame { align-content: start; padding-top: 22%; }
.book-featured[data-cover] .book-frame { padding-block: 13% 4%; }
.book-featured[data-cover] .book-frame h3 { margin-top: 0; }
.book[data-cover] :is(.book-subtitle, .book-author) { text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.book-featured[data-cover] .book-author { padding-top: 0; margin-inline: -8%; font-size: .68rem; }
.book[data-cover] .book-author span { display: none; }
/* the small volumes: a compact cover, so the title on it is set smaller */
.book:not(.book-featured) .book-frame { padding: 14px 8px; gap: 4px; }
.book:not(.book-featured) .book-frame h3 { font-size: .98rem; }
.book:not(.book-featured) .book-ornament { width: 20px; height: 20px; margin-bottom: 2px; }
.book:not(.book-featured) :is(.book-subtitle, .book-author) { display: none; }
.book:not(.book-featured) .book-cover { padding: 7px; }
.book:not(.book-featured)[data-cover] .book-cover { padding: 0; }
.book:not(.book-featured)[data-cover] .book-frame { padding: 18% 10px 0; }
/* books readable online: two links under the caption; Sukayna's cover carries its own title */
.book-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.book-actions .text-link { font-size: .84rem; padding: 6px 13px; }
.book-actions .text-link .arrow { width: 14px; height: 14px; }
.book-file { display: inline-flex; align-items: center; text-decoration: none; font-weight: 600; font-size: .84rem; padding: 5px 13px; border-radius: 999px; color: var(--ink); border: 1px solid rgba(19, 48, 42, .28); background: rgba(252, 248, 239, .7); }
.book-file:hover { border-color: var(--gold-deep); }

/* mawalid: the painted covers on one manuscript page, set in Amiri, a classical naskh
   that carries the vowelled titles and honorifics well; English uses the display serif */
.mawalid { --mawlid-font: "Amiri", var(--serif); }
[lang="en"] .mawalid { --mawlid-font: var(--display); }
.mawalid .section-head { margin-inline: auto; justify-items: center; text-align: center; max-width: 56rem; }
.mawalid .section-title { font-family: var(--mawlid-font); font-weight: 700; font-size: clamp(2rem, 1.25rem + 2.3vw, 3.4rem); line-height: 1.55; text-wrap: balance; }
.mawalid .section-intro { font-family: var(--mawlid-font); font-size: clamp(1.1rem, 1rem + .45vw, 1.4rem); line-height: 1.8; color: var(--gold-deep); text-wrap: balance; }
.mawalid .section-head::after { content: ""; width: min(260px, 60%); height: 12px; margin-top: 4px; background:
  radial-gradient(circle, var(--gold) 0 3px, transparent 3.5px) center / 12px 12px no-repeat,
  linear-gradient(90deg, transparent, var(--gold) 40%, transparent 46%, transparent 54%, var(--gold) 60%, transparent) center / 100% 1px no-repeat; }
.mawlid-list {
  --mawlid-gap: clamp(18px, 2.4vw, 38px);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(28px, 4vh, 44px) var(--mawlid-gap);
  padding: clamp(26px, 3.4vw, 52px) clamp(20px, 3vw, 48px) clamp(24px, 3vw, 44px); border-radius: 26px;
  background: rgba(251, 246, 234, .86);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(176, 139, 69, .5), inset 0 0 0 8px rgba(251, 246, 234, .9), inset 0 0 0 9px rgba(176, 139, 69, .4);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
}
.mawlid { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.mawlid-cover { position: relative; width: 100%; margin: 0 0 14px; aspect-ratio: 400 / 566; overflow: hidden; border-radius: 3px 8px 8px 3px; background: var(--emerald); box-shadow: 0 22px 40px rgba(60, 42, 12, .3), 0 3px 8px rgba(60, 42, 12, .2); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
[dir="rtl"] .mawlid-cover { border-radius: 8px 3px 3px 8px; }
.mawlid:hover .mawlid-cover { transform: translateY(-5px); box-shadow: 0 30px 50px rgba(60, 42, 12, .34), 0 3px 8px rgba(60, 42, 12, .2); }
.mawlid-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the bound edge of each volume: a soft fold where the spine meets the board */
.mawlid-cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .12) 3%, rgba(0, 0, 0, .08) 6%, transparent 10%); box-shadow: inset 0 0 0 1px rgba(214, 163, 76, .28); }
[dir="rtl"] .mawlid-cover::after { background: linear-gradient(270deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .12) 3%, rgba(0, 0, 0, .08) 6%, transparent 10%); }
.mawlid h3 { font-family: var(--mawlid-font); font-weight: 700; font-size: clamp(1.25rem, 1.05rem + .5vw, 1.6rem); line-height: 1.6; color: var(--emerald); }
.mawlid-subject { font-family: var(--mawlid-font); font-size: clamp(.98rem, .92rem + .2vw, 1.08rem); line-height: 1.8; color: var(--muted); text-wrap: balance; }
.mawlid-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; margin-top: auto; padding-top: 12px; }
.mawlid-actions .text-link { padding: 2px 0; border-radius: 0; background: none; color: var(--emerald); font-size: .86rem; border-bottom: 1px solid var(--gold); }
.mawlid-actions .text-link:hover { color: var(--gold-deep); }
.mawlid-actions .text-link .arrow { width: 14px; height: 14px; }
.mawlid-actions .book-file { font-size: .74rem; letter-spacing: .06em; padding: 2px 10px; }
[lang="en"] .mawlid h3 { font-weight: 600; font-size: clamp(1.3rem, 1.1rem + .5vw, 1.65rem); line-height: 1.25; }
[lang="en"] .mawlid-subject { font-size: clamp(1rem, .95rem + .2vw, 1.12rem); line-height: 1.5; }

/* mission */
.method .wrap { display: grid; gap: clamp(48px, 8vh, 90px); }
.founder-note { margin: 0; display: grid; justify-items: center; text-align: center; gap: 18px; max-width: 60rem; margin-inline: auto; }
.founder-note .section-index { justify-content: center; }
.founder-note blockquote {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 3.1rem); line-height: 1.6; text-wrap: balance;
  text-shadow: 0 0 26px var(--halo), 0 0 6px var(--halo), 0 0 2px var(--halo);
}
.founder-note blockquote::before, .founder-note blockquote::after { color: var(--gold); font-family: Georgia, serif; }
[dir="rtl"] .founder-note blockquote::before { content: "”"; margin-inline-end: .1em; }
[dir="rtl"] .founder-note blockquote::after { content: "“"; margin-inline-start: .1em; }
[dir="ltr"] .founder-note blockquote::before { content: "“"; margin-inline-end: .1em; }
[dir="ltr"] .founder-note blockquote::after { content: "”"; margin-inline-start: .1em; }
.founder { font-family: var(--serif); font-weight: 600; color: var(--gold-deep); text-shadow: 0 0 10px var(--halo); }
.founder::before { content: ""; display: inline-block; width: 40px; height: 1px; background: var(--gold); vertical-align: middle; margin-inline-end: 12px; }
.method-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.method-item { padding: 26px 24px 28px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line-soft); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); position: relative; }
.method-item::before { content: ""; position: absolute; top: -1px; inset-inline: 24px; height: 3px; border-radius: 0 0 3px 3px; background: repeating-linear-gradient(90deg, var(--gold-2) 0 10px, var(--emerald-2) 10px 20px); }
.method-item h3 { font-size: 1.4rem; margin-bottom: 10px; }
.method-item p { color: var(--muted); }

/* contact */
/* the wordmark is drawn in particles in the open space above the panel */
.contact { padding-top: clamp(260px, 46vh, 480px); padding-bottom: clamp(30px, 5vh, 60px); }
.contact-panel { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: clamp(28px, 4vw, 56px); border-radius: 32px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.contact-copy { display: grid; gap: 12px; }
.contact-copy p:last-child { color: var(--muted); max-width: 34rem; }
.contact-links { display: grid; gap: 8px; justify-items: start; }
.contact-label { font-size: .85rem; color: var(--gold-deep); letter-spacing: .05em; }
.contact-number { text-decoration: none; font-family: var(--sans); font-weight: 600; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem); color: var(--ink); border-bottom: 1px solid var(--gold); padding-bottom: 2px; }
.location { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .95rem; margin-top: 8px; }
.location svg { width: 18px; height: 18px; fill: none; stroke: var(--gold-deep); stroke-width: 1.8; }

/* identity card: paper, official, plain */
.identity-section { padding-top: clamp(260px, 54vh, 580px); } /* room for the fountain canopy drawn by the scene */
.identity-card {
  max-width: 860px; margin-inline: auto; padding: clamp(24px, 4vw, 48px);
  color: var(--ink); border-radius: 18px;
  background: linear-gradient(180deg, #fffdf6, #f6eddb);
  box-shadow: 0 30px 80px rgba(84, 62, 24, .2), inset 0 0 0 1px rgba(176, 139, 69, .5), inset 0 0 0 7px #f6eedb, inset 0 0 0 8px rgba(176, 139, 69, .45);
}
.identity-top { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; margin-bottom: 8px; border-bottom: 3px double rgba(176, 139, 69, .7); }
.identity-mark { width: 64px; height: 64px; border-radius: 14px; }
.identity-top h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); color: var(--emerald); }
.identity-top p { font-size: .7rem; letter-spacing: .26em; color: #7a5f2e; }
.identity-data { margin: 0; display: grid; }
.identity-row { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; padding: 12px 4px; border-bottom: 1px solid rgba(176, 139, 69, .3); }
.identity-row:last-child { border-bottom: 0; }
.identity-row dt { color: #7a6338; font-size: .92rem; }
.identity-row dd { margin: 0; font-weight: 600; color: var(--ink); }
.identity-row a { color: var(--emerald); }

/* footer */
/* a deep emerald band closes the page */
.site-footer {
  margin-top: clamp(60px, 10vh, 120px); padding: 56px 0 30px; color: var(--ivory);
  background: linear-gradient(180deg, #0f4236, #072a22); border-top: 3px solid var(--gold);
  --muted: rgba(244, 234, 211, .76); --faint: rgba(244, 234, 211, .56); --line-soft: rgba(244, 234, 211, .14);
}
.site-footer .brand-name small { color: var(--gold-2); }
.site-footer :focus-visible { outline-color: var(--gold-2); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.footer-grid p { color: var(--muted); font-size: .92rem; margin-top: 16px; max-width: 34rem; }
.footer-grid h3 { font-family: var(--sans); font-size: .85rem; font-weight: 600; color: var(--gold-2); letter-spacing: .04em; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--muted); font-size: .92rem; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--ivory); text-decoration: underline; text-underline-offset: 4px; }
.back-top { display: inline-block; margin-top: 16px; font-size: .9rem; color: var(--gold-2); }
.copyright { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-size: .8rem; color: var(--faint); }

/* view controls */
.view-controls { position: fixed; z-index: 15; bottom: 16px; inset-inline-start: 16px; display: flex; gap: 8px; }
.view-controls[hidden] { display: none; }
.view-controls button { display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; justify-content: center; padding: 0 12px; font: inherit; font-size: .8rem; color: var(--ink); border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(252, 248, 239, .82); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); cursor: pointer; }
.view-controls button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-deep); }
.view-controls button:disabled { opacity: .5; cursor: default; }
.view-controls svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.motion-control .motion-play, [data-motion="paused"] .motion-control .motion-pause { display: none; }
[data-motion="paused"] .motion-control .motion-play { display: block; }

/* clearer view: opaque panels, quieter scene */
[data-transparency="reduced"] .scene-canvas { opacity: .32; }
[data-transparency="reduced"] .scene-poster { opacity: .25; }
.scene-ready[data-transparency="reduced"] .scene-poster { opacity: 0; }
[data-transparency="reduced"] :is(.head-row, .activity, .project, .book, .method-item, .contact-panel, .mawlid-list, .project-dialog, .view-controls button) {
  background: #fcf8ef; -webkit-backdrop-filter: none; backdrop-filter: none;
}
[data-transparency="reduced"] .hero-name, [data-transparency="reduced"] .hero-lead { color: var(--ink); }
/* the same calm panels from the device preference alone, before or without JavaScript */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :is(.head-row, .activity, .project, .book, .method-item, .contact-panel, .mawlid-list, .project-dialog, .view-controls button) {
    background: #fcf8ef; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .language-switch a[aria-current] { outline: 2px solid CanvasText; outline-offset: -2px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .head-row, .activity, .project, .book, .mawlid-list, .method-item, .contact-panel, .project-dialog { background: #fcf8ef; }
}

/* ---------- English edition ---------- */
[lang="en"] { --display: "Cormorant Garamond", Georgia, "Times New Roman", serif; }
[lang="en"] body { line-height: 1.7; }
[lang="en"] .hero-name { font-weight: 600; line-height: 1.04; letter-spacing: -.012em; font-size: clamp(2.3rem, .9rem + 3vw, 4.3rem); }
[lang="en"] .hero-tagline { font-style: italic; font-weight: 500; font-size: clamp(1.3rem, .9rem + 1.2vw, 2.1rem); margin-top: .35em; }
[lang="en"] .hero-lead, [lang="en"] .book-subtitle, [lang="en"] .founder, [lang="en"] .activities-title { font-family: var(--display); }
[lang="en"] .hero-lead { font-weight: 600; font-size: clamp(1.08rem, .95rem + .35vw, 1.38rem); line-height: 1.45; max-width: 60rem; }
[lang="en"] .hero-tagline { margin-top: .2em; }
[lang="en"] .arch-window { height: clamp(120px, 20vh, 250px); }
[lang="en"] .activities-title { font-size: clamp(1.08rem, 1rem + .3vw, 1.3rem); letter-spacing: .02em; }
[lang="en"] .section-title { font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
[lang="en"] .founder-note blockquote { font-weight: 500; font-style: italic; line-height: 1.35; }
[lang="en"] :is(.activity h3, .project h4, .group-head h3, .method-item h3, .book-frame h3, .project-dialog-copy h2, .identity-top h2) { font-weight: 600; line-height: 1.2; }
[lang="en"] .brand-name { font-family: var(--display); font-size: 1.2rem; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .nav-links a { padding: 8px 10px; font-size: .88rem; }
  .project-grid { --cols: 2; }
  /* three above two, the second row centred */
  .mawlid-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mawlid { grid-column: span 2; }
  .mawlid:nth-child(4) { grid-column: 2 / span 2; }
}
@media (max-width: 900px) {
  :root { --head: 112px; }
  .head-row { flex-wrap: wrap; row-gap: 4px; border-radius: 24px; padding: 8px 10px; }
  .nav-links { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; justify-content: space-between; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
  .head-actions { margin-inline-start: auto; }
  .activity-grid, .method-list { grid-template-columns: 1fr; max-width: 560px; }
  .book-shelf { grid-template-columns: 1fr; max-width: 560px; gap: 28px; }
  .book-featured { grid-template-columns: 1fr; justify-items: center; }
  .book-featured .book-stage { width: min(220px, 64%); }
  .activity-grid { gap: 14px; text-align: start; }
  .activity { display: grid; grid-template-columns: 112px 1fr; column-gap: 16px; align-items: center; padding: 10px 14px 10px 10px; border-radius: var(--radius); }
  [dir="ltr"] .activity { padding: 10px 10px 10px 14px; }
  .activity .arch-window { grid-row: span 2; margin: 0; height: auto; aspect-ratio: 3 / 3.6; }
  .activity h3 { align-self: end; padding-inline: 0; margin: 0; font-size: 1.3rem; }
  .activity p { align-self: start; padding-inline: 0; font-size: .92rem; line-height: 1.75; }
  .contact-panel { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .project-dialog-content { grid-template-columns: 1fr; }
  .project-dialog-content .project-art { width: 120px; }
}
@media (max-width: 640px) {
  :root { --head: 104px; }
  body { font-size: 1rem; }
  .site-head { top: 8px; width: calc(100% - 16px); }
  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 1rem; }
  .brand-name small { display: none; }
  .head-contact { padding: 8px 14px; font-size: .84rem; }
  .language-switch a { padding: 4px 9px; }
  .hero { padding-top: calc(var(--head) + 40px); gap: 30px; }
  .project-grid { --cols: 1; }
  .project { padding: 18px; gap: 14px; }
  .project-art { width: 60px; }
  .book { grid-template-columns: 96px 1fr; gap: 18px; }
  .book-featured { grid-template-columns: 1fr; }
  .activity { grid-template-columns: 88px 1fr; }
  .book-featured .book-subtitle { font-size: .78rem; }
  .book-featured .book-stage { width: 210px; }
  .book-featured .book-frame h3 { font-size: 1.15rem; }
  .book { padding: 16px; }
  .book-featured .book-frame { padding-inline: 12px; }
  .project-scope { grid-template-columns: 1fr; }
  .identity-row { grid-template-columns: 1fr; gap: 2px; }
  .footer-grid { grid-template-columns: 1fr; }
  .view-controls { bottom: 10px; inset-inline-start: 10px; }
  .view-controls .glass-control span { display: none; }
  .mawlid-list { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 22px 16px; }
  .mawlid:nth-child(4) { grid-column: span 2; }
  .mawlid:last-child { grid-column: 2 / span 2; }
}
/* narrow phones: each volume beside its title, as in the books section */
@media (max-width: 440px) {
  .mawlid-list { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; gap: 22px; }
  .mawlid, .mawlid:nth-child(4), .mawlid:last-child { grid-column: auto; }
  .mawlid { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 16px; row-gap: 2px; align-items: start; text-align: start; }
  .mawlid-cover { grid-row: 1 / -1; margin: 0; }
  .mawlid-actions { justify-content: flex-start; padding-top: 8px; }
}
@media (max-width: 520px) {
  :root { --head: 96px; }
  .head-row { gap: 8px; }
  .brand-name { display: none; }
  .head-actions { gap: 6px; }
}
@media (max-width: 340px) {
  .head-contact { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
[data-motion="paused"] *, [data-motion="paused"] *::before, [data-motion="paused"] *::after { animation: none !important; transition-duration: 0s !important; }
html[data-motion="paused"] { scroll-behavior: auto; }

/* ---------- print ---------- */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .scene-canvas, .scene-poster, .scene-veil, .site-head, .view-controls, .project-details-button, .skip, .back-top, .arch-window, .book-spine, .book-pages, .book-ornament, .project-art { display: none !important; }
  .book-stage { perspective: none; width: auto; }
  .book-object { transform: none !important; aspect-ratio: auto; }
  .book-cover { position: static; transform: none; background: none; padding: 0; }
  .book-frame { border: 0; outline: 0; padding: 0; }
  .book-author { position: static; }
  .book-name { display: none; }
  .book-featured { grid-template-columns: 1fr; }
  .hero { min-height: 0; padding: 0 0 24px; text-align: start; justify-items: start; }
  .hero-name, .hero-lead, .section-title, .founder-note blockquote { text-shadow: none; color: #000; }
  .hero-tagline, .project-subtitle, .section-index, .founder, .activities-title, .group-head p { color: #444; }
  * { text-shadow: none !important; box-shadow: none !important; }
  .section-head, .group-head { background: none; }
  .section { padding-block: 18px; }
  .contact, .identity-section { padding-top: 18px; }
  .project-scope dt, .project-address { color: #444; }
  .project-scope dd, .method-item h3, .activity h3, .project h4, .group-head h3, .book-frame h3, .book-subtitle, .book-author { color: #000; }
  .project-tag, .project-status { color: #333 !important; border-color: #999 !important; background: none !important; }
  .project-scope div { background: none; border-color: #ccc; }
  .activity, .project, .book, .method-item, .contact-panel { background: none; border: 1px solid #bbb; backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; break-inside: avoid; }
  .activity { border-radius: 8px; }
  .catalogue-ready .project .project-body { display: block; }
  .project-copy > * { grid-column: 1 / -1 !important; }
  :is(.activity p, .project-body, .method-item p, .section-intro, .contact-copy p, .book-caption, .location, .footer-grid p, .footer-grid ul, .copyright) { color: #222; }
  .text-link { background: none; color: #000; padding: 0; text-decoration: underline; }
  .text-link::after { content: " (" attr(href) ")"; font-weight: 400; }
  .book-file { border: 0; background: none; color: #000; padding: 0; text-decoration: underline; }
  .book-file::after { content: " (" attr(href) ")"; font-weight: 400; }
  .book-shelf { grid-template-columns: 1fr; }
  .mawlid-list { display: block; }
  .mawalid .section-intro { color: #222; }
  .mawlid-cover { display: none; }
  .mawlid-list { padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .mawlid { display: block; margin-bottom: 8px; padding: 10px 12px; text-align: start; background: none; border: 1px solid #bbb; backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; break-inside: avoid; }
  .mawlid h3 { color: #000; }
  .mawlid-actions .text-link { border: 0; }
  .mawlid-subject { color: #222; }
  .mawlid-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
  .identity-card { box-shadow: none; border: 1px solid #999; background: #fff; }
  .site-footer { background: none; color: #000; border-top: 1px solid #999; }
  .footer-grid h3, .site-footer .brand-name small, .back-top { color: #333; }
  .book-author span { color: #444; }
  .project-dialog { display: none !important; }
  html.project-dialog-open { overflow: visible; }
  .hero-inner::before { display: none; }
  .contact-number { color: #000; }
}
