:root {
  --paper: #f6ecd7;
  --paper-border: rgba(130, 91, 53, 0.18);
  --ink: #2b1b11;
  --ink-soft: rgba(43, 27, 17, 0.74);
  --gold: #d9b67d;
  --shell: #090706;
  --server-shell-bg-glow: rgba(124, 84, 42, 0.16);
  --server-shell-bg-top: #0d0a09;
  --server-shell-bg-bottom: #080605;
  --server-link: #31516a;
  --atlas-fallback-bg: rgba(27, 17, 11, 0.78);
  --atlas-fallback-border: rgba(228, 194, 138, 0.22);
  --atlas-fallback-text: rgba(243, 228, 197, 0.92);
  --story-backlink-text: rgba(243, 228, 197, 0.86);
}

:root[data-theme='light'] {
  --server-shell-bg-glow: rgba(206, 168, 113, 0.2);
  --server-shell-bg-top: #f4ecdd;
  --server-shell-bg-bottom: #e1d1b8;
  --server-link: #486980;
  --atlas-fallback-bg: rgba(247, 240, 228, 0.88);
  --atlas-fallback-border: rgba(141, 107, 72, 0.18);
  --atlas-fallback-text: rgba(70, 48, 30, 0.88);
  --story-backlink-text: rgba(76, 53, 32, 0.86);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 8%, var(--server-shell-bg-glow), transparent 30%),
    linear-gradient(180deg, var(--server-shell-bg-top) 0%, var(--server-shell-bg-bottom) 100%);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}

body.story-view {
  overflow-y: auto;
}

body.atlas-view {
  overflow: hidden;
}

a {
  color: var(--server-link);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.atlas-main {
  position: relative;
  min-height: 100vh;
}

.atlas-island {
  position: relative;
  min-height: 100vh;
}

.atlas-fallback {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 4;
  max-width: 520px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(228, 194, 138, 0.22);
  border-color: var(--atlas-fallback-border);
  background: var(--atlas-fallback-bg);
  color: var(--atlas-fallback-text);
  backdrop-filter: blur(12px);
}

.story-main {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.story-backlink {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--story-backlink-text);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-backlink__sigil {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, rgba(236, 198, 141, 0.42), rgba(107, 69, 39, 0.18));
  color: rgba(255, 233, 193, 0.96);
  box-shadow: 0 0 18px rgba(220, 176, 104, 0.30);
}

.story-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 28px;
  align-items: start;
}

.story-article {
  border-radius: 28px;
  padding: 28px;
  border: 1px solid var(--paper-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(246, 236, 215, 0.98), rgba(235, 221, 192, 0.94));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.story-header {
  margin-bottom: 26px;
}

.story-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  color: rgba(60, 38, 22, 0.7);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-kicker__dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(116, 78, 45, 0.32);
}

.story-title {
  margin: 0 0 14px;
  color: rgba(28, 16, 10, 0.98);
  font-size: clamp(38px, 5vw, 62px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.story-excerpt {
  margin: 0;
  max-width: 62ch;
  color: rgba(55, 35, 20, 0.78);
  font-size: 18px;
  line-height: 1.62;
}

.story-hero {
  margin: 22px 0 28px;
}

.story-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(50, 35, 20, 0.16);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.16);
}

.story-block {
  margin: 0 0 24px;
}

.story-block--heading h2 {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(60, 38, 22, 0.82);
}

.story-block--paragraph .story-paragraph,
.story-block--paragraph .story-paragraph p {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.72;
  color: rgba(40, 25, 15, 0.88);
}

.story-block--paragraph .story-paragraph p:last-child {
  margin-bottom: 0;
}

.story-block--quote blockquote {
  margin: 0;
  padding: 16px 18px;
  border-left: 3px solid rgba(120, 80, 48, 0.35);
  border-radius: 18px;
  border: 1px solid rgba(92, 63, 39, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.08));
}

.story-block--quote p {
  margin: 0;
  font-size: 18px;
  line-height: 1.64;
}

.story-block--quote cite {
  display: block;
  margin-top: 10px;
  color: rgba(55, 35, 20, 0.72);
  font-style: normal;
}

