/* Demo masjid website — styles, version 1.13
   Follows the Islamic Studies site: deep green with a faint gold geometric
   pattern, a scalloped edge into cream, gold octagon badges and a medallion. */

@font-face { font-family: "DM Serif"; src: url("/assets/fonts/dmserif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("/assets/fonts/amiri-ar-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+FD3E-FD3F; }
@font-face { font-family: "Amiri"; src: url("/assets/fonts/amiri-ar-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+FD3E-FD3F; }
@font-face { font-family: "Readex"; src: url("/assets/fonts/readex-latin.woff2") format("woff2"); font-weight: 160 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Readex"; src: url("/assets/fonts/readex-ar.woff2") format("woff2"); font-weight: 160 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }

:root {
  /* palette taken from the Islamic Studies site */
  --night: #13291f;        /* deep green */
  --night-2: #1d3d2f;
  --glow: #2e5743;         /* lighter green at the centre of the header */
  --sand: #f5f1e4;         /* cream page */
  --stone: #ece4cc;
  --brass: #9c7c36;        /* gold for text on cream */
  --gold: #c9a24f;         /* gold lines and icons */
  --brass-hi: #e8d499;     /* pale gold on green */
  --sage: #2e5743;
  --ink: #1a2e25;
  --muted: #66665a;
  --white: #fcf9ef;        /* card cream */
  --line: #e4d9bb;

  --display: "DM Serif", "Playfair Display", Georgia, serif;
  --arabic: "Amiri", "Geeza Pro", "Traditional Arabic", serif;
  --body: "Readex", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23c9a24f' stroke-width='1.3'%3E%3Crect x='28' y='28' width='40' height='40'/%3E%3Crect x='28' y='28' width='40' height='40' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='10'/%3E%3C/g%3E%3C/svg%3E");
  --gutter: 16px;
  --max: 1180px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--sand); color: var(--ink);
  font-family: var(--body); font-size: 1.03rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
html[dir="rtl"] body { font-size: 1.08rem; line-height: 1.85; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.12; text-wrap: balance; }
h2, h3 { font-family: var(--display); }
html[dir="rtl"] h2, html[dir="rtl"] h3 { font-family: var(--arabic); font-weight: 700; line-height: 1.35; }
p { margin: 0 0 1em; }

.wrap {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 8px; top: 8px; transform: translateY(-300%); z-index: 50; background: var(--brass-hi); color: var(--night); padding: 8px 14px; border-radius: 8px; }
.skip:focus { transform: none; }

/* green surfaces share the faint gold pattern */
.hero, .jumuah-panel, .donate, .topbar { background-color: var(--night); }

/* ---------- ribbon + top bar ---------- */
.demo-ribbon { background: var(--brass-hi); color: var(--night); font-size: 0.88rem; }
.ribbon-in { padding-block: 8px; }
.demo-ribbon p { margin: 0; }
.demo-ribbon a { font-weight: 600; margin-inline-start: 6px; }

.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; color: var(--white); border-bottom: 1px solid rgba(201, 162, 79, 0.25); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--night); }
.topbar-in { display: flex; align-items: center; gap: 12px 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-inline-end: auto; }
.brand-arch { width: 24px; height: 30px; color: var(--gold); flex: none; }
.brand-names { display: grid; line-height: 1.15; }
.brand-names b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
html[dir="rtl"] .brand-names b { font-family: var(--arabic); font-weight: 700; font-size: 1.25rem; }
.brand-alt { font-family: var(--arabic); font-size: 0.95rem; color: var(--brass-hi); }
.brand-alt[lang="en"] { font-family: var(--display); font-size: 0.85rem; }

#nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav a { display: block; text-decoration: none; padding: 8px 12px; border-radius: 999px; color: rgba(252, 249, 239, 0.86); font-size: 0.95rem; }
.nav a:hover { background: rgba(232, 212, 153, 0.1); color: var(--white); }
.nav .nav-donate { background: var(--brass-hi); color: var(--night); font-weight: 600; margin-inline-start: 6px; }
.nav .nav-donate:hover { background: #f1e2b4; color: var(--night); }
.nav-toggle { display: none; font: inherit; font-size: 0.9rem; color: var(--white); background: transparent; border: 1px solid rgba(232, 212, 153, 0.45); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.lang { font: inherit; font-size: 0.9rem; cursor: pointer; color: var(--brass-hi); background: transparent; border: 1px solid rgba(232, 212, 153, 0.55); padding: 6px 14px; border-radius: 999px; }
.lang:hover { background: rgba(232, 212, 153, 0.12); }
.lang[lang="ar"] { font-family: var(--arabic); font-size: 1.02rem; padding-block: 3px 7px; }
@media (max-width: 1040px) {
  .nav-toggle { display: inline-block; }
  #nav-list { display: none; position: absolute; inset-inline: 0; top: 68px; flex-direction: column; align-items: stretch; gap: 0; background: var(--night); padding: 8px var(--gutter) 18px; border-bottom: 1px solid rgba(201, 162, 79, 0.25); max-height: calc(100vh - 120px); overflow-y: auto; }
  #nav-list.open { display: flex; }
  .nav a { padding: 12px 8px; border-radius: 10px; }
  .nav .nav-donate { text-align: center; margin: 8px 0 0; }
  .topbar-in { gap: 10px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600; text-decoration: none; padding: 13px 24px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; transition: background-color 0.15s ease, transform 0.15s ease; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-brass { background: var(--night); color: var(--brass-hi); border-color: var(--night); }
.btn-brass:hover { background: var(--night-2); }
.btn-night { background: var(--brass-hi); color: var(--night); }
.btn-night:hover { background: #f1e2b4; }
.btn-line { background: transparent; color: var(--night); border-color: var(--gold); }
.btn-line:hover { background: rgba(201, 162, 79, 0.1); }

/* ---------- hero ---------- */
.hero {
  position: relative; color: var(--white); overflow: hidden;
  background-image: var(--pattern), radial-gradient(ellipse at 50% 30%, var(--glow) 0%, var(--night) 62%);
  background-size: 96px 96px, cover;
  background-blend-mode: normal;
}
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(46, 87, 67, 0.68), rgba(19, 41, 31, 0.93) 65%); pointer-events: none; }
/* scalloped edge into the cream page, like the Islamic Studies site */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 20px;
  background: radial-gradient(circle at 18px 20px, var(--sand) 16px, var(--gold) 16.5px, var(--gold) 17.5px, transparent 18px) repeat-x;
  background-size: 36px 20px;
}
.hero-in { position: relative; display: grid; gap: 40px; align-items: center; padding-block: 48px 76px; }
@media (min-width: 960px) { .hero-in { grid-template-columns: 1.1fr 0.9fr; gap: 56px; padding-block: 64px 100px; } }

.emblem { width: 76px; height: 76px; color: var(--gold); margin-bottom: 18px; }
.dates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--brass-hi); font-size: 0.95rem; margin-bottom: 14px; }
.dates .sep { width: 5px; height: 5px; transform: rotate(45deg); background: currentColor; opacity: 0.7; }
.hero h1 { display: grid; gap: 4px; margin-bottom: 16px; }
.h-en { font-family: var(--display); font-size: clamp(2.8rem, 1.6rem + 5vw, 5.2rem); line-height: 1.02; letter-spacing: -0.01em; color: var(--white); }
.h-ar { font-family: var(--arabic); font-weight: 400; font-size: clamp(2.3rem, 1.5rem + 3.4vw, 3.9rem); color: var(--brass-hi); line-height: 1.35; }
html[dir="rtl"] .h-en { font-family: var(--arabic); font-weight: 700; line-height: 1.25; }
html[dir="rtl"] .h-ar { font-family: var(--display); font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); line-height: 1.1; }

.divider { display: flex; align-items: center; gap: 12px; max-width: 320px; margin-bottom: 22px; color: var(--gold); }
.divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.divider span:last-child { background: linear-gradient(90deg, currentColor, transparent); }
.divider i { width: 10px; height: 10px; transform: rotate(45deg); background: currentColor; flex: none; }

.lede { font-size: 1.2rem; color: rgba(252, 249, 239, 0.85); max-width: 40ch; margin-bottom: 26px; }


/* mihrab window */
.window { justify-self: center; width: min(100%, 440px); }
.mihrab { position: relative; aspect-ratio: 400 / 540; filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.55)); }
.mihrab-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lamp-glow { transition: opacity 1.2s ease; opacity: 0.75; }
.mihrab[data-phase="night"] .lamp-glow, .mihrab[data-phase="dusk"] .lamp-glow, .mihrab[data-phase="dawn"] .lamp-glow { opacity: 1; }
.flame { animation: flicker 3.2s ease-in-out infinite; transform-origin: 200px 210px; }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: 0.82; } 60% { opacity: 0.95; } }
@media (prefers-reduced-motion: reduce) { .flame { animation: none; } }

