/* ============================================================
   MIGONE: Fondazione Migone, per la Tutela dell'Autenticità Casa Migone
   Design system: black/graphite documentary archive aesthetic.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500;600&family=Cormorant:ital,wght@0,400;0,500;1,400&family=Archivo:wght@300;400;500&display=swap');

:root {
  --black: #f4f4f2;
  --near-black: #141414;
  --ivory: #e8e8e6;
  --ivory-dim: #9a9a98;
  --sepia: #6b6f72;
  --sepia-bright: #7c8288;
  --rule: rgba(232, 232, 230, 0.2);
  --paper: #f9f9f8;
  --ink: #111111;
  --ink-dim: rgba(17, 17, 17, 0.55);
  --rule-paper: rgba(17, 17, 17, 0.1);
  --sepia-paper: #6b6f72;
  --serif-display: 'Cormorant Garamond', Georgia, serif;
  --sans-body: 'Archivo', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --tracking-wide: 0.22em;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--black);
  color: var(--ink);
  font-family: var(--sans-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--sepia-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(107, 111, 114, 0.3);
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover {
  color: var(--ivory);
  border-color: var(--ivory);
}

h1, h2, h3, h4 {
  font-family: var(--serif-display);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em 0;
  color: var(--ivory);
}

p {
  text-align: justify;
  text-align-last: left;
}

.eyebrow {
  display: block;
  font-family: var(--sans-body);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--sepia-bright);
  margin-bottom: 0.6em;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 244, 242, 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(26, 26, 26, 0.1);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 32px;
}

.nav-mark {
  font-family: var(--serif-display);
  font-size: 1.3rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  border-bottom: none;
}
.nav-mark:hover { color: var(--sepia-paper); border-bottom: none; }

.nav-logo {
  display: block;
}
.nav-logo svg {
  display: block;
  height: 26px;
  width: auto;
}

.nav-logo-center {
  justify-self: center;
  display: block;
}
.nav-logo-center svg,
.nav-logo-center img {
  display: block;
  height: 22px;
  width: auto;
  filter: brightness(0);
  transition: filter 0.3s ease;
}
.nav-logo-center:hover img,
.nav-logo-center:hover svg {
  filter: brightness(0.42) !important;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia-paper);
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--sepia-paper);
}

.nav-links-left {
  justify-self: start;
}

.nav-right-group {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 24px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}
.lang-toggle a {
  color: var(--sepia-paper);
  border-bottom: none;
  padding: 2px 1px;
}
.lang-toggle a.active {
  color: var(--ink);
  border-bottom: 1px solid var(--sepia-paper);
}
.lang-toggle a:hover { color: var(--ink); }
.lang-toggle .sep { color: var(--rule-paper); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 70%);
  border-bottom: 1px solid var(--rule);
  padding-top: 80px;
  padding-bottom: 8vh;
}
.hero:has(.hero-upper) {
  align-items: center;
  padding-top: 120px;
}
.hero:has(.hero-upper) .hero-lower::after {
  display: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* Hero overlay: seal + title + mission on dark video */
.hero .hero-content {
  max-width: 680px;
  will-change: transform;
}
.hero .hero-content:has(.hero-upper) {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 62vh;
  margin-top: -16vh;
}
.hero-upper,
.hero-lower {
  text-align: center;
}
.hero-lower::after {
  content: "";
  display: block;
  width: 192px;
  height: 1px;
  margin: 80px auto 0;
  background: var(--ivory-dim);
  animation: lineIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 3.4s both;
}
.hero .foundation-seal img {
  filter: invert(1);
}
.hero .section-title,
.hero .mission {
  color: #ffffff;
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
}
.hero .mission + .mission {
  color: rgba(255, 255, 255, 0.9);
}

.hero-plate {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,8,8,0.58) 0%, rgba(8,8,8,0.82) 60%, rgba(8,8,8,0.96) 100%),
    repeating-linear-gradient(45deg, rgba(100,100,100,0.03) 0 2px, transparent 2px 4px);
  opacity: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
}

.hero-content .eyebrow {
  letter-spacing: 0.3em;
  margin-bottom: 1.2em;
}

