:root {
  --bg: #0B1634;
  --card: #132247;
  --text: #F4F1E8;
  --muted: #A7B2CF;
  --hairline: rgba(244, 241, 232, 0.14);
  --gold: #F2C14E;
  --coral: #FF8A80;
  --mint: #4FE3C1;
  --mat: #F4F1E8;

  --font-head: 'Bodoni Moda', 'Georgia', serif;
  --font-body: 'Figtree', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --dock-h: 144px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  padding-bottom: calc(var(--dock-h) + var(--safe-bottom) + 28px);
}

body.lock-scroll { overflow: hidden; height: 100%; }

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

a { color: inherit; text-decoration: none; }

/* ---------- progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2.5px;
  width: 0%;
  background: var(--gold);
  z-index: 60;
  transition: width 80ms linear;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: 66svh;
  min-height: 66vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #101d45 0%, var(--bg) 70%);
}

.hero-ring {
  position: absolute;
  width: min(72vw, 340px);
  height: min(72vw, 340px);
  animation: spin 60s linear infinite;
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-ring .star {
  fill: var(--gold);
  opacity: 0.85;
}

.hero-line {
  position: relative;
  z-index: 2;
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 4.2vw, 1.6rem);
  color: var(--text);
  text-align: center;
  letter-spacing: 0.02em;
  padding: 0 14%;
}

/* ---------- sections ---------- */
.section {
  padding: 56px 20px 48px;
  max-width: 600px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 36px;
}

.section-header .star-ring-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.section-header .numeral {
  font-family: var(--font-head);
  font-size: 2.6rem;
  font-weight: 500;
}

.section-header .name {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  font-weight: 600;
  margin: 10px 0 14px;
}

.section-header .hairline {
  width: 56px;
  height: 1px;
  background: var(--hairline);
  margin-bottom: 12px;
}

.section-header .kicker {
  font-family: var(--font-head);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
}

.section-finanza .numeral, .section-finanza .name { color: var(--gold); }
.section-economia .numeral, .section-economia .name { color: var(--coral); }
.section-tecnologia .numeral, .section-tecnologia .name { color: var(--mint); }

.cards {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============ FINANZA — postage stamps ============ */
.card-fin {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.stamp-mat {
  background: var(--mat);
  padding: 14px;
  border-radius: 3px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.35);
  width: 70%;
  position: relative;
}

.stamp-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 1px;
}

.stamp-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0;
  transition: opacity 500ms ease;
}
.stamp-img-wrap img.loaded { opacity: 1; }

.stamp-img-wrap::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    repeating-radial-gradient(circle at 6px 0, var(--mat) 0 3px, transparent 3.5px 12px),
    repeating-radial-gradient(circle at 6px 0, var(--mat) 0 3px, transparent 3.5px 12px);
  background-position: top left, bottom left;
  background-size: 12px 6px, 12px 6px;
  background-repeat: repeat-x, repeat-x;
}
.stamp-img-wrap::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    repeating-radial-gradient(circle at 0 6px, var(--mat) 0 3px, transparent 3.5px 12px),
    repeating-radial-gradient(circle at 0 6px, var(--mat) 0 3px, transparent 3.5px 12px);
  background-position: top left, top right;
  background-size: 6px 12px, 6px 12px;
  background-repeat: repeat-y, repeat-y;
}

.valore-chip {
  position: absolute;
  top: -8px;
  right: 2px;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 2;
}

.postmark {
  position: absolute;
  bottom: -10px;
  left: 2px;
  width: 46px;
  height: 46px;
  border: 1.5px solid rgba(11,22,52,0.35);
  border-radius: 50%;
  z-index: 2;
}

.stamp-text {
  text-align: left;
  width: 100%;
  margin-top: 26px;
}

.stamp-text h3 {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.25;
}

.stamp-text p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 12px;
}

.read-more {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  font-weight: 500;
}
.read-more.gold { color: var(--gold); }
.read-more.coral { color: var(--coral); }
.read-more.mint { color: var(--mint); }

/* ============ ECONOMIA — gilded ovals ============ */
.card-eco {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  text-align: center;
}

