@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/SourceSerif4-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/SourceSerif4-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/Inter-normal.woff2") format("woff2");
}

/* qartadas.com — línea del tiempo de Cartagena */

:root {
  --color-bg: #faf6ee;
  --color-bg-elevated: #f5efe3;
  --color-surface: #fffdf8;
  --color-text: #2c2416;
  --color-text-muted: #5c5346;
  --color-terracotta: #b5532f;
  --color-tyrian: #6d1f3a;
  --color-ochre: #c79a3b;
  --color-olive: #6b7a3a;
  --color-sage: #8a9178;
  --color-sea: var(--color-terracotta);
  --color-sea-mid: var(--color-tyrian);
  --color-sea-light: var(--color-ochre);
  --color-border: rgba(44, 36, 22, 0.14);
  --color-axis: rgba(181, 83, 47, 0.28);
  --color-header-bg: rgba(250, 246, 238, 0.96);
  --color-progress: var(--color-terracotta);
  --color-focus: var(--color-terracotta);
  --color-shadow: rgba(44, 36, 22, 0.1);
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 3.25rem;
  --progress-h: 3px;
  --name-tape-h: 0px;
  --content-max: 1280px;
  --radius: 0.4rem;
  --space: 1.25rem;
  --era-mastia: #6b7a3a;
  --era-qart: #6d1f3a;
  --era-romana: #8b6b4a;
  --era-bizancio: #7a5548;
  --era-andalus: #c79a3b;
  --era-arsenal: #5c4033;
  --era-moderna: #b5532f;
  --era-hoy: #6b7a3a;
  color-scheme: light;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--progress-h) + var(--name-tape-h) + 0.5rem);
}

html.js.name-tape-active {
  --name-tape-h: 36px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-sea-mid);
}

a:focus-visible,
button:focus-visible,
.site-nav a:focus-visible,
.lang-switch__btn:focus-visible,
.hero__scroll:focus-visible,
.atlas__epoch:focus-visible,
.atlas__panel-close:focus-visible,
.more-link:focus-visible,
.back-top:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* —— Progress —— */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--progress-h);
  z-index: 100;
  background: transparent;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--color-progress);
  transition: width 0.1s linear;
}

@media (prefers-reduced-motion: reduce) {
  .progress__bar {
    transition: none;
  }
}

/* —— Header / nav —— */
.site-header {
  position: sticky;
  top: var(--progress-h);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  min-height: var(--header-h);
  padding: 0.5rem 1rem;
  background: var(--color-header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--color-terracotta) 55%, transparent);
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: calc(100% - 5.5rem);
  flex: 1 1 auto;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0.25rem;
  border-radius: 0.3rem;
  border: 2px solid transparent;
  text-decoration: none;
  line-height: 0;
  opacity: 0.72;
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.lang-switch__btn:hover {
  opacity: 1;
}

.lang-switch__btn.is-active {
  opacity: 1;
  border-color: var(--color-terracotta, #b85c38);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-ochre, #c79a3b) 55%, transparent);
}

.lang-switch__flag {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-text) 18%, transparent);
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 0.25rem;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover {
  color: var(--color-text);
}

.site-nav a.is-active {
  color: var(--color-sea);
  background: color-mix(in srgb, var(--color-sea) 12%, transparent);
  font-weight: 600;
}

/* —— Name tape (JS only; fixed, no layout shift; visible on timeline) —— */
.name-tape {
  display: none;
}

.js .name-tape {
  display: flex;
  position: fixed;
  top: calc(var(--progress-h) + var(--header-h));
  left: 0;
  right: 0;
  z-index: 85;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 36px;
  padding: 0 1rem;
  background: var(--color-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--color-terracotta) 45%, transparent);
  font-size: 0.8rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
}

.js .name-tape.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.name-tape__current {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
}

.name-tape__label {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.name-tape__name {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--color-sea);
  transition: opacity 0.25s ease;
}

.name-tape__name.is-fading {
  opacity: 0;
}

.name-tape__sequence {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
}

.name-tape__sequence li {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  white-space: nowrap;
  transition: color 0.25s ease, font-weight 0.25s ease;
}

.name-tape__sequence li + li::before {
  content: "→";
  margin-right: 0.35rem;
  color: var(--color-axis);
  font-weight: 400;
}

.name-tape__sequence li.is-active {
  color: var(--color-sea);
  font-weight: 700;
}

.name-tape__dots {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
}

.name-tape__dots li {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-axis);
  transition: background 0.25s ease, transform 0.25s ease;
}

.name-tape__dots li.is-active {
  background: var(--color-terracotta);
  transform: scale(1.25);
}

@media (min-width: 768px) {
  .js .name-tape {
    padding: 0 1.5rem;
  }

  .name-tape__sequence {
    display: flex;
  }

  .name-tape__dots {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .name-tape,
  .name-tape__name,
  .name-tape__sequence li,
  .name-tape__dots li {
    transition: none;
  }
}

/* —— Hero —— */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - var(--progress-h));
  min-height: calc(100dvh - var(--header-h) - var(--progress-h));
  padding: 3rem 1.5rem 4.5rem;
  overflow: hidden;
  background: var(--color-tyrian);
}

.hero__photo-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
}

