/* =========================================================
   JGO — Modern Minimal Design System
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --bg-alt: #faf9f6;
  --surface: #ffffff;
  --field-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.78);
  --ink: #0f1115;
  --ink-strong: #000000;
  --on-ink: #ffffff;
  --ink-soft: #2a2d34;
  --muted: #6b6f76;
  --line: #ececec;
  --line-strong: #d9d9d9;
  --focus-ring: rgba(15, 17, 21, .08);
  --accent: #ff5a1f;
  --accent-soft: #ffe7dc;
  --accent-ink: #b13a0b;
  --grad-a: #ff5a1f;
  --grad-b: #ff9a3c;
  --grad-c: #ffd166;
  --cta-a: #0f1115;
  --cta-b: #1c1f26;
  --footer-bg: #0f1115;
  --footer-line: #232730;
  --ok-bg: #ecfdf3;
  --ok-ink: #036b39;
  --ok-line: #b7ebcb;
  --danger-bg: #fdecec;
  --danger-ink: #92211a;
  --danger-line: #f3c4c1;
  --danger-text: #c0392b;
  --shadow-sm: 0 1px 2px rgba(15, 17, 21, .04), 0 1px 1px rgba(15, 17, 21, .04);
  --shadow-md: 0 8px 24px rgba(15, 17, 21, .06), 0 2px 6px rgba(15, 17, 21, .04);
  --shadow-lg: 0 24px 48px rgba(15, 17, 21, .10), 0 8px 16px rgba(15, 17, 21, .04);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 .5em;
  line-height: 1.15;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
ul { padding: 0; margin: 0; list-style: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.display {
  font-size: clamp(2.5rem, 6.5vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.grad {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b) 50%, var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--muted);
  max-width: 56ch;
}
.muted { color: var(--muted); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 1rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-container {
  display: flex;
  align-items: center;
  /* The nav takes the slack (`margin: 0 auto` below) so the action buttons and
     the colour-mode toggle stay grouped at the right edge. */
  justify-content: flex-start;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.nav-container > nav { margin: 0 auto; }
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -.02em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark { line-height: 1; }
.brand-logo {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 50%;
}
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  display: inline-block;
}
.primary-nav {
  display: flex;
  gap: 28px;
  font-size: .95rem;
  font-weight: 500;
}
.primary-nav a {
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}
.primary-nav a.active,
.primary-nav a:hover { color: var(--ink); }
.primary-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions .logout-form { display: inline-flex; margin: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  margin: 3px 0;
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease), color .2s var(--ease), border .2s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
}
.btn-primary:hover {
  background: var(--ink-strong);
  color: var(--on-ink);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--bg-soft); }
.section-head {
  text-align: center;
  margin: 0 auto 56px;
  max-width: 720px;
}
.section-head h2 { margin: 0; }

/* ---------- Slider ---------- */
.slider {
  position: relative;
  width: 100%;
  height: clamp(460px, 66vh, 640px);
  overflow: hidden;
  background: var(--bg-soft);
}
.slides {
  position: relative;
  width: 100%;
  height: 100%;
}
.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s var(--ease), transform 8s ease-out;
  transform: scale(1.05);
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transform: scale(1);
}
.slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 17, 21, .72) 0%, rgba(15, 17, 21, .45) 50%, rgba(15, 17, 21, .25) 100%);
}
.slide-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 680px;
  padding-top: 24px;
}
.slide-content h1,
.slide-content h2,
.slide-content .lead { color: #fff; }
/* Hero headlines run smaller than a page .display so five slides keep a
   consistent height without the copy overflowing the shorter frame. */
.slide-content h1,
.slide-content h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4.6vw, 3.25rem);
  line-height: 1.08;
  text-shadow: 0 2px 24px rgba(15, 17, 21, .35);
}
.slide-content .lead {
  margin: 14px 0 26px;
  font-size: clamp(.95rem, 1.15vw, 1.1rem);
  max-width: 52ch;
  opacity: .95;
}
.slide-content .eyebrow {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: .74rem;
  margin-bottom: .8rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.slide-content .btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .5);
}
.slide-content .btn-ghost:hover {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: background .2s, transform .2s, border-color .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.slider-arrow:hover {
  background: rgba(255, 255, 255, .25);
  border-color: rgba(255, 255, 255, .6);
  transform: translateY(-50%) scale(1.05);
}
.slider-arrow.prev { left: 24px; }
.slider-arrow.next { right: 24px; }

.slider-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}
.slider-dot {
  width: 32px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .35);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background .25s, width .25s;
}
.slider-dot:hover { background: rgba(255, 255, 255, .55); }
.slider-dot.is-active {
  background: #fff;
  width: 48px;
}