.hero-mark {
  font-family: var(--serif-display);
  font-size: clamp(3.2rem, 9vw, 7rem);
  letter-spacing: 0.08em;
  line-height: 1;
  margin: 0;
}

.hero-logo {
  display: block;
  width: clamp(280px, 36vw, 520px);
  height: auto;
  margin: 0 auto;
  color: var(--ivory);
}

@keyframes hero-logo-arrive {
  0%   {
    opacity: 0;
    transform: translateY(20px) scale(1.04);
    filter: blur(14px) brightness(0) invert(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px) brightness(0) invert(1);
  }
}

@keyframes hero-logo-arrive-simple {
  0%   { opacity: 0; transform: translateY(14px) scale(1.02); filter: brightness(0) invert(1); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    filter: brightness(0) invert(1); }
}

.hero-logo-centered {
  align-items: center;
  padding-bottom: 22vh;
}

.hero-logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4em;
}

.hero-logo-name {
  display: block;
  width: clamp(260px, 34vw, 520px);
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0;
  animation: hero-logo-arrive 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.hero-logo-milano {
  display: block;
  width: clamp(187px, 24.5vw, 374px);
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0;
  animation: hero-logo-arrive-simple 2s cubic-bezier(0.16, 1, 0.3, 1) 1.4s forwards;
}

.hero-sub {
  margin-top: 0.6em;
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.3em;
  color: var(--ivory-dim);
}

.hero-note {
  margin-top: 2.4em;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ivory-dim);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  font-style: italic;
}

/* ---------- Sections / Layout ---------- */

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 96px 32px;
  background: var(--paper);
  box-shadow: 0 0 0 100vmax var(--paper);
  clip-path: inset(0 -100vmax 0 -100vmax);
  position: relative;
  color: var(--ink);
}
.section + .section {
  border-top: 1px solid rgba(17, 17, 17, 0.22);
}
.section-content-ruled {
  border-top: none !important;
}
.section-content-ruled::before {
  content: '';
  display: block;
  height: 1px;
  background: rgba(17, 17, 17, 0.22);
  margin-bottom: 48px;
}
.section-narrow {
  max-width: 760px;
}
.section-tight-bottom {
  padding-bottom: 32px;
}
.section-tight-top {
  padding-top: 40px;
}
.section-flush-top {
  border-top: none !important;
  padding-top: 8px;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 0.3em;
}
.section-ruled::after {
  content: "";
  display: block;
  width: 120px;
  height: 1px;
  margin: 20px auto 0;
  background: var(--sepia-paper);
  transform: scaleX(0);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.section-ruled.js-visible::after {
  transform: scaleX(1);
}
.section-intro {
  color: var(--ink-dim);
  font-size: 1.05rem;
  max-width: 640px;
}
.section-intro-justify {
  text-align: justify;
  text-align-last: left;
}
.center .section-intro {
  margin: 0 auto;
}

.section h1, .section h2, .section h3, .section h4 {
  color: var(--ink);
}
.section .eyebrow {
  color: var(--sepia-paper);
}
.section a {
  color: var(--sepia-paper);
  border-bottom-color: rgba(156, 114, 40, 0.35);
}
.section a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.section-dark {
  padding-top: 93px;
  padding-bottom: 124px;
  background: var(--near-black);
  box-shadow: 0 0 0 100vmax var(--near-black);
  color: var(--ivory);
}
.section-dark::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background-image:
    linear-gradient(rgba(10, 10, 10, 0.74), rgba(10, 10, 10, 0.82)),
    url('../assets/journal/milan-regimes/migone-aspari-piazza-fontana-1788.jpg');
  background-size: cover;
  background-position: center 35%;
  background-attachment: fixed;
  filter: grayscale(0.6) brightness(0.55) contrast(1.05);
  z-index: 0;
  pointer-events: none;
}
.section-dark > * {
  position: relative;
  z-index: 1;
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 {
  color: var(--ivory);
}
.section-dark .eyebrow {
  color: var(--sepia-bright);
}
.section-dark a {
  color: var(--ivory);
  border-bottom-color: rgba(232, 232, 230, 0.35);
}
.section-dark a:hover {
  color: var(--sepia-bright);
  border-color: var(--sepia-bright);
}
.section-dark .foundation-seal {
  margin-top: -50px;
}
.section-dark .foundation-seal img {
  filter: invert(1);
}
.section-dark .mission {
  color: var(--ivory);
}
.section-dark .mission + .mission {
  color: rgba(232, 232, 230, 0.9);
}

/* ---------- Placeholder plates (stand-ins for archive scans) ---------- */

.plate {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(160deg, #2a2218 0%, #181410 60%, #0e0c09 100%);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.plate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    115deg,
    rgba(199, 154, 85, 0.04) 0px,
    rgba(199, 154, 85, 0.04) 1px,
    transparent 1px,
    transparent 6px
  );
}
.plate-label {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  padding: 0 18px;
  font-style: italic;
}
.plate-caption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--ink-dim);
  font-style: italic;
}
.plate-wrapper {
  display: block;
}
.plate-img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
.plate-wrapper .plate-caption {
  display: block;
  text-align: right;
  margin-top: 8px;
}