.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.06);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(44, 36, 22, 0.2) 0%, rgba(44, 36, 22, 0.45) 40%, rgba(44, 36, 22, 0.82) 100%),
    linear-gradient(90deg, rgba(109, 31, 58, 0.22), transparent 55%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  text-align: center;
  padding-bottom: 0.5rem;
  color: #faf6ee;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(3.25rem, 14vw, 6.5rem);
  font-weight: 700;
  line-height: 0.98;
  color: #faf6ee;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 24px rgba(44, 36, 22, 0.45);
}

.hero__subtitle {
  margin: 0 0 0.85rem;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: rgba(250, 246, 238, 0.9);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.hero__names {
  margin: 0 auto 2.25rem;
  max-width: 38rem;
  font-family: var(--font-serif);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: rgba(250, 246, 238, 0.82);
  border-top: 1px solid rgba(250, 246, 238, 0.35);
  border-bottom: 1px solid rgba(250, 246, 238, 0.35);
  padding: 0.65rem 0;
}

.hero__scroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: rgba(250, 246, 238, 0.85);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__scroll svg {
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll svg {
    animation: none;
  }

  .hero__photo-wrap {
    will-change: auto;
  }
}

/* —— Panorama band —— */
.photo-band {
  position: relative;
  width: 100%;
  max-height: min(38vh, 280px);
  height: min(38vh, 280px);
  overflow: hidden;
  margin: 0;
  background: var(--color-bg-elevated);
}

.photo-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: sepia(0.28) saturate(0.82) contrast(1.05);
  display: block;
}

.photo-band__caption {
  position: absolute;
  right: 0.75rem;
  bottom: 0.5rem;
  margin: 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  color: #faf6ee;
  background: rgba(44, 36, 22, 0.55);
  border-radius: 0.2rem;
}

/* —— Story + historical atlas —— */
.story {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 0 2rem;
  width: 100%;
}

.story__layout {
  display: flex;
  flex-direction: column;
}

.atlas {
  position: sticky;
  top: calc(var(--progress-h) + var(--header-h) + var(--name-tape-h));
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 6px 16px rgba(44, 36, 22, 0.08);
  max-height: max(240px, 38vh);
  min-height: 240px;
}

.atlas__chrome {
  padding: 0.45rem 0.75rem 0.25rem;
  flex-shrink: 0;
}

.atlas__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--color-terracotta);
  line-height: 1.2;
}

.atlas__state-title {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-family: var(--font-serif);
  font-style: italic;
}

.atlas__live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.atlas__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f3eee4;
}