.slider-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, .15);
  z-index: 3;
}
.slider-progress .bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .15s linear;
}

/* ---------- Logos strip ---------- */
.logos { padding: 48px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.logos-label {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.logos-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--muted);
  opacity: .85;
}
.logos-row span { transition: color .2s; }
.logos-row span:hover { color: var(--ink); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

/* ---------- Service cards ---------- */
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform .25s var(--ease), border .2s, box-shadow .25s var(--ease);
}
.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.service-icon {
  width: 48px; height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: 16px;
}
.service-card h3 { margin-bottom: 8px; }
.service-card p { font-size: .96rem; }
.link-arrow {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border .2s, color .2s;
}
.link-arrow:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.stat-card span { color: var(--muted); font-size: .92rem; }

/* ---------- Checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 28px; }
.checklist li {
  display: flex;
  gap: 10px;
  padding-left: 28px;
  position: relative;
  color: var(--ink-soft);
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--bg);
}

/* ---------- Testimonials ---------- */
.testimonial {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 0;
  position: relative;
}
.testimonial::before {
  content: '"';
  position: absolute;
  top: -8px; left: 24px;
  font-family: 'Space Grotesk', serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent);
  opacity: .25;
}
.testimonial p { font-size: 1.02rem; color: var(--ink); }
.testimonial footer {
  color: var(--muted);
  font-size: .92rem;
  border: none;
  padding: 0;
}

/* ---------- CTA card ---------- */
.cta-section { padding-top: 0; }
.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 56px;
  background: linear-gradient(135deg, var(--cta-a) 0%, var(--cta-b) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 60%; height: 200%;
  background: radial-gradient(closest-side, rgba(255, 90, 31, .25), transparent 70%);
  pointer-events: none;
}
.cta-card h2, .cta-card .lead { color: #fff; }
.cta-card .lead { opacity: .85; margin: 8px 0 0; }
/* The CTA card keeps its dark gradient in both themes, so this button holds a
   light fill and a dark label rather than following --ink, which inverts. */
.cta-card .btn-primary {
  background: #fff;
  color: #0f1115;
}
.cta-card .btn-primary:hover { background: var(--accent); color: #fff; }

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
  padding: clamp(80px, 10vw, 140px) 0 clamp(40px, 6vw, 80px);
  background:
    radial-gradient(40% 60% at 80% 0%, rgba(255, 154, 60, 0.10), transparent 60%),
    var(--bg);
}
.page-hero .lead { margin-top: 16px; }

/* ---------- About story ---------- */
.story-art {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.story-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.story-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  color: var(--accent);
}
.story-card span { color: var(--muted); font-size: .92rem; }

.value-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.value-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.value-card p { margin: 0; font-size: .96rem; }

/* ---------- Process ---------- */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
.process li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.process .step {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--accent);
  display: block;
  margin-bottom: 16px;
}
.process h3 { margin-bottom: 6px; }
.process p { margin: 0; font-size: .96rem; }

/* ---------- Pricing ---------- */
.pricing .price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  transition: transform .2s var(--ease), border .2s;
}
.pricing .price-card:hover { transform: translateY(-4px); }
.pricing .featured {
  border-color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.pricing .tag {
  position: absolute;
  top: -14px;
  left: 32px;
  background: var(--ink);
  color: #fff;
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.price-card .price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 8px 0;
  color: var(--ink);
}
.price-card .price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact-wrap { align-items: stretch; }
.contact-info { padding-right: 16px; }
.contact-list { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.contact-list li { display: flex; flex-direction: column; gap: 2px; }
.contact-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-list a { color: var(--ink); font-weight: 500; }
.contact-list a:hover { color: var(--accent); }

.contact-form-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 500; font-size: .92rem; color: var(--ink); }
.form-row input,
.form-row textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border .2s, box-shadow .2s;
  resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.error { color: var(--danger-text); font-size: .85rem; }

.alert {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  font-weight: 500;
}
.alert.success {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border: 1px solid var(--ok-line);
}
.alert.error {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 1px solid var(--danger-line);
}

/* ---------- Auth: the lamp sign-in page ----------
   The page is a room with one pendant lamp in it. Pulling the cord is the
   colour-mode switch: lamp on = light mode, lamp off = dark mode, so the
   light in the illustration and the light on the page are the same thing.
   `--lamp-drop` is the distance from the top of the page to the shade's rim,
   which is where the glow and the beam are anchored. */
.lamp-page {
  --lamp-drop: 148px;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px 40px;
  background: var(--bg);
  overflow: hidden;
  transition: background-color .45s var(--ease);
}

/* Everything the lamp throws light on, painted under the lamp and the card. */
.lamp-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.lamp-light > * {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity .45s var(--ease);
}

/* Halo around the shade. */
.lamp-glow {
  top: calc(var(--lamp-drop) - 200px);
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 116, .50), rgba(255, 196, 116, 0) 68%);
}
/* The beam. A cone struck from the bulb rather than a clipped triangle: a
   conic gradient has no geometric edge to give itself away, and the mask
   fades it out before it reaches the bottom of the room. */
