/* ============================================================
   قصائد أبو عبدالله — public site
   Look: an illuminated diwan. Parchment, juniper green and antique
   gold; eight-pointed stars; an Al-Qatt band as the signature strip.
   Themes: baha (default), manuscript, najdi, night × light/dark.
   ============================================================ */

@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Light.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Medium.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Black.woff2) format('woff2'); font-weight: 800 900; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Text'; src: url(/fonts/thmanyahseriftext-Light.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Text'; src: url(/fonts/thmanyahseriftext-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Text'; src: url(/fonts/thmanyahseriftext-Medium.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Text'; src: url(/fonts/thmanyahseriftext-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Display'; src: url(/fonts/thmanyahserifdisplay-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Display'; src: url(/fonts/thmanyahserifdisplay-Medium.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Display'; src: url(/fonts/thmanyahserifdisplay-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Display'; src: url(/fonts/thmanyahserifdisplay-Black.woff2) format('woff2'); font-weight: 800 900; font-display: swap; }

/* ---------- Tokens ---------- */

:root {
  --sans: 'Thmanyah Sans', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --serif: 'Thmanyah Serif Text', 'Thmanyah Serif Display', 'Geeza Pro', 'Noto Naskh Arabic', serif;
  --display: 'Thmanyah Serif Display', 'Thmanyah Serif Text', 'Geeza Pro', serif;
  --wrap: 1180px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gold-3: #e3c77a; /* gold on dark surfaces */
  --foil: linear-gradient(176deg, #fbf0c4 0%, #e6ca78 36%, #b98f39 70%, #e9d08a 100%);
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23D9B866' stroke-width='.9'%3E%3Cpath d='M24.4 24.4h31.2v31.2H24.4zM40 18l22 22-22 22-22-22zM40 18V0M62 40h18M40 62v18M18 40H0M24.4 24.4 0 0M55.6 24.4 80 0M55.6 55.6 80 80M24.4 55.6 0 80'/%3E%3C/g%3E%3C/svg%3E");
  --grain-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.2 0 0 0 0 0.2 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url%28%23n%29'/%3E%3C/svg%3E");
  --grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url%28%23n%29'/%3E%3C/svg%3E");
  --grain: var(--grain-light);
}

/* Al-Baha: juniper green, parchment, antique gold, Asiri terracotta */
:root,
[data-theme='baha'] {
  --bg: #f4efe3;
  --bg-2: #eae3d0;
  --surface: #fbf8f0;
  --surface-2: #f4eedf;
  --ink: #1a2a22;
  --ink-2: #43554b;
  --muted: #68776d;
  --line: #dcd2ba;
  --line-2: #c8bb99;
  --brand: #14503c;
  --brand-2: #1b6a50;
  --brand-ink: #fbf6e6;
  --gold: #86651c;
  --gold-2: #b08a3c;
  --terra: #a6492e;
  --verse: #16241d;
  --hero-1: #0b2a1f;
  --hero-2: #17513e;
  --hero-ink: #f6efd9;
  --hero-glow: #2f7a5c;
  --m1: #2e6e57;
  --m2: #1e5743;
  --m3: #123f30;
  --m4: #0b2a1f;
  --qatt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='22' viewBox='0 0 96 22'%3E%3Crect width='96' height='22' fill='%230B2A1F'/%3E%3Crect width='96' height='2' fill='%23D9B866'/%3E%3Crect y='20' width='96' height='2' fill='%23D9B866'/%3E%3Cpath d='M0 18 12 5l12 13z' fill='%23D9B866'/%3E%3Cpath d='M24 18 36 5l12 13z' fill='%23B4553A'/%3E%3Cpath d='M48 18 60 5l12 13z' fill='%23F3EBD3'/%3E%3Cpath d='M72 18 84 5l12 13z' fill='%233E8C6A'/%3E%3Cpath d='M24 4.5l2.2 2.2L24 8.9l-2.2-2.2zM48 4.5l2.2 2.2L48 8.9l-2.2-2.2zM72 4.5l2.2 2.2L72 8.9l-2.2-2.2zM0 4.5l2.2 2.2L0 8.9l-2.2-2.2zM96 4.5l2.2 2.2L96 8.9l-2.2-2.2z' fill='%23F3EBD3'/%3E%3C/svg%3E");
  --shadow-sm: 0 1px 2px rgba(60, 45, 15, 0.06), 0 6px 18px -10px rgba(60, 45, 15, 0.22);
  --shadow: 0 2px 4px rgba(60, 45, 15, 0.06), 0 22px 48px -22px rgba(60, 45, 15, 0.38);
}
[data-theme='baha'][data-mode='dark'] {
  --bg: #0a1712;
  --bg-2: #0f2019;
  --surface: #12271e;
  --surface-2: #173226;
  --ink: #efe9d6;
  --ink-2: #c3ccbe;
  --muted: #8fa094;
  --line: #23392e;
  --line-2: #33523f;
  --brand: #e0c173;
  --brand-2: #edd38f;
  --brand-ink: #0a1712;
  --gold: #e0c173;
  --gold-2: #b8923f;
  --terra: #e08a6b;
  --verse: #f3eedd;
}

/* Manuscript: aged paper, oxblood rubrication, gold */
[data-theme='manuscript'] {
  --bg: #f2e8d2;
  --bg-2: #e8dbbe;
  --surface: #faf3e1;
  --surface-2: #f1e6cd;
  --ink: #2a1e13;
  --ink-2: #58483a;
  --muted: #77665a;
  --line: #dccba6;
  --line-2: #c4ae80;
  --brand: #7a2e1f;
  --brand-2: #94402e;
  --brand-ink: #faf3e1;
  --gold: #7f5e1b;
  --gold-2: #b08a3c;
  --terra: #7a2e1f;
  --verse: #24190f;
  --hero-1: #24170d;
  --hero-2: #4a321f;
  --hero-ink: #f6ead0;
  --hero-glow: #8a633b;
  --m1: #6b4e33;
  --m2: #543b26;
  --m3: #3b2819;
  --m4: #24170d;
  --qatt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='22' viewBox='0 0 96 22'%3E%3Crect width='96' height='22' fill='%2324170D'/%3E%3Crect width='96' height='2' fill='%23C9A24A'/%3E%3Crect y='20' width='96' height='2' fill='%23C9A24A'/%3E%3Cpath d='M0 18 12 5l12 13z' fill='%23C9A24A'/%3E%3Cpath d='M24 18 36 5l12 13z' fill='%238C3A2B'/%3E%3Cpath d='M48 18 60 5l12 13z' fill='%23F1E4C6'/%3E%3Cpath d='M72 18 84 5l12 13z' fill='%237A5A32'/%3E%3Cpath d='M24 4.5l2.2 2.2L24 8.9l-2.2-2.2zM48 4.5l2.2 2.2L48 8.9l-2.2-2.2zM72 4.5l2.2 2.2L72 8.9l-2.2-2.2zM0 4.5l2.2 2.2L0 8.9l-2.2-2.2zM96 4.5l2.2 2.2L96 8.9l-2.2-2.2z' fill='%23F1E4C6'/%3E%3C/svg%3E");
}
[data-theme='manuscript'][data-mode='dark'] {
  --bg: #15100a;
  --bg-2: #1c150d;
  --surface: #221a10;
  --surface-2: #2b2115;
  --ink: #f0e4ca;
  --ink-2: #cdbd9d;
  --muted: #a39274;
  --line: #3a2d1d;
  --line-2: #54422b;
  --brand: #d9b25f;
  --brand-2: #e6c57d;
  --brand-ink: #15100a;
  --gold: #d9b25f;
  --gold-2: #a8843a;
  --terra: #d97a62;
  --verse: #f5ebd5;
}

/* Najdi: sand and clay, teal doors */
[data-theme='najdi'] {
  --bg: #f3e9d8;
  --bg-2: #eadcc4;
  --surface: #fcf5e8;
  --surface-2: #f4ead7;
  --ink: #2b1c12;
  --ink-2: #5c4433;
  --muted: #7e6857;
  --line: #e0cfb4;
  --line-2: #c9b18a;
  --brand: #96462a;
  --brand-2: #ae5a3a;
  --brand-ink: #fcf5e8;
  --gold: #845f1c;
  --gold-2: #c29545;
  --terra: #2e6258;
  --verse: #25170e;
  --hero-1: #4a2110;
  --hero-2: #8c4a27;
  --hero-ink: #fbefdc;
  --hero-glow: #c9834f;
  --m1: #a8694a;
  --m2: #8a4e30;
  --m3: #6b3820;
  --m4: #4a2110;
  --qatt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='22' viewBox='0 0 96 22'%3E%3Crect width='96' height='22' fill='%234A2110'/%3E%3Crect width='96' height='2' fill='%23E0B463'/%3E%3Crect y='20' width='96' height='2' fill='%23E0B463'/%3E%3Cpath d='M0 18 12 5l12 13z' fill='%23E0B463'/%3E%3Cpath d='M24 18 36 5l12 13z' fill='%23B2452C'/%3E%3Cpath d='M48 18 60 5l12 13z' fill='%23F6E9D2'/%3E%3Cpath d='M72 18 84 5l12 13z' fill='%233F7F72'/%3E%3Cpath d='M24 4.5l2.2 2.2L24 8.9l-2.2-2.2zM48 4.5l2.2 2.2L48 8.9l-2.2-2.2zM72 4.5l2.2 2.2L72 8.9l-2.2-2.2zM0 4.5l2.2 2.2L0 8.9l-2.2-2.2zM96 4.5l2.2 2.2L96 8.9l-2.2-2.2z' fill='%23F6E9D2'/%3E%3C/svg%3E");
}
[data-theme='najdi'][data-mode='dark'] {
  --bg: #170f0a;
  --bg-2: #1f150e;
  --surface: #261a11;
  --surface-2: #2f2016;
  --ink: #f2e4d2;
  --ink-2: #d2b8a0;
  --muted: #aa8f79;
  --line: #3d2b1f;
  --line-2: #58402d;
  --brand: #e59a6c;
  --brand-2: #efb088;
  --brand-ink: #170f0a;
  --gold: #e0b463;
  --gold-2: #b58b43;
  --terra: #8cc0b4;
  --verse: #f7eadb;
}

/* Night over the Sarawat: navy and gold */
[data-theme='night'] {
  --bg: #eef0f5;
  --bg-2: #e2e6ef;
  --surface: #f9fafc;
  --surface-2: #f0f2f7;
  --ink: #131b2b;
  --ink-2: #3d4960;
  --muted: #5f6b81;
  --line: #d5dbe7;
  --line-2: #b9c3d6;
  --brand: #1a2f55;
  --brand-2: #274476;
  --brand-ink: #f9fafc;
  --gold: #7d5e1e;
  --gold-2: #b8923f;
  --terra: #6b4e9c;
  --verse: #0f1726;
  --hero-1: #060b17;
  --hero-2: #14274a;
  --hero-ink: #f1ead6;
  --hero-glow: #2c4a85;
  --m1: #2a426e;
  --m2: #1d3157;
  --m3: #13223f;
  --m4: #0a1426;
  --qatt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='22' viewBox='0 0 96 22'%3E%3Crect width='96' height='22' fill='%23060B17'/%3E%3Crect width='96' height='2' fill='%23D4B26A'/%3E%3Crect y='20' width='96' height='2' fill='%23D4B26A'/%3E%3Cpath d='M0 18 12 5l12 13z' fill='%23D4B26A'/%3E%3Cpath d='M24 18 36 5l12 13z' fill='%235C7FB5'/%3E%3Cpath d='M48 18 60 5l12 13z' fill='%23E9EDF5'/%3E%3Cpath d='M72 18 84 5l12 13z' fill='%237E6BB0'/%3E%3Cpath d='M24 4.5l2.2 2.2L24 8.9l-2.2-2.2zM48 4.5l2.2 2.2L48 8.9l-2.2-2.2zM72 4.5l2.2 2.2L72 8.9l-2.2-2.2zM0 4.5l2.2 2.2L0 8.9l-2.2-2.2zM96 4.5l2.2 2.2L96 8.9l-2.2-2.2z' fill='%23E9EDF5'/%3E%3C/svg%3E");
  --shadow-sm: 0 1px 2px rgba(15, 25, 50, 0.06), 0 6px 18px -10px rgba(15, 25, 50, 0.22);
  --shadow: 0 2px 4px rgba(15, 25, 50, 0.06), 0 22px 48px -22px rgba(15, 25, 50, 0.38);
}
[data-theme='night'][data-mode='dark'] {
  --bg: #070d1a;
  --bg-2: #0c1425;
  --surface: #101b31;
  --surface-2: #16233d;
  --ink: #e8ecf5;
  --ink-2: #b5c0d6;
  --muted: #8a97b0;
  --line: #1f2c47;
  --line-2: #2e4066;
  --brand: #d9b866;
  --brand-2: #e7cb85;
  --brand-ink: #070d1a;
  --gold: #d9b866;
  --gold-2: #a8873d;
  --terra: #b39de0;
  --verse: #f2f4fa;
}

[data-mode='dark'] {
  --grain: var(--grain-dark);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px -10px rgba(0, 0, 0, 0.6);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 26px 54px -22px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
[data-mode='light'] { color-scheme: light; }

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--bg);
  background-image: var(--grain);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; display: block; }
/* A word longer than its box (a pasted link, a title typed without spaces) breaks
   instead of pushing the whole page sideways. */
h1, h2, h3, p, li, .half, .card-bayt span, .pn span, .media-title, .sr-item strong, .sr-item span, .contact-poem, .hub-desc, .hub-card strong { word-break: break-word; overflow-wrap: anywhere; }
.card, .pn, .media-tile, .hub-card { min-width: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--gold-2) 35%, transparent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 16px; border-radius: 8px; transition: top 0.2s; }
.skip:focus { top: 10px; color: var(--brand-ink); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.wrap.narrow { max-width: 1040px; }
.center { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* Ornaments */
.rule { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold-2); margin: 6px auto; width: min(260px, 60%); }
.rule i { flex: 1; height: 1px; background: linear-gradient(to left, transparent, currentColor); }
.rule i:last-child { background: linear-gradient(to right, transparent, currentColor); }
.rule svg { flex: none; }
.qatt { height: 22px; background: var(--qatt) center / 96px 22px repeat-x; }
.arch { border-radius: 999px 999px 10px 10px; }
.foil { color: #e6ca78; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .foil { background: var(--foil); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.25s var(--ease), background-color 0.2s, box-shadow 0.25s;
}
.btn:hover { background: var(--brand-2); color: var(--brand-ink); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn svg { transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(-3px); }
.btn-gold { background: linear-gradient(180deg, #ecd48f, #c9a24a); border-color: #b8923f; color: #2a1f06; }
.btn-gold:hover { background: linear-gradient(180deg, #f3dea3, #d4ae58); color: #2a1f06; }
.btn-ghost { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); transition: background-color 0.2s, color 0.2s; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
[data-mode='dark'] .i-moon,
[data-mode='light'] .i-sun,
html:not([data-mode]) .i-sun { display: none; }

.label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--gold); }
.label::before { content: ''; width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); flex: none; }
.badge-media { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--terra); border: 1px solid color-mix(in srgb, var(--terra) 40%, transparent); border-radius: 999px; padding: 1px 10px; }

/* ---------- Top bar ---------- */

.announce { background: linear-gradient(90deg, #c9a24a, #e9d08a, #c9a24a); color: #2a1f06; text-align: center; font-size: 14.5px; font-weight: 600; padding: 7px 16px; }
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 14px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 21px; white-space: nowrap; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand img { border-radius: 11px; flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 2px; margin-inline-start: 16px; }
.nav a { position: relative; padding: 8px 14px; color: var(--ink-2); font-weight: 500; }
.nav a::after { content: ''; position: absolute; inset-inline: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--gold-2); transform: scaleX(0); transition: transform 0.3s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after,
.nav a.on::after { transform: scaleX(1); }
.nav a.on { color: var(--ink); font-weight: 700; }
.tools { margin-inline-start: auto; display: flex; gap: 2px; }
.menu-btn { display: none; }
.theme-menu { position: absolute; inset-inline-end: clamp(16px, 4vw, 32px); top: 64px; z-index: 5; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 200px; }
.theme-menu[hidden] { display: none; }
.theme-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 8px; text-align: start; }
.theme-menu button:hover { background: var(--bg-2); }
.sw { width: 20px; height: 20px; border-radius: 50%; display: inline-block; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.sw-baha { background: linear-gradient(135deg, #14503c 50%, #c9a24a 50%); }
.sw-manuscript { background: linear-gradient(135deg, #7a2e1f 50%, #f2e8d2 50%); }
.sw-najdi { background: linear-gradient(135deg, #96462a 50%, #2e6258 50%); }
.sw-night { background: linear-gradient(135deg, #14274a 50%, #d9b866 50%); }

@media (max-width: 800px) {
  .menu-btn { display: inline-grid; }
  .nav { display: none; position: absolute; top: 68px; inset-inline: 0; flex-direction: column; gap: 0; margin: 0; padding: 8px clamp(16px, 4vw, 32px) 16px; background: var(--surface); border-bottom: 1px solid var(--line-2); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 18px; }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
  .nav a.on { color: var(--gold); }
  .brand { font-size: 19px; }
}

/* ---------- Hero ---------- */

.hero,
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--hero-ink);
  background:
    radial-gradient(1000px 480px at 50% -8%, color-mix(in srgb, var(--hero-glow) 60%, transparent), transparent 72%),
    linear-gradient(180deg, var(--hero-1), var(--hero-2));
}
.hero-bg { position: absolute; inset: 0; z-index: -1; background-image: var(--lattice); background-size: 88px 88px; background-position: center top; opacity: 0.17; -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 0%, #000 25%, transparent 78%); mask-image: radial-gradient(ellipse 85% 75% at 50% 0%, #000 25%, transparent 78%); }
.hero-in { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; padding-block: clamp(48px, 8vw, 96px) clamp(8px, 2vw, 24px); }
.hero-star { color: var(--gold-3); margin-bottom: 6px; }
.hero-photo { width: 124px; height: 156px; object-fit: cover; border: 2px solid var(--gold-3); padding: 4px; background: color-mix(in srgb, var(--hero-1) 60%, transparent); margin-bottom: 10px; }
.hero-title { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(42px, 8.6vw, 98px); line-height: 1.45; padding-inline: 0.1em; letter-spacing: 0; }
.hero-poet { margin: 0; font-size: clamp(17px, 2vw, 21px); font-weight: 500; color: color-mix(in srgb, var(--hero-ink) 92%, transparent); }
.hero .rule,
.stage .rule { color: var(--gold-3); margin-block: 12px; }
.hero-tag { margin: 0; max-width: 34em; font-size: clamp(16px, 1.8vw, 19px); color: color-mix(in srgb, var(--hero-ink) 74%, transparent); }
.mountains { display: block; width: 100%; height: clamp(110px, 16vw, 220px); margin-top: clamp(8px, 2vw, 20px); }
.mountains path { stroke-width: 7; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mountains .m1 { fill: var(--m1); stroke: var(--m1); }
.mountains .m2 { fill: var(--m2); stroke: var(--m2); }
.mountains .m3 { fill: var(--m3); stroke: var(--m3); }
.mountains .m4 { fill: var(--m4); stroke: var(--m4); }
.fog-0 { stop-color: var(--hero-ink); stop-opacity: 0; }
.fog-1 { stop-color: var(--hero-ink); stop-opacity: 0.16; }

/* Night theme: stars and a crescent in the hero sky */
[data-theme='night'] .hero-bg { opacity: 0.5; -webkit-mask-image: none; mask-image: none; background-size: auto;
  background-image:
    radial-gradient(1.2px 1.2px at 8% 16%, #fff, transparent 60%), radial-gradient(1px 1px at 17% 38%, #fff, transparent 60%),
    radial-gradient(1.4px 1.4px at 26% 9%, #fff, transparent 60%), radial-gradient(1px 1px at 34% 27%, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 46% 6%, #fff, transparent 60%), radial-gradient(1px 1px at 58% 19%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 67% 8%, #fff, transparent 60%), radial-gradient(1px 1px at 74% 33%, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 83% 14%, #fff, transparent 60%), radial-gradient(1px 1px at 92% 26%, #fff, transparent 60%),
    radial-gradient(1px 1px at 12% 52%, #fff, transparent 60%), radial-gradient(1.3px 1.3px at 88% 47%, #fff, transparent 60%),
    radial-gradient(1px 1px at 52% 40%, #fff, transparent 60%), radial-gradient(1.1px 1.1px at 40% 55%, #fff, transparent 60%); }
[data-theme='night'] .hero-bg::after { content: ''; position: absolute; top: clamp(24px, 6vw, 60px); inset-inline-start: clamp(24px, 12vw, 190px); width: 46px; height: 46px; border-radius: 50%; box-shadow: inset 12px -6px 0 0 #f1e3b0; transform: rotate(-18deg); }

.searchbar { display: flex; align-items: center; gap: 10px; width: min(560px, 100%); margin-top: 22px; padding: 6px 8px 6px 6px; padding-inline-start: 20px; border-radius: 999px; background: color-mix(in srgb, var(--hero-ink) 96%, transparent); color: #1a2a22; border: 1px solid color-mix(in srgb, var(--gold-3) 70%, transparent); box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.55); }
.searchbar > svg { color: #6b7a70; flex: none; }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 10px 0; font-size: 16.5px; color: #1a2a22; }
.searchbar input::placeholder { color: #7b877e; }
.searchbar-go { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: linear-gradient(180deg, #ecd48f, #c9a24a); color: #2a1f06; transition: transform 0.25s var(--ease); }
.searchbar-go:hover { transform: scale(1.06); }
.searchbar.big { margin: 0 auto 8px; background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.searchbar.big input { color: var(--ink); }
.search-note { text-align: center; color: var(--muted); margin: 10px 0 22px; }

@media (prefers-reduced-motion: no-preference) {
  .hero-in > *,
  .hub-in > * { animation: rise 0.9s var(--ease) both; }
  .hero-in > :nth-child(2), .hub-in > :nth-child(2) { animation-delay: 0.08s; }
  .hero-in > :nth-child(3), .hub-in > :nth-child(3) { animation-delay: 0.16s; }
  .hero-in > :nth-child(4), .hub-in > :nth-child(4) { animation-delay: 0.24s; }
  .hero-in > :nth-child(5), .hub-in > :nth-child(5) { animation-delay: 0.32s; }
  .hero-in > :nth-child(6), .hub-in > :nth-child(6) { animation-delay: 0.4s; }
  .gate-card { animation: rise 0.8s var(--ease) both; }
  /* site.js marks below-the-fold items .pre, then swaps to .in as they scroll into view */
  .reveal.pre { opacity: 0; transform: translateY(18px); }
  .reveal.in { transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */

.sec { margin-block: clamp(44px, 6.5vw, 80px); }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.sec-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(25px, 3.2vw, 34px); line-height: 1.5; }
.sec-star { color: var(--gold-2); flex: none; }
.sec-line { flex: 1; height: 1px; min-width: 20px; background: linear-gradient(to left, var(--line-2), transparent); }
.sec-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.sec-more svg { transition: transform 0.3s var(--ease); }
.sec-more:hover svg { transform: translateX(-4px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 17px; border: 1px solid var(--line-2); border-radius: 999px; background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--ink-2); font-weight: 500; font-size: 15px; transition: border-color 0.2s, color 0.2s, background-color 0.2s; }
.chip small { font-size: 12px; color: var(--muted); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.on small { color: inherit; opacity: 0.8; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 22px; }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 28px 28px 20px; background-color: var(--surface); background-image: var(--grain); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s; }
.card::before,
.card::after { content: ''; position: absolute; width: 18px; height: 18px; border: 0 solid var(--gold-2); pointer-events: none; transition: width 0.4s var(--ease), height 0.4s var(--ease); }
.card::before { top: 9px; inset-inline-start: 9px; border-top-width: 1.5px; border-inline-start-width: 1.5px; }
.card::after { bottom: 9px; inset-inline-end: 9px; border-bottom-width: 1.5px; border-inline-end-width: 1.5px; }
.card:hover { color: var(--ink); transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card:hover::before,
.card:hover::after { width: 40px; height: 40px; }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 24px; }
.card-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.55; }
.card-bayt { flex: 1; display: grid; align-content: start; font-family: var(--serif); font-size: 17px; line-height: 2.05; color: var(--ink-2); }
.card-bayt span:nth-child(2) { padding-inline-start: 2.2em; }
.card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 13px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.card-go { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 700; }
.card-go svg { transition: transform 0.3s var(--ease); }
.card:hover .card-go svg { transform: translateX(-5px); }

/* Featured poem */
.feature { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 5vw, 64px); padding: clamp(34px, 5vw, 64px); border-radius: 8px; color: var(--hero-ink); background: radial-gradient(700px 360px at 85% 0%, color-mix(in srgb, var(--hero-glow) 55%, transparent), transparent 70%), linear-gradient(140deg, var(--hero-1), var(--hero-2)); box-shadow: var(--shadow); }
.feature::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--lattice); background-size: 88px 88px; opacity: 0.1; }
.feature::after { content: ''; position: absolute; inset: 12px; border: 1px solid color-mix(in srgb, var(--gold-3) 50%, transparent); border-radius: 3px; pointer-events: none; transition: inset 0.4s var(--ease); }
.feature:hover { color: var(--hero-ink); }
.feature:hover::after { inset: 8px; }
.feature .label { color: var(--gold-3); }
.feature .badge-media { color: var(--hero-ink); border-color: color-mix(in srgb, var(--hero-ink) 40%, transparent); }
.feature-title { margin: 12px 0 14px; font-family: var(--display); font-weight: 900; font-size: clamp(32px, 5vw, 56px); line-height: 1.45; }
.feature .feature-verses { --verse-size: clamp(17px, 2vw, 21px); color: color-mix(in srgb, var(--hero-ink) 92%, transparent); margin-bottom: 26px; max-width: 30em; }
.feature-verses .verse { padding: 0; }
.feature-media { position: relative; width: clamp(190px, 24vw, 290px); }
.feature-media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--gold-3); padding: 5px; }
.feature-media .play-badge { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); }
.play-badge { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(180deg, #ecd48f, #c9a24a); color: #2a1f06; box-shadow: 0 0 0 6px rgba(233, 208, 138, 0.22), 0 10px 26px rgba(0, 0, 0, 0.35); transition: transform 0.3s var(--ease); }
a:hover .play-badge { transform: scale(1.08); }
.feature:hover .feature-media .play-badge { transform: translateX(-50%) scale(1.08); }
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature-media { order: -1; justify-self: center; width: min(220px, 60%); }
}

.media-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 46%), 1fr)); gap: 22px; }
.media-tile { display: grid; gap: 4px; justify-items: center; text-align: center; color: var(--ink); }
.media-thumb { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: end center; padding-bottom: 18px; background: linear-gradient(160deg, var(--hero-1), var(--hero-2)) center / cover; border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.media-tile:hover .media-thumb { transform: translateY(-5px); box-shadow: var(--shadow); }
.media-title { margin-top: 10px; font-family: var(--display); font-weight: 700; font-size: 19px; }
.media-sub { font-size: 13.5px; color: var(--muted); }

/* ---------- Pages ---------- */

.page { padding-block: clamp(34px, 5vw, 60px) 20px; }
.page-head { text-align: center; margin-bottom: clamp(22px, 3vw, 36px); }
.page-title { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(32px, 5vw, 52px); line-height: 1.5; }
.page-sub { margin: 8px auto 0; max-width: 40em; color: var(--muted); }

/* ---------- Poem ---------- */

.preview-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 9px 16px; font-size: 14.5px; font-weight: 600; color: #5c3d00; background: #fdeeba; border-bottom: 1px solid #e8cf7a; }
[data-mode='dark'] .preview-note { color: #f6e2a4; background: #3b3013; border-color: #6a5622; }
.poem-head { text-align: center; padding-block: clamp(30px, 5vw, 56px) 6px; }
.crumbs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; font-size: 14.5px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs svg { color: var(--gold-2); }
.poem-title { margin: 10px 0 4px; font-family: var(--display); font-weight: 900; font-size: clamp(34px, 6.2vw, 64px); line-height: 1.5; color: var(--ink); }
.poem-meta { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin: 12px 0 0; padding: 0; color: var(--muted); font-size: 15px; }
.poem-meta li { display: inline-flex; align-items: center; gap: 7px; }
.poem-meta li + li::before { content: ''; width: 5px; height: 5px; margin-inline: 14px; background: var(--gold-2); transform: rotate(45deg); }

.player { margin: 30px auto 0; }
.video-player { max-width: 720px; padding: 6px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); border-radius: 6px; }
.video-player video { display: block; width: 100%; max-height: 72vh; background: #000; border-radius: 3px; }
.audio-player { display: flex; align-items: center; gap: 16px; max-width: 720px; padding: 14px 18px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-sm); }
.ap-icon { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); }
.ap-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ap-body strong { font-size: 15px; }
.ap-body audio { width: 100%; height: 38px; }
.dl { text-align: center; font-size: 14.5px; margin: 12px 0 0; }
.dl a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.poem-intro { max-width: 46em; margin: 26px auto 0; text-align: center; color: var(--ink-2); font-size: 17.5px; white-space: pre-line; }

/* The leaf: a framed page of the diwan */
.leaf { position: relative; margin-top: 30px; padding: clamp(58px, 6vw, 76px) clamp(18px, 5vw, 70px) clamp(34px, 4vw, 52px); background-color: var(--surface); background-image: var(--grain); border: 1px solid var(--line-2); border-radius: 4px; box-shadow: var(--shadow); }
.leaf::before { content: ''; position: absolute; inset: 12px; border: 1px solid color-mix(in srgb, var(--gold-2) 65%, transparent); pointer-events: none; }
.leaf-star { position: absolute; z-index: 1; color: var(--gold-2); background: var(--surface); padding: 4px; box-sizing: content-box; border-radius: 50%; }
.leaf-star.s1 { top: 12px; right: 12px; transform: translate(50%, -50%); }
.leaf-star.s2 { top: 12px; left: 12px; transform: translate(-50%, -50%); }
.leaf-star.s3 { bottom: 12px; right: 12px; transform: translate(50%, 50%); }
.leaf-star.s4 { bottom: 12px; left: 12px; transform: translate(-50%, 50%); }
.leaf-tools { position: absolute; top: 24px; inset-inline-end: 28px; display: flex; gap: 6px; z-index: 2; }
.leaf-tools button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; font-weight: 600; transition: border-color 0.2s, color 0.2s; }
.leaf-tools button:hover { border-color: var(--gold-2); color: var(--ink); }
.leaf-tools button[aria-pressed='false'] { opacity: 0.55; text-decoration: line-through; }

.verses { --verse-size: 23px; font-family: var(--serif); font-size: var(--verse-size); line-height: 2.15; color: var(--verse); }
.verse { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 7px 14px; border-radius: 6px; }
.verse .half { display: block; text-wrap: balance; }
.verse .ajuz { text-align: end; padding-inline-start: 1.2em; }
.verse .vsep { display: none; color: var(--gold-2); }
.verse .vn { display: none; position: absolute; inset-inline-start: -30px; top: 50%; transform: translateY(-50%); font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--gold-2); user-select: none; -webkit-user-select: none; }
.verse.single { text-align: center; }
#verses { max-width: 30em; margin-inline: auto; }
#verses .verse { cursor: pointer; transition: background-color 0.2s; }
#verses .verse + .verse:not(.single) { border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent); border-radius: 0; }
#verses .verse:hover,
#verses .verse.sel,
#verses .verse:focus-visible { background: color-mix(in srgb, var(--gold-2) 13%, transparent); }

/* Two halves on one line around a central star (added by site.js when every verse fits) */
#verses.cols { max-width: none; }
.verses.cols .verse:not(.single) { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: clamp(14px, 2.4vw, 30px); }
/* Only two-half verses are kept on one line; a single line may still wrap. */
.verses.cols .verse:not(.single) .half { white-space: nowrap; }
.verses.cols .verse .sadr { text-align: end; }
.verses.cols .verse .ajuz { text-align: start; padding-inline-start: 0; }
.verses.cols .verse .vsep { display: grid; place-items: center; }
#verses.cols .verse + .verse:not(.single) { border-top: 0; border-radius: 6px; }
@media (min-width: 720px) {
  #verses.cols { padding-inline: 28px; }
  #verses.cols .verse .vn { display: block; inset-inline-start: -22px; }
}
.feature-verses.cols .verse .vsep { color: var(--gold-3); }

.stanza-title { margin: 26px 0 8px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 0.95em; color: var(--terra); }
.stanza-title::before,
.stanza-title::after { content: ''; display: inline-block; width: 0.4em; height: 0.4em; margin-inline: 0.9em; background: var(--gold-2); transform: rotate(45deg); vertical-align: middle; }
.stanza-sep { margin-block: 16px; }
.signature { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 34px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--gold); }

@media (max-width: 720px) {
  .verses { --verse-size: 19.5px; }
  .leaf { padding-top: 66px; }
  .leaf-tools { inset-inline-end: auto; left: 50%; transform: translateX(-50%); }
  .verse { padding-inline: 8px; }
}

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 30px 0 8px; }
.act { display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 9px 18px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 15.5px; transition: transform 0.25s var(--ease), border-color 0.2s, color 0.2s, box-shadow 0.25s; }
.act:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow-sm); }
.act-wa { color: #128a4a; border-color: color-mix(in srgb, #25d366 55%, var(--line-2)); }
.act-wa:hover { color: #0e7a41; border-color: #25d366; }
[data-mode='dark'] .act-wa { color: #4ee08a; }
.act-like.liked { color: var(--terra); border-color: color-mix(in srgb, var(--terra) 55%, var(--line-2)); }
.act-like.liked svg { fill: currentColor; }
.hint { text-align: center; margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }

.original { margin: 28px auto 0; max-width: 720px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.original summary { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 13px 18px; cursor: pointer; font-weight: 600; color: var(--ink-2); list-style: none; }
.original summary::-webkit-details-marker { display: none; }
.original summary:hover { color: var(--brand); }
.original img { margin: 0 auto; padding: 0 14px 14px; border-radius: 4px; }

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 40px 0 10px; }
.pn { display: grid; gap: 2px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); transition: border-color 0.2s, transform 0.25s var(--ease); }
.pn small { color: var(--gold); font-weight: 700; font-size: 13px; }
.pn span { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.6; }
.pn-prev { text-align: end; }
.pn:hover { border-color: var(--gold-2); color: var(--ink); transform: translateY(-2px); }
.poem-contact { text-align: center; margin: 18px 0 0; font-size: 15px; }
.poem-contact a { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }

/* Floating menu for a single verse */
.verse-pop { position: absolute; z-index: 60; display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: var(--hero-1); color: var(--hero-ink); border: 1px solid color-mix(in srgb, var(--gold-3) 55%, transparent); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3); transform: translateX(50%); white-space: nowrap; }
.verse-pop button { border: 0; background: none; color: inherit; padding: 7px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 600; }
.verse-pop button:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- About & contact ---------- */

.about { text-align: center; }
.about-photo { width: 190px; height: 240px; object-fit: cover; margin: 0 auto 22px; padding: 6px; border: 1px solid var(--gold-2); box-shadow: var(--shadow); }
.about-text { text-align: start; font-size: 18.5px; line-height: 2.1; max-width: 42em; margin: 0 auto 26px; }
.about-text p { margin: 0 0 1em; white-space: pre-line; }
.about-count { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--gold); margin: 0 0 22px; }

.contact-form { position: relative; display: grid; gap: 16px; max-width: 760px; margin-inline: auto; padding: clamp(22px, 4vw, 40px); background-color: var(--surface); background-image: var(--grain); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--shadow); }
.contact-form label { display: grid; gap: 7px; }
.contact-form label > span { font-weight: 600; font-size: 15px; color: var(--ink-2); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.contact-form input,
.contact-form textarea { width: 100%; padding: 12px 15px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); outline: 0; font-size: 16px; transition: border-color 0.2s, box-shadow 0.2s; }
.contact-form textarea { resize: vertical; min-height: 150px; }
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-2) 22%, transparent); }
.contact-form .btn { justify-self: start; }
.contact-poem { padding: 10px 15px; border-radius: 6px; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--ink-2); }
.req { color: var(--terra); font-style: normal; }
.form-status { margin: 0; font-weight: 600; min-height: 1.6em; }
.form-status.ok { color: var(--brand); }
.form-status.err { color: #c0392b; }
[data-mode='dark'] .form-status.err { color: #ef7766; }

/* ---------- Search overlay, modal, toast ---------- */

.search-overlay,
.modal { position: fixed; inset: 0; z-index: 90; display: grid; padding: 16px; background: color-mix(in srgb, #050a08 62%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.search-overlay { align-items: start; justify-items: center; padding-top: min(12vh, 110px); z-index: 80; }
.search-overlay[hidden] { display: none; }
.search-box { width: 100%; max-width: 660px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45); }
.search-form { display: flex; align-items: center; gap: 12px; padding: 8px 10px; padding-inline-start: 20px; border-bottom: 1px solid var(--line); }
.search-form > svg { color: var(--gold-2); flex: none; }
.search-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 12px 0; font-size: 18.5px; }
.search-results { max-height: min(60vh, 520px); overflow: auto; }
.sr-item { display: grid; gap: 2px; padding: 14px 22px; border-bottom: 1px solid var(--line); color: var(--ink); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover,
.sr-item.active,
.sr-item:focus { background: var(--surface-2); color: var(--ink); outline: 0; }
.sr-item strong { font-family: var(--display); font-size: 19px; }
.sr-item span { font-family: var(--serif); font-size: 15.5px; color: var(--muted); }
.sr-empty { padding: 26px; text-align: center; color: var(--muted); }
mark { background: color-mix(in srgb, var(--gold-2) 38%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.modal { place-items: center; }
.modal-box { width: 100%; max-width: 940px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; padding-inline-start: 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-family: var(--display); font-size: 22px; }
.modal-body { padding: clamp(14px, 3vw, 24px); }
.card-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.card-preview { display: grid; place-items: center; padding: 16px; min-height: 280px; background: var(--bg-2); border-radius: 8px; }
.card-preview canvas, .card-preview img { display: block; max-width: 100%; max-height: 64vh; width: auto; height: auto; border-radius: 4px; box-shadow: var(--shadow); }
.card-opts { display: grid; gap: 16px; align-content: start; }
.card-opts h4 { margin: 0 0 8px; font-size: 14.5px; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-opts h4 button { border: 0; background: none; color: var(--brand); font-size: 13.5px; font-weight: 700; padding: 2px 4px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-row button { padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); font-size: 14.5px; font-weight: 500; }
.opt-row button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.verse-pick { max-height: 230px; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); }
.verse-pick label { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 15px; line-height: 1.8; cursor: pointer; }
.verse-pick label:last-child { border-bottom: 0; }
.verse-pick input,
.card-check input { width: 18px; height: 18px; margin-top: 5px; accent-color: var(--brand); flex: none; }
.card-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.card-check input { margin: 0; }
.card-note { margin: 0; font-size: 13.5px; color: var(--muted); }
.card-actions { display: grid; gap: 8px; }
@media (max-width: 800px) {
  .card-layout { grid-template-columns: 1fr; }
  .card-preview canvas, .card-preview img { max-height: 48vh; }
}
.qr-box { display: grid; justify-items: center; gap: 14px; text-align: center; }
.qr-box img { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; padding: 14px; border-radius: 8px; border: 1px solid var(--line-2); }
.qr-box p { margin: 0; }

.toast { position: fixed; z-index: 120; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 140px); padding: 11px 22px; border-radius: 999px; background: var(--hero-1); color: var(--hero-ink); border: 1px solid color-mix(in srgb, var(--gold-3) 55%, transparent); font-weight: 600; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.25s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Footer ---------- */

.footer { margin-top: clamp(60px, 9vw, 110px); }
.footer-in { position: relative; isolation: isolate; text-align: center; padding: 46px 0 calc(34px + env(safe-area-inset-bottom)); color: var(--hero-ink); background: linear-gradient(180deg, var(--hero-1), color-mix(in srgb, var(--hero-1) 72%, #000)); }
.footer-in::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--lattice); background-size: 88px 88px; opacity: 0.07; }
.footer-star { color: var(--gold-3); }
.footer-name { margin: 8px 0 0; font-family: var(--display); font-weight: 900; font-size: 28px; color: var(--gold-3); }
.footer-poet { margin: 2px 0 0; color: color-mix(in srgb, var(--hero-ink) 80%, transparent); }
.socials { display: flex; justify-content: center; gap: 10px; margin: 20px 0 4px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--hero-ink); border: 1px solid color-mix(in srgb, var(--gold-3) 45%, transparent); transition: background-color 0.2s, color 0.2s, transform 0.25s var(--ease); }
.socials a:hover { background: var(--gold-3); color: #2a1f06; transform: translateY(-3px); }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; margin: 18px 0 0; }
.footer-nav a { color: color-mix(in srgb, var(--hero-ink) 85%, transparent); font-weight: 500; }
.footer-nav a:hover { color: var(--gold-3); }
.footer-small { margin: 18px 0 0; font-size: 13.5px; color: color-mix(in srgb, var(--hero-ink) 55%, transparent); }

/* ---------- Stage: password gate and obaid.blog landing ---------- */

.stage-body { background: var(--hero-1); }
.stage { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.stage .mountains { margin-top: auto; flex: none; }
.gate-card { position: relative; width: min(450px, calc(100% - 32px)); margin: clamp(36px, 10vh, 120px) auto 30px; padding: 46px clamp(22px, 5vw, 38px) 36px; text-align: center; background: color-mix(in srgb, var(--hero-1) 58%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid color-mix(in srgb, var(--gold-3) 55%, transparent); border-radius: 4px; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.4); }
.gate-card .leaf-star { color: var(--gold-3); background: var(--hero-1); }
.gate-card .leaf-star.s1 { top: 0; right: 0; }
.gate-card .leaf-star.s2 { top: 0; left: 0; }
.gate-card .leaf-star.s3 { bottom: 0; right: 0; }
.gate-card .leaf-star.s4 { bottom: 0; left: 0; }
.gate-logo { margin: 0 auto 14px; border-radius: 18px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }
.gate-card h1 { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(30px, 6vw, 40px); line-height: 1.5; }
.gate-poet { margin: 2px 0 0; font-size: 15.5px; color: color-mix(in srgb, var(--hero-ink) 85%, transparent); }
.gate-msg { margin: 6px 0 20px; color: color-mix(in srgb, var(--hero-ink) 78%, transparent); }
.gate-form { display: grid; gap: 12px; }
.gate-form input { width: 100%; padding: 13px 18px; text-align: center; font-size: 17px; border-radius: 999px; outline: 0; color: var(--hero-ink); background: color-mix(in srgb, var(--hero-ink) 9%, transparent); border: 1px solid color-mix(in srgb, var(--gold-3) 45%, transparent); transition: border-color 0.2s, box-shadow 0.2s; }
.gate-form input::placeholder { color: color-mix(in srgb, var(--hero-ink) 55%, transparent); }
.gate-form input:focus { border-color: var(--gold-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-3) 25%, transparent); }
.gate-err { margin: 14px 0 0; font-weight: 600; color: #ffb4a3; }
.countdown { display: flex; justify-content: center; gap: 8px; margin: 0 0 22px; }
.countdown div { display: grid; min-width: 66px; padding: 9px 4px; border: 1px solid color-mix(in srgb, var(--gold-3) 40%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--hero-ink) 6%, transparent); }
.countdown strong { font-family: var(--display); font-size: 26px; line-height: 1.3; color: var(--gold-3); }
.countdown span { font-size: 12.5px; color: color-mix(in srgb, var(--hero-ink) 70%, transparent); }

.hub-in { position: relative; width: 100%; max-width: 1060px; margin: 0 auto; padding: clamp(60px, 11vh, 120px) clamp(16px, 4vw, 32px) 20px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 20px; width: 100%; margin-top: 40px; }
.hub-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 24px 28px; color: var(--hero-ink); text-align: center; background: color-mix(in srgb, var(--hero-1) 55%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid color-mix(in srgb, var(--gold-3) 50%, transparent); border-radius: 4px; box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.6); transition: transform 0.35s var(--ease), border-color 0.3s; }
a.hub-card:hover { transform: translateY(-6px); border-color: var(--gold-3); color: var(--hero-ink); }
.hub-card strong { font-family: var(--display); font-weight: 900; font-size: 28px; line-height: 1.5; }
.hub-desc { color: color-mix(in srgb, var(--hero-ink) 74%, transparent); font-size: 15.5px; flex: 1; }
.hub-card .btn { margin-top: 14px; }
.hub-icon { display: grid; place-items: center; width: 66px; height: 78px; margin-bottom: 6px; color: var(--gold-3); border: 1px solid color-mix(in srgb, var(--gold-3) 55%, transparent); border-radius: 999px 999px 8px 8px; }
.hub-card.soon { opacity: 0.72; border-style: dashed; }
.soon-badge { margin-top: 14px; padding: 4px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--gold-3); border: 1px solid color-mix(in srgb, var(--gold-3) 45%, transparent); }
.hub-mode { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 3; color: var(--hero-ink); }
.hub-mode:hover { background: rgba(255, 255, 255, 0.12); color: var(--hero-ink); }

/* ---------- Print ---------- */

@media print {
  .topbar, .footer, .actions, .hint, .leaf-tools, .prev-next, .poem-contact, .player, .dl, .announce, .original, .crumbs, .toast, .skip, .poem > .sec, .preview-note, .verse-pop, .modal, .search-overlay { display: none !important; }
  html, body { background: #fff !important; color: #000; }
  .leaf { box-shadow: none; background: none; }
  .verse { break-inside: avoid; }
  .reveal.pre { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* No transitions at all (a tiny duration would still delay every style change by a
     frame, which breaks the script's text measurements); animations jump to their end. */
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}
