/* Sheaf landing: herbarium / biology-textbook plate */

:root {
  --bg: #f4efe6;
  --bg-gradient: radial-gradient(ellipse 110% 75% at 8% 0%, #ebe3d4 0%, #f4efe6 52%);
  --text: #181410;
  --body: #3a3530;
  --muted: #524c44;
  --accent: #3d5c4a;
  --accent-soft: rgba(61, 92, 74, 0.12);
  --hairline: rgba(31, 26, 20, 0.18);

  --signals: #b85c38;
  --remember: #3a5f73;
  --dream: #6b5478;
  --speak: #b0892e;
  --human: #4a6b3e;
  --gold: #9a7b2f;
  --stale: #a33a3a;

  --glass-bg: #faf6ef;
  --glass-border: rgba(24, 20, 16, 0.14);
  --glass-blur: none;
  --glass-shadow: 0 1px 0 rgba(24, 20, 16, 0.06);
  --plate-inset: #e9e2d6;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --text-track: min(76rem, 100%);
  --page: min(1440px, calc(100vw - var(--gutter)));
  --gutter: clamp(28px, 4vw, 64px);
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--body);
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  max-width: var(--page);
  margin: 0;
  padding: 48px var(--gutter) 72px calc(var(--gutter) + 4px);
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  z-index: 100;
}

.skip-link:focus {
  top: 20px;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}

h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--text);
  font-size: 1.02rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
}

h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

/* Subtitle styling */
.subtitle {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 0;
  display: block;
}

p {
  max-width: var(--text-track);
  margin-bottom: 0.85rem;
}

.hero p,
.section > p,
.section > .fail-list,
footer p {
  max-width: 100%;
}

p:last-child {
  margin-bottom: 0;
}

/* Sections: phase-colored top rule, no kickers / eyebrows */

.section {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
  border-left: 3px solid var(--hairline);
  padding-left: 1.25rem;
  padding-right: 0.25rem;
  width: 100%;
  max-width: 100%;
}

.section--signals {
  border-left-color: var(--signals);
}

.section--remember {
  border-left-color: var(--remember);
}

.section--dream {
  border-left-color: var(--dream);
}

.section--speak {
  border-left-color: var(--speak);
}

.hero {
  margin-bottom: 0.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline);
}

/* Editorial frontispiece spread */

.hero--spread {
  display: grid;
  grid-template-columns: minmax(16rem, 5fr) minmax(18rem, 7fr);
  column-gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

.hero--spread .hero-masthead h1 {
  font-size: clamp(2.75rem, 5vw, 3.75rem);
  line-height: 1.05;
  margin-bottom: 0.65rem;
}

.hero-masthead {
  margin-bottom: 1.5rem;
}

.hero-masthead .subtitle {
  margin-bottom: 0.85rem;
}

.hero-masthead::after {
  content: "";
  display: block;
  width: 4rem;
  height: 1px;
  background: var(--hairline);
  margin-top: 0.85rem;
}

.hero-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--muted);
  margin: 0.75rem 0 0;
  line-height: 1.4;
}

.hero-lede {
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--text);
  max-width: 22rem;
  margin-bottom: 1.25rem;
}

.hero-bridge {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 22rem;
  margin-bottom: 0;
}

.hero-body {
  border-left: 1px solid var(--hairline);
  padding-left: clamp(1.25rem, 3vw, 2rem);
}

.hero-problem {
  padding-top: 0.85rem;
  border-top: 2px solid var(--hairline);
  margin-bottom: 2rem;
}

.hero-problem:last-of-type {
  margin-bottom: 0;
}

.hero-problem--temporal {
  border-top-color: var(--remember);
}

.hero-problem--session {
  border-top-color: var(--speak);
}

.hero-problem h2 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.hero-roman {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-right: 0.45rem;
}

.hero-problem p {
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 0;
  max-width: none;
}

.hero-notation {
  font-family: var(--mono);
  font-size: 0.92em;
  font-weight: 500;
  color: var(--text);
  background: none;
  padding: 0;
}

.hero-purpose {
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--body);
  max-width: none;
}

.hero-purpose em {
  font-style: italic;
  color: var(--text);
}

@media (max-width: 899px) {
  .hero--spread {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 0.5rem;
    padding-bottom: 2rem;
  }

  .hero-body {
    border-left: none;
    padding-left: 0;
    display: contents;
  }

  .hero-rail {
    display: contents;
  }

  .hero-masthead {
    order: 1;
  }

  .hero-lede {
    order: 2;
    max-width: none;
    margin-bottom: 1.5rem;
  }

  .hero-problem--temporal {
    order: 3;
  }

  .hero-problem--session {
    order: 4;
  }

  .hero-bridge {
    order: 5;
    max-width: none;
    margin: 0.25rem 0 1.25rem;
  }

  .hero-purpose {
    order: 6;
    margin-top: 0;
  }

  .hero-meta {
    letter-spacing: 0.04em;
  }
}