/* ---------- Grids ---------- */

.grid {
  display: grid;
  gap: 28px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Tables ---------- */

table.archive-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5em;
  font-size: 0.95rem;
}
table.archive-table th,
table.archive-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-paper);
}
table.archive-table th {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sepia-paper);
  font-weight: 400;
}
table.archive-table tr:last-child td { border-bottom: none; }

/* ---------- Card / item ---------- */

.item-card {
  border: 1px solid var(--rule-paper);
  padding: 24px;
  background: rgba(26, 20, 16, 0.025);
}
.item-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3em;
}
.item-meta {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sepia-paper);
  margin-bottom: 0.6em;
  display: block;
  text-align: left;
}
.item-card p {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Brand marks (Marchi Storici) ---------- */

.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.brand-mark {
  border: 1px solid var(--rule-paper);
  background: rgba(26, 20, 16, 0.025);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.brand-mark[open] {
  border-color: var(--sepia);
  background: rgba(26, 20, 16, 0.05);
}

.brand-mark summary {
  list-style: none;
  cursor: pointer;
  padding: 28px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 96px;
  position: relative;
}
.brand-mark summary::-webkit-details-marker { display: none; }

.brand-mark summary::after {
  content: "+";
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--serif-display);
  font-size: 1rem;
  color: var(--ink-dim);
  transition: transform 0.25s ease, color 0.25s ease;
}
.brand-mark[open] summary::after {
  content: "\2212";
  color: var(--sepia-paper);
}

.brand-mark-name {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: color 0.25s ease;
}
.brand-mark:hover .brand-mark-name { color: var(--sepia-paper); }

.brand-mark-body {
  padding: 0 22px 26px;
  border-top: 1px solid var(--rule-paper);
  padding-top: 20px;
}
.brand-mark-context {
  color: var(--ink-dim);
  font-size: 0.92rem;
  margin: 0 0 0.8em;
}
.brand-mark-pending {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  font-style: italic;
  color: var(--ink-dim);
  opacity: 0.75;
  margin: 0;
}

@media (max-width: 760px) {
  .brand-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .brand-grid { grid-template-columns: 1fr; }
}

/* ---------- Medals ---------- */

.medal-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  list-style: none;
  max-width: 760px;
  margin: 8px auto 0;
  padding: 24px 4px 0;
  overflow: visible;
}

.medal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 80px;
  min-width: 0;
  padding: 6px 0;
}

.medal-img {
  width: 100%;
  max-width: 80px;
  height: auto;
  aspect-ratio: 1 / 1;
  filter: brightness(0.88);
  opacity: 0.82;
  transition: transform 0.25s ease-out,
              filter 0.25s ease-out, opacity 0.25s ease-out;
  will-change: transform;
}

.medal:hover .medal-img,
.medal:focus-within .medal-img {
  transform: scale(1.08) translateY(-3px);
  opacity: 1;
  filter: brightness(1.05);
}

.medal.is-hovered .medal-img {
  transform: scale(1.08) translateY(-3px);
  opacity: 1;
  filter: brightness(1.05);
  transition-duration: 0.35s;
}

