/* ---- Site header / nav ---- */
#site-header {
  position: sticky; top: 0; z-index: 100;
  /* The flat-winding motif as a site-wide signature line beneath the header */
  background: var(--wound-brass) center bottom / auto 12px repeat-x, var(--paper);
}
.nav-bar { display: flex; align-items: center; gap: var(--space-2); padding-block: var(--space-2); }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; margin-right: auto; }
.brand-mark { font-family: var(--font-serif); font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.brand-sub { font-size: var(--fs-eyebrow); letter-spacing: 0.18em; color: var(--brass); }
#primary-nav ul { list-style: none; display: flex; gap: var(--space-2); margin: 0; padding: 0; flex-wrap: wrap; }
#primary-nav a {
  text-decoration: none; color: var(--muted); font-size: var(--fs-small);
  padding: 0.35rem 0.1rem; border-bottom: 2px solid transparent; min-height: var(--tap);
  display: inline-flex; align-items: center;
}
#primary-nav a:hover { color: var(--ink); }
#primary-nav a.is-active { color: var(--ink); border-bottom-color: var(--brass); }

/* Language switcher — always visible top-right, beside the hamburger on mobile */
.nav-tools { display: flex; align-items: center; gap: 0.5rem; }
.lang-switch {
  font-family: var(--font-sans); font-size: var(--fs-small); color: var(--brass);
  text-decoration: none; padding: 0.4rem 0.7rem; border: 1px solid var(--hairline-2);
  border-radius: var(--radius); min-height: var(--tap); display: inline-flex; align-items: center;
}
.lang-switch:hover { color: var(--ink); border-color: var(--brass); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 0.5rem; min-width: var(--tap); min-height: var(--tap); }
.nav-toggle span { width: 26px; height: 2px; background: var(--ink); display: block; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  #primary-nav { display: none; width: 100%; }
  #site-header.nav-open #primary-nav { display: block; }
  #site-header.nav-open .nav-bar { flex-wrap: wrap; }
  #primary-nav ul { flex-direction: column; gap: 0.25rem; padding-bottom: var(--space-2); }
}

/* ---- Footer ---- */
#site-footer { background: var(--ink); color: var(--on-ink-muted); margin-top: var(--space-6); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-block: var(--space-3); flex-wrap: wrap; }
.footer-copy { margin: 0; font-size: var(--fs-small); max-width: none; }
.footer-legal a { color: var(--on-ink-muted); text-decoration: none; margin-left: var(--space-2); font-size: var(--fs-small); }
.footer-legal a:hover { color: var(--brass); }

/* ---- Buttons / links ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-sans); font-size: var(--fs-small); font-weight: 600;
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--ink); padding: 0.7rem 1.3rem; border-radius: var(--radius);
  min-height: var(--tap); transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink); color: var(--on-ink); }
.btn--brass { border-color: var(--brass); color: var(--brass); }
.btn--brass:hover { background: var(--brass); color: var(--ink); }
.arrow-link { color: var(--brass); font-weight: 600; text-decoration: none; font-size: var(--fs-small); }
.arrow-link:hover { text-decoration: underline; }

/* ---- Cards / figures ---- */
.figure { margin: var(--space-3) 0; }
.figure figcaption { font-size: var(--fs-small); color: var(--muted); margin-top: var(--space-1); max-width: var(--measure); }

/* ---- Data tables ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-small); margin: var(--space-3) 0; }
table.data th, table.data td { border-bottom: 1px solid var(--hairline); padding: 0.8rem 0.7rem; text-align: left; vertical-align: top; }
table.data thead th { border-bottom: 2px solid var(--ink); color: var(--ink); font-family: var(--font-serif); }
table.data tbody tr:nth-child(even) { background: rgba(184,146,74,0.05); }

/* ---- Pull quote ---- */
.pullquote { font-family: var(--font-serif); font-size: var(--fs-h3); color: var(--ink); border-left: 3px solid var(--brass); padding-left: var(--space-3); margin: var(--space-4) 0; max-width: var(--measure); }

/* ---- Timeline ---- */
.tl-wrap { padding-block: var(--space-3); }
.tl-legend { display: flex; gap: var(--space-3); font-size: var(--fs-small); color: var(--muted); margin-bottom: var(--space-3); }
.tl-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.tl-swatch.life { background: var(--brass); }
.tl-swatch.world { background: var(--ink); }

