/* nerdblom.se — "Herbarium" design.
   Source of truth for the look: design/Main.dc.html (1440px canvas). Below
   that width the layout steps down at 1100px, 900px and 640px. */

:root {
  --paper: #F2EDE0;
  --sheet: #F8F4EA;
  --label: #FBF8F1;
  --band: #EAE3D2;
  --ink: #1E271F;
  --moss: #405C3B;
  --body: #3A3F36;
  --text-2: #45493F;
  --muted: #5B5A4C;
  --rule: #CFC5AE;
  --leaf: #DCE3D0;
  --petal: #E9C9B8;
  --stamp: #A63D2A;
  --stamp-deep: #86301F;

  --night-text: #F2EDE0;
  --night-body: #C9CCBE;
  --night-label: #BFC6B2;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --gutter: clamp(20px, 6.6vw, 96px);
  --section: clamp(72px, 8vw, 112px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ink); }
a:hover { color: var(--stamp); }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 3px; }

h1, h2, h3, p, dl, dd, blockquote, figure { margin: 0; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 12px 18px; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 13px;
}
.skip:focus { left: 16px; top: 16px; }

.wrap { max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }

.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); font-weight: 400;
}

.display {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1;
  font-size: clamp(46px, 5.3vw, 76px);
}
.display em { font-style: italic; color: var(--moss); }

/* --- header ------------------------------------------------------------ */

.site-header { position: relative; border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-block: 28px;
}

.brand { display: flex; align-items: baseline; gap: 16px; text-decoration: none; }
.brand-name {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 38px; line-height: 1; letter-spacing: -0.01em;
}
.brand-tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}

.site-nav {
  display: flex; align-items: center; gap: 36px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
}
.site-nav a { text-decoration: none; }
.site-nav a:not(.pill):hover { text-decoration: underline; text-underline-offset: 6px; }

.pill {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 22px; border: 1px solid var(--ink); border-radius: 999px;
}
.pill:hover { background: var(--ink); color: var(--paper); }

.nav-toggle {
  display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px;
  background: transparent; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer;
}
.nav-toggle svg { transition: transform 200ms ease; }
.nav-toggle[aria-expanded="true"] svg { transform: rotate(45deg); }

/* --- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 0 30px; border: none; border-radius: 999px;
  background: var(--stamp); color: #FFFFFF;
  font-family: var(--sans); font-size: 17px; font-weight: 500; text-decoration: none;
  cursor: pointer; transition: background-color 160ms ease;
}
.btn:hover { background: var(--stamp-deep); color: #FFFFFF; }

.link-arrow { font-size: 17px; font-weight: 500; text-underline-offset: 6px; }

/* --- hero -------------------------------------------------------------- */

.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 80px; align-items: center;
  padding-block: 88px 104px;
}
.hero-copy { display: flex; flex-direction: column; gap: 32px; }
.hero-copy .eyebrow { color: var(--stamp); }
.hero h1 {
  font-family: var(--serif); font-weight: 500; line-height: 0.94; letter-spacing: -0.02em;
  font-size: clamp(56px, 8vw, 116px);
}
.hero h1 em { font-style: italic; color: var(--moss); }
.lede { font-size: 20px; line-height: 1.6; max-width: 580px; color: var(--body); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }

.taxonomy {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
  margin-top: 16px; padding-top: 24px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px;
}
.taxonomy dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.taxonomy dd { margin-top: 6px; font-size: 14px; }

.specimen {
  position: relative; height: 760px;
  background: var(--sheet); border: 1px solid var(--rule);
  box-shadow: 0 30px 60px -40px rgba(30, 39, 31, 0.45);
}
.tape { position: absolute; top: -12px; width: 120px; height: 30px; background: rgba(206, 190, 148, 0.6); }
.tape--l { left: 60px; transform: rotate(-4deg); }
.tape--r { right: 70px; width: 110px; transform: rotate(5deg); }
.specimen-art { position: absolute; inset: 40px 40px auto; height: 560px; display: flex; justify-content: center; }
.specimen-art svg { width: 440px; max-width: 100%; height: auto; }

.stamp {
  position: absolute; left: 40px; bottom: 44px; width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 2px solid var(--stamp); border-radius: 50%; color: var(--stamp);
  font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1.5;
  letter-spacing: 0.12em; text-transform: uppercase;
  transform: rotate(-12deg); opacity: 0.9;
}

.specimen-label {
  position: absolute; right: 32px; bottom: 32px; width: 320px;
  display: flex; flex-direction: column; gap: 8px; padding: 18px 20px;
  background: var(--label); border: 1px solid var(--ink);
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
}
.specimen-label-head {
  display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--ink);
  font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
}
.specimen-label-name { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.2; }
.specimen-label span { color: var(--muted); }

/* --- about ------------------------------------------------------------- */

.about { background: var(--band); border-block: 1px solid var(--rule); }
.about .wrap {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 96px;
  padding-block: var(--section);
}
.about-quote { display: flex; flex-direction: column; gap: 28px; }
.about blockquote {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(36px, 3.9vw, 56px); line-height: 1.08; letter-spacing: -0.01em;
}
.about-body {
  display: flex; flex-direction: column; gap: 24px; padding-top: 44px;
  font-size: 18px; line-height: 1.7; color: #33382F;
}
.notes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; margin-top: 8px;
  font-family: var(--mono); font-size: 13px; line-height: 1.5;
}
.notes div { padding-top: 10px; border-top: 1px solid var(--ink); }
.notes dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.notes dd { margin-top: 4px; font-size: 15px; color: var(--ink); }

/* --- section heads ----------------------------------------------------- */

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px 64px; }
.section-head > div { display: flex; flex-direction: column; gap: 16px; }
.section-head > p { max-width: 420px; font-size: 17px; line-height: 1.6; color: var(--muted); }