.atlas__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.atlas__paper { fill: #f3eee4; }
.atlas__sea { fill: #c8cebe; }
.atlas__land { fill: #e8d7b4; }
.atlas__shore {
  fill: none;
  stroke: #8a7350;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.85;
}
.atlas__lagoon { fill: #9aa392; opacity: 0.9; }
.atlas__lagoon-shore {
  fill: none;
  stroke: #6f7668;
  stroke-width: 1.1;
  stroke-linejoin: round;
  opacity: 0.75;
}
.atlas__marsh-water { fill: #9aa392; opacity: 0.5; }
.atlas__marsh { fill: url(#atlas-hatch); opacity: 0.88; }
.atlas__contour {
  fill: none;
  stroke: #c79a3b;
  stroke-width: 0.7;
  opacity: 0.5;
  stroke-linejoin: round;
}
.atlas__contour--major {
  stroke-width: 1.35;
  opacity: 0.72;
  stroke: #a67c2d;
}
.atlas__shade {
  fill: #c4a56a;
  opacity: 0.14;
  pointer-events: none;
}
.atlas__wall {
  fill: none;
  stroke: #6d1f3a;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.atlas__wall--biz { stroke: #7a5548; stroke-width: 3.6; }
.atlas[data-state="bizantina"] .atlas__wall--punica { opacity: 0.35; }
.atlas[data-state="bizantina"] .atlas__marker--roman { opacity: 0.45; }
.atlas__arsenal-block {
  fill: #5c4033;
  stroke: #2c2416;
  stroke-width: 1;
  opacity: 0.88;
}

.atlas__hill-peak {
  fill: #c79a3b;
  stroke: #5c4033;
  stroke-width: 1.1;
}
.atlas__hill-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12.5px;
  fill: #2c2416;
  stroke: #faf6ee;
  stroke-width: 3.5px;
  paint-order: stroke fill;
  pointer-events: none;
}
.atlas__hill-elev {
  font-family: var(--font-sans);
  font-size: 9.5px;
  fill: #5c5346;
  stroke: #faf6ee;
  stroke-width: 2.5px;
  paint-order: stroke fill;
  pointer-events: none;
}
.atlas__marker-icon {
  fill: #b5532f;
  stroke: #faf6ee;
  stroke-width: 1.3;
}
.atlas__marker-glyph {
  fill: #faf6ee;
  stroke: none;
  pointer-events: none;
}
.atlas__marker--wall .atlas__marker-icon { fill: #6d1f3a; }
.atlas__marker--arsenal .atlas__marker-icon { fill: #5c4033; }
.atlas__marker--castle .atlas__marker-icon { fill: #7a5548; }
.atlas__marker-label {
  font-family: var(--font-serif);
  font-size: 11px;
  fill: #2c2416;
  stroke: #faf6ee;
  stroke-width: 3px;
  paint-order: stroke fill;
  pointer-events: none;
}
.atlas__marker--dense .atlas__marker-label {
  opacity: 0;
}
.atlas__marker--dense:hover .atlas__marker-label,
.atlas__marker--dense:focus-within .atlas__marker-label,
.atlas__hill:hover .atlas__marker-label {
  opacity: 1;
}
.atlas__leader {
  fill: none;
  stroke: #8a7350;
  stroke-width: 0.8;
  opacity: 0.65;
  pointer-events: none;
}
.atlas__ann {
  font-family: var(--font-serif);
  font-size: 11px;
  fill: #6d1f3a;
  font-style: italic;
  stroke: #faf6ee;
  stroke-width: 3px;
  paint-order: stroke fill;
  pointer-events: none;
}
.atlas__hit {
  fill: transparent;
  cursor: pointer;
}
.atlas__hit:focus { outline: none; }
.atlas__hit:focus-visible {
  stroke: var(--color-focus);
  stroke-width: 2;
  fill: rgba(181, 83, 47, 0.12);
}
.atlas__compass-n,
.atlas__scale text {
  font-family: var(--font-serif);
  font-size: 11px;
  fill: #2c2416;
}

/* State visibility */
.atlas-layer[data-states],
.atlas__marker[data-states] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.atlas[data-state="mastia"] .atlas-layer[data-states~="mastia"],
.atlas[data-state="qart"] .atlas-layer[data-states~="qart"],
.atlas[data-state="romana"] .atlas-layer[data-states~="romana"],
.atlas[data-state="bizantina"] .atlas-layer[data-states~="bizantina"],
.atlas[data-state="medieval"] .atlas-layer[data-states~="medieval"],
.atlas[data-state="arsenal"] .atlas-layer[data-states~="arsenal"],
.atlas[data-state="hoy"] .atlas-layer[data-states~="hoy"],
.atlas[data-state="mastia"] .atlas__marker[data-states~="mastia"],
.atlas[data-state="qart"] .atlas__marker[data-states~="qart"],
.atlas[data-state="romana"] .atlas__marker[data-states~="romana"],
.atlas[data-state="bizantina"] .atlas__marker[data-states~="bizantina"],
.atlas[data-state="medieval"] .atlas__marker[data-states~="medieval"],
.atlas[data-state="arsenal"] .atlas__marker[data-states~="arsenal"],
.atlas[data-state="hoy"] .atlas__marker[data-states~="hoy"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.atlas-layer--hills,
.atlas-layer--land,
.atlas-layer--sea,
.atlas-layer--contours {
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .atlas-layer[data-states],
  .atlas__marker[data-states] {
    transition: none;
  }
}

.atlas__epochs {
  display: flex;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
}
.atlas__epoch {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 2.6rem;
  padding: 0.25rem 0.3rem;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.62rem;
  cursor: pointer;
  border-radius: 0.25rem;
}
.atlas__epoch-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-border);
  border: 1.5px solid var(--color-ochre);
}
.atlas__epoch.is-active {
  color: var(--color-terracotta);
  font-weight: 600;
}
.atlas__epoch.is-active .atlas__epoch-dot {
  background: var(--color-terracotta);
  border-color: var(--color-terracotta);
}
.atlas__epoch:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.atlas__footnote {
  display: none;
  margin: 0;
  padding: 0.35rem 0.75rem 0.5rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.atlas__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 62%;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -8px 24px rgba(44, 36, 22, 0.12);
  z-index: 5;
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.atlas__panel[hidden] { display: none !important; }
.atlas__panel-close {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -0.25rem 0 -0.4rem auto;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 2px 8px rgba(44, 36, 22, 0.18);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  width: 2.2rem;
  height: 2.2rem;
}
.atlas__panel-close:hover { background: var(--color-bg); color: var(--color-terracotta); }
.atlas__panel-body h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  padding-right: 1.5rem;
}
.atlas__panel-era {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--color-terracotta);
  font-weight: 600;
}
.atlas__panel-body p {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
}
.atlas__panel-figure {
  margin: 0 0 0.6rem;
}
.atlas__panel-figure img {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
  border-radius: 0.25rem;
}
.atlas__panel-figure figcaption {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.atlas-a11y {
  margin: 0.75rem 1rem 0;
  font-size: 0.9rem;
}
.atlas-a11y__list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
.atlas-a11y__cat {
  color: var(--color-text-muted);
  font-size: 0.85em;
}

@media (min-width: 720px) {
  .story {
    padding: 1rem 1.25rem 3rem;
  }
  .story__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 44%);
    gap: 1.25rem 1.5rem;
    align-items: start;
  }
  .atlas {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--progress-h) + var(--header-h) + var(--name-tape-h) + 16px);
    max-height: none;
    min-height: 520px;
    height: calc(100vh - var(--progress-h) - var(--header-h) - var(--name-tape-h) - 32px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px var(--color-shadow);
    background: var(--color-surface);
  }
  .timeline {
    grid-column: 1;
    grid-row: 1;
    max-width: none;
    padding: 1rem 0.5rem 4rem 0;
  }
  .atlas__chrome { padding: 0.75rem 1rem 0.35rem; }
  .atlas__title { font-size: 1.15rem; }
  .atlas__state-title { font-size: 0.88rem; }
  .atlas__stage {
    margin: 0 0.75rem;
    flex: 1;
  }
  .atlas__footnote { display: block; }
  .atlas__panel {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 48%);
    max-height: none;
    border-top: none;
    border-left: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: -6px 0 18px rgba(44, 36, 22, 0.1);
  }
  .atlas__panel-figure img { max-height: 160px; }
  .atlas__epochs { padding: 0.45rem 0.6rem; }
  .atlas__epoch { font-size: 0.68rem; min-width: 3rem; }
}


.more-link {
  display: inline-block;
  margin-top: 0.45rem;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-terracotta);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.more-link:hover { color: var(--color-tyrian); }
.curiosity .more-link { font-style: normal; }

/* —— Timeline —— */
.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  max-width: var(--content-max);
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.35rem;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--color-axis) 4%,
    var(--color-axis) 96%,
    transparent
  );
}

/* Era bands */
.era-band {
  position: relative;
  margin: 2.5rem 0 1.5rem;
  scroll-margin-top: calc(var(--header-h) + var(--progress-h) + var(--name-tape-h) + 0.5rem);
}

.era-band + .era-band,
.milestone + .era-band {
  margin-top: 3rem;
}

.era-band::before {
  content: "";
  display: block;
  height: 1px;
  margin: 0 0 1.5rem;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--color-ochre) 40%, transparent) 20%,
    color-mix(in srgb, var(--color-terracotta) 45%, transparent) 50%,
    color-mix(in srgb, var(--color-tyrian) 30%, transparent) 80%,
    transparent
  );
}