.story-block--image figure {
  margin: 0;
}

.story-block--image img {
  display: block;
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(50, 35, 20, 0.16);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.14);
}

.story-block--image figcaption {
  margin-top: 10px;
  color: rgba(55, 35, 20, 0.74);
  font-size: 13px;
  line-height: 1.45;
  font-style: italic;
}

.story-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.story-card {
  border-radius: 24px;
  padding: 20px 20px 18px;
  border: 1px solid rgba(228, 194, 138, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 246, 228, 0.08), rgba(255, 246, 228, 0.03)),
    rgba(26, 17, 11, 0.72);
  color: rgba(243, 228, 197, 0.92);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.story-card__eyebrow {
  margin-bottom: 12px;
  color: rgba(232, 205, 155, 0.78);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-meta-grid {
  display: grid;
  gap: 14px;
}

.story-meta-item dt {
  margin: 0 0 4px;
  color: rgba(232, 205, 155, 0.78);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-meta-item dd {
  margin: 0;
  color: rgba(243, 228, 197, 0.94);
  font-size: 15px;
  line-height: 1.45;
}

.story-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.story-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(228, 194, 138, 0.18);
  background: rgba(255, 246, 228, 0.06);
  color: rgba(243, 228, 197, 0.92);
  font-size: 12px;
}

.story-author {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.story-author__avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 246, 228, 0.08);
  border: 1px solid rgba(228, 194, 138, 0.18);
  color: rgba(243, 228, 197, 0.96);
  font-size: 18px;
  overflow: hidden;
}

.story-author__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-author__name {
  margin: 0;
  font-size: 18px;
  color: rgba(243, 228, 197, 0.96);
}

.story-author__title,
.story-author__bio {
  margin: 6px 0 0;
  color: rgba(243, 228, 197, 0.76);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .story-shell {
    grid-template-columns: 1fr;
  }

  .story-main {
    width: min(100vw - 24px, 900px);
    padding-top: 18px;
  }

  .story-article {
    padding: 22px;
  }
}

/* ── My Globe ──────────────────────────────────────────────────────── */

/* Hide the editorial atlas chrome when in my-globe mode, but keep reader/logbook mountpoints
   visible — they are position:fixed and need to render when a pin is tapped. */
.my-view .panel,
.my-view .panel-blur-edge,
.my-view .fog,
.my-view .vignette {
  display: none;
}

/* Reader sits at z-index 4; lift it above the my-overlay (z-index 10) when active. */
.my-view .reader {
  z-index: 12;
}

/* Step the my-overlay out of the way while a story is being read. */
body.reading .my-overlay {
  opacity: 0;
  pointer-events: none;
}

.my-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.my-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  pointer-events: auto;
  background: linear-gradient(to bottom, rgba(4, 2, 1, 0.72) 0%, transparent 100%);
}

.my-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 248, 235, 1);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.my-brand i {
  font-style: italic;
  color: var(--gold);
}

.my-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(228, 194, 138, 0.38);
  object-fit: cover;
}

.my-name {
  font-size: 14px;
  color: rgba(255, 248, 235, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.my-add-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(228, 194, 138, 0.28);
  color: rgba(255, 248, 235, 0.80);
  text-decoration: none;
  pointer-events: auto;
  transition: background 0.15s ease, color 0.15s ease;
}

.my-add-btn:hover {
  background: rgba(255, 246, 228, 0.12);
  color: rgba(255, 248, 235, 1);
}

.my-signout {
  background: none;
  border: 1px solid rgba(255, 246, 228, 0.3);
  border-radius: 999px;
  color: rgba(255, 248, 235, 0.78);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 13px;
  cursor: pointer;
  pointer-events: auto;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.my-signout:hover {
  background: rgba(255, 246, 228, 0.12);
  color: rgba(255, 248, 235, 1);
  border-color: rgba(255, 246, 228, 0.5);
}

.my-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px 80px;
  pointer-events: none;
}

.my-tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 700;
  color: rgba(255, 250, 240, 1);
  text-align: center;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 480px;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.7),
    0 4px 24px rgba(0, 0, 0, 0.5);
}