.lamp-beam {
  top: calc(var(--lamp-drop) - 10px);
  width: min(1400px, 190vw);
  height: 88vh;
  background: conic-gradient(from 145deg at 50% 0%,
    rgba(255, 186, 102, 0) 0deg,
    rgba(255, 186, 102, .34) 15deg,
    rgba(255, 194, 120, .42) 35deg,
    rgba(255, 186, 102, .34) 55deg,
    rgba(255, 186, 102, 0) 70deg);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .95), rgba(0, 0, 0, .28) 46%, transparent 84%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .95), rgba(0, 0, 0, .28) 46%, transparent 84%);
  filter: blur(18px);
}
/* Where the light lands, roughly behind the card. */
.lamp-pool {
  top: calc(var(--lamp-drop) + 250px);
  width: min(900px, 130vw);
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 201, 133, .22), transparent 72%);
  filter: blur(6px);
}
/* The one thing that only shows with the lamp off: enough spill from
   somewhere else in the room to keep the fixture from being a black cut-out. */
.lamp-ambient {
  top: 0;
  width: min(940px, 130vw);
  height: 440px;
  background: radial-gradient(50% 60% at 50% 18%, rgba(132, 162, 212, .13), transparent 72%);
  opacity: 0;
}

/* Lamp off: no glow, no beam, no pool — just the ambient spill. */
[data-theme="dark"] .lamp-glow,
[data-theme="dark"] .lamp-beam,
[data-theme="dark"] .lamp-pool { opacity: 0; }
[data-theme="dark"] .lamp-ambient { opacity: 1; }

