@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Fraunces:opsz,wght@9..144,400;9..144,600&display=swap');

:root {
  --ink: #16382f;
  --ink-deep: #0b2a23;
  --paper: #f5f0e6;
  --paper-light: #fffdf8;
  --gold: #a86e1b;
  --gold-light: #d7b06e;
  --rust: #9b432d;
  --line: rgba(22, 56, 47, .22);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink-deep);
  background:
    radial-gradient(circle at 18% 12%, rgba(168,110,27,.08), transparent 30rem),
    linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,.22)),
    var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 999; background: var(--paper-light); padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }

.site-header {
  width: min(calc(100% - 3rem), var(--max));
  height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.wordmark { display: inline-flex; align-items: center; gap: .65rem; font-weight: 600; letter-spacing: .16em; text-decoration: none; }
.wordmark-seal { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--gold); border-radius: 50%; font-family: var(--serif); color: var(--gold); letter-spacing: 0; }
nav { display: flex; gap: 2rem; }
nav a { font-size: .86rem; text-decoration: none; letter-spacing: .08em; text-transform: uppercase; }
nav a:hover, nav a:focus-visible { color: var(--gold); }
.menu-button { display: none; }

.hero {
  width: min(calc(100% - 3rem), var(--max));
  min-height: calc(100vh - 84px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(340px, .78fr);
  gap: clamp(3rem, 7vw, 7.5rem);
  align-items: center;
  padding: clamp(3.5rem, 6vw, 6rem) 0;
}
.eyebrow, .kicker { margin: 0 0 1rem; color: var(--gold); text-transform: uppercase; font-size: .72rem; font-weight: 600; letter-spacing: .2em; }
.logo { width: min(100%, 590px); margin: -1rem 0 0; mix-blend-mode: multiply; }
.intro { max-width: 38rem; font-family: var(--serif); font-size: clamp(1.15rem, 1.5vw, 1.42rem); line-height: 1.55; margin: .6rem 0 2rem; }
.text-link { text-decoration: none; display: inline-flex; gap: .75rem; align-items: center; border-bottom: 1px solid var(--gold); padding-bottom: .25rem; font-size: .9rem; font-weight: 600; letter-spacing: .06em; }
.text-link span { color: var(--gold); font-size: 1.2em; }
.hero-portrait { margin: 0; position: relative; }
.portrait-frame { position: relative; padding: .85rem; background: var(--paper-light); border: 1px solid var(--gold-light); box-shadow: 0 24px 60px rgba(26, 45, 37, .18); transform: none; }
.portrait-frame::before, .portrait-frame::after { content: ''; position: absolute; width: 1.4rem; height: 1.4rem; border-color: var(--gold); border-style: solid; }
.portrait-frame::before { inset: .45rem auto auto .45rem; border-width: 1px 0 0 1px; }
.portrait-frame::after { inset: auto .45rem .45rem auto; border-width: 0 1px 1px 0; }
.portrait-frame img { display: block; position: static; width: 100%; max-width: 100%; height: auto; min-height: 0; margin: 0; padding: 0; filter: none; transform: none; }
.specimen-label { position: absolute; left: 1.7rem; bottom: 1.7rem; background: rgba(250,247,239,.92); padding: .55rem .75rem; color: var(--ink); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.hero-portrait figcaption { display: grid; gap: .1rem; padding: 1rem 1.25rem 0; }
.hero-portrait figcaption strong { font-family: var(--serif); font-size: 1.1rem; }
.hero-portrait figcaption span { font-size: .82rem; color: rgba(11,42,35,.66); }

.manifest { background: var(--ink-deep); color: var(--paper); min-height: 210px; padding: 3rem max(1.5rem, calc((100vw - var(--max)) / 2)); display: grid; grid-template-columns: auto 1fr auto; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.manifest-mark { font-family: var(--serif); font-size: clamp(3rem, 7vw, 6rem); line-height: 1; color: var(--gold-light); }
.manifest p:last-child { font-family: var(--serif); font-size: clamp(1.65rem, 3vw, 3rem); margin: 0; line-height: 1.2; }
.seal { width: 7rem; height: 7rem; border: 1px solid var(--gold-light); border-radius: 50%; display: grid; place-items: center; text-align: center; color: var(--gold-light); font-family: var(--serif); font-size: .8rem; line-height: 1.2; text-transform: uppercase; letter-spacing: .13em; transform: rotate(-8deg); }

.research, .archive, .confidential { width: min(calc(100% - 3rem), var(--max)); margin: 0 auto; padding: clamp(5.5rem, 10vw, 10rem) 0; }
.section-heading { display: grid; grid-template-columns: 1.25fr .65fr; gap: 4rem; align-items: end; margin-bottom: 4.5rem; }
h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
.section-heading h2, .archive-heading h2 { font-size: clamp(2.4rem, 5vw, 5.2rem); line-height: 1.02; letter-spacing: -.035em; }
.section-heading > p { margin: 0 0 .5rem; font-size: 1.05rem; max-width: 32rem; }
.department-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.department { background: var(--paper-light); border: 1px solid var(--line); overflow: hidden; }
.department-image { height: 310px; position: relative; overflow: hidden; background: #d9d2c4; }
.department-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.department:hover .department-image img { transform: scale(1.025); }
.department-image > span { position: absolute; top: 1rem; left: 1rem; background: var(--paper-light); padding: .45rem .7rem; font-size: .67rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.apothecary-crop img { object-position: 34% 50%; }
.beauty-crop img { object-position: 51% 42%; }
.department-body { padding: clamp(1.75rem, 3vw, 3rem); }
.department h3 { font-size: clamp(2rem, 3.4vw, 3.8rem); line-height: 1.05; margin-bottom: 1.15rem; }
.department-body > p:not(.kicker) { max-width: 33rem; margin: 0 0 1.8rem; color: rgba(11,42,35,.72); }
.topic-list { list-style: none; padding: 1.25rem 0 0; margin: 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .6rem 1.1rem; }
.topic-list li { font-size: .8rem; letter-spacing: .04em; }
.topic-list li::before { content: '·'; color: var(--gold); margin-right: .45rem; }
.department-wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1.35fr .65fr; }
.department-wide .department-image { height: 100%; min-height: 450px; }
.department-wide .department-body { display: flex; flex-direction: column; justify-content: center; }

.archive { width: 100%; max-width: none; padding-left: max(1.5rem, calc((100vw - var(--max)) / 2)); padding-right: max(1.5rem, calc((100vw - var(--max)) / 2)); background: #d9d2c4; }
.archive-heading { max-width: 900px; margin-bottom: 4rem; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.archive-card { margin: 0; background: var(--paper-light); padding: .8rem; box-shadow: 0 15px 40px rgba(31,35,29,.1); }
.archive-image { height: min(58vw, 590px); overflow: hidden; background: #bcb4a7; }
.archive-image img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; filter: saturate(.82); }

.archive-card figcaption { padding: 1.4rem 1rem 1rem; display: grid; gap: .45rem; }
.archive-card figcaption span { font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; color: var(--gold); }
.archive-card figcaption strong { font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.55rem); font-weight: 400; }

.confidential { padding-top: 6rem; padding-bottom: 6rem; }
.confidential details { border: 1px solid var(--gold); background: rgba(255,253,248,.62); }
.confidential summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center; min-height: 120px; padding: 1.5rem clamp(1.5rem, 4vw, 3rem); }
.confidential summary::-webkit-details-marker { display: none; }
.confidential summary small { display: block; color: var(--gold); text-transform: uppercase; letter-spacing: .16em; margin-bottom: .25rem; }
.lock { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); }
.toggle { font-family: var(--serif); font-size: 2rem; color: var(--gold); transition: transform .25s ease; }
details[open] .toggle { transform: rotate(45deg); }
.secret-message { text-align: center; padding: clamp(3.5rem, 8vw, 7rem) 1.5rem; border-top: 1px solid var(--line); background: var(--ink-deep); color: var(--paper); }
.secret-message h2 { font-size: clamp(2.7rem, 6vw, 6rem); line-height: 1; color: var(--paper-light); }
.secret-message > p:not(.eyebrow) { max-width: 670px; margin: 2rem auto 0; font-size: 1.1rem; }
.secret-message .birthday-claim { color: var(--gold-light); font-family: var(--serif); font-size: clamp(1.4rem, 2.5vw, 2rem); }

footer { min-height: 240px; background: var(--ink-deep); color: var(--paper); padding: 4rem max(1.5rem, calc((100vw - var(--max)) / 2)); border-top: 1px solid rgba(215,176,110,.22); display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 2rem; }
.footer-mark { color: var(--paper); }
footer p { margin: 0; font-size: .82rem; color: rgba(245,240,230,.68); }
footer > a:last-child { font-size: .8rem; text-underline-offset: .3rem; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } .department-image img { transition: none; } }

@media (max-width: 820px) {
  .site-header { width: min(calc(100% - 2rem), var(--max)); height: 72px; }
  .menu-button { display: grid; gap: 6px; background: none; border: 0; padding: .75rem .25rem; }
  .menu-button span:not(.sr-only) { display: block; width: 25px; height: 1px; background: var(--ink); transition: transform .2s; }
  .menu-button[aria-expanded="true"] span:nth-child(2) { transform: translateY(3.5px) rotate(45deg); }
  .menu-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-3.5px) rotate(-45deg); }
  nav { display: none; position: absolute; top: 72px; left: -1rem; right: -1rem; padding: 1.5rem; background: var(--paper-light); border-bottom: 1px solid var(--line); flex-direction: column; gap: 1.2rem; box-shadow: 0 14px 30px rgba(11,42,35,.1); }
  nav.open { display: flex; }
  .hero { width: min(calc(100% - 2rem), var(--max)); grid-template-columns: 1fr; gap: 3rem; padding: 3.5rem 0 5rem; }
  .logo { margin-top: -.5rem; }
  .hero-portrait { width: 92%; margin-left: auto; }

  .manifest { grid-template-columns: auto 1fr; padding: 3.5rem 1.5rem; }
  .seal { display: none; }
  .research, .confidential { width: min(calc(100% - 2rem), var(--max)); }
  .section-heading { grid-template-columns: 1fr; gap: 1.75rem; }
  .department-grid { grid-template-columns: 1fr; }
  .department-wide { grid-column: auto; display: block; }
  .department-wide .department-image { min-height: 0; height: 310px; }
  .archive { padding-left: 1rem; padding-right: 1rem; }
  .archive-grid { grid-template-columns: 1fr; }
  .archive-image { height: min(125vw, 640px); }
  footer { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { min-height: auto; }
  .intro { font-size: 1.08rem; }

  .manifest { grid-template-columns: 1fr; gap: .7rem; }
  .manifest-mark { font-size: 2.6rem; }
  .department-image, .department-wide .department-image { height: 245px; }
  .department-body { padding: 1.5rem; }
  .confidential summary { grid-template-columns: auto 1fr; }
  .toggle { display: none; }
}

/* Topic links and future-entry pages */
.topic-list a { display: inline-block; padding: .35rem 0; font-size: .9rem; text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--gold-light); }
.topic-list a:hover { color: var(--gold); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.department { scroll-margin-top: 1.5rem; }
.topic-page { width: min(calc(100% - 3rem), 850px); margin: 0 auto; padding: clamp(3rem, 8vw, 7rem) 0; }
.topic-page .eyebrow { font-size: .875rem; }
.topic-page h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 7vw, 4.8rem); line-height: 1.15; overflow-wrap: anywhere; margin: 0 0 2rem; }
.topic-placeholder { padding: clamp(1.25rem, 4vw, 2.5rem); border: 1px solid var(--gold-light); background: var(--paper-light); margin-bottom: 2rem; }
.topic-placeholder p { margin: 0; }
.topic-placeholder p + p { margin-top: .75rem; }

/* Preserve the full archive photo, including the milk label, at every width. */
.archive-image.milk-full, .archive-image.expedition-full { height: auto; overflow: visible; background: transparent; }
.archive-image.milk-full img, .archive-image.expedition-full img { width: 100%; height: auto; object-fit: contain; filter: none; }
