/* The Heart of Maldives — public site
   Colours come from the active theme as CSS variables (see includes/themes.php). */

:root {
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 22px;
  --radius-sm: 14px;
  --wrap: 1240px;
  --gut: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2,.7,.2,1);
  /* derived */
  --text: var(--ink);
  --muted: rgb(var(--ink-rgb) / .64);
  --line: rgb(var(--ink-rgb) / .12);
  --surface: rgb(var(--tint-rgb) / .62);
  --glass-bg: rgb(var(--tint-rgb) / .55);
  --glass-line: rgb(255 255 255 / .55);
  --shadow: 0 1px 0 rgb(255 255 255 / .4) inset, 0 18px 50px -24px rgb(var(--ink-rgb) / .35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode=light]) { --glass-bg: rgb(var(--tint-rgb) / .5); --glass-line: rgb(255 255 255 / .1); --shadow: 0 1px 0 rgb(255 255 255 / .06) inset, 0 22px 60px -26px rgb(0 0 0 / .8); }
}
:root[data-mode=dark] { --glass-bg: rgb(var(--tint-rgb) / .5); --glass-line: rgb(255 255 255 / .1); --shadow: 0 1px 0 rgb(255 255 255 / .06) inset, 0 22px 60px -26px rgb(0 0 0 / .8); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16.5px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgb(var(--accent-rgb) / .10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgb(var(--accent2-rgb) / .07), transparent 60%);
  background-attachment: fixed;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* ---------- frosted glass ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
}

/* ---------- type ---------- */
.kicker { font: 600 .74rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 .7rem; }
.kicker-light { color: #fff; opacity: .9; }
.block-title, .page-title, .story-title, .hero-title, .foot-title {
  font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.02; margin: 0 0 .9rem;
  font-variation-settings: "opsz" 144;
}
.block-title { font-size: clamp(2rem, 4.4vw, 3.6rem); }
.page-title { font-size: clamp(2.6rem, 7vw, 5.6rem); }
.block-intro { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.prose p { font-size: 1.06rem; }
.prose.dropcap > p:first-child::first-letter {
  font: 600 4.4em/0.8 var(--serif); float: left; margin: .08em .1em 0 0; color: var(--accent);
}
.pull {
  margin: 1.8rem 0 0; padding: 0 0 0 1.2rem; border-left: 3px solid var(--accent2);
  font: italic 400 clamp(1.3rem, 2.4vw, 1.75rem)/1.3 var(--serif); color: var(--text);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em; padding: .85em 1.35em; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; border: 0; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
  box-shadow: 0 10px 30px -12px rgb(var(--accent-rgb) / .8);
}
.btn:hover { transform: translateY(-2px); }
.btn .ico { transition: transform .25s var(--ease); }
.btn:hover .ico { transform: translateX(3px); }
.btn-glass { background: rgb(255 255 255 / .18); border: 1px solid rgb(255 255 255 / .45); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; transition: background .2s, transform .2s;
}
.icon-btn:hover { background: rgb(var(--accent-rgb) / .12); }
.link-btn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: none; display: inline-flex; gap: .3em; align-items: center; }

/* ---------- nav ---------- */
.nav {
  position: fixed; z-index: 50; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(calc(100% - 24px), 1180px); display: flex; align-items: center; gap: 1rem;
  padding: 8px 10px 8px 18px; border-radius: 999px;
  transition: transform .45s var(--ease), opacity .3s, background .3s;
}
/* Auto-hide: slides away while scrolling down, returns when scrolling up or near the top */
body.nav-hidden .nav { transform: translate(-50%, calc(-100% - 24px)); opacity: 0; pointer-events: none; }
body.nav-hidden .greeting { transform: translate(-50%, -90px); opacity: 0; pointer-events: none; }
.brand { display: flex; align-items: center; height: 40px; }
.logo { height: 38px; width: auto; }
.logo-dark { display: none; }
.nav-links { display: flex; gap: .2rem; margin-left: auto; }
.nav-links a { text-decoration: none; font-weight: 500; font-size: .93rem; padding: .5em .9em; border-radius: 999px; transition: background .2s; }
.nav-links a:hover { background: rgb(var(--accent-rgb) / .12); }
.nav-tools { display: flex; gap: .4rem; }
.menu-btn { display: none; }
.when-dark { display: none; }

/* dark-mode swaps */
:root[data-mode=dark] .logo-light, :root[data-mode=dark] .when-light { display: none; }
:root[data-mode=dark] .logo-dark, :root[data-mode=dark] .when-dark { display: inline; }
:root[data-mode=dark] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode=light]) .logo-light, :root:not([data-mode=light]) .when-light { display: none; }
  :root:not([data-mode=light]) .when-dark { display: inline; }
  :root:not([data-mode=light]) .logo-dark { display: block; }
}