.era-band:first-child::before {
  display: none;
}

.era-band > section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.25rem;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-ochre) 14%, var(--color-bg-elevated)),
      var(--color-bg-elevated) 55%,
      color-mix(in srgb, var(--color-terracotta) 10%, var(--color-bg-elevated))
    );
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 2px 12px var(--color-shadow);
}

.era-band__text {
  order: 2;
}

.era-band__art {
  order: 1;
  width: min(100%, 220px);
  height: 100px;
  color: var(--color-tyrian);
  flex-shrink: 0;
}

.era-band h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  color: var(--color-sea);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.era-band__range {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.era-band__name-chip {
  display: inline-block;
  margin: 0.75rem 0 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--color-sea);
  background: color-mix(in srgb, var(--color-sea) 12%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-sea) 28%, transparent);
  border-radius: 999px;
}

.era-band__name-chip strong {
  font-weight: 700;
}

.era-band__name-mean {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Milestones */
.milestone {
  position: relative;
  margin: 0 0 2rem;
  padding-left: 2.75rem;
}

.milestone article {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.35rem;
  box-shadow: 0 2px 10px var(--color-shadow);
  border-left-width: 3px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.milestone[data-era="epoca-mastia"] article { border-left-color: var(--era-mastia); }
.milestone[data-era="epoca-qart"] article { border-left-color: var(--era-qart); }
.milestone[data-era="epoca-romana"] article { border-left-color: var(--era-romana); }
.milestone[data-era="epoca-bizancio"] article { border-left-color: var(--era-bizancio); }
.milestone[data-era="epoca-andalus"] article { border-left-color: var(--era-andalus); }
.milestone[data-era="epoca-arsenal"] article { border-left-color: var(--era-arsenal); }
.milestone[data-era="epoca-moderna"] article { border-left-color: var(--era-moderna); }
.milestone[data-era="epoca-hoy"] article { border-left-color: var(--era-hoy); }

.milestone article:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-shadow);
}

@media (prefers-reduced-motion: reduce) {
  .milestone article {
    transition: none;
  }

  .milestone article:hover {
    transform: none;
  }
}

.milestone__year-bg {
  position: absolute;
  right: 0.5rem;
  top: 0.25rem;
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 12vw, 5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-sea);
  opacity: 0.06;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.milestone__node {
  position: absolute;
  left: 0.85rem;
  top: 1.6rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--color-bg);
  border: 3px solid var(--color-sea);
  z-index: 1;
}

.milestone--rename {
  margin-top: 1.75rem;
}

.milestone--rename article {
  overflow: visible;
  padding-top: 1.6rem;
}

.milestone--rename .milestone__node {
  width: 1.2rem;
  height: 1.2rem;
  left: 0.78rem;
  border-width: 2px;
  box-shadow: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--color-terracotta);
}

.milestone__rename {
  position: absolute;
  left: 0;
  top: -0.85rem;
  z-index: 3;
  display: inline-block;
  max-width: min(100%, 16rem);
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: #fff;
  background: var(--color-terracotta);
  border-radius: 0.25rem;
  box-shadow: 0 2px 8px var(--color-shadow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.milestone__era-tag {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 0.2rem;
  color: #fff;
  background: var(--era-mastia);
}

.era-tag--mastia { background: var(--era-mastia); }
.era-tag--qart { background: var(--era-qart); }
.era-tag--romana { background: var(--era-romana); }
.era-tag--bizancio { background: var(--era-bizancio); }
.era-tag--andalus { background: var(--era-andalus); }
.era-tag--arsenal { background: var(--era-arsenal); }
.era-tag--moderna { background: var(--era-moderna); }
.era-tag--hoy { background: var(--era-hoy); }

.milestone__heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.milestone__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  color: var(--color-sea);
  opacity: 0.85;
}

.milestone__year {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-sea);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.milestone h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 0.65rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.milestone p {
  position: relative;
  z-index: 1;
  margin: 0 0 0.85rem;
  color: var(--color-text);
}

.milestone p:last-child {
  margin-bottom: 0;
}

.curiosity {
  position: relative;
  z-index: 1;
  margin-top: 0.85rem;
  padding: 1rem 1.1rem 1rem 1.25rem;
  background: color-mix(in srgb, var(--color-ochre) 12%, var(--color-bg));
  border-left: 3px solid var(--color-ochre);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.curiosity p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.55;
}

.curiosity strong {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-terracotta);
}

