/* =========================================================
   THE PRINGSHEIM PROJECT
   Global stylesheet adapted to the uploaded index.html
   ========================================================= */

:root {
  --paper: #f7f4ec;
  --paper-soft: #fbf9f4;
  --paper-deep: #ece6da;
  --ink: #202620;
  --muted: #667067;
  --green: #315d45;
  --green-dark: #244634;
  --green-deep: #163226;
  --cream: #f8f1e4;
  --line: rgba(31, 63, 47, 0.20);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", Arial, sans-serif;
  --container: 1180px;
  --shadow: 0 24px 65px rgba(20, 42, 31, 0.16);
}

/* Reset */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

p {
  margin: 0 0 1.25rem;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--green-dark);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(4rem, 8vw, 7.3rem);
  line-height: 0.92;
}

h2 {
  font-size: clamp(2.7rem, 5vw, 4.7rem);
  line-height: 1.02;
}

h3 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.1;
}

cite {
  font-style: italic;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(calc(100% - 3rem), var(--container));
  margin-inline: auto;
}

.section-pad {
  padding: clamp(5rem, 9vw, 8.5rem) 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  background: #fff;
  color: var(--green-dark);
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */

.site-header {
  position: relative;
  z-index: 20;
  background: rgba(247, 244, 236, 0.97);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
}

.brand-name {
  color: var(--green-dark);
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  font-weight: 600;
  line-height: 1;
}

.brand-tagline {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.7rem);
}

.primary-nav a {
  position: relative;
  padding: 0.4rem 0;
  color: #424a43;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
}

.primary-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--green);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.primary-nav a:hover::after,
.primary-nav a.active::after,
.primary-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}

.nav-toggle span[aria-hidden="true"] {
  display: block;
  height: 1px;
  margin: 5px 0;
  background: var(--green-dark);
}

/* Shared typography and buttons */

.eyebrow {
  margin-bottom: 1rem;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button,
.button-primary,
.button-secondary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--green-dark);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.button-primary {
  background: var(--green-dark);
  color: #fff;
}

.button-secondary {
  background: transparent;
  color: var(--green-dark);
}

.button:hover,
.button-primary:hover,
.button-secondary:hover {
  transform: translateY(-2px);
}

.button-primary:hover {
  background: var(--green-deep);
}

.button-secondary:hover {
  background: var(--green-dark);
  color: #fff;
}

.text-link {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}

.text-link span {
  transition: transform 180ms ease;
}

.text-link:hover span {
  transform: translateX(4px);
}

/* Home hero */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(49, 93, 69, 0.07), transparent 30%),
    var(--paper);
}

.hero::after {
  position: absolute;
  right: -170px;
  bottom: -270px;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(49, 93, 69, 0.12);
  border-radius: 50%;
  content: "";
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.82fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: center;
}

.hero-copy {
  max-width: 680px;
}

.title-rule {
  width: 92px;
  height: 1px;
  margin: 2rem 0 1.15rem;
  background: var(--green);
}

.hero-subtitle {
  margin: 0 0 1.4rem;
  color: var(--green);
  font-family: var(--serif);
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  font-style: italic;
  line-height: 1.2;
}

.hero-intro {
  max-width: 610px;
  color: #4f5850;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.portrait-wrap {
  position: relative;
  margin: 0;
}

.portrait-wrap::before {
  position: absolute;
  top: 1.2rem;
  right: -1.2rem;
  bottom: -1.2rem;
  left: 1.2rem;
  border: 1px solid var(--line);
  content: "";
}

.portrait-wrap img {
  position: relative;
  width: 100%;
  height: auto;
  background: var(--paper-deep);
  box-shadow: var(--shadow);
}