/* ---------- greeting banner ---------- */
.greeting {
  position: fixed; z-index: 49; top: 76px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem .55rem 1rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; max-width: calc(100% - 24px);
  animation: drop .7s var(--ease) backwards .4s;
  transition: transform .45s var(--ease), opacity .3s;
}
.greeting a { text-decoration: none; }
.greeting-spark { color: var(--accent2); display: inline-flex; animation: spin 6s linear infinite; }
.greeting-close { background: none; border: 0; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.greeting-close:hover { background: var(--line); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -14px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.preview-flag { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 60; background: #111; color: #fff; padding: .5rem 1rem; border-radius: 999px; font-size: .85rem; }
.preview-flag a { color: #9ff; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 45; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; color: #fff; isolation: isolate; }
.hero-img { position: absolute; inset: -6% 0 0; background-size: cover; background-position: center; z-index: -2; transform: scale(1.06); animation: heroIn 2.4s var(--ease) forwards; will-change: transform; }
@keyframes heroIn { to { transform: scale(1); } }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(0 0 0 / .25) 0%, transparent 30%, transparent 45%, rgb(3 20 28 / .78) 100%); }
.hero-inner { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut) clamp(70px, 12vh, 120px); }
.hero-issue { display: flex; gap: 1.2rem; border-top: 1px solid rgb(255 255 255 / .5); padding-top: .7rem; max-width: 420px; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.hero-issue span + span::before { content: "·"; margin-right: 1.2rem; }
.hero-title { font-size: clamp(4.2rem, 16vw, 13rem); line-height: .86; margin: .2rem 0 1.4rem; font-weight: 400; letter-spacing: -.045em; text-shadow: 0 10px 40px rgb(0 0 0 / .25); }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 34ch; margin-bottom: 1.8rem; opacity: .95; }
.hero-scroll { position: absolute; bottom: 26px; right: var(--gut); width: 26px; height: 42px; border: 1.5px solid rgb(255 255 255 / .7); border-radius: 20px; }
.hero-scroll span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; background: #fff; border-radius: 2px; animation: scrollDot 1.8s infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- blocks ---------- */
.block { padding: clamp(56px, 9vw, 110px) 0; }
.block-head { margin-bottom: clamp(26px, 4vw, 44px); }
.block + .block { padding-top: clamp(20px, 4vw, 50px); }
.more { margin: 2.2rem 0 0; text-align: center; }

/* stats */
.stats { padding-top: clamp(30px, 5vw, 60px) !important; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0; }
.stat { padding: 1.4rem 1.4rem 1.2rem; border-radius: var(--radius); }
.stat dt { font: 400 clamp(2.4rem, 4.6vw, 3.6rem)/1 var(--serif); color: var(--accent); letter-spacing: -.03em; }
.stat dd { margin: .5rem 0 0; color: var(--muted); font-size: .95rem; }

/* article */
.article-grid { display: grid; gap: clamp(28px, 5vw, 70px); align-items: center; }
.has-img .article-grid { grid-template-columns: 1.05fr .95fr; }
.img-left .article-text { order: 2; }
.article-img { margin: 0; border-radius: calc(var(--radius) + 6px); overflow: hidden; aspect-ratio: 4 / 5; box-shadow: var(--shadow); }
.article-img img { width: 100%; height: 100%; object-fit: cover; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.4rem; }
.chip { font: 500 .88rem var(--sans); color: var(--text); padding: .5em 1em; border-radius: 999px; cursor: pointer; transition: background .25s, color .25s, transform .2s; }
.chip span { opacity: .55; font-size: .8em; margin-left: .2em; }
.chip:hover { transform: translateY(-1px); }
.chip.is-on { background: var(--accent); color: #fff; border-color: transparent; }

/* ---------- cards & magazine grid ---------- */
.mag { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 132px; grid-auto-flow: dense; gap: 18px; }
.mag .card { grid-column: span 4; grid-row: span 3; }
.mag .card-large { grid-column: span 4; grid-row: span 4; }
.mag .card-feature { grid-column: span 8; grid-row: span 4; }
.mag .card.no-img.card-standard { grid-row: span 2; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.grid .card { aspect-ratio: 4 / 5; }
.grid .card.no-img { aspect-ratio: auto; min-height: 260px; }

.card { position: relative; border-radius: var(--radius); overflow: hidden; isolation: isolate; background: var(--surface); border: 1px solid var(--line); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgb(var(--ink-rgb) / .5); }
.card-link { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; text-decoration: none; color: inherit; }
.card-media { position: absolute; inset: 0; z-index: -1; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card.has-img .card-body { margin: 10px; padding: .95rem 1.1rem 1rem; border-radius: var(--radius-sm); }
.card-meta { display: flex; align-items: center; gap: .6rem; margin: 0 0 .35rem; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.card-num { font: italic 500 1.05rem/1 var(--serif); letter-spacing: 0; color: var(--accent2); }
.card-title { font: 500 1.35rem/1.12 var(--serif); letter-spacing: -.01em; margin: 0; }
.card-feature .card-title { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
.card-sub { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.card-text { margin: .5rem 0 0; color: var(--muted); font-size: .93rem; line-height: 1.5; }
/* typographic cards (no photo) */
.card.no-img { background: linear-gradient(160deg, rgb(var(--accent-rgb) / .14), rgb(var(--accent2-rgb) / .08)), var(--surface); }
.card.no-img .card-link { justify-content: space-between; padding: 1.3rem 1.4rem 1.4rem; }
.card.no-img .card-body { padding: 0; }
.card.no-img .card-num { font-size: 3.6rem; line-height: .9; display: block; color: rgb(var(--accent-rgb) / .9); }
.card.no-img .card-meta { flex-direction: column; align-items: flex-start; gap: .9rem; }
.card-pattern { position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(circle at 85% 15%, rgb(var(--accent-rgb) / .25) 0 60px, transparent 61px),
    repeating-radial-gradient(circle at 85% 15%, transparent 0 18px, rgb(var(--accent-rgb) / .12) 18px 19px);
}
.card.is-hidden { display: none; }

/* rail */
.rail-wrap { position: relative; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 24px; scrollbar-width: thin; }
.rail .card { aspect-ratio: 3 / 4; scroll-snap-align: start; }
.rail-btn { position: absolute; top: calc(50% - 32px); z-index: 2; }
.rail-prev { left: -18px; } .rail-next { right: -18px; }

/* numbered list */
.list-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list-item a { display: grid; grid-template-columns: 1fr 180px; gap: 1.4rem; align-items: center; padding: 1.4rem .4rem; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .25s, padding .25s var(--ease); }
.list-item a:hover { background: rgb(var(--accent-rgb) / .06); padding-left: 1rem; }
.list-num { font: italic 400 2.6rem/1 var(--serif); color: var(--accent2); }
.list-text { display: flex; flex-direction: column; gap: .2rem; }
.list-text .kicker { margin: 0; }
.list-text strong { font: 500 1.5rem/1.15 var(--serif); }
.list-item img { width: 180px; height: 110px; object-fit: cover; border-radius: var(--radius-sm); }

/* events */
.event-list { display: grid; gap: 14px; }
.event { display: grid; grid-template-columns: 88px 1fr 150px; gap: 1.2rem; align-items: center; padding: 14px; border-radius: var(--radius); text-decoration: none; transition: transform .3s var(--ease); }
.event:hover { transform: translateX(4px); }
.event-date { display: grid; place-items: center; text-transform: uppercase; font-size: .78rem; letter-spacing: .14em; font-weight: 600; color: var(--accent); }
.event-date strong { font: 400 2.6rem/1 var(--serif); letter-spacing: 0; color: var(--text); }
.event-text { display: flex; flex-direction: column; gap: .15rem; }
.event-text .kicker { margin: 0; }
.event-text strong { font: 500 1.35rem/1.2 var(--serif); }
.event img { width: 150px; height: 100px; object-fit: cover; border-radius: var(--radius-sm); }

/* gallery */
.masonry { columns: 4 240px; column-gap: 14px; }
.m-item { display: block; margin-bottom: 14px; border-radius: var(--radius-sm); overflow: hidden; break-inside: avoid; }
.m-item img { width: 100%; transition: transform .8s var(--ease), filter .4s; }
.m-item:hover img { transform: scale(1.04); }

/* map */
.map { height: clamp(360px, 55vh, 560px); border-radius: var(--radius); overflow: hidden; }
.map-small { height: 220px; border-radius: var(--radius-sm); }
.leaflet-container { font-family: var(--sans); background: rgb(var(--accent-rgb) / .15); }
.map-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; background: var(--accent); transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 6px 16px -4px rgb(0 0 0 / .45); display: grid; place-items: center; }
.map-pin span { transform: rotate(45deg); color: #fff; font: 600 11px var(--sans); }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 12px 14px; }
.pop-title { font: 500 1.05rem/1.2 var(--serif); margin: 0 0 4px; }
.pop img { width: 200px; height: 110px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.map-empty { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 2rem; text-align: center; }

/* CTA banner */
.cta-card { border-radius: calc(var(--radius) + 8px); background-size: cover; background-position: center; min-height: 460px; display: flex; align-items: flex-end; padding: clamp(14px, 3vw, 30px); max-width: calc(var(--wrap) - 2 * var(--gut)); margin: 0 var(--gut); }
@media (min-width: 1240px) { .cta-card { margin: 0 auto; } }
.cta-inner { max-width: 560px; padding: clamp(20px, 3vw, 34px); border-radius: var(--radius); }

/* ---------- item page ---------- */
.story-head { position: relative; padding: 150px 0 50px; isolation: isolate; }
.story-head.has-img { min-height: 78svh; display: flex; align-items: flex-end; color: #fff; padding-bottom: 60px; }
.story-head.has-img .kicker, .story-head.has-img .crumbs a { color: #fff; }
.story-img { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; }
.story-head .hero-shade { z-index: -1; }
.story-head-inner { width: 100%; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1.4rem; }
.story-head.has-img .crumbs { color: rgb(255 255 255 / .8); }
.crumbs a { text-decoration: none; color: var(--accent); }
.story-meta { display: flex; align-items: center; gap: 1rem; margin: 0; }
.story-meta .kicker { margin: 0; }
.story-num { font: italic 400 3rem/1 var(--serif); color: var(--accent2); }
.story-head.has-img .story-num { color: #fff; }
.story-title { font-size: clamp(2.6rem, 7vw, 5.8rem); margin: .4rem 0 .6rem; max-width: 16ch; }
.story-sub { font-size: 1.15rem; opacity: .85; margin: 0; }
.story-cta { margin: 1.4rem 0 0; }
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(30px, 5vw, 70px); padding-top: clamp(36px, 6vw, 70px); padding-bottom: 40px; }
.standfirst { font: 400 clamp(1.25rem, 2.2vw, 1.6rem)/1.4 var(--serif); margin-bottom: 1.6rem; }
.story-body .prose { max-width: 66ch; }
.story-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 2rem; }
.story-gallery a { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; }
.story-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.story-gallery a:hover img { transform: scale(1.06); }
.story-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 100px; align-self: start; }
.side-card { padding: 1.1rem 1.2rem; border-radius: var(--radius); }
.side-card p { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 .6rem; word-break: break-word; }
.side-card .kicker { display: block; }
.pager a { display: block; text-decoration: none; padding: .6rem 0; font: 500 1.05rem/1.25 var(--serif); }
.pager a + a { border-top: 1px solid var(--line); }
.pager .kicker { margin-bottom: .3rem; display: flex; align-items: center; gap: .3rem; }
.pager-next { text-align: right; }
.pager-next .kicker { justify-content: flex-end; }

.page-top { padding-top: 140px; }
.search { display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem .3rem 1rem; border-radius: 999px; max-width: 460px; margin-top: 1.4rem; }
.search input { flex: 1; border: 0; background: none; font: inherit; color: inherit; padding: .55rem 0; outline: none; }

/* ---------- footer ---------- */
.foot { margin-top: 60px; border-top: 1px solid var(--line); padding: 60px 0 0; }
.foot-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.foot-title { font-size: clamp(2rem, 4vw, 3rem); }
.foot-brand .muted { max-width: 44ch; }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.foot-cols a { display: block; text-decoration: none; padding: .25rem 0; color: var(--muted); }
.foot-cols a:hover { color: var(--accent); }
.foot-bar { max-width: var(--wrap); margin: 40px auto 0; padding: 20px var(--gut) 34px; border-top: 1px solid var(--line); display: flex; gap: 1.5rem; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); }
.foot-logo { display: inline-block; margin-bottom: 1.2rem; }
.foot-logo img { height: clamp(72px, 9vw, 110px); width: auto; }

/* Back-to-top bubble: bottom right, fades out while scrolling, back when scrolling stops */
.to-top {
  position: fixed; right: clamp(14px, 3vw, 28px); bottom: clamp(14px, 3vw, 28px); z-index: 48;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); cursor: pointer; font-size: 1.15rem;
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease), background .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top.show.scrolling { opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; }
.to-top:hover { background: var(--accent); color: #fff; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgb(2 10 14 / .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(92vw, 1400px); }
.lightbox img { max-height: 82vh; width: auto; margin: 0 auto; border-radius: 12px; }
.lightbox figcaption { color: #fff; text-align: center; margin-top: .8rem; opacity: .85; }
.lightbox .icon-btn { position: absolute; color: #fff; border-color: rgb(255 255 255 / .3); background: rgb(255 255 255 / .08); }
.lb-close { top: 18px; right: 18px; } .lb-prev { left: 18px; top: 50%; } .lb-next { right: 18px; top: 50%; }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease) var(--d, 0ms), transform .8s var(--ease) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .mag { grid-template-columns: repeat(6, 1fr); }
  .mag .card, .mag .card-large { grid-column: span 3; }
  .mag .card-feature { grid-column: span 6; }
  .story-grid { grid-template-columns: 1fr; }
  .story-side { position: static; }
  .has-img .article-grid { grid-template-columns: 1fr; }
  .img-left .article-text { order: 0; }
  .article-img { aspect-ratio: 16 / 10; }
}
@media (max-width: 820px) {
  .menu-btn { display: inline-grid; }
  .nav-links { position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; padding: 10px; border-radius: 24px; background: var(--glass-bg); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--glass-line); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .25s, transform .25s var(--ease); }
  .nav.open .nav-links { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a { padding: .8em 1em; }
  .nav-tools { margin-left: auto; }
  .foot-inner { grid-template-columns: 1fr; }
  .list-item a { grid-template-columns: 1fr; }
  .list-item img { display: none; }
  .event { grid-template-columns: 70px 1fr; }
  .event img { display: none; }
  .greeting { top: 72px; font-size: .85rem; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .mag { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .mag .card, .mag .card-large, .mag .card-feature { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 5; }
  .mag .card.no-img { aspect-ratio: auto; min-height: 220px; }
  .mag .card-feature { aspect-ratio: 4 / 5; }
  .rail-btn { display: none; }
  .hero-scroll { display: none; }
  .foot-bar { flex-wrap: wrap; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; }
}