.next {
  position: absolute; left: 25%; right: 25%; bottom: 7%; padding: 14px 10px 12px;
  border-radius: 14px; background: rgba(12, 29, 21, 0.86); color: var(--white);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 162, 79, 0.55); text-align: center;
}
.next p { margin: 0; }
.next-label { font-size: 0.82rem; color: var(--brass-hi); letter-spacing: 0.04em; }
.next-name { font-family: var(--display); font-size: clamp(1.4rem, 1rem + 1.6vw, 1.9rem); line-height: 1.2; }
html[dir="rtl"] .next-name { font-family: var(--arabic); font-weight: 700; }
.next-time { display: grid; gap: 0; font-size: 0.88rem; line-height: 1.5; color: rgba(252, 249, 239, 0.8); }
.next-time b { color: var(--white); font-weight: 600; }
.next-time .dot { display: inline-block; width: 4px; height: 4px; transform: rotate(45deg); background: var(--gold); vertical-align: middle; margin: 0 6px; }
.countdown { margin-top: 6px !important; font-size: clamp(1.15rem, 0.9rem + 1vw, 1.5rem); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; color: var(--brass-hi); }

/* ---------- section basics ---------- */
section { scroll-margin-top: 76px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.sec-head h2, .sec-title { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); color: var(--night); }
.sec-title { margin-bottom: 24px; }
.sec-head h2::after, .sec-title::after {
  content: ""; display: block; width: 74px; height: 9px; margin-top: 10px;
  background:
    linear-gradient(var(--gold), var(--gold)) left center / 30px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right center / 30px 1.5px no-repeat,
    linear-gradient(45deg, transparent 32%, var(--gold) 33% 67%, transparent 68%) center / 9px 9px no-repeat;
}
.sec-note { color: var(--muted); font-size: 0.92rem; margin: 0; }
.empty { color: var(--muted); list-style: none; padding: 18px; border: 1.5px dashed var(--line); border-radius: 12px; }