.portrait-wrap figcaption,
.scientific-figure figcaption {
  position: relative;
  margin-top: 0.95rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

/* Legacy strip */

.legacy-strip {
  padding: 2rem 0;
  background: var(--green-dark);
  color: #fff;
}

.legacy-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.legacy-grid p {
  margin: 0;
  padding: 0 1.25rem;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.legacy-grid p:first-child {
  padding-left: 0;
}

.legacy-grid p:last-child {
  padding-right: 0;
  border-right: 0;
}

.legacy-grid strong,
.legacy-grid span {
  display: block;
}

.legacy-grid strong {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
}

.legacy-grid span {
  margin-top: 0.15rem;
  color: #c6d2c8;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Why it matters */

.matters {
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: center;
}

.section-copy {
  max-width: 650px;
}

.section-copy h2 {
  margin-bottom: 1.65rem;
}

.section-copy p {
  color: #4f5850;
}

.scientific-figure {
  margin: 0;
}

.scientific-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

/* Publication */

.publication {
  background: var(--paper);
}

.book-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: center;
}

.book-cover {
  margin: 0;
  display: flex;
  justify-content: center;
}

.book-cover img {
  width: min(100%, 430px);
  height: auto;
  box-shadow: 0 22px 50px rgba(24, 46, 33, 0.20);
}

.book-copy {
  max-width: 700px;
}

.book-subtitle {
  margin: -0.5rem 0 1.6rem;
  color: var(--green);
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  font-style: italic;
  line-height: 1.3;
}

/* Outreach support */

.outreach-hero {
  padding: clamp(5.5rem, 11vw, 10rem) 0 clamp(5rem, 9vw, 8rem);
  background:
    radial-gradient(circle at 80% 20%, rgba(49, 93, 69, 0.09), transparent 32%),
    var(--paper);
}

.outreach-hero__inner,
.outreach-hero-inner {
  max-width: 980px;
}

.outreach-lead {
  max-width: 780px;
  margin-top: 2rem;
  margin-bottom: 0;
  color: #525b53;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.7vw, 2.1rem);
  line-height: 1.38;
}

.event-feature,
.current-event {
  position: relative;
  padding: clamp(5rem, 9vw, 8.5rem) 0;
  overflow: hidden;
  background: var(--green-dark);
  color: #edf2ed;
}

.event-feature h2,
.current-event h2 {
  color: #fff;
}

.event-feature__image,
.event-photo,
.current-event-visual {
  margin: 0;
}

.event-feature__image img,
.event-photo img,
.current-event-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow);
}

.exhibition-section,
.exhibition {
  padding: clamp(5rem, 10vw, 9rem) 0;
  background: var(--paper);
}

.exhibition-section__grid,
.exhibition-grid,
.exhibition-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: center;
}

.exhibition-section__poster,
.poster-frame,
.exhibition-visual {
  min-height: 580px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: clamp(2rem, 5vw, 4.5rem);
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.exhibition-section__poster img,
.poster-frame img,
.exhibition-visual img {
  width: 100%;
  height: auto;
  max-height: 760px;
  object-fit: contain;
}

/* Footer */

.site-footer {
  padding: 4.5rem 0 1.5rem;
  background: var(--green-deep);
  color: #d7e1d8;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-brand {
  margin-bottom: 0.55rem;
  color: #fff;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
}

.footer-grid > div:first-child {
  max-width: 560px;
}

.footer-links {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
}

.footer-links span {
  display: inline-block;
  min-width: 1.6rem;
  color: #b9c9bd;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #aebdaf;
  font-size: 0.75rem;
}

.footer-bottom p {
  margin: 0;
}

/* Responsive */

@media (max-width: 980px) {
  .header-inner {
    min-height: 92px;
  }

  .nav-toggle {
    display: block;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.5rem 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a {
    padding: 0.7rem 0;
  }

  .hero-grid,
  .split-grid,
  .book-grid,
  .exhibition-section__grid,
  .exhibition-grid,
  .exhibition-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .section-copy,
  .book-copy {
    max-width: 760px;
  }

  .portrait-wrap {
    width: min(100%, 650px);
  }

  .legacy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 0;
  }

  .legacy-grid p:nth-child(2n) {
    border-right: 0;
  }

  .legacy-grid p:nth-child(odd) {
    padding-left: 0;
  }

  .legacy-grid p:nth-child(even) {
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 2rem), var(--container));
  }

  .brand-tagline {
    display: none;
  }

  h1 {
    font-size: clamp(3.5rem, 18vw, 5rem);
  }

  .button-group {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .button-primary,
  .button-secondary {
    width: 100%;
  }

  .portrait-wrap::before {
    top: 0.7rem;
    right: -0.7rem;
    bottom: -0.7rem;
    left: 0.7rem;
  }

  .legacy-grid {
    grid-template-columns: 1fr;
  }

  .legacy-grid p,
  .legacy-grid p:first-child,
  .legacy-grid p:last-child,
  .legacy-grid p:nth-child(odd),
  .legacy-grid p:nth-child(even) {
    padding: 0 0 1rem;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .legacy-grid p:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.4rem;
  }
}

/* ===== Illustration styling for Biography ===== */

/* Historical illustrations */
.illustrated-image,
.scientific-figure,
.poster-frame {
    background: #f7f4ec;
    padding: 1.5rem;
    border: 1px solid #d9d2c5;
    border-radius: 4px;
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
}

.illustrated-image img,
.scientific-figure img,
.poster-frame img {
    display: block;
    width: 100%;
    height: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    object-fit: contain;
}

/* Captions */
.illustrated-image figcaption,
.scientific-figure figcaption {
    margin-top: .9rem;
    font-size: .82rem;
    line-height: 1.5;
    color: #666;
    font-style: italic;
}

/* Biography feature sections */
.discovery-feature,
.institution-feature {
    padding: 5rem 0;
}

.illustrated-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.illustrated-grid.reverse > :first-child {
    order: 1;
}

.illustrated-grid.reverse > :last-child {
    order: 2;
}

@media (max-width: 900px) {
    .illustrated-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .illustrated-image,
    .scientific-figure,
    .poster-frame {
        padding: 1rem;
    }
}