.my-subtext {
  font-size: 15px;
  color: rgba(255, 250, 240, 0.9);
  text-align: center;
  line-height: 1.6;
  margin: 0 0 36px;
  max-width: 320px;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.7),
    0 4px 20px rgba(0, 0, 0, 0.5);
}

.my-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(220, 186, 128, 0.94), rgba(196, 154, 80, 0.92));
  border: 1px solid rgba(255, 232, 180, 0.30);
  color: rgba(26, 14, 4, 0.96);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  box-shadow:
    0 8px 28px rgba(217, 182, 125, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.my-cta:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 36px rgba(217, 182, 125, 0.30),
    0 4px 12px rgba(0, 0, 0, 0.45);
  color: rgba(26, 14, 4, 0.96);
}

.my-cta:active {
  transform: translateY(0);
}

/* ── Unpoly modal layer (Unpoly 3.x custom elements) ─────────────── */

@keyframes modal-fade-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

@keyframes capture-sheet-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

up-modal up-modal-box {
  background: #0d0a09;
  border: 1px solid rgba(228, 194, 138, 0.12);
  border-radius: 20px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(228, 194, 138, 0.06);
  animation: modal-fade-in 0.18s ease both;
}

up-modal up-modal-backdrop {
  background: rgba(4, 2, 1, 0.72);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.15s ease both;
}

/* ── Capture sheet (bottom-sheet variant) ────────────────────────── */

up-modal.capture-sheet up-modal-viewport {
  align-items: flex-end;
  padding-inline: 0;
  padding-block-end: 0;
}

up-modal.capture-sheet up-modal-box {
  background: #faf5ec;
  border: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -6px 48px rgba(50, 30, 8, 0.16), 0 -1px 4px rgba(50, 30, 8, 0.08);
  width: min(640px, 100vw);
  max-width: none;
  max-height: 92vh;
  overflow-y: auto;
  padding: 0;
  animation: capture-sheet-in 0.38s cubic-bezier(0.32, 0.72, 0, 1) both;
}

up-modal.capture-sheet up-modal-backdrop {
  background: rgba(20, 12, 4, 0.50);
  backdrop-filter: blur(8px);
  animation: modal-fade-in 0.22s ease both;
}

@media (max-width: 640px) {
  up-modal.capture-sheet up-modal-box {
    border-radius: 0;
    max-height: 100dvh;
    width: 100vw;
  }
}

/* ── Capture form (light mode) ───────────────────────────────────── */

.cap-main {
  background: transparent;
}

.cap-form {
  display: flex;
  flex-direction: column;
}

/* Drag handle bar at top of sheet */
.cap-handle-bar {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(140, 100, 50, 0.20);
  margin: 14px auto 0;
  flex-shrink: 0;
}

/* ── Photo zone ───────────────── */

.cap-photo-zone {
  position: relative;
  margin: 16px 20px 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(190, 155, 100, 0.08);
  border: 1.5px dashed rgba(160, 110, 52, 0.22);
  cursor: pointer;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s, background 0.18s;
}

.cap-photo-zone:hover {
  border-color: rgba(160, 110, 52, 0.38);
  background: rgba(190, 155, 100, 0.12);
}

.cap-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.cap-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  pointer-events: none;
}

.cap-photo-icon {
  color: rgba(130, 90, 44, 0.45);
}

.cap-photo-label {
  font-size: 15px;
  font-weight: 500;
  color: rgba(60, 38, 14, 0.65);
}

.cap-photo-sub {
  font-size: 12px;
  color: rgba(100, 70, 30, 0.45);
}

.cap-photo-preview {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 14px;
  pointer-events: none;
}

.cap-photo-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(250, 245, 236, 0.92);
  border: 1px solid rgba(160, 110, 52, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(60, 38, 14, 0.70);
  box-shadow: 0 2px 8px rgba(40, 20, 4, 0.12);
  transition: background 0.14s;
}

.cap-photo-remove:hover {
  background: rgba(250, 245, 236, 1);
}

/* ── Fields ───────────────────── */

.cap-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 28px;
}