/* Peoples block (pre-Roman mosaic) */
.milestone--wide article {
  padding-bottom: 1.5rem;
}

.peoples {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
  margin: 0.25rem 0 0.85rem;
}

.peoples__group h4 {
  margin: 0 0 0.45rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.peoples__region {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.peoples__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.people-chip {
  display: inline-block;
  margin: 0;
  padding: 0.22rem 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-olive) 10%, var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
}

.people-chip--local {
  border-color: var(--color-terracotta);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-terracotta) 35%, transparent);
  background: color-mix(in srgb, var(--color-terracotta) 8%, var(--color-surface));
}

.people-chip--link {
  color: var(--color-terracotta);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.people-chip--link:hover {
  color: var(--color-tyrian);
}

details.people-chip {
  max-width: 100%;
}

details.people-chip > summary {
  cursor: pointer;
  list-style: none;
}

details.people-chip > summary::-webkit-details-marker {
  display: none;
}

details.people-chip[open] {
  display: block;
  width: 100%;
  padding-bottom: 0.45rem;
}

.people-chip__note {
  margin: 0.4rem 0 0;
  padding: 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.peoples__footnote {
  position: relative;
  z-index: 1;
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Troop types box (Hannibal) */
.troop-types {
  position: relative;
  z-index: 1;
  margin: 0.35rem 0 0.85rem;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--era-qart) 7%, var(--color-bg));
  border: 1px solid color-mix(in srgb, var(--era-qart) 28%, var(--color-border));
  border-radius: var(--radius);
}

.troop-types > p {
  margin: 0 0 0.45rem;
}

.troop-types > p strong {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-tyrian);
}

.troop-types ul {
  margin: 0;
  padding-left: 1.1rem;
}

.troop-types li {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--color-text);
}

.troop-types li:last-child {
  margin-bottom: 0;
}

.troop-types li strong {
  font-weight: 700;
  color: var(--color-text);
}

/* Reveal animation — only when .js is on html */
.js .reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* —— Back to top —— */
.back-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-sea);
  text-decoration: none;
  box-shadow: 0 4px 16px var(--color-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
}

.back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--color-bg-elevated);
}

@media (prefers-reduced-motion: reduce) {
  .back-top {
    transition: opacity 0.2s, visibility 0.2s;
    transform: none;
  }

  .back-top.is-visible {
    transform: none;
  }
}

/* —— Footer —— */
.site-footer {
  padding: 2.5rem 1.25rem 3rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  background: var(--color-bg-elevated);
}