.tl-stage { position: relative; padding-block: 2.5rem; outline: none; }
.tl-axis { position: relative; height: 2px; background: var(--hairline-strong); margin: 0; }
.tl-tick { position: absolute; top: 8px; transform: translateX(-50%); font-family: var(--font-serif); font-size: var(--fs-small); color: var(--muted-2); }
.tl-track { position: relative; height: 0; }
.tl-track--world { margin-bottom: 2px; }
.tl-track--life { margin-top: 2px; }
.tl-dot {
  position: absolute; top: 0; transform: translate(-50%, -50%);
  width: 13px; height: 13px; padding: 0; border: 0; border-radius: 50%;
  cursor: pointer; min-width: var(--tap); min-height: var(--tap);
  background: transparent;
}
.tl-dot::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--brass);
}
.tl-dot--world::after { background: var(--ink); }
.tl-dot.is-major::after { width: 16px; height: 16px; box-shadow: 0 0 0 4px var(--brass-soft); }
.tl-dot:hover::after, .tl-dot:focus-visible::after { transform: translate(-50%, -50%) scale(1.25); }

.tl-detail { margin-top: var(--space-3); min-height: 7rem; }
.tl-card { background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-3); max-width: 560px; }
.tl-card-title { margin-top: 0.25rem; }
.tl-card p { max-width: none; }

@media (max-width: 620px) {
  .tl-stage { display: none; }
  .tl-detail::before { content: "1881 – 1952"; display:block; font-family: var(--font-serif); color: var(--ink); font-weight: 700; margin-bottom: var(--space-2); }
}

.tl-mobile { display: none; list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.tl-m-item { display: flex; gap: var(--space-2); padding: var(--space-2) 0; border-top: 1px solid var(--hairline); }
.tl-m-year { font-family: var(--font-serif); color: var(--brass); font-weight: 700; min-width: 3.5em; }
.tl-m-place { color: var(--muted); }
.tl-m-item p { margin: 0.25rem 0 0; max-width: none; }
@media (max-width: 620px) {
  .tl-mobile { display: block; }
}

/* ---- Gallery ---- */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-bottom: var(--space-3); }
.chip {
  font-family: var(--font-sans); font-size: var(--fs-small);
  background: transparent; color: var(--muted); border: 1px solid var(--hairline-2);
  padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer; min-height: var(--tap);
}
.chip:hover { color: var(--ink); border-color: var(--brass); }
.chip.is-active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

.gallery-item { margin: 0; }
.gallery-thumb { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius); overflow: hidden; }
.gallery-thumb picture img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.25s, box-shadow 0.25s; }
.gallery-thumb:hover picture img { transform: scale(1.02); box-shadow: var(--shadow); }
.gallery-item figcaption { font-size: var(--fs-small); color: var(--muted); margin-top: var(--space-1); }

/* ---- Lightbox ---- */
.lb-lock { overflow: hidden; }
.lb-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(22,17,13,0.92); display: grid; place-items: center; padding: var(--space-3); }
.lb { position: relative; max-width: min(1100px, 92vw); max-height: 90vh; display: grid; place-items: center; }
.lb-figure { margin: 0; text-align: center; }
.lb-figure picture img { max-height: 80vh; width: auto; margin: 0 auto; border-radius: var(--radius); }
.lb-figure figcaption { color: var(--on-ink-muted); margin-top: var(--space-2); font-size: var(--fs-small); }
.lb-close, .lb-nav {
  position: absolute; background: rgba(255,255,255,0.08); color: var(--on-ink);
  border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; cursor: pointer;
  width: var(--tap); height: var(--tap); font-size: 1.5rem; line-height: 1; display: grid; place-items: center;
}
.lb-close { top: -1rem; right: -1rem; }
.lb-prev { left: -1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: -1rem; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-nav:hover { background: var(--brass); color: var(--ink); }
.lb-nav:disabled { opacity: 0.3; cursor: not-allowed; }
@media (max-width: 560px) { .lb-close { top: 0.25rem; right: 0.25rem; } .lb-prev { left: 0.25rem; } .lb-next { right: 0.25rem; } }

/* ---- Home: hero, teaser, strip ---- */
.hero { position: relative; min-height: 70vh; display: flex; align-items: flex-end; background: var(--ink); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0.85; }
.hero-overlay { position: relative; z-index: 1; padding-block: var(--space-5); background: linear-gradient(0deg, rgba(22,17,13,0.85), rgba(22,17,13,0)); color: var(--on-ink); }
.hero-overlay h1 { color: var(--on-ink); margin: var(--space-1) 0; }
.hero-eyebrow { color: var(--brass); }
.hero-sub { color: var(--on-ink-muted); font-size: var(--fs-h3); max-width: var(--measure); }

.story-teaser { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-4); align-items: center; }
@media (max-width: 760px) { .story-teaser { grid-template-columns: 1fr; } }
.story-figure picture img { border-radius: var(--radius); box-shadow: var(--shadow); }