/* Specimen plates (class name .glass kept) */

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 0;
  box-shadow: var(--glass-shadow);
}

/* Three-column layout for Fig. 1 */
.three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.three-column .specimen h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.three-column .specimen p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.join {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}

.join-cell {
  padding: 1.1rem 1.15rem;
}

.join-cell h3 {
  color: var(--text);
}

.join-cell p {
  font-size: 0.95rem;
  color: var(--body);
  max-width: none;
  margin: 0;
  line-height: 1.5;
}

.fail-list {
  list-style: none;
  margin: 1rem 0 0;
  max-width: 100%;
}

.fail-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--body);
}

.fail-list li:last-child {
  border-bottom: none;
}

.fail-list code {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-right: 0.35rem;
}

/* Lithograph plate (Fig. 1) */

.plate {
  margin-top: 1.35rem;
  padding: 1.1rem 1.15rem 1.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--text);
  box-shadow: inset 0 0 0 1px var(--glass-border), inset 0 0 0 4px var(--glass-bg),
    inset 0 0 0 5px color-mix(in srgb, var(--text) 25%, transparent);
  max-width: 100%;
}

.plate-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-serif);
  color: var(--text);
}

.plate-num {
  font-size: 0.72rem;
  font-variant: small-caps;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.plate-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.plate-sub {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--body);
}

.plate-figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.specimen {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.specimen-epithet {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--body);
  max-width: none;
  margin: 0;
}

.specimen-letter {
  font-variant: small-caps;
  font-weight: 600;
  color: var(--text);
  margin-right: 0.25rem;
}

.specimen-drawing {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--hairline);
  background: var(--plate-inset);
}

.specimen-verdict {
  font-size: 0.9rem;
  color: var(--body);
  margin: 0;
  max-width: none;
}

.specimen-verdict strong {
  font-weight: 600;
  color: var(--text);
}

.specimen-verdict .stale {
  font-style: italic;
  color: var(--stale);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.plate-gold {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  font-size: 0.95rem;
  color: var(--body);
  max-width: none;
}

.plate-gold em {
  font-style: italic;
  color: var(--gold);
}

.plate-note {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.95rem;
  color: var(--body);
  max-width: none;
}

/* Botanical Methods colophon */

.methods--botanical {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
  width: 100%;
}

.methods-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
  line-height: 1.4;
}

.methods-masthead {
  margin-bottom: 1.35rem;
}

.methods-masthead h2 {
  margin-bottom: 0;
}

.methods-masthead::after {
  content: "";
  display: block;
  width: 4rem;
  height: 1px;
  background: var(--hairline);
  margin-top: 0.75rem;
}

.methods-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.methods-item {
  padding-top: 0;
  border-top: none;
}

.methods-item h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.methods-item p {
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 0;
  max-width: none;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}

footer p {
  font-size: 0.95rem;
  color: var(--body);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.9rem;
}

.footer-links a {
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.footer-links a:hover {
  border-bottom-color: var(--accent);
  color: var(--text);
}

/* Catalog sidebar navigation */
.catalog-nav {
  position: fixed;
  left: max(24px, calc((100vw - var(--page)) / 2));
  top: 120px;
  width: 140px;
  z-index: 10;
}

.catalog-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--hairline);
}

.catalog-nav li {
  padding: 8px 0 8px 16px;
  font-family: var(--font-serif);
  font-size: 14px;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: border-color 0.2s;
}

.catalog-nav li.active {
  border-left-color: var(--accent);
  font-weight: 600;
}

.catalog-nav li.star::after {
  content: " ★";
  color: var(--gold);
  font-size: 11px;
  margin-left: 4px;
}

.catalog-nav a {
  color: var(--body);
  text-decoration: none;
}

.catalog-nav a:hover {
  color: var(--text);
}

/* Main content offset when sidebar present */
@media (min-width: 1024px) {
  body {
    padding-left: calc(var(--gutter) + 180px);
  }
}

@media (max-width: 720px) {
  body {
    padding: 32px 20px 56px 22px;
    font-size: 17px;
  }

  h1 {
    font-size: 2rem;
  }

  .join,
  .plate-figures {
    grid-template-columns: 1fr;
  }

  .three-column {
    grid-template-columns: 1fr;
  }

  .catalog-nav {
    display: none;
  }
}

@media (max-width: 1023px) {
  .catalog-nav {
    display: none;
  }
}