.site-footer p {
  margin: 0 auto 0.75rem;
  max-width: 36rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.site-footer__year {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem !important;
}

/* —— Desktop: centered axis, alternating cards —— */
@media (min-width: 768px) {
  .site-header {
    padding: 0.5rem 1.5rem;
  }

  .site-nav a {
    font-size: 0.8rem;
    padding: 0.4rem 0.65rem;
  }

  .bay-map {
    padding: 2.5rem 1.5rem 1.5rem;
  }

  .bay-map__frame {
    padding: 1.5rem 1.5rem 1.25rem;
  }

  .bay-map__svg {
    aspect-ratio: 2 / 1;
    height: auto;
    min-height: 0;
  }

  .timeline {
    padding: 3rem 1.5rem 5rem;
  }

  .timeline::before {
    left: 1.35rem;
    transform: none;
  }

  .story .timeline {
    padding-left: 0;
    padding-right: 0;
  }

  .milestone {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 3rem;
    padding-right: 0;
  }

  .milestone--left,
  .milestone--right {
    margin-left: 0;
    margin-right: 0;
    padding-left: 3rem;
    padding-right: 0;
  }

  .milestone__node,
  .milestone--left .milestone__node,
  .milestone--right .milestone__node {
    left: 0.95rem;
    right: auto;
  }

  .milestone--left article,
  .milestone--right article {
    text-align: left;
    border-left-width: 3px;
    border-right-width: 1px;
  }

  .milestone--left .milestone__heading,
  .milestone--right .milestone__heading {
    flex-direction: row;
  }

  .milestone--left .milestone__year-bg,
  .milestone--right .milestone__year-bg {
    left: auto;
    right: 0.5rem;
  }

  .milestone--left .curiosity,
  .milestone--right .curiosity {
    border-right: none;
    border-left: 3px solid var(--color-ochre);
    border-radius: 0 var(--radius) var(--radius) 0;
  }

  .milestone--left .milestone__rename,
  .milestone--right .milestone__rename {
    left: 2.75rem;
    right: auto;
  }

  .era-band > section {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding: 1.75rem 2rem;
    gap: 1.5rem;
  }

  .era-band__text {
    order: 1;
    flex: 1;
  }

  .era-band__art {
    order: 2;
    width: 200px;
    height: 110px;
  }

  .era-band {
    margin: 3.5rem 0 2rem;
  }

  .milestone {
    width: calc(50% - 2rem);
    padding-left: 0;
    margin-bottom: 2.5rem;
  }

  .milestone--left {
    margin-left: 0;
    margin-right: auto;
    padding-right: 2.5rem;
  }

  .milestone--right {
    margin-left: auto;
    margin-right: 0;
    padding-left: 2.5rem;
  }

  .milestone--left .milestone__node {
    left: auto;
    right: -0.55rem;
  }

  .milestone--right .milestone__node {
    left: -0.55rem;
    right: auto;
  }

  .milestone--left article {
    text-align: right;
    border-left-width: 1px;
    border-right-width: 3px;
  }

  .milestone[data-era="epoca-mastia"] article { border-left-color: var(--era-mastia); border-right-color: var(--color-border); }
  .milestone[data-era="epoca-qart"] article { border-left-color: var(--era-qart); border-right-color: var(--color-border); }
  .milestone[data-era="epoca-romana"] article { border-left-color: var(--era-romana); border-right-color: var(--color-border); }
  .milestone[data-era="epoca-bizancio"] article { border-left-color: var(--era-bizancio); border-right-color: var(--color-border); }
  .milestone[data-era="epoca-andalus"] article { border-left-color: var(--era-andalus); border-right-color: var(--color-border); }
  .milestone[data-era="epoca-arsenal"] article { border-left-color: var(--era-arsenal); border-right-color: var(--color-border); }
  .milestone[data-era="epoca-moderna"] article { border-left-color: var(--era-moderna); border-right-color: var(--color-border); }
  .milestone[data-era="epoca-hoy"] article { border-left-color: var(--era-hoy); border-right-color: var(--color-border); }

  .milestone--left .milestone__heading {
    flex-direction: row-reverse;
  }

  .milestone--left .milestone__year-bg {
    right: auto;
    left: 0.5rem;
  }

  .milestone--left .curiosity {
    border-left: none;
    border-right: 3px solid var(--color-ochre);
    border-radius: var(--radius) 0 0 var(--radius);
  }

  .milestone--left.milestone--rename .milestone__node {
    right: -0.62rem;
    left: auto;
  }

  .milestone--right.milestone--rename .milestone__node {
    left: -0.62rem;
    right: auto;
  }

  .milestone--left .milestone__rename {
    left: auto;
    right: 0;
  }

  .milestone--right .milestone__rename {
    left: 0;
    right: auto;
  }
}

@media (min-width: 1024px) {
  .milestone article {
    padding: 1.5rem 1.6rem 1.6rem;
  }

  .milestone h3 {
    font-size: 1.3rem;
  }

  .era-band__art {
    width: 240px;
    height: 120px;
  }

}


/* —— Milestone photos —— */
.milestone__figure {
  position: relative;
  z-index: 1;
  margin: 0 0 1rem;
  background: transparent;
}

.milestone__figure button {
  appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: block;
  cursor: zoom-in;
  border-radius: 0.35rem;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #e8dfd0;
}

.milestone__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease;
  cursor: zoom-in;
}

.milestone__figure:hover img,
.milestone__figure:focus-within img {
  transform: scale(1.04);
}

.milestone__figure figcaption {
  margin: 0.4rem 0 0;
  padding: 0 0.1rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  font-style: italic;
  font-family: var(--font-serif);
}


.milestone__mosaic {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.milestone__mosaic .milestone__figure {
  margin: 0;
}

.milestone__mosaic .milestone__figure button {
  aspect-ratio: 3 / 4;
}

@media (prefers-reduced-motion: reduce) {
  .milestone__figure img {
    transition: none;
  }

  .milestone__figure:hover img,
  .milestone__figure:focus-within img {
    transform: none;
  }
}

.milestone--left .milestone__mosaic,
.milestone--left .milestone__figure figcaption {
  text-align: right;
}

/* —— Lightbox —— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(44, 36, 22, 0.88);
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox.is-open {
  display: grid;
}

.lightbox__img {
  max-width: min(96vw, 1100px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  appearance: none;
  border: 1px solid rgba(250, 246, 238, 0.35);
  background: rgba(44, 36, 22, 0.55);
  color: #faf6ee;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__caption {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  max-width: min(90vw, 40rem);
  margin: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: #faf6ee;
  background: rgba(44, 36, 22, 0.65);
  border-radius: 0.25rem;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
}

body.lightbox-open {
  overflow: hidden;
}

/* —— Credits —— */
.credits {
  max-width: 40rem;
  margin: 2rem auto 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--color-border);
  text-align: left;
}

.credits h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--color-tyrian);
  text-align: center;
}

.credits ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.credits li {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  padding-left: 0.85rem;
  position: relative;
}

.credits li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--color-terracotta);
  font-weight: 700;
}