.cap-title-input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid rgba(160, 110, 52, 0.18);
  background: transparent;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #2c1a0a;
  outline: none;
  padding: 4px 0 10px;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.cap-title-input::placeholder {
  color: rgba(100, 65, 25, 0.35);
  font-weight: 400;
}

.cap-title-input:focus {
  border-bottom-color: rgba(160, 110, 52, 0.45);
}

/* Meta chips row (date + location) */
.cap-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cap-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(190, 155, 100, 0.09);
  border: 1px solid rgba(160, 110, 52, 0.16);
  color: rgba(80, 52, 18, 0.70);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}

.cap-meta-chip:hover {
  background: rgba(190, 155, 100, 0.15);
  border-color: rgba(160, 110, 52, 0.26);
}

.cap-meta-chip svg {
  flex-shrink: 0;
  color: rgba(130, 88, 30, 0.60);
}

.cap-date-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: rgba(60, 38, 14, 0.82);
  outline: none;
  cursor: pointer;
  min-width: 0;
  -webkit-appearance: none;
}

.cap-date-input::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.cap-loc-chip[data-state="detected"] {
  background: rgba(160, 200, 140, 0.12);
  border-color: rgba(100, 160, 80, 0.22);
  color: rgba(40, 80, 30, 0.80);
}

.cap-loc-chip[data-state="detecting"] {
  opacity: 0.7;
}

.cap-loc-text {
  font-size: 13px;
  color: inherit;
  font-family: Inter, 'Noto Color Emoji', sans-serif;
}

/* Manual coordinate fallback */
.cap-coords {
  display: flex;
  gap: 10px;
}

.cap-coord-input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(160, 110, 52, 0.18);
  background: rgba(255, 248, 236, 0.70);
  color: #2c1a0a;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.cap-coord-input::placeholder {
  color: rgba(100, 65, 25, 0.38);
}

.cap-coord-input:focus {
  border-color: rgba(160, 110, 52, 0.42);
}

.cap-notes {
  width: 100%;
  border: 1px solid rgba(160, 110, 52, 0.16);
  border-radius: 12px;
  background: rgba(255, 248, 236, 0.50);
  color: #2c1a0a;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  padding: 11px 14px;
  outline: none;
  resize: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
}

.cap-notes::placeholder {
  color: rgba(100, 65, 25, 0.38);
}

.cap-notes:focus {
  border-color: rgba(160, 110, 52, 0.36);
  background: rgba(255, 248, 236, 0.75);
}

.cap-error {
  font-size: 13px;
  color: #b03a2e;
  min-height: 18px;
}

.cap-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 4px;
}

.cap-save-btn {
  padding: 12px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c4923a, #a87228);
  border: 1px solid rgba(220, 175, 90, 0.30);
  color: #fff8ee;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(180, 130, 40, 0.22), 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}

.cap-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(180, 130, 40, 0.28), 0 2px 6px rgba(0, 0, 0, 0.14);
}

.cap-save-btn:active {
  transform: translateY(0);
}

.cap-dismiss-link {
  color: rgba(80, 52, 18, 0.50);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

.cap-dismiss-link:hover {
  color: rgba(80, 52, 18, 0.80);
}

@media (max-width: 480px) {
  .cap-coords { flex-direction: column; }
}

/* ── Static page overlay ─────────────────────────────────────── */

@keyframes static-page-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1);     }
}

up-modal.static-page up-modal-viewport {
  align-items: center;
  padding: 24px;
}

up-modal.static-page up-modal-box {
  background: #faf5ec;
  border: none;
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.28);
  width: min(740px, 100%);
  max-width: none;
  max-height: 88vh;
  overflow: hidden auto;
  padding: 0;
  animation: static-page-in 0.22s ease both;
}

up-modal.static-page up-modal-backdrop {
  background: rgba(4, 2, 1, 0.52);
  backdrop-filter: blur(10px);
  animation: modal-fade-in 0.2s ease both;
}

@media (max-width: 640px) {
  up-modal.static-page up-modal-viewport {
    align-items: flex-end;
    padding: 0;
  }
  up-modal.static-page up-modal-box {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 20px 20px 0 0;
  }
}

/* ── Static page content ─────────────────────────────────────── */