/* ---- The fixture ---- */
.lamp {
  position: relative;
  z-index: 1;
  flex: none;
  width: 200px;
  height: 196px;
  transform-origin: top center;
}
.lamp-wire {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 58px;
  margin-left: -1px;
  background: #6b7280;
}
.lamp-fixture {
  position: absolute;
  top: 56px;
  left: 0;
  width: 200px;
  height: 140px;
  overflow: visible;
}
.lamp-cap { fill: #6b7280; }
.lamp-shade { fill: #ff6a2c; }
.lamp-rim { fill: #ffe2bb; }
.lamp-bulb { fill: #fff6e2; }
.lamp-fixture .lamp-cap,
.lamp-fixture .lamp-shade,
.lamp-fixture .lamp-rim,
.lamp-fixture .lamp-bulb { transition: fill .45s var(--ease); }
.lamp-halo { transition: opacity .45s var(--ease); }

/* Off: a cold, unlit fixture. */
[data-theme="dark"] .auth-logo img {
  border-color: #3a424e;
  filter: brightness(.9);
}

[data-theme="dark"] .lamp-shade { fill: #333a44; }
[data-theme="dark"] .lamp-rim { fill: #454d59; }
[data-theme="dark"] .lamp-bulb { fill: #2b313a; }
[data-theme="dark"] .lamp-halo { opacity: 0; }

/* ---- The pull cord: the colour-mode switch ---- */
.lamp-cord {
  position: absolute;
  top: 112px;
  left: calc(50% + 38px);
  width: 34px;
  height: 104px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  /* The button box is wider than the cord so it stays easy to hit. */
}
.lamp-cord-line,
.lamp-cord-grip {
  position: absolute;
  left: 50%;
  background: #6b7280;
  transition: height .18s var(--ease), top .18s var(--ease);
}
.lamp-cord-line {
  top: 0;
  width: 2px;
  height: 58px;
  margin-left: -1px;
}
.lamp-cord-grip {
  top: 54px;
  width: 12px;
  height: 20px;
  margin-left: -6px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
/* Held down, the cord stretches; let go, it snaps back and the light flips. */
.lamp-cord:active .lamp-cord-line { height: 76px; }
.lamp-cord:active .lamp-cord-grip { top: 72px; }
.lamp-cord:focus-visible { outline: none; }
.lamp-cord:focus-visible .lamp-cord-grip {
  box-shadow: 0 0 0 4px var(--focus-ring);
  background: var(--ink);
}
.lamp-cord:hover .lamp-cord-grip { background: var(--ink); }

/* ---- The card ---- */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 56px 0 0;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: background .45s var(--ease), border-color .45s var(--ease);
}
/* The card's header is centred over a left-aligned form: the emblem and the
   greeting are the thing you land on, the fields are the thing you read. */
.auth-head {
  text-align: center;
  margin-bottom: 26px;
}
.auth-logo {
  display: inline-block;
  line-height: 0;
  border-radius: 50%;
}
.auth-logo:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}
/* The emblem carries fine lettering around its rim, so it needs real size to
   be legible at all — and a ring, since its own background is white and would
   otherwise float on the card with no edge. */
.auth-logo img {
  height: 76px;
  width: 76px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 18px;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  transition: border-color .45s var(--ease), filter .45s var(--ease);
}
.auth-card h1 {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  margin-bottom: 6px;
}
.auth-subtitle { margin: 0; }
.auth-card .alert { margin-bottom: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }

/* "Continue with Google" — outlined, so it sits beside the filled primary
   button without competing with it. */
.btn-oauth {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  padding: 13px 20px;
  font-size: .95rem;
}
.btn-oauth:hover {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn-oauth svg { flex: none; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--muted);
  font-size: .82rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Password field with the show/hide button tucked inside it. */
.field-with-action { position: relative; display: flex; }
.field-with-action input { flex: 1; padding-right: 46px; }
.field-action {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.field-action:hover { color: var(--ink); background: var(--bg-soft); }
.field-action:focus-visible {
  outline: none;
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field-action svg { width: 18px; height: 18px; }
/* One glyph at a time: the eye while hidden, the struck-through eye while shown. */
.field-action .icon-eye-off { display: none; }
.field-action[aria-pressed="true"] .icon-eye { display: none; }
.field-action[aria-pressed="true"] .icon-eye-off { display: block; }

.lamp-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  text-align: center;
}
.lamp-tip { margin: 0; font-size: .82rem; }

/* The one way off this page, so it should look pressable rather than read as
   fine print. Ghost weight on purpose: it must never compete with "Sign in".
   Built on .btn, so it inherits the pill shape, gap and lift on hover. */
.auth-back {
  padding: 9px 18px;
  font-size: .88rem;
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.auth-back:hover {
  color: var(--ink);
  background: var(--bg-soft);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.auth-back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.auth-back svg {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform .2s var(--ease);
}
/* The arrow leads the way out. */
.auth-back:hover svg { transform: translateX(-3px); }

/* Shorter viewports and phones: the same room, a smaller lamp, so the card
   still starts near the top of the screen. */
@media (max-height: 940px), (max-width: 560px) {
  .lamp-page { --lamp-drop: 118px; padding-bottom: 32px; }
  .lamp { transform: scale(.8); height: 157px; }
  .auth-card { margin-top: 40px; padding: 28px 24px; }
}
@media (max-width: 560px) {
  .lamp-page { padding-left: 16px; padding-right: 16px; }
  /* The emblem is proportionally larger on a narrow screen, so take it back
     a little and keep the whole form above the fold. */
  .auth-logo img { height: 64px; width: 64px; margin-bottom: 14px; }
  .auth-head { margin-bottom: 20px; }
}

/* ---------- Admin ---------- */
.admin-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.admin-tag {
  margin-left: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.admin-main { padding: 56px 24px; }
.stats-row { margin-bottom: 40px; }
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.admin-panel h3 { margin-bottom: 16px; }
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  font-size: .94rem;
}
.data-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.data-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: #cfd1d6;
  padding: 64px 0 32px;
}
.site-footer .brand,
.site-footer h4 { color: #fff; }
.site-footer .muted { color: #8d919a; }
.site-footer a { color: #cfd1d6; }
.site-footer a:hover { color: var(--accent); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand p { max-width: 40ch; margin-top: 12px; }

.site-footer .social-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.site-footer .social-links li {
  display: inline-flex;
  margin: 0;
}
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #cfd1d6;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.social-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
.social-icon svg { display: block; }

.site-footer h4 {
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.site-footer ul { display: flex; flex-direction: column; gap: 8px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--footer-line);
  font-size: .88rem;
}

/* ---------- Content cards (events / blog) ---------- */
.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--ease), border .2s, box-shadow .25s var(--ease);
}
.content-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.content-media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}
.content-media img,
.content-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.content-media.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), #fff);
}
.content-media.placeholder span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
}
.content-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; }
.content-body h3 { margin: 0; font-size: 1.2rem; }
.content-body h3 a { color: var(--ink); }
.content-body h3 a:hover { color: var(--accent); }
.content-body p { margin: 0; font-size: .96rem; }
.content-body .link-arrow { margin-top: auto; }
.content-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge-article { background: #eef4ff; color: #1d4ed8; border-color: #d6e2ff; }
.badge-press { background: #f3eeff; color: #6d28d9; border-color: #e3d8ff; }
.badge-announcement { background: var(--accent-soft); color: var(--accent-ink); border-color: #ffd5c4; }
.badge-upcoming { background: #ecfdf3; color: #036b39; border-color: #b7ebcb; }
.badge-past { background: var(--bg-soft); color: var(--muted); }
.badge-draft { background: #fff4e5; color: #92591a; border-color: #ffe2b8; }
.badge-running {
  background: #e7f9ee;
  color: #067647;
  border-color: #a6e9c2;
  gap: 6px;
}
.badge-running::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 0 rgba(18, 183, 106, .6);
  animation: badge-pulse 1.6s var(--ease) infinite;
}
@keyframes badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, .55); }
  70% { box-shadow: 0 0 0 6px rgba(18, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}

/* ---------- Article (detail) pages ---------- */
.article-page { padding-top: clamp(40px, 6vw, 72px); }
.article-narrow { max-width: 760px; }
.article-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 28px 0;
  border: 1px solid var(--line);
}
.article-content { font-size: 1.06rem; line-height: 1.75; }
.article-content p { margin: 0 0 1.1em; color: var(--ink-soft); }

/* ---------- Public gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery-item {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.gallery-item img,
.gallery-item video {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg-soft);
}
.gallery-embed {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--ink), #1c1f26);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #fff;
}
.gallery-play span {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.gallery-play small { opacity: .85; }
.gallery-item figcaption {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .9rem;
}
.gallery-item figcaption strong { font-size: .98rem; }
.gallery-item figcaption span { color: var(--muted); }
.gallery-tag {
  align-self: flex-start;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ---------- Gallery albums (grid of albums -> one album page) ---------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.album-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.album-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

/* The combined preview: first photo large, the next two stacked beside it. */
.album-collage {
  display: grid;
  gap: 3px;
  aspect-ratio: 4 / 3;
  background: var(--line);
}
.album-collage-1 { grid-template-columns: 1fr; }
.album-collage-2 { grid-template-columns: 2fr 1fr; }
.album-collage-3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.album-collage-3 .album-frame:first-child { grid-row: span 2; }
.album-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--bg-soft);
}
.album-frame img,
.album-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease);
}
.album-card:hover .album-frame img { transform: scale(1.04); }
.album-frame-video {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ink), #1c1f26);
}
.album-frame-badge {
  position: absolute;
  top: 8px; left: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(15, 17, 21, .7);
  color: #fff;
  font-size: .7rem;
  display: flex; align-items: center; justify-content: center;
}
/* "+4" over the last preview when the album holds more than we show. */
.album-frame-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 17, 21, .55);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .02em;
}
.album-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.album-body h3 { font-size: 1.1rem; margin: 0; }
.album-body p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
}
.album-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.album-count {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  color: var(--muted);
}
.album-body .link-arrow { margin-top: auto; }
.album-head { margin: 16px 0 28px; }
.album-head .content-meta { margin-top: 12px; }