/* cream sections carry the pattern very faintly */
.prayer, .programs, .visit { background-image: var(--pattern); background-size: 120px 120px; background-color: var(--sand); }
.prayer, .programs, .visit { position: relative; isolation: isolate; }
.prayer::before, .programs::before, .visit::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(245, 241, 228, 0.9); }

/* ---------- prayer tiles ---------- */
.prayer { padding-block: 64px 56px; }
.times { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .times { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .times { grid-template-columns: repeat(6, 1fr); } }
.tile {
  position: relative; display: grid; gap: 2px; justify-items: center; text-align: center;
  padding: 20px 10px 18px; border-radius: 16px; background: var(--white);
  border: 1px solid var(--line); box-shadow: 0 10px 24px -18px rgba(19, 41, 31, 0.45);
}
.badge { display: block; width: 54px; height: 54px; margin-bottom: 8px; }
.badge svg { width: 100%; height: 100%; overflow: visible; }
.badge .oct { fill: rgba(232, 212, 153, 0.25); stroke: var(--gold); stroke-width: 1.4; }
.badge .ico { fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile .p-name { font-family: var(--display); font-size: 1.35rem; color: var(--night); }
.tile .p-ar { font-family: var(--arabic); font-size: 1.1rem; color: var(--brass); line-height: 1.4; }
html[dir="rtl"] .tile .p-name { font-family: var(--arabic); font-weight: 700; }
html[dir="rtl"] .tile .p-ar { font-family: var(--display); font-size: 0.95rem; color: var(--muted); }
.tile .p-adhan { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 6px; color: var(--ink); }
.tile .p-iq { font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile .p-iq b { color: var(--ink); font-weight: 600; }
.tile.sunrise { background: transparent; border-style: dashed; box-shadow: none; }
.tile.sunrise .p-adhan { color: var(--muted); }
.tile.is-next { background: var(--night); border-color: var(--gold); box-shadow: 0 18px 30px -18px rgba(19, 41, 31, 0.8); }
.tile.is-next .p-name, .tile.is-next .p-adhan, .tile.is-next .p-iq b { color: var(--white); }
.tile.is-next .p-iq { color: rgba(252, 249, 239, 0.7); }
.tile.is-next .p-ar { color: var(--brass-hi); }
.tile.is-next .badge .oct { fill: rgba(232, 212, 153, 0.12); stroke: var(--brass-hi); }
.tile.is-next .badge .ico { stroke: var(--brass-hi); }
.tile.is-next::before { content: attr(data-badge); position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 0.72rem; padding: 2px 10px; border-radius: 999px; background: var(--brass-hi); color: var(--night); font-weight: 600; white-space: nowrap; }
.tile.is-past { opacity: 0.6; }

.jumuah-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; padding: 14px 20px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); }
.j-title { font-family: var(--display); font-size: 1.25rem; color: var(--night); }
html[dir="rtl"] .j-title { font-family: var(--arabic); font-weight: 700; }
#jumuah-times, .j-times { display: flex; flex-wrap: wrap; gap: 6px 18px; font-variant-numeric: tabular-nums; }
#jumuah-times b, .j-times b { font-weight: 600; color: var(--brass); }
@media (max-width: 560px) { .jumuah-strip { border-radius: 16px; } }

.month { margin-top: 22px; }
.month summary { list-style: none; }
.month summary::-webkit-details-marker { display: none; }
.month[open] summary { margin-bottom: 16px; }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--white); }
.month-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; min-width: 640px; }
.month-table th, .month-table td { padding: 8px 12px; text-align: start; border-bottom: 1px solid #efe7d0; white-space: nowrap; }
.month-table thead th { position: sticky; top: 0; background: var(--night); font-weight: 600; color: var(--brass-hi); }
.month-table tr.today td { background: #f3e7c3; font-weight: 600; }
.month-table td.day { color: var(--muted); }

/* ---------- news + events ---------- */
.news { padding-block: 64px; background: var(--white); border-block: 1px solid var(--line); }
.news-in { display: grid; gap: 48px; }
@media (min-width: 960px) { .news-in { grid-template-columns: 1fr 1fr; gap: 56px; } }
.ann-list, .event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.ann { padding-bottom: 16px; border-bottom: 1px solid #efe7d0; }
.ann:last-child { border-bottom: 0; }
.ann time { font-size: 0.85rem; color: var(--brass); font-weight: 600; }
.ann h3 { font-size: 1.35rem; margin: 2px 0 6px; color: var(--night); }
.ann p { margin: 0 0 6px; color: #3d4a43; }
.ann a { font-weight: 600; color: var(--sage); }
.event { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; }
.cal { display: grid; justify-items: center; padding: 10px 0 8px; border-radius: 14px; background: var(--night); color: var(--white); line-height: 1.1; border: 1px solid var(--gold); box-shadow: inset 0 0 0 3px var(--night), inset 0 0 0 4px rgba(201, 162, 79, 0.45); }
.cal .m { font-size: 0.75rem; color: var(--brass-hi); letter-spacing: 0.04em; }
.cal .d { font-family: var(--display); font-size: 1.7rem; }
.event h3 { font-size: 1.25rem; color: var(--night); margin-bottom: 4px; }
.event .meta { font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
.event p { margin: 0; color: #3d4a43; }

/* ---------- programs ---------- */
.programs { padding-block: 64px; }
.programs-in { display: grid; gap: 20px; align-items: start; }
@media (min-width: 960px) { .programs-in { grid-template-columns: 0.85fr 1.15fr; } }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: 0 12px 30px -24px rgba(19, 41, 31, 0.5); }
.panel h3 { font-size: 1.6rem; color: var(--night); margin-bottom: 10px; }
.jumuah-panel {
  color: var(--white); border-color: var(--gold);
  background-image: linear-gradient(rgba(19, 41, 31, 0.9), rgba(19, 41, 31, 0.9)), var(--pattern);
  background-size: auto, 96px 96px;
}
.jumuah-panel h3 { color: var(--brass-hi); }
.jumuah-panel p { color: rgba(252, 249, 239, 0.82); }
.j-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.j-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 18px; border-radius: 999px; background: rgba(13, 30, 22, 0.6); border: 1px solid rgba(201, 162, 79, 0.45); }
.j-list b { font-size: 1.4rem; font-weight: 600; color: var(--brass-hi); font-variant-numeric: tabular-nums; }

/* ---------- donate ---------- */
.donate {
  color: var(--white); padding-block: 60px; border-block: 1px solid var(--gold);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(46, 87, 67, 0.85), rgba(19, 41, 31, 0.95) 70%), var(--pattern);
  background-size: auto, 96px 96px;
}
.donate-in { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .donate-in { grid-template-columns: 1.4fr 0.6fr; } }
.donate h2 { font-size: clamp(2rem, 1.5rem + 1.8vw, 2.8rem); margin-bottom: 12px; color: var(--brass-hi); }
.donate p { max-width: 54ch; color: rgba(252, 249, 239, 0.88); }
.funds { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.funds li { padding: 4px 14px; border-radius: 999px; border: 1px solid rgba(232, 212, 153, 0.55); color: var(--brass-hi); font-size: 0.92rem; }
.donate-cta { display: grid; gap: 8px; justify-items: start; }
@media (min-width: 900px) { .donate-cta { justify-items: end; text-align: end; } }
.donate-cta .btn { font-size: 1.1rem; padding: 16px 34px; }
.donate .small { font-size: 0.88rem; margin: 0; color: rgba(252, 249, 239, 0.75); }

/* ---------- visit ---------- */
.visit { padding-block: 64px 72px; }
.visit-in { display: grid; gap: 32px; align-items: start; }
@media (min-width: 960px) { .visit-in { grid-template-columns: 1fr 1fr; gap: 56px; } }
.visit-info p { max-width: 52ch; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 20px 0 24px; }
.facts dt { font-weight: 600; color: var(--night); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
#v-phone, #v-email { unicode-bidi: plaintext; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.row2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; align-items: end; } }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.93rem; min-width: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--ink); width: 100%;
  padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--line); background: #fffdf6;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); background: #fffef9; box-shadow: 0 0 0 3px rgba(201, 162, 79, 0.22); }
.field .bad, .field input.bad, .field textarea.bad { border-color: #a8442c; }
.form-note { color: var(--muted); margin: 0; }
.form .btn { justify-self: start; }
.form-msg { margin: 0; font-weight: 600; min-height: 1.5em; }
.form-msg.ok { color: #2e6b4f; }
.form-msg.err { color: #a8442c; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.school-panel .form { margin-top: 18px; padding-top: 18px; border-top: 1px solid #efe7d0; }

/* ---------- footer ---------- */
.footer { background: var(--night); color: rgba(252, 249, 239, 0.75); font-size: 0.9rem; border-top: 1px solid rgba(201, 162, 79, 0.35); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 24px; }
.footer p { margin: 0; }
.footer a { color: var(--brass-hi); }
.version { color: var(--brass-hi); font-weight: 600; margin-inline-start: 10px; white-space: nowrap; }

/* ---------- phones: prayer window first ---------- */
@media (max-width: 959px) {
  .hero-in { gap: 28px; padding-block: 28px 64px; }
  .window { order: -1; width: min(100%, 360px); }
  .emblem { display: none; }
}

/* ---------- gallery ---------- */
.gallery { padding-block: 64px; background: var(--white); border-top: 1px solid var(--line); }
.photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 280px)); gap: 22px; }
.photo { margin: 0; display: grid; gap: 10px; }
.photo-frame {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 999px 999px 12px 12px;
  border: 4px solid var(--white); outline: 1.5px solid var(--gold); outline-offset: 0;
  box-shadow: 0 0 0 6px var(--white), 0 0 0 7px rgba(201, 162, 79, 0.5), 0 18px 30px -20px rgba(19, 41, 31, 0.6);
  background: var(--night);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { text-align: center; font-family: var(--display); font-size: 1.15rem; color: var(--night); }
html[dir="rtl"] .photo figcaption { font-family: var(--arabic); font-weight: 700; }
.photo.sample .photo-frame {
  display: grid; place-items: center;
  background-image: radial-gradient(ellipse at 50% 35%, rgba(46, 87, 67, 0.9), rgba(19, 41, 31, 0.97) 70%), var(--pattern);
  background-size: auto, 72px 72px;
}
.photo.sample svg { width: 46%; height: auto; color: var(--brass-hi); }
.photo.sample .tag { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 0.75rem; white-space: nowrap; padding: 3px 10px; border-radius: 999px; color: var(--night); background: var(--brass-hi); }

/* ---------- donate demo note ---------- */
.donate .small.flash { color: var(--brass-hi); font-weight: 600; }

/* ---------- monthly timetable tools ---------- */
.btn.small { padding: 8px 16px; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.4; cursor: default; }
.month-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; }
.m-title { font-family: var(--display); font-size: 1.35rem; color: var(--night); min-width: 10ch; text-align: center; }
html[dir="rtl"] .m-title { font-family: var(--arabic); font-weight: 700; }
#m-print { margin-inline-start: auto; }
.month-table td { vertical-align: top; }
.month-table td .a { display: block; }
.month-table td .q { display: block; font-size: 0.78rem; color: var(--brass); font-weight: 600; }
.month-table tr.fri td.day { color: var(--night); font-weight: 600; }
.table-key { margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }
.print-msg { margin: 0 0 8px; font-size: 0.9rem; color: var(--brass); font-weight: 600; }
.print-msg:empty { display: none; }
.print-head { display: none; }

/* ---------- Ramadan ---------- */
.ram-strip {
  display: flex; flex-wrap: wrap; gap: 6px 10px; margin: -8px 0 26px; padding: 0;
}
.ram-strip span { padding: 5px 14px; border-radius: 999px; border: 1px solid rgba(232, 212, 153, 0.55); color: var(--brass-hi); font-size: 0.95rem; }
.ram-strip .rs-day { background: var(--brass-hi); color: var(--night); font-weight: 600; border-color: var(--brass-hi); }

.ramadan {
  position: relative; padding-block: 64px; color: var(--white);
  background-image: radial-gradient(ellipse at 80% 0%, rgba(46, 87, 67, 0.85), rgba(19, 41, 31, 0.96) 60%), var(--pattern);
  background-size: auto, 96px 96px; background-color: var(--night);
  border-block: 1px solid var(--gold);
}
.ram-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 22px; }
.ramadan h2 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); color: var(--brass-hi); }
.ramadan h2::before {
  content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-inline-end: 0.35em; vertical-align: -0.05em;
  border-radius: 50%; box-shadow: inset 0.18em -0.1em 0 0 var(--brass-hi);
}
html[dir="rtl"] .ramadan h2::before { box-shadow: inset -0.18em -0.1em 0 0 var(--brass-hi); }
.ram-sub { margin: 8px 0 0; color: rgba(252, 249, 239, 0.8); max-width: 60ch; }
.ram-today { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.rt-item { display: grid; gap: 2px; padding: 14px 18px; border-radius: 16px; background: rgba(12, 29, 21, 0.7); border: 1px solid rgba(201, 162, 79, 0.55); text-align: center; }
.rt-l { font-size: 0.85rem; color: var(--brass-hi); }
.rt-item b { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ram-note { max-width: 70ch; color: rgba(252, 249, 239, 0.9); margin-bottom: 18px; }
.ram-eid { margin: 16px 0 0; padding: 12px 18px; border-radius: 999px; display: inline-block; background: var(--brass-hi); color: var(--night); font-weight: 600; }
.ramadan .table-wrap { background: var(--white); border-color: var(--gold); }
.ram-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; min-width: 640px; color: var(--ink); }
.ram-table th, .ram-table td { padding: 8px 12px; text-align: start; border-bottom: 1px solid #efe7d0; white-space: nowrap; }
.ram-table thead th { position: sticky; top: 0; background: var(--night); color: var(--brass-hi); font-weight: 600; }
.ram-table td.rday { font-weight: 700; color: var(--brass); }
.ram-table td.iftar { font-weight: 700; color: var(--night); }
.ram-table td.imsak { color: #7a5a1e; }
.ram-table tr.tenth td { border-bottom: 2px solid var(--gold); }
.ram-table tr.today td { background: #f3e7c3; font-weight: 600; }

/* ---------- printing ---------- */
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body::before { display: none !important; }
  body.printing > *:not(main) { display: none !important; }
  body.printing main > section:not(.print-target) { display: none !important; }
  body.printing .print-target {
    display: block !important; padding: 0 !important; margin: 0 !important; border: 0 !important;
    background: #fff !important; color: #000 !important;
  }
  body.printing .print-target::before, body.printing .print-target::after { display: none !important; }
  body.printing .print-target .sec-head,
  body.printing .print-target .times,
  body.printing .print-target .jumuah-strip,
  body.printing .print-target .month > summary,
  body.printing .print-target .month-tools,
  body.printing .print-target .ram-head,
  body.printing .print-target .ram-today,
  body.printing .print-target .print-msg { display: none !important; }
  body.printing .print-head { display: block; text-align: center; margin-bottom: 6mm; color: #000; }
  .ph-name { font-family: var(--display); font-size: 16pt; margin: 0; }
  .ph-title { font-size: 13pt; font-weight: 600; margin: 2mm 0; }
  .ph-meta { font-size: 9pt; margin: 0; color: #333; }
  body.printing .table-wrap { overflow: visible !important; border: 1px solid #888 !important; border-radius: 0 !important; background: #fff !important; }
  body.printing table { min-width: 0 !important; width: 100% !important; font-size: 8.5pt !important; color: #000 !important; }
  body.printing th, body.printing td { padding: 2px 5px !important; line-height: 1.35 !important; border-bottom: 1px solid #ccc !important; }
  body.printing thead th { position: static !important; background: #e9e4d4 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing tr.today td { background: none !important; }
  body.printing tr { break-inside: avoid; }
  body.printing .month-table td .a, body.printing .month-table td .q { display: inline !important; }
  body.printing .month-table td .q { color: #555 !important; font-size: 8pt; margin-inline-start: 4px; }
  body.printing .month-table td .q::before { content: "/ "; }
  body.printing .table-key, body.printing .ram-note, body.printing .ram-eid { color: #000 !important; background: none !important; font-size: 9pt; padding: 0 !important; margin-top: 3mm !important; }
}

/* ================= multi-page layout (version 1.5) ================= */

/* current page in the menu */
.nav a[aria-current="page"] { color: var(--brass-hi); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.nav .nav-donate[aria-current="page"] { box-shadow: none; border-radius: 999px; color: var(--night); outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 1040px) { .nav a[aria-current="page"] { box-shadow: none; background: rgba(232, 212, 153, 0.12); border-radius: 10px; } }

/* inner page header */
.page-hero {
  position: relative; overflow: hidden; color: var(--white); text-align: center;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(46, 87, 67, 0.75), rgba(19, 41, 31, 0.95) 70%), var(--pattern);
  background-size: auto, 96px 96px; background-color: var(--night);
}
.page-hero .wrap { padding-block: 52px 66px; display: grid; justify-items: center; }
.page-hero h1 { font-family: var(--display); font-size: clamp(2.3rem, 1.6rem + 3vw, 3.6rem); color: var(--white); }
html[dir="rtl"] .page-hero h1 { font-family: var(--arabic); font-weight: 700; line-height: 1.3; }
.page-hero .divider { width: 240px; margin: 14px auto 14px; }
.page-hero p { margin: 0; color: rgba(252, 249, 239, 0.82); max-width: 52ch; font-size: 1.1rem; }
.page-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 20px;
  background: radial-gradient(circle at 18px 20px, var(--sand) 16px, var(--gold) 16.5px, var(--gold) 17.5px, transparent 18px) repeat-x;
  background-size: 36px 20px;
}

.panel-h { font-size: 1.6rem; color: var(--night); margin-bottom: 10px; }
.jumuah-panel .panel-h { color: var(--brass-hi); }
.more-row { margin-top: 28px; }
.sec-head .btn { align-self: center; }

/* home: explore cards */
.explore { padding-block: 64px; }
.explore-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.explore-card {
  display: grid; gap: 8px; align-content: start; text-decoration: none; color: var(--ink);
  padding: 26px; border-radius: 20px; background: var(--white); border: 1px solid var(--line);
  box-shadow: 0 12px 30px -24px rgba(19, 41, 31, 0.5);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.explore-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.ex-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--brass); margin-bottom: 6px;
  background: rgba(232, 212, 153, 0.25); border: 1.4px solid var(--gold);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.ex-icon svg { width: 34px; height: 34px; }
.explore-card h3 { font-size: 1.45rem; color: var(--night); }
.explore-card p { margin: 0; color: var(--muted); }
.ex-more { margin-top: 6px; font-weight: 600; color: var(--brass); }

/* prayer page */
.month-block { margin-top: 48px; }
.jumuah-wide { display: grid; gap: 18px; align-items: center; }
@media (min-width: 900px) { .jumuah-wide { grid-template-columns: 1.2fr 1fr; gap: 40px; } }
.jumuah-wide .j-list { margin: 0; }

/* school page */
.school-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 960px) { .school-grid { grid-template-columns: 1.1fr 0.9fr; gap: 48px; } }
.lead-p { font-size: 1.15rem; max-width: 60ch; }
.facts-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 22px 0 36px; }
.facts-cards div { padding: 14px 16px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.facts-cards dt { font-size: 0.85rem; color: var(--brass); font-weight: 600; }
.facts-cards dd { margin: 2px 0 0; font-weight: 600; color: var(--night); }
.learn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.learn-list li { display: grid; gap: 2px; padding-inline-start: 26px; position: relative; }
.learn-list li::before, .offer-list li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: 0.55em; width: 10px; height: 10px; transform: rotate(45deg);
  background: var(--gold);
}
.learn-list b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--night); }
html[dir="rtl"] .learn-list b { font-family: var(--arabic); font-weight: 700; }
.learn-list span { color: var(--muted); }

/* about page */
.about-grid { display: grid; gap: 36px; align-items: start; }
@media (min-width: 960px) { .about-grid { grid-template-columns: 1.2fr 1fr; gap: 56px; } }
.about-grid p { max-width: 62ch; }
.offer-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.offer-list li { position: relative; padding-inline-start: 26px; }
.visit-tips { max-width: 760px; }

/* donate page */
.ways-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.ways-grid .panel h3 { font-size: 1.35rem; }
.ways-grid .panel p { margin: 0; color: var(--muted); }

/* footer */
.footer-grid { display: grid; gap: 20px 48px; padding-block: 34px 18px; border-bottom: 1px solid rgba(201, 162, 79, 0.25); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1fr auto; } }
.footer-grid p { margin: 0 0 6px; }
.f-name b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--white); }
html[dir="rtl"] .f-name b { font-family: var(--arabic); font-weight: 700; }
.f-alt { color: var(--brass-hi); font-family: var(--arabic); margin-inline-start: 8px; }
.f-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 6px 28px; }
.f-links a { color: rgba(252, 249, 239, 0.8); text-decoration: none; }
.f-links a:hover { color: var(--brass-hi); }
.footer [data-js="v-phone"], .footer [data-js="v-email"] { unicode-bidi: plaintext; }
body[data-page="ramadan"] .page-hero::after { display: none; }
.nf-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0 auto; }

/* back to home on every inner page (1.7) */
.page-hero .wrap { padding-block: 24px 66px; }
.back-home {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; padding: 7px 16px 7px 12px; border-radius: 999px;
  background: rgba(252, 249, 239, 0.08); border: 1px solid rgba(232, 212, 153, 0.45); color: var(--white);
  font-weight: 600; font-size: 0.92rem; text-decoration: none; transition: background 0.2s;
}
.back-home:hover { background: rgba(252, 249, 239, 0.16); }
.back-home:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
html[dir="rtl"] .back-home svg { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .back-home { transition: none; } }

/* menu items never break onto two lines (1.9) */
.nav a { white-space: nowrap; }

/* ================= 1.10: menus with sub-pages ================= */
.has-sub { position: relative; }
.sub-btn { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 0.95rem; color: rgba(252, 249, 239, 0.86); background: transparent; border: 0; padding: 8px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.sub-btn:hover, .has-sub.open > .sub-btn { background: rgba(232, 212, 153, 0.1); color: var(--white); }
.has-sub.is-current > .sub-btn { color: var(--brass-hi); }
.sub-btn .chev { transition: transform 0.2s; }
.has-sub.open > .sub-btn .chev { transform: rotate(180deg); }
.sub { list-style: none; margin: 0; padding: 0; }
.sub a[aria-current="page"] { color: var(--brass-hi); }
@media (min-width: 1041px) {
  .sub {
    display: none; position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 40; min-width: 230px;
    flex-direction: column; padding: 8px; background: var(--night); border: 1px solid rgba(201, 162, 79, 0.35); border-radius: 16px;
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.6);
  }
  .sub::before { content: ""; position: absolute; inset-inline: 0; top: -10px; height: 10px; }
  .has-sub:hover > .sub, .has-sub.open > .sub, .has-sub:focus-within > .sub { display: flex; }
  .sub a { border-radius: 10px; padding: 10px 12px; }
}
@media (max-width: 1040px) {
  .sub-btn { width: 100%; justify-content: space-between; padding: 12px 8px; border-radius: 10px; color: var(--brass-hi); font-weight: 600; }
  .sub-btn .chev { display: none; }
  .sub { display: flex; flex-direction: column; padding-inline-start: 14px; margin-bottom: 6px; border-inline-start: 1px solid rgba(201, 162, 79, 0.3); margin-inline-start: 8px; }
  .sub a { padding: 9px 8px; }
}
@media (prefers-reduced-motion: reduce) { .sub-btn .chev { transition: none; } }

/* links between the pages of one section */
.sub-pages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.sub-pages a { text-decoration: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--night); font-size: 0.92rem; }
.sub-pages a:hover { border-color: var(--gold); }
.ann-list.wide, .event-list.wide { max-width: 860px; }
.more-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* school */
.school-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.school-links a { display: grid; gap: 2px; text-decoration: none; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--sand); color: var(--text, inherit); }
.school-links a:hover { border-color: var(--gold); }
.school-links b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--night); }
html[dir="rtl"] .school-links b { font-family: var(--arabic); font-weight: 700; }
.school-links span { color: var(--muted); font-size: 0.93rem; }
.program-grid .panel { display: flex; flex-direction: column; gap: 10px; }
.mini-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.93rem; }
.mini-facts dt { color: var(--brass); font-weight: 600; }
.mini-facts dd { margin: 0; color: var(--night); }
.steps-list { list-style: none; counter-reset: st; margin: 0 0 40px; padding: 0; display: grid; gap: 16px; }
.steps-list li { counter-increment: st; display: grid; grid-template-columns: 42px 1fr; column-gap: 14px; }
.steps-list li::before { content: counter(st); grid-row: span 2; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--night); color: var(--brass-hi); font-weight: 700; }
.steps-list b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--night); }
html[dir="rtl"] .steps-list b { font-family: var(--arabic); font-weight: 700; }
.steps-list span { color: var(--muted); }
.fees { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.fees th, .fees td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: start; }
.fees th { font-weight: 500; }
.fees td { text-align: end; font-weight: 700; color: var(--night); white-space: nowrap; }
.fees tr:last-child th, .fees tr:last-child td { border-bottom: 0; }
.small-note { margin-top: 14px; font-size: 0.92rem; color: var(--muted); }
.forms-wrap { max-width: 860px; }
.form-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pick { font: inherit; cursor: pointer; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--night); }
.pick[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--brass-hi); }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.cal-list li { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.cal-when { font-weight: 700; color: var(--brass); }
@media (max-width: 560px) { .cal-list li { grid-template-columns: 1fr; gap: 2px; } }

/* ================= 1.11: motion ================= */
/* The verse caret in the mihrab */
.caret { fill: #e8d499; animation: caret-blink 1s steps(1) infinite; }
.caret.done { animation: none; opacity: 0; transition: opacity 0.8s ease; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* Hero: the name, the lines and the mihrab arrive in turn */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes window-in { from { opacity: 0; transform: translateY(34px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes sway { 0%, 100% { transform: rotate(-1.8deg); } 50% { transform: rotate(1.8deg); } }
@keyframes tile-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }

.motion .hero .emblem { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both, spin 120s linear 1s infinite; }
.motion .hero .dates { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both; }
.motion .hero .h-en { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both; }
.motion .hero .h-ar { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.38s both; }
.motion .hero .divider { animation: fade 0.6s ease 0.55s both; }
.motion .hero .divider span { animation: grow 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s both; transform-origin: right; }
.motion .hero .divider span:last-child { transform-origin: left; }
.motion .hero .lede { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.7s both; }
.motion .hero .window { animation: window-in 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both; }
.motion .next { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 1.2s both; }
.motion .lamp { transform-box: view-box; transform-origin: 200px 124px; animation: sway 7s ease-in-out infinite; }

/* Inner pages: the heading settles in */
.motion .page-hero .back-home { animation: fade 0.6s ease both; }
.motion .page-hero h1 { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.05s both; }
.motion .page-hero .divider { animation: fade 0.6s ease 0.25s both; }
.motion .page-hero .divider span { animation: grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both; transform-origin: right; }
.motion .page-hero .divider span:last-child { transform-origin: left; }
.motion .page-hero p { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both; }

/* Scroll: each part rises when it comes into view */
.motion .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease var(--d, 0ms), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0ms); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .times.in > li { animation: tile-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.motion .times.in > li:nth-child(2) { animation-delay: 0.07s; }
.motion .times.in > li:nth-child(3) { animation-delay: 0.14s; }
.motion .times.in > li:nth-child(4) { animation-delay: 0.21s; }
.motion .times.in > li:nth-child(5) { animation-delay: 0.28s; }
.motion .times.in > li:nth-child(6) { animation-delay: 0.35s; }
.motion .event-list.in > li, .motion .ann-list.in > li { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.motion .event-list.in > li:nth-child(2), .motion .ann-list.in > li:nth-child(2) { animation-delay: 0.08s; }
.motion .event-list.in > li:nth-child(3), .motion .ann-list.in > li:nth-child(3) { animation-delay: 0.16s; }
.motion .event-list.in > li:nth-child(n+4), .motion .ann-list.in > li:nth-child(n+4) { animation-delay: 0.24s; }

/* Small touches on hover */
.explore-card .ex-icon svg { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.explore-card:hover .ex-icon svg { transform: translateY(-4px) rotate(-5deg); }
.btn { transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease; }
.btn:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .caret, .explore-card .ex-icon svg, .btn { animation: none; transition: none; }
  .btn:hover, .explore-card:hover .ex-icon svg { transform: none; }
}
@media print {
  .motion .reveal { opacity: 1 !important; transform: none !important; }
  .motion .lamp, .motion .hero * { animation: none !important; }
}

/* 1.12: when the hero is one column (phones and medium screens), centre the name and text */
@media (max-width: 959px) {
  .hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .hero-copy .dates { justify-content: center; }
  .hero-copy h1 { display: flex; flex-direction: column; align-items: center; }
  .hero-copy .divider { width: 100%; margin-inline: auto; }
  .hero-copy .lede { margin-inline: auto; }
  .hero-copy .ram-strip { margin-inline: auto; }
}