.sp-main {
  position: relative;
  background: #faf5ec;
  color: var(--ink);
  min-height: 100%;
}

.sp-close {
  position: sticky;
  top: 0;
  float: right;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 16px 16px -36px auto;
  border-radius: 50%;
  background: rgba(43, 27, 17, 0.07);
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  z-index: 1;
}

.sp-close:hover {
  background: rgba(43, 27, 17, 0.13);
  color: var(--ink);
}

.sp-hero {
  width: 100%;
  position: relative;
}

.sp-hero::after {
  content: '';
  display: block;
  height: 28px;
  background: linear-gradient(to bottom, transparent, #faf5ec);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.sp-hero img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.sp-hero--small  img { height: clamp(140px, 22vw, 240px); }
.sp-hero--medium img { height: clamp(180px, 28vw, 320px); }
.sp-hero--large  img { height: clamp(220px, 36vw, 420px); }

.sp-body {
  padding: 36px 48px 64px;
}

@media (max-width: 640px) {
  .sp-body { padding: 28px 24px 52px; }
}

.sp-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(34px, 9vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 20px;
}

.sp-block + .sp-block { margin-top: 24px; }

/* prose */
.sp-prose { line-height: 1.75; font-size: 16px; color: var(--ink); }
.sp-prose h2 { font-family: 'Caveat', cursive; font-size: clamp(22px, 5vw, 28px); font-weight: 600; margin: 28px 0 8px; color: var(--ink); }
.sp-prose h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: var(--ink); }
.sp-prose p  { margin: 0 0 14px; }
.sp-prose ul, .sp-prose ol { margin: 0 0 14px; padding-left: 22px; }
.sp-prose li { margin-bottom: 4px; }
.sp-prose a  { color: var(--server-link); text-decoration: underline; text-underline-offset: 2px; }
.sp-prose blockquote { border-left: 3px solid var(--gold); margin: 0 0 14px 0; padding: 4px 0 4px 16px; color: var(--ink-soft); font-style: italic; }
.sp-prose hr { border: none; border-top: 1px solid rgba(100, 80, 60, 0.15); margin: 28px 0; }

/* pull quote */
.sp-quote blockquote {
  border-left: 3px solid var(--gold);
  margin: 0;
  padding: 8px 0 8px 20px;
}
.sp-quote blockquote p {
  font-family: 'Playfair Display', serif;
  font-size: clamp(17px, 3vw, 21px);
  font-style: italic;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.5;
}
.sp-quote blockquote cite {
  font-size: 13px;
  color: var(--ink-soft);
  font-style: normal;
}

/* image */
.sp-figure figure { margin: 0; }
.sp-figure img { width: 100%; border-radius: 10px; display: block; }
.sp-figure figcaption {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
  text-align: center;
}

/* callout */
.sp-callout {
  background: #f0e6d0;
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
}
.sp-callout__title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(100, 72, 30, 0.8);
  margin: 0 0 8px;
}
.sp-callout__body { font-size: 15px; line-height: 1.65; color: var(--ink); }
.sp-callout__body h2, .sp-callout__body h3 { font-family: 'Caveat', cursive; font-weight: 600; margin: 0 0 6px; }
.sp-callout__body p { margin: 0 0 8px; }
.sp-callout__body p:last-child { margin: 0; }
.sp-callout__body a { color: var(--server-link); }

/* two columns */
.sp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.sp-two-col__col { font-size: 15px; line-height: 1.7; color: var(--ink); }
.sp-two-col__col h2 { font-family: 'Caveat', cursive; font-size: clamp(20px, 4vw, 24px); font-weight: 600; margin: 0 0 8px; }
.sp-two-col__col h3 { font-family: 'Caveat', cursive; font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.sp-two-col__col p  { margin: 0 0 10px; }
.sp-two-col__col a  { color: var(--server-link); }

@media (max-width: 560px) {
  .sp-two-col { grid-template-columns: 1fr; gap: 20px; }
}

/* divider */
.sp-divider {
  border: none;
  border-top: 1px solid rgba(100, 80, 60, 0.15);
  margin: 4px 0;
}