/* --- specimens (services) ---------------------------------------------- */

.specimens .wrap { display: flex; flex-direction: column; gap: 56px; padding-block: var(--section); }
.plates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.plate {
  display: flex; flex-direction: column; gap: 16px; padding: 28px;
  background: var(--sheet); border: 1px solid var(--rule);
}
.plate-meta {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.plate-art { height: 200px; display: flex; align-items: center; justify-content: center; border-bottom: 1px dashed var(--rule); }
.plate-latin { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1.1; }
.plate h3 { font-size: 20px; font-weight: 600; }
.plate p:last-child { font-size: 16px; line-height: 1.6; color: var(--text-2); }

/* --- method ------------------------------------------------------------ */

.method { background: var(--ink); color: var(--night-text); }
.method a { color: var(--night-text); }
.method .wrap { display: flex; flex-direction: column; gap: 56px; padding-block: 104px var(--section); }
.method .eyebrow { color: var(--night-label); }
.method .display em { color: var(--petal); }
.method .section-head > p { color: var(--night-body); }
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
.stage { display: flex; flex-direction: column; gap: 14px; }
.stage svg { width: 100%; height: 150px; }
.stage .eyebrow { font-size: 12px; }
.stage h3 { font-size: 22px; font-weight: 600; }
.stage p:last-child { font-size: 16px; line-height: 1.6; color: var(--night-body); }

/* --- contact ----------------------------------------------------------- */

.contact .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 96px; align-items: start;
  padding-block: var(--section);
}
.contact-copy { display: flex; flex-direction: column; gap: 28px; }
.contact-copy h2 {
  font-family: var(--serif); font-weight: 500; line-height: 0.98; letter-spacing: -0.02em;
  font-size: clamp(50px, 5.8vw, 84px);
}
.contact-copy h2 em { font-style: italic; color: var(--stamp); }
.contact-copy p:not(.eyebrow) { max-width: 520px; font-size: 19px; line-height: 1.65; color: var(--body); }

.card {
  position: relative; display: flex; flex-direction: column; gap: 28px;
  padding: 40px 44px 44px;
  background: var(--sheet); border: 1px solid var(--rule); border-top: 4px solid var(--stamp);
  box-shadow: 0 30px 60px -40px rgba(30, 39, 31, 0.45);
}
.card-head {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .field-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 0; border: none; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 19px; line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { padding: 8px 0; resize: vertical; min-height: 104px; }
.field input::placeholder, .field textarea::placeholder { color: #7C7A6C; }
.field input:focus, .field textarea:focus {
  outline: none; border-bottom-color: var(--stamp); box-shadow: 0 1px 0 var(--stamp);
}
/* keep the sheet colour when the browser autofills */
.field input:-webkit-autofill, .field input:-webkit-autofill:hover, .field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--sheet) inset; box-shadow: 0 0 0 1000px var(--sheet) inset;
}

.captcha-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-top: 6px; }
.captcha-img { display: block; height: 56px; width: auto; border: 1px solid var(--rule); background: var(--sheet); }
.captcha-refresh {
  min-height: 44px; padding: 0 16px; background: transparent; border: 1px solid var(--ink); border-radius: 999px;
  color: var(--ink); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; align-self: center;
}
.captcha-refresh:hover { background: var(--ink); color: var(--paper); }
.captcha-row input { flex: 1 1 160px; min-width: 140px; letter-spacing: 0.12em; }

.card .btn { width: 100%; min-height: 60px; margin-top: 8px; font-size: 18px; }

.cform-status {
  min-height: 20px; margin-top: -8px;
  font-family: var(--mono); font-size: 12px; line-height: 20px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.cform-status[data-state="ok"] { color: var(--moss); }
.cform-status[data-state="error"] { color: var(--stamp); }
.cform-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* --- footer ------------------------------------------------------------ */

.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px;
  padding-block: 28px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.site-footer .motto { font-family: var(--serif); font-style: italic; font-size: 20px; letter-spacing: 0; text-transform: none; color: var(--ink); }

/* --- responsive -------------------------------------------------------- */

@media (max-width: 1099.98px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 56px; padding-block: 56px 88px; }
  .specimen { height: auto; padding: 48px 24px 24px; }
  .specimen-art { position: static; height: auto; }
  .specimen-label { position: relative; right: auto; bottom: auto; width: auto; max-width: 340px; margin: 16px 0 0 auto; }
  .stamp { width: 116px; height: 116px; left: 24px; bottom: 32px; font-size: 10px; }
  .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 56px; }
  .about .wrap, .contact .wrap { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .about-body { padding-top: 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 899.98px) {
  .brand-tag { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px; background: var(--sheet); border-bottom: 1px solid var(--rule);
    box-shadow: 0 24px 40px -32px rgba(30, 39, 31, 0.5);
  }
  .site-nav a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--rule); }
  .site-nav .pill { justify-content: center; margin-top: 16px; border-bottom: 1px solid var(--ink); }
  .site-nav.is-open { display: flex; animation: nav-in 220ms ease-out both; }
  .site-nav.is-closing { display: flex; animation: nav-out 180ms ease-in both; }
}

@media (max-width: 639.98px) {
  .site-header .wrap { padding-block: 18px; }
  .brand-name { font-size: 32px; }
  .lede { font-size: 18px; }
  .taxonomy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stamp { display: none; }
  .tape--l { left: 20px; }
  .tape--r { right: 20px; }
  .stage svg { height: 120px; }
  .specimen-label { max-width: none; margin-left: 0; }
  .plates, .stages, .notes { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 28px 20px 28px; }
  .captcha-img { height: 48px; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

@keyframes nav-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes nav-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