.card-eco.pos-left { align-items: flex-start; text-align: left; }
.card-eco.pos-right { align-items: flex-end; text-align: right; }

.oval-wrap {
  width: 62%;
  aspect-ratio: 3 / 4;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 3px var(--coral),
    0 0 0 6px var(--bg),
    0 0 0 9px rgba(255,138,128,0.55);
  margin-bottom: 20px;
}

.oval-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0;
  transition: opacity 500ms ease;
}
.oval-wrap img.loaded { opacity: 1; }

.eco-text h3 {
  font-family: var(--font-head);
  font-style: italic;
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 500;
  margin: 0 0 10px;
  line-height: 1.3;
}

.eco-text p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 12px;
}

.flourish { opacity: 0.8; margin: 0 4px; }

/* ============ TECNOLOGIA — hexagons ============ */
.card-tec {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.card-tec.pos-left { align-items: flex-start; }
.card-tec.pos-right { align-items: flex-end; }

.hex-outer {
  position: relative;
  width: 74%;
  aspect-ratio: 1 / 1;
  margin-bottom: 18px;
}

.hex-outline {
  position: absolute;
  inset: 0;
  transform: translate(8px, 8px);
  clip-path: polygon(25% 2%, 75% 2%, 100% 50%, 75% 98%, 25% 98%, 0% 50%);
  border: 1.5px solid var(--mint);
  opacity: 0.55;
}

.hex-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  overflow: hidden;
}

.hex-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0;
  transition: opacity 500ms ease;
}
.hex-wrap img.loaded { opacity: 1; }

.hex-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mint);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: block;
}

.tec-text { width: 100%; }
.card-tec.pos-left .tec-text { text-align: left; }
.card-tec.pos-right .tec-text { text-align: right; }

.tec-text h3 {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.25;
}

.tec-text p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 12px;
}

.chip-mint {
  display: inline-block;
  border: 1px solid var(--mint);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 20px;
}

/* ---------- footer ---------- */
.footer {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px 20px;
  text-align: center;
  border-top: 1px solid var(--hairline);
}

.footer-tagline {
  font-family: var(--font-head);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 14px;
}

.footer-email {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  opacity: 0.8;
}

/* ---------- dock ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(19, 34, 71, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  z-index: 50;
  max-width: calc(100vw - 24px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  transition: transform 300ms ease, opacity 300ms ease;
}

.dock.hidden {
  transform: translateX(-50%) translateY(140%);
  opacity: 0;
  pointer-events: none;
}

.dock-logo {
  width: 120px;
  max-width: 34vw;
  height: auto;
  border-radius: 999px;
  flex-shrink: 0;
}

.dock-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.dock-chips::-webkit-scrollbar { display: none; }

.dock-chip {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.01em;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--muted);
  padding: 7px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 250ms ease, color 250ms ease, border-color 250ms ease;
}

.dock-chip.active[data-color="gold"] { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.dock-chip.active[data-color="coral"] { background: var(--coral); color: var(--bg); border-color: var(--coral); }
.dock-chip.active[data-color="mint"] { background: var(--mint); color: var(--bg); border-color: var(--mint); }

/* ---------- overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(.22,.9,.3,1);
}

.overlay.open { transform: translateY(0); }

.overlay-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay-close {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(19, 34, 71, 0.85);
  border: 1px solid var(--hairline);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  backdrop-filter: blur(10px);
}

.overlay-hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.overlay-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay-body {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 22px 60px;
}

.overlay-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.overlay-pill[data-color="gold"] { background: rgba(242,193,78,0.15); color: var(--gold); border: 1px solid var(--gold); }
.overlay-pill[data-color="coral"] { background: rgba(255,138,128,0.15); color: var(--coral); border: 1px solid var(--coral); }
.overlay-pill[data-color="mint"] { background: rgba(79,227,193,0.15); color: var(--mint); border: 1px solid var(--mint); }

.overlay-headline {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 14px;
}

.overlay-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 24px;
}

.overlay-text p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 20px;
}

/* ---------- misc ---------- */
@media (min-width: 640px) {
  .hero-line { padding: 0 20%; }
}