/* Photos on an album page open in the lightbox. */
.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(10, 11, 14, .92);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: var(--radius);
}
.lightbox-caption {
  position: absolute;
  left: 0; right: 0; bottom: 24px;
  text-align: center;
  color: rgba(255, 255, 255, .82);
  font-size: .9rem;
  padding: 0 60px;
}
.lightbox-btn {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, .2); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Admin: media manager on the album form ---------- */
.media-manager {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.media-tile {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
}
.media-tile img,
.media-tile video,
.media-tile-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.media-tile-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ink), #1c1f26);
}
.media-cover-tag {
  position: absolute;
  top: 8px; right: 8px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
}
.media-tile-remove {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: .82rem;
  font-weight: 500;
  border-top: 1px solid var(--line);
}
.media-tile-remove input { width: 16px; height: 16px; accent-color: var(--danger-text); }
/* A tile marked for removal dims, so the pending delete is obvious on save. */
.media-tile:has(input:checked) { border-color: var(--danger-line); }
.media-tile:has(input:checked) img,
.media-tile:has(input:checked) video,
.media-tile:has(input:checked) .media-tile-placeholder { opacity: .35; }

/* ---------- Admin nav + lists + forms ---------- */
.admin-nav {
  display: flex;
  gap: 22px;
  font-size: .95rem;
  font-weight: 500;
}
.admin-nav a { color: var(--ink-soft); }
.admin-nav a.active, .admin-nav a:hover { color: var(--ink); }