.medal.is-dimmed .medal-img {
  opacity: 0.4;
  filter: brightness(0.7);
  transition-duration: 0.35s;
}

.medal-caption {
  margin-top: 9px;
  width: 90px;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--ink-dim);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.medal:hover .medal-caption,
.medal:focus-within .medal-caption,
.medal.is-hovered .medal-caption {
  opacity: 1;
  transform: translateY(0);
  color: var(--sepia-paper);
}

.medal-year {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(-100% - 8px));
  white-space: nowrap;
  z-index: 2;
  color: var(--ink);
  font-family: var(--serif-display);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.medal:hover .medal-year,
.medal:focus-within .medal-year,
.medal.is-hovered .medal-year {
  opacity: 1;
}

@media (max-width: 600px) {
  .medal-row {
    gap: 20px 14px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 380px;
    margin: 46px auto 44px;
    padding-top: 0;
  }
  .medal { flex: 0 0 calc(25% - 11px); width: auto; padding: 0; }
  .medal-img { order: 1; width: 100%; max-width: none; opacity: 1; filter: none; }
  .medal-year {
    order: 2;
    position: static;
    transform: none;
    opacity: 1;
    margin: 9px 0 0;
    font-size: 0.8rem;
    color: var(--sepia-paper);
  }
  .medal-caption { display: none; }
}

/* ---------- Pull quote / mission ---------- */

.foundation-seal {
  width: 112px;
  margin: 0 auto 0.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.foundation-seal img {
  width: 100%;
  height: auto;
  display: block;
}

.foundation-seal + .section-title {
  font-size: clamp(2.2rem, 4vw, 3.1rem);
}
.foundation-seal + .section-title::after {
  content: "";
  display: block;
  width: 192px;
  height: 1px;
  margin: 24px auto 52px;
  background: var(--sepia-paper);
}
.section-dark .foundation-seal + .section-title::after {
  background: var(--sepia-bright);
}

.mission {
  font-family: var(--serif-display);
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1.6;
  text-align: justify;
  text-align-last: left;
  color: var(--ink);
}
.mission + .mission {
  margin-top: 1.6em;
  color: var(--ink-dim);
  font-size: 1.12rem;
}

/* ---------- Journal / Diario ---------- */

.journal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-top: 24px;
}

.journal-card-plate {
  margin-bottom: 18px;
}

.journal-card a:has(.journal-card-img) {
  border-bottom: none;
}
.journal-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center top;
  margin-bottom: 18px;
}

.journal-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25em;
  text-align: left;
}

.journal-card-summary {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin: 0 0 0.9em;
  text-align: left;
}

.journal-card-link {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  text-align: right;
  margin-top: auto;
  padding-top: 1.2em;
}

.journal-article-meta {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 0.6em;
}

.journal-back {
  display: inline-block;
  margin-top: 2.5em;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.journal-note {
  font-size: 0.82rem;
  color: var(--ink-dim);
  font-style: italic;
  border-top: 1px solid var(--rule-paper);
  margin-top: 2.5em;
  padding-top: 1.2em;
}

.article-figure {
  margin: 0.5em 0 2.8em;
}
.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}
.article-figure figcaption {
  margin-top: 0.75em;
  font-size: 0.8rem;
  color: var(--sepia-paper);
  letter-spacing: 0.03em;
  font-style: italic;
}