/* —— Story layout override: one timeline column beside the sticky atlas (no left/right alternation) —— */
@media (min-width: 768px) {
  .story .timeline { padding: 1rem 0 4rem; max-width: none; }
  .story .timeline::before { left: 1.35rem; transform: none; }
  .story .milestone,
  .story .milestone--left,
  .story .milestone--right {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 3rem;
    padding-right: 0;
  }
  .story .milestone__node,
  .story .milestone--left .milestone__node,
  .story .milestone--right .milestone__node,
  .story .milestone--left.milestone--rename .milestone__node,
  .story .milestone--right.milestone--rename .milestone__node { left: 0.95rem; right: auto; }
  .story .milestone--left article,
  .story .milestone--right article { text-align: left; border-left-width: 3px; border-right-width: 1px; }
  .story .milestone--left .milestone__heading,
  .story .milestone--right .milestone__heading { flex-direction: row; }
  .story .milestone--left .milestone__year-bg,
  .story .milestone--right .milestone__year-bg { left: auto; right: 0.5rem; }
  .story .milestone--left .curiosity,
  .story .milestone--right .curiosity {
    border-right: none;
    border-left: 3px solid var(--color-ochre);
    border-radius: 0 var(--radius) var(--radius) 0;
  }
  .story .milestone--left .milestone__rename,
  .story .milestone--right .milestone__rename { left: 2.75rem; right: auto; }
  .story .era-band > section { padding: 1.5rem 1.5rem; }
  .story .era-band__art { width: 150px; height: 90px; }
}
@media (min-width: 720px) {
  .story__layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 1.25rem 2.5rem; }
  .atlas { height: calc(100vh - var(--progress-h) - var(--header-h) - var(--name-tape-h) - 32px); max-height: 780px; }
}

@media (max-width: 600px) {
  .atlas__hill-label { font-size: 16px; }
  .atlas__hill-elev { font-size: 12px; }
  .atlas__marker-label { font-size: 14px; }
}

/* —— Timeline nodes sit ON the axis (outside the card), all widths —— */
.story .timeline { padding-left: 0; padding-right: 0; }
.story .milestone,
.story .milestone--left,
.story .milestone--right { padding-left: 3rem; padding-right: 0; }
.story .milestone article { overflow: visible; }
.story .milestone .milestone__node,
.story .milestone--left .milestone__node,
.story .milestone--right .milestone__node { left: -2.29rem; right: auto; }
.story .milestone--rename .milestone__node,
.story .milestone--left.milestone--rename .milestone__node,
.story .milestone--right.milestone--rename .milestone__node { left: -2.4rem; right: auto; }


/* —— Clickable affordance on the atlas —— */
.atlas__hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 0;
  font-size: 0.74rem;
  color: var(--color-terracotta);
  font-weight: 600;
}
.atlas__hint-icon {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(181, 83, 47, 0.22);
}
.atlas__hill, .atlas__marker { cursor: pointer; }
.atlas__pulse {
  fill: none;
  stroke: var(--color-terracotta);
  stroke-width: 1.6;
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: atlas-pulse 2.6s ease-out infinite;
}
.atlas.has-interacted .atlas__pulse { animation: none; opacity: 0; }
@keyframes atlas-pulse {
  0% { opacity: 0.75; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(3.2); }
}
.atlas__hill-peak, .atlas__marker-dot { transition: transform 0.18s ease, fill 0.18s ease; transform-box: fill-box; transform-origin: center; }
.atlas__hill:hover .atlas__hill-peak,
.atlas__marker:hover .atlas__marker-dot { transform: scale(1.55); fill: var(--color-terracotta); }
.atlas__hill:hover .atlas__hill-label,
.atlas__marker:hover .atlas__marker-label { fill: var(--color-terracotta); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  .atlas__pulse { animation: none; }
}
@media (max-width: 600px) {
  .atlas__hint { font-size: 0.7rem; }
  .atlas__hit { r: 20px; }
}

@media (max-width: 719px) {
  .atlas { max-height: max(300px, 48vh); min-height: 300px; }
}

/* —— Mobile / tablet: the place card is a real bottom sheet over the page, not a sliver inside the tiny map —— */
@media (max-width: 959px) {
  .atlas__panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    max-height: 68vh;
    z-index: 200;
    padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 34px rgba(44, 36, 22, 0.28);
    overscroll-behavior: contain;
  }
  .atlas__panel::before {
    content: "";
    display: block;
    width: 2.6rem;
    height: 0.28rem;
    margin: -0.55rem auto 0.7rem;
    border-radius: 0.2rem;
    background: var(--color-border);
  }
  .atlas__panel-figure img { max-height: 190px; width: 100%; object-fit: cover; border-radius: 0.4rem; }
  .atlas__panel-body h3 { font-size: 1.25rem; }
  .atlas__panel-body p { font-size: 1rem; line-height: 1.5; }
  .atlas__panel-body .more-link { display: inline-block; padding: 0.35rem 0; font-size: 1rem; }
  .atlas__panel-close { width: 2.5rem; height: 2.5rem; font-size: 1.5rem; }
}