/* ---------- Avatar ---------- */
.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: block;
}
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .02em;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-color: transparent;
  user-select: none;
}
.avatar-lg { width: 46px; height: 46px; }
.avatar-lg.avatar-initials { font-size: 1rem; }
.avatar-xl { width: 88px; height: 88px; }
.avatar-xl.avatar-initials { font-size: 1.9rem; }

/* ---------- Account menu (admin header) ---------- */
.account-menu { position: relative; }
.account-trigger {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.account-trigger:hover { transform: translateY(-1px); }
.account-trigger:hover .avatar,
.account-trigger[aria-expanded="true"] .avatar { border-color: var(--accent); }
.account-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.account-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  min-width: 232px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.account-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.account-panel-id {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.account-panel-id strong { font-size: .95rem; }
.account-panel-id span { font-size: .8rem; }
/* Long names and addresses truncate rather than stretching the panel. */
.account-panel-id strong,
.account-panel-id span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-panel form { margin: 0; }
.account-panel-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: .92rem;
  font-weight: 500;
  text-align: left;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.account-panel-item:hover,
.account-panel-item:focus-visible {
  background: var(--bg-soft);
  color: var(--ink);
  outline: none;
}
.account-panel-signout {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--danger-text);
}
.account-panel-signout:hover,
.account-panel-signout:focus-visible { color: var(--danger-text); }

.page-flash { padding-top: 20px; }

/* ---------- Account pages ---------- */
.account-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  font-size: .92rem;
  font-weight: 500;
}
.account-tabs a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
}
.account-tabs a:hover { color: var(--ink); border-color: var(--line-strong); }
.account-tabs a.active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-ink);
}
.avatar-field {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.avatar-field-controls {
  display: grid;
  gap: 10px;
  min-width: 240px;
  flex: 1;
}
.admin-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.admin-list-head h1 { margin: 0; font-size: 1.9rem; }
.manage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform .2s var(--ease), border .2s, box-shadow .2s var(--ease);
}
.manage-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.manage-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.manage-card > span:nth-of-type(1) { color: var(--muted); }
.manage-card .link-arrow { margin-top: 10px; font-size: .9rem; }
.form-panel { max-width: 760px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.form-row input[type="file"] { font-size: .92rem; color: var(--muted); }
.form-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.form-preview img,
.form-preview video {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.form-preview .muted { font-size: .82rem; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: .95rem;
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.row-actions form { display: inline; margin: 0; }
.link-danger {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #c0392b;
  cursor: pointer;
}
.link-danger:hover { text-decoration: underline; }

/* ---------- Rich admin tables ---------- */
.data-table-rich { border-collapse: separate; border-spacing: 0; }
.data-table-rich thead th {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  white-space: nowrap;
}
.data-table-rich thead th:first-child { border-top-left-radius: var(--radius-sm); }
.data-table-rich thead th:last-child { border-top-right-radius: var(--radius-sm); }
.data-table-rich td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.data-table-rich tbody tr { transition: background .15s var(--ease); }
.data-table-rich tbody tr:hover { background: var(--bg-soft); }
.data-table-rich tbody tr:last-child td { border-bottom: none; }
.data-table-rich .nowrap { white-space: nowrap; color: var(--muted); }
.table-title { font-weight: 600; color: var(--ink); }
a.table-title:hover { color: var(--accent); }

.col-thumb { width: 56px; padding-right: 0 !important; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.data-table-rich thead .col-actions { text-align: right; }

.table-thumb {
  width: 48px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  display: block;
}
.table-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), #fff);
}

/* ---------- Row action icon buttons ---------- */
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.table-actions form { display: inline-flex; margin: 0; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease),
    border-color .15s var(--ease), transform .12s var(--ease);
}
.icon-btn:hover {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.icon-btn:active { transform: translateY(0); }
.icon-btn.danger:hover {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-line);
}
.icon-btn svg { display: block; }
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.admin-gallery-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--surface);
}
.admin-gallery-item img,
.admin-gallery-item video,
.admin-gallery-item .content-media.placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.media-type-tag {
  position: absolute;
  top: 8px; left: 8px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  background: rgba(15,17,21,.7);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
}
.admin-gallery-item figcaption {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .album-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .slider { height: clamp(430px, 62vh, 560px); }
  .slider-arrow { width: 44px; height: 44px; font-size: 1.4rem; }
  .slider-arrow.prev { left: 12px; }
  .slider-arrow.next { right: 12px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-card { flex-direction: column; text-align: center; padding: 40px 28px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav, .nav-actions { display: none; }

  /* The colour-mode button stays reachable without opening the menu. */
  .nav-container .theme-toggle { margin-left: auto; }

  /* Keep brand + toggles together on the top row when the menu expands. */
  .nav-container .brand { order: 0; }
  .nav-container .theme-toggle { order: 1; }
  .nav-container .nav-toggle { order: 2; }
  .nav-container .primary-nav { order: 3; }
  .nav-container .nav-actions { order: 4; }

  /* Collapsed menu: brand + toggle on row 1, links and actions stack below. */
  .site-header.nav-open .nav-container { flex-wrap: wrap; }
  .site-header.nav-open .primary-nav,
  .site-header.nav-open .nav-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 14px;
  }
  .site-header.nav-open .primary-nav {
    padding-top: 18px;
    margin-top: 6px;
    border-top: 1px solid var(--line);
  }
  .site-header.nav-open .primary-nav a { padding: 6px 0; }
  .site-header.nav-open .primary-nav a.active::after { display: none; }
  .site-header.nav-open .nav-actions { padding-bottom: 6px; }
  .site-header.nav-open .nav-actions .btn { width: 100%; }
  .site-header.nav-open .nav-actions .logout-form { width: 100%; }

  /* Inside the stacked mobile menu the account panel flows with the list
     instead of floating over it, so it can't overlay the links below. */
  .site-header.nav-open .account-menu { width: 100%; }
  .site-header.nav-open .account-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    line-height: normal;
  }
  .site-header.nav-open .account-trigger::after {
    content: attr(data-label);
    font-size: .95rem;
    font-weight: 500;
    color: var(--ink-soft);
  }
  .site-header.nav-open .account-panel {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 10px;
    box-shadow: none;
  }

  /* Admin chrome stacks on tablets/phones. */
  .admin-nav { order: 3; width: 100%; gap: 18px; flex-wrap: wrap; }
  .admin-list-head { flex-direction: column; align-items: flex-start; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .album-grid { grid-template-columns: 1fr; }
  .admin-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox { padding: 20px 12px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .process { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .contact-form-wrap { padding: 24px; }
  .contact-info { padding-right: 0; }
  .hero-meta { gap: 20px; }

  /* Slider: hide arrows on phones — swipe + dots remain. */
  .slider { height: clamp(400px, 68vh, 480px); }
  .slider-arrow { display: none; }
  .slide-content { padding-top: 16px; }
  .slide-content .lead { margin: 12px 0 20px; }

  /* Service / value cards a touch tighter on phones. */
  .service-card, .value-card, .testimonial { padding: 24px; }

  /* Admin header stacks instead of overflowing. */
  .admin-header .nav-container { flex-wrap: wrap; gap: 12px; }
  .admin-header .nav-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .avatar-field { gap: 14px; }
  .admin-main { padding: 40px 18px; }
  .data-table { min-width: 520px; }
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 44px;
  padding: 8px;
  border-radius: 999px;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .92rem;
  line-height: 1;
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease),
    border-color .2s var(--ease), transform .15s var(--ease),
    box-shadow .2s var(--ease);
}
.page-link.page-nav { gap: 4px; color: var(--accent-ink); }
.page-link.page-edge { font-weight: 700; }
a.page-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
a.page-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.page-link.is-current {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-color: transparent;
  color: #fff;
  cursor: default;
  box-shadow: 0 6px 16px rgba(255, 90, 31, .32);
}
.page-link.is-disabled {
  opacity: .45;
  background: var(--bg-soft);
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
  box-shadow: none;
}
.page-ellipsis {
  display: inline-flex;
  align-items: flex-end;
  height: 42px;
  padding: 0 4px 6px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1px;
}

/* Pagination sits flush inside admin panels */
.admin-panel .pagination { margin-top: 24px; }

/* ---------- Page-size selector ---------- */
.list-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}
.admin-list-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-size {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
/* Custom chevron — hides the native one for a consistent cross-browser look. */
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.page-size-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 34px 9px 16px;
  cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.page-size-select:hover { border-color: var(--accent); }
.page-size-select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.page-size .btn { padding: 9px 16px; }

/* ---------- Donations ---------- */
.donate-form .donate-amount-field {
  border: 0;
  padding: 0;
  margin: 0 0 4px;
}
.donate-amount-field legend {
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
  padding: 0;
  margin-bottom: 10px;
}
.donate-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.amount-chip {
  flex: 1 1 auto;
  min-width: 84px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease),
    color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
.amount-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.amount-chip.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 90, 31, .3);
}
.amount-input-row { margin-bottom: 6px; }
.donate-secure-note {
  margin-top: 14px;
  font-size: .85rem;
  text-align: center;
}
.donate-form .alert { margin-bottom: 16px; }