.gallery-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); margin-bottom: var(--space-2); }
@media (max-width: 760px) { .gallery-strip { grid-template-columns: repeat(2, 1fr); } }
.gallery-strip .figure { margin: 0; }
.gallery-strip a { display: block; }
.gallery-strip img { aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.gallery-strip figcaption { font-size: var(--fs-small); color: var(--muted); margin-top: 0.4rem; }

/* ---- Chapter nav ---- */
.chapter-nav { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin: var(--space-3) 0 var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--hairline); position: sticky; top: 64px; background: var(--paper); z-index: 5; }
.chapter-nav a { font-size: var(--fs-small); color: var(--muted); text-decoration: none; padding: 0.25rem 0; }
.chapter-nav a:hover { color: var(--brass); }

/* ---- Patent list ---- */
.patent-list { list-style: none; padding: 0; display: grid; gap: var(--space-1); }
.patent-list li { position: relative; padding-left: 1.8rem; }
.patent-list li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 16px; height: 16px; background: var(--coil-brass) center / contain no-repeat; }
.patent-list a { font-family: var(--font-serif); }

/* ---- Entrance: one orchestrated hero load ----
   Concentrated on the hero (the page-load moment), not scattered across sections.
   Scoped to prefers-reduced-motion: no-preference so the initial hidden state only
   exists for users who can see motion; base.css neutralises durations otherwise. */
@media (prefers-reduced-motion: no-preference) {
  .hero-img { animation: heroSettle 1.6s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
  .hero-overlay .eyebrow,
  .hero-overlay h1,
  .hero-overlay .hero-sub {
    opacity: 0; transform: translateY(16px);
    animation: fadeUp 0.85s cubic-bezier(0.2, 0.65, 0.2, 1) both;
  }
  .hero-overlay .eyebrow   { animation-delay: 0.18s; }
  .hero-overlay h1         { animation-delay: 0.34s; }
  .hero-overlay .hero-sub  { animation-delay: 0.50s; }
}
@keyframes heroSettle { from { transform: scale(1.07); opacity: 0.5; } to { transform: scale(1); opacity: 0.85; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---- Archival imagery: unify source scans to one warm desaturated tone ----
   Lightbox large views are intentionally excluded so detail stays true to source.
   Tune via the --archive-filter token (set to `none` to disable). */
.hero-img,
.story-figure picture img,
.gallery-strip img,
.gallery-thumb picture img { filter: var(--archive-filter); }

/* ---- Motif: centered coil divider (the flat winding, flanked by hairlines) ---- */
hr.coil-divider {
  border: 0; height: 34px; margin-block: var(--space-5);
  background:
    linear-gradient(var(--hairline-2), var(--hairline-2)) left center / calc(50% - 19px) 1px no-repeat,
    linear-gradient(var(--hairline-2), var(--hairline-2)) right center / calc(50% - 19px) 1px no-repeat,
    var(--coil-brass) center / 34px 34px no-repeat;
}

/* ---- Surface: full-bleed brass band (recognition & reach) ---- */
.band { position: relative; overflow: hidden; background: var(--brass); color: var(--ink);
        padding-block: var(--space-6); margin-block: var(--space-5); }
.band-inner { position: relative; z-index: 1; }
.band .eyebrow { color: var(--ink); opacity: 0.7; }
.band h2 { color: var(--ink); }
.band p { color: rgba(22, 17, 13, 0.8); max-width: 60ch; }
.band::after { content: ""; position: absolute; right: -3rem; top: 50%; transform: translateY(-50%);
               width: 360px; height: 360px; max-width: 60vw; background: var(--coil-ink) center / contain no-repeat;
               opacity: 0.08; pointer-events: none; }
.stat-row { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-4); }
.stat { min-width: 8.5rem; }
.stat .num { font-family: var(--font-serif); font-size: var(--fs-h2); line-height: 1; color: var(--ink); }
.stat .cap { font-size: var(--fs-small); color: rgba(22, 17, 13, 0.72); margin-top: 0.35rem; }
@media (max-width: 560px) {
  .band::after { width: 240px; height: 240px; opacity: 0.06; right: -4rem; }
}

/* ---- Reading spine: date + place marginalia per life-moment ----
   Each .beat is one located moment. The left gutter (date over place) reads as
   a vertical spine running down the page; the brass tick echoes the timeline
   dots. Collapses to a label-above on narrow screens. */
.beat {
  display: grid;
  grid-template-columns: minmax(6.5rem, 7.5rem) 1fr;
  column-gap: 2rem;
  margin-block: var(--space-4);
}
.beat-label { position: relative; padding-left: 0.75rem; }
.beat-label::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brass);
}
.beat-date { font-family: var(--font-serif); font-weight: 700; color: var(--ink); line-height: 1.1; }
.beat-place {
  font-family: var(--font-serif); font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass);
  margin-top: 0.2rem;
}
.beat-body > p:first-child { margin-top: 0; }
.beat-body > p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .beat { grid-template-columns: 1fr; row-gap: 0.35rem; margin-block: var(--space-3); }
}