/* —— Reading typography: refined serif for explanatory text, Inter for interface —— */
body { font-optical-sizing: auto; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.milestone p,
.curiosity p,
.atlas__panel-body p,
.era-band__text p,
.peoples__footnote,
.site-footer p {
  font-family: var(--font-serif);
  font-size: 1.075rem;
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: #3a3228;
  hyphens: auto;
  text-wrap: pretty;
}
.curiosity p { font-style: italic; font-size: 1.04rem; }
.milestone h3, .atlas__panel-body h3 { letter-spacing: 0; }
@media (max-width: 600px) {
  .milestone p, .curiosity p, .atlas__panel-body p { font-size: 1.06rem; line-height: 1.7; }
}

.milestone__year-bg .milestone__year-bc { font-size: 0.34em; font-weight: 700; letter-spacing: 0.02em; margin-left: 0.15em; }
.atlas__land--hoy { fill-rule: evenodd; }

/* —— Time layers: earlier remains stay on the map, faded while buried, full when visible today —— */
.atlas[data-state="medieval"] .atlas__marker--roman,
.atlas[data-state="arsenal"] .atlas__marker--roman { opacity: 0.45; }
.atlas[data-state="medieval"] .atlas__marker--roman:hover,
.atlas[data-state="arsenal"] .atlas__marker--roman:hover,
.atlas[data-state="medieval"] .atlas__marker--roman:focus-within,
.atlas[data-state="arsenal"] .atlas__marker--roman:focus-within { opacity: 1; }
.atlas__marker--modern .atlas__marker-dot { fill: #6d1f3a; }

.atlas__castle { fill: #7a5548; stroke: #faf6ee; stroke-width: 0.9; paint-order: stroke; }
.atlas__castle--door { fill: #faf6ee; stroke: none; }
.atlas__ann--castle { font-size: 10px; fill: #5c4033; font-style: italic; paint-order: stroke; stroke: #f3eee4; stroke-width: 2.4px; }
.atlas__marker--naval .atlas__marker-dot { fill: #5c4033; }

/* —— Atlas text scales up when the map column is narrow (tablet right-hand column, phone) —— */
.atlas__stage { container-type: inline-size; container-name: atlas-stage; }
@container atlas-stage (max-width: 440px) {
  .atlas__hill-label { font-size: 17px; }
  .atlas__hill-elev { font-size: 12.5px; }
  .atlas__marker-label { font-size: 15px; }
  .atlas__ann { font-size: 13px; }
}
@media (min-width: 720px) and (max-width: 959px) {
  .atlas__epochs { padding: 0.4rem 0.3rem; gap: 0; }
  .atlas__epoch { min-width: 0; font-size: 0.6rem; flex: 1 1 0; }
  .atlas__epoch-label { white-space: normal; text-align: center; line-height: 1.1; }
}

/* —— Atlas chrome: visually quiet (kept for screen readers), more room for the map —— */
.atlas__title,
.atlas__state-title {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.atlas__chrome { padding-top: 0.5rem; padding-bottom: 0.25rem; }

/* —— Markers: bigger, ringed, distinguishable colours —— */
.atlas__marker-dot { r: 6px; stroke: #faf6ee; stroke-width: 2px; paint-order: stroke; }
.atlas__marker--roman .atlas__marker-dot { fill: #2c2416; }
.atlas__marker--wall .atlas__marker-dot { fill: #8a1f2f; }
.atlas__marker--naval .atlas__marker-dot { fill: #3f6b45; }
.atlas__marker--modern .atlas__marker-dot { fill: #b5532f; }
.atlas__marker--arsenal .atlas__marker-dot { fill: #3f6b45; }
.atlas__castle-wrap { cursor: pointer; }
.atlas__castle-wrap:hover .atlas__castle { fill: var(--color-terracotta); }
.atlas__castle-wrap:hover .atlas__ann--castle { fill: var(--color-terracotta); text-decoration: underline; }

/* —— Place card inside the map column (desktop): compact type, wider card, bottom overlay when the map is narrow —— */
@media (min-width: 960px) {
  .atlas__panel { width: min(340px, 64%); padding: 0.7rem 0.85rem 0.9rem; }
  .atlas__panel .atlas__panel-body h3 { font-size: 1.1rem; line-height: 1.25; margin: 0.15rem 0 0.2rem; }
  .atlas__panel .atlas__panel-body .atlas__panel-era { font-size: 0.78rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--color-terracotta); margin: 0 0 0.45rem; font-family: var(--font-sans); font-weight: 600; }
  .atlas__panel .atlas__panel-body p { font-size: 0.92rem; line-height: 1.5; }
  .atlas__panel .atlas__panel-body .more-link { font-size: 0.88rem; }
  .atlas__panel .atlas__panel-figure figcaption { font-size: 0.68rem; }
  .atlas__panel .atlas__panel-figure img { max-height: 150px; }
}
@container atlas-stage (max-width: 520px) {
  .atlas__panel {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 66%;
    border-left: none; border-top: 1px solid var(--color-border);
    border-radius: 12px 12px 0 0; box-shadow: 0 -8px 22px rgba(44, 36, 22, 0.16);
  }
}

/* —— No top menu: the page keeps all its height; the language flags float over the hero and repeat in the footer —— */
:root { --header-h: 0px; }
.site-header {
  position: absolute;
  top: calc(var(--progress-h) + 0.6rem);
  right: 0.75rem;
  left: auto;
  z-index: 300;
  min-height: 0;
  padding: 0.15rem 0.3rem;
  background: rgba(250, 246, 238, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
}
.site-header .lang-switch { margin-left: 0; }
.site-footer__lang { display: flex; justify-content: center; margin: 0.6rem 0; }