/* Donation admin stat cards */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* Thank-you receipt */
.donate-receipt {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow-md);
}
.donate-receipt-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 2rem;
  color: #fff;
}
.donate-receipt-icon.is-paid { background: linear-gradient(135deg, #21a366, #36c98a); }
.donate-receipt-icon.is-pending { background: linear-gradient(135deg, var(--grad-b), var(--grad-c)); }
.donate-receipt h1 { margin: 0 0 10px; }
.donate-receipt-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  text-align: left;
  margin: 28px 0;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.donate-receipt-meta dt {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.donate-receipt-meta dd { margin: 0; font-weight: 600; }
.donate-receipt-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
  .donate-receipt-meta { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Dark mode ----------
   `data-theme` is written on <html> by partials/theme-init.ejs before first
   paint, so switching modes never flashes the wrong palette. */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1116;
  --bg-soft: #151920;
  --bg-alt: #12161c;
  --surface: #171c24;
  --field-bg: #12161c;
  --header-bg: rgba(14, 17, 22, 0.82);
  --ink: #f1f3f6;
  --ink-strong: #ffffff;
  --on-ink: #0e1116;
  --ink-soft: #d2d7de;
  --muted: #98a1ae;
  --line: #262c36;
  --line-strong: #38404d;
  --focus-ring: rgba(241, 243, 246, .12);
  --accent: #ff6a33;
  --accent-soft: #3a2018;
  --accent-ink: #ffb694;
  --cta-a: #171c24;
  --cta-b: #10141a;
  --footer-bg: #0a0d11;
  --footer-line: #1e242d;
  --ok-bg: #0f2a1d;
  --ok-ink: #6ee7a8;
  --ok-line: #1d4635;
  --danger-bg: #2c1414;
  --danger-ink: #ffa9a2;
  --danger-line: #4d2320;
  --danger-text: #ff8b82;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40), 0 1px 1px rgba(0, 0, 0, .30);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .30);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, .55), 0 8px 16px rgba(0, 0, 0, .35);
}
[data-theme="dark"] .badge-article { background: #14213f; color: #9dbcff; border-color: #22315c; }
[data-theme="dark"] .badge-press { background: #241a3d; color: #c4b0ff; border-color: #33265a; }
[data-theme="dark"] .badge-upcoming { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
[data-theme="dark"] .badge-draft { background: #33240f; color: #f0c07a; border-color: #4a361a; }
[data-theme="dark"] .badge-announcement { border-color: #5a3223; }
[data-theme="dark"] .badge-running { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
[data-theme="dark"] .site-footer { color: var(--ink-soft); }
[data-theme="dark"] .site-footer .brand,
[data-theme="dark"] .site-footer h4 { color: var(--ink); }
[data-theme="dark"] .site-footer .muted { color: var(--muted); }
[data-theme="dark"] .site-footer a { color: var(--ink-soft); }
/* Photography is shot for a light page; take a little glare off it. */
[data-theme="dark"] .gallery-item img,
[data-theme="dark"] .album-frame img,
[data-theme="dark"] .content-card img { filter: brightness(.88); }

/* ---------- Colour-mode toggle ---------- */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.theme-toggle:hover {
  background: var(--bg-soft);
  border-color: var(--ink);
}
.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: none;
}
/* One glyph for the mode you are in; `data-theme` is set before first paint. */
[data-theme="light"] .theme-toggle .theme-icon-light,
[data-theme="dark"] .theme-toggle .theme-icon-dark { display: block; }
/* No JS: no `data-theme` is ever written, so fall back to the sun. */
html:not([data-theme]) .theme-toggle .theme-icon-light { display: block; }

/* Hover/focus tooltip — the label the button no longer shows inline. */
.theme-toggle::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--on-ink);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s var(--ease);
  pointer-events: none;
}
.theme-toggle:hover::after,
.theme-toggle:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
/* The button sits at the right edge, so anchor the tooltip there rather than
   centring it — centred, it would hang off the viewport on narrow screens. */
.nav-container .theme-toggle::after,
.theme-toggle.is-floating::after {
  left: auto;
  right: 0;
  transform: none;
}

.theme-toggle.is-floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 60;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