/* ---- Roster callout: surfaces buried biographical data (names + dates) ---- */
.roster {
  border: 1px solid var(--hairline); border-left: 3px solid var(--brass);
  border-radius: var(--radius); padding: var(--space-2) var(--space-3);
  margin-block: var(--space-3); background: rgba(184, 146, 74, 0.04);
}
.roster-title { margin: 0 0 0.5rem; font-family: var(--font-serif); color: var(--ink); }
.roster dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; column-gap: 1rem; row-gap: 0.2rem; }
.roster dt { font-family: var(--font-serif); color: var(--ink); }
.roster dd { margin: 0; color: var(--muted); font-size: var(--fs-small); }
/* Narrow screens: a max-content label column can't shrink and would overflow
   the measure when a label is long (e.g. "Salons of the hairdressers'
   association"). Stack label over value below 540px, like the .beat collapse. */
@media (max-width: 540px) {
  .roster dl { grid-template-columns: 1fr; row-gap: 0.1rem; }
  .roster dt { font-size: var(--fs-small); }
  .roster dd { margin: 0 0 0.55rem; }
}

/* Patent table: reflow to stacked cards on phones. The 4-column table is
   wider than a phone viewport, so instead of a horizontal-scroll area we
   turn each row into a brass-edged card with the patent number as its
   heading and the remaining fields as labelled lines (data-label). */
@media (max-width: 560px) {
  .patent-data thead { display: none; }
  .patent-data,
  .patent-data tbody,
  .patent-data tr,
  .patent-data td { display: block; width: 100%; box-sizing: border-box; }
  .patent-data tbody tr {
    border: 1px solid var(--hairline); border-left: 3px solid var(--brass);
    border-radius: var(--radius); padding: 0.4rem 0.85rem 0.55rem;
    margin-bottom: var(--space-2); background: rgba(184, 146, 74, 0.04);
  }
  .patent-data td { padding: 0.3rem 0; border: 0; }
  .patent-data td::before {
    content: attr(data-label) " \2014 ";
    font-family: var(--font-serif); color: var(--brass);
    font-size: var(--fs-eyebrow); letter-spacing: 0.12em;
    text-transform: uppercase; font-weight: 700;
  }
  .patent-data td:first-child {
    font-family: var(--font-serif); font-size: var(--fs-h3); color: var(--ink);
    line-height: 1.2; border-bottom: 1px solid var(--hairline);
    padding: 0.1rem 0 0.45rem; margin-bottom: 0.15rem;
  }
  .patent-data td:first-child::before { content: ""; }
}