@media (max-width: 760px) {
  .journal-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

.site-footer {
  background: #1a1a1a;
  border-top: none;
}
.footer-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 48px;
  display: grid;
  grid-template-columns: auto 0.45fr 0.45fr;
  column-gap: 0;
  row-gap: 48px;
}
.footer-col-label {
  font-family: var(--sans-body);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(230,230,228,0.4);
  margin: 0 0 18px;
}
.footer-nav-group {
  align-self: start;
  margin-right: 40px;
}
.footer-nav-lists {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  padding-right: 40px;
  border-right: 0.5px solid rgba(230,230,228,0.15);
}
.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-nav li a {
  font-family: var(--serif-display);
  font-size: 1rem;
  color: rgba(230,230,228,0.75);
  border-bottom: none;
  transition: color 0.2s ease;
}
.footer-nav li a:hover {
  color: #e6e6e4;
  border-bottom: none;
}
.footer-nl-head {
  font-family: var(--serif-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: #e6e6e4;
  margin: 0 0 10px;
}
.footer-nl-text {
  font-family: var(--serif-display);
  font-size: 0.9rem;
  color: rgba(230,230,228,0.6);
  line-height: 1.6;
  margin: 0 0 18px;
}
.footer-nl-row {
  display: flex;
}
.footer-nl-input {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--serif-display);
  font-size: 0.85rem;
  border: 0.5px solid rgba(230,230,228,0.2);
  border-right: none;
  background: rgba(255,255,255,0.06);
  color: #e6e6e4;
  outline: none;
}
.footer-nl-input::placeholder {
  color: rgba(230,230,228,0.3);
}
.footer-nl-btn {
  padding: 9px 16px;
  font-family: var(--sans-body);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
  color: rgba(230,230,228,0.7);
  border: 0.5px solid rgba(230,230,228,0.2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.footer-nl-btn:hover {
  background: rgba(230,230,228,0.9);
  color: #1a1a1a;
}
.footer-legal {
  align-self: start;
  margin-right: 48px;
}
.footer-legal p:not(.footer-nl-head) {
  font-family: var(--serif-display);
  font-size: 0.9rem;
  color: rgba(230,230,228,0.6);
  line-height: 1.6;
  margin: 0 0 6px;
}
.footer-legal a {
  font-family: var(--sans-body);
  font-size: 0.7rem;
  color: rgba(230,230,228,0.45);
  border-bottom: none;
  transition: color 0.2s ease;
}
.footer-legal a:hover {
  color: #e6e6e4;
  border-bottom: none;
}
.footer-bottom {
  border-top: 0.5px solid rgba(230,230,228,0.1);
  background: #1a1a1a;
}
.footer-bottom-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-copy {
  font-family: var(--sans-body);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: rgba(230,230,228,0.3);
}
.footer-lang {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--sans-body);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}
.footer-lang a {
  color: rgba(230,230,228,0.35);
  border-bottom: none;
  transition: color 0.2s ease;
}
.footer-lang a:hover,
.footer-lang a.active {
  color: #e6e6e4;
  border-bottom: none;
}
.footer-lang .sep {
  color: rgba(230,230,228,0.2);
}
@media (max-width: 900px) {
  .footer-body {
    grid-template-columns: 1fr 1fr;
    column-gap: 36px;
    row-gap: 40px;
    padding: 48px 28px 40px;
  }
  .footer-nav-group { margin-right: 0; }
  .footer-legal { margin-right: 0; }
  .footer-nav-lists {
    border-right: none;
    padding-right: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    column-gap: 32px;
    row-gap: 12px;
    max-width: 430px;
  }
  .footer-nav { display: contents; }
  .footer-nav li a { font-size: 0.95rem; }
  .footer-body > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 500px) {
  .footer-body {
    grid-template-columns: 1fr;
    row-gap: 34px;
    padding: 44px 24px 36px;
  }
  .footer-body > div:last-child { grid-column: auto; }
  .footer-nav-lists { max-width: none; column-gap: 18px; }
  /* stagger the three columns: left, centre, right */
  .footer-nav-lists ul:nth-child(1) li:nth-child(3),
  .footer-nav-lists ul:nth-child(2) li:nth-child(1) { text-align: center; }
  .footer-nav-lists ul:nth-child(2) li:nth-child(2),
  .footer-nav-lists ul:nth-child(2) li:nth-child(3) { text-align: right; }
  .footer-nl-row { max-width: none; }
  .footer-bottom-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 16px 24px;
  }
}

/* ---------- Scroll & hover effects ---------- */

/* Reveal on scroll */
.js-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.js-reveal.js-visible {
  opacity: 1;
  transform: none;
}

/* Nav solidifies on scroll */
.site-header {
  transition: background 0.5s ease, border-color 0.5s ease;
}
.site-header.scrolled {
  background: rgba(10, 9, 8, 0.98);
  border-bottom: 1px solid var(--rule);
}

/* Nav link — underline draws in from left */
.nav-links a {
  position: relative;
  border-bottom: none !important;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--sepia-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

/* Dark section etching — parallax via background-attachment: fixed */
.section-dark::before {
  will-change: background-position;
}

/* Hero image — parallax via JS */
.hero-media {
  will-change: transform;
  animation: simpleFade 2.5s ease 0s both;
}

/* Hero logo — fades up after image has settled */
.hero-logo {
  animation: fadeUp 1.8s cubic-bezier(0.22, 1, 0.36, 1) 1.8s both;
}

/* Divider rule — draws in from centre when section title reveals */
.foundation-seal + .section-title::after {
  transform: scaleX(0);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.foundation-seal + .section-title.js-visible::after {
  transform: scaleX(1);
}

/* ---- Fondazione intro: simple sequential fades ---- */

@keyframes sealGrow {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes simpleFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-dark .foundation-seal {
  animation: simpleFade 1s ease 0.2s both;
}
.section-dark .section-title {
  animation: simpleFade 1s ease 0.8s both;
}
.section-dark .mission:nth-of-type(1) {
  animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 2.6s both;
}
.section-dark .mission:nth-of-type(2) {
  animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 3.2s both;
}

/* ---- Hero intro: staggered blur-dissolve arrivals ---- */
@keyframes lineIn {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes heroSealArrive {
  0%   { opacity: 0; transform: scale(0.82); filter: blur(10px); }
  100% { opacity: 1; transform: scale(1);    filter: blur(0px); }
}
@keyframes heroLogoArriveFdn {
  0%   { opacity: 0; transform: translateY(18px) scale(1.03); filter: brightness(0) invert(1); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    filter: brightness(0) invert(1); }
}
@keyframes heroMissionArriveFdn {
  0%   { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0);    filter: blur(0px); }
}

.hero .foundation-seal {
  animation: heroSealArrive 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
.hero .section-title {
  animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.9s both;
}
.hero .foundation-seal + .section-title::after {
  background: var(--ivory-dim);
  transition: none;
  animation: lineIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.5s both;
}
.foundation-logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  margin-top: 2.4em;
  margin-bottom: 2.4em;
}
.foundation-logo-fondazione,
.foundation-logo-name {
  display: block;
  width: clamp(180px, 22vw, 340px);
  height: auto;
  filter: brightness(0) invert(1);
}
.hero .foundation-logo-fondazione {
  opacity: 0;
  animation: heroLogoArriveFdn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}
.hero .foundation-logo-name {
  opacity: 0;
  animation: heroLogoArriveFdn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.95s forwards;
}
.hero .mission:nth-of-type(1) {
  animation: heroMissionArriveFdn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 2.3s both;
}
.hero .mission:nth-of-type(2) {
  animation: heroMissionArriveFdn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 2.9s both;
}

.medal {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Journal card hover — lift + border brightens */
.journal-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease;
}
.journal-card:hover {
  transform: translateY(-4px);
  border-color: var(--sepia-bright);
}

/* Brand mark accordion hover */
.brand-mark summary {
  transition: color 0.25s ease;
}

/* ---------- Misc ---------- */

.divider {
  width: 48px;
  height: 1px;
  background: var(--sepia);
  margin: 28px auto;
}
.center { text-align: center; }
.small-caps-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia-bright);
}

/* ---------- Mobile navigation ---------- */
.nav-toggle { display: none; }
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
  padding: 0 44px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu.open li { opacity: 1; transform: none; }
.mobile-menu.open li:nth-child(1) { transition-delay: 0.10s; }
.mobile-menu.open li:nth-child(2) { transition-delay: 0.17s; }
.mobile-menu.open li:nth-child(3) { transition-delay: 0.24s; }
.mobile-menu.open li:nth-child(4) { transition-delay: 0.31s; }
.mobile-menu.open li:nth-child(5) { transition-delay: 0.38s; }
.mobile-menu.open li:nth-child(6) { transition-delay: 0.45s; }
.mobile-close { opacity: 0; transition: opacity 0.35s ease 0.2s; }
.mobile-menu.open .mobile-close { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .mobile-menu li, .mobile-close { transition: none; }
  .mobile-menu li { opacity: 1; transform: none; }
}
.mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}
.mobile-menu a {
  font-family: var(--serif-display);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  border: none;
}
.mobile-menu a.active { color: var(--sepia-paper); }
.mobile-menu .mobile-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}
.mobile-menu .mobile-lang a { font-family: var(--sans-body); font-size: 0.9rem; }
body.menu-open { overflow: hidden; }
body.menu-open .nav-toggle { display: none; }
.nav-toggle.open span { background: var(--ink) !important; }

.mobile-close {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.mobile-close::before,
.mobile-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
}
.mobile-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.mobile-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

@media (max-width: 1000px) {
  .nav-inner { position: relative; display: flex; justify-content: center; align-items: center; }
  .nav-links { display: none; }
  .nav-right-group { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); gap: 0; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    z-index: 60;
  }
  .nav-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.3s ease, opacity 0.2s ease;
  }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
}

/* On mobile & tablet: single column, images woven between the paragraphs */
@media (max-width: 1024px) {
  /* force the chapter grid to a single column (tablets keep 2-col otherwise) */
  .chapter-panel .grid-2 { grid-template-columns: 1fr; }
  /* ungroup the image and text columns so their contents share one flow */
  .chapter-panel .grid-2 > div:has(> .plate-wrapper),
  .chapter-panel .grid-2 > div:has(> h2) { display: contents; }
  /* uniform rhythm; the grid's column gap no longer applies between items */
  .chapter-panel { padding-bottom: 1.5rem; }
  .chapter-panel .grid-2 { row-gap: 1.2rem; }
  .chapter-panel .grid-2 .item-meta,
  .chapter-panel .grid-2 h2,
  .chapter-panel .grid-2 p { margin: 0; }

  /* label and heading on top */
  .chapter-panel .grid-2 .item-meta { order: -2; }
  .chapter-panel .grid-2 h2 { order: -1; }

  /* each image sits right after its own paragraph, so chapters end on text */
  .chapter-panel .grid-2 p:nth-of-type(1) { order: 1; }
  .chapter-panel .grid-2 p:nth-of-type(2) { order: 3; }
  .chapter-panel .grid-2 p:nth-of-type(3) { order: 5; }
  .chapter-panel .grid-2 p:nth-of-type(4) { order: 7; }
  .chapter-panel .grid-2 p:nth-of-type(5) { order: 9; }
  .chapter-panel .grid-2 p:nth-of-type(6) { order: 11; }
  .chapter-panel .grid-2 p:nth-of-type(7) { order: 13; }
  .chapter-panel .grid-2 p:nth-of-type(n+8) { order: 15; }

  .chapter-panel .grid-2 > div > .plate-wrapper:nth-child(1) { order: 2; }
  .chapter-panel .grid-2 > div > .plate-wrapper:nth-child(2) { order: 4; }
  .chapter-panel .grid-2 > div > .plate-wrapper:nth-child(3) { order: 6; }
  .chapter-panel .grid-2 > div > .plate-wrapper:nth-child(4) { order: 8; }
  .chapter-panel .grid-2 > .plate-wrapper { order: 2; }
  .chapter-panel .grid-2 .plate-wrapper { margin: 0.6rem 0 !important; }
}

/* Desktop: tighten the space below each chapter before the prev/next links */
@media (min-width: 1025px) {
  .chapter-panel { padding-bottom: 40px; }
}

/* Foundation hero: keep the seal clear of the header on tall phones */
@media (max-width: 760px) {
  .hero:has(.hero-upper) { align-items: flex-start; padding-top: 44px; }
  .hero .hero-content:has(.hero-upper) {
    margin-top: 0;
    min-height: auto;
    justify-content: flex-start;
  }
  .hero .foundation-seal { width: 88px; }
  .hero .foundation-logo-stack { margin-top: 1.2em; margin-bottom: 1.8em; }
  .hero .mission { font-size: 1.05rem; line-height: 1.5; }
  .hero .mission + .mission { font-size: 0.98rem; margin-top: 1.15em; }
}
