/* ==========================================================================
   David Barnouw — davidbarnouw.nl
   Editorial / archival design system.
   ========================================================================== */

:root {
  --paper: #e7e6da;
  --paper-2: #dbd9c7;
  --surface: #f2f1e6;
  --ink: #191c15;
  --ink-soft: #494b3d;
  --ink-faint: #82805f;
  --rule: #c7c4a9;
  --rule-strong: #b0ac8c;
  --accent: #4b5320;
  --accent-2: #333a14;
  --stamp: #a3231f;
  --focus: #191c15;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--ink);
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.15em;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 4.6vw, 4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1.1em; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75em 1.25em;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--accent);
  padding: 0.3em 0.65em;
  border-radius: 1px;
  transform: rotate(-0.6deg);
  margin-bottom: 1.1em;
}

.section {
  padding: 4.5rem 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 2.5rem;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85em 1.5em;
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--paper);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-sm {
  padding: 0.55em 1.1em;
  font-size: 0.85rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.link-btn:hover {
  color: var(--accent);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: relative;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  gap: 1.5rem;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
}
.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
}
.brand-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav a {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav a:hover,
.nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  width: 42px;
  height: 38px;
  position: relative;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--ink);
}
.nav-toggle span { top: 18px; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1.25rem;
    display: none;
  }
  .nav a {
    width: 100%;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule);
  }
  body.nav-open .nav { display: flex; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--rule);
}

.hero-ghost {
  position: absolute;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  color: var(--paper-2);
  z-index: 0;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}
.hero-ghost--1 {
  top: -3.5rem;
  right: -1.5rem;
  font-size: clamp(6rem, 22vw, 15rem);
}
.hero-ghost--2 {
  bottom: -4.5rem;
  right: 8vw;
  font-size: clamp(4rem, 14vw, 9rem);
  color: transparent;
  -webkit-text-stroke: 1px var(--paper-2);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero .lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
}

.page-hero {
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}
.page-hero--sm .lead {
  max-width: 640px;
}

/* ---------- Stats strip ---------- */

.stats-band {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.stat {
  padding: 2rem 1.5rem;
  border-left: 1px solid var(--rule);
  text-align: left;
}
.stat:first-child { border-left: none; }
.stat-number {
  display: block;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  color: var(--ink);
}
.stat-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  max-width: 22ch;
}

@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--rule); }
  .stat:first-child { border-top: none; }
}

/* ---------- Books ---------- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.25rem;
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.book-cover {
  aspect-ratio: 3 / 4.3;
  border-radius: 2px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(29,26,21,0.08), 0 12px 24px -18px rgba(29,26,21,0.45);
}
.book-cover--ink { background: var(--ink); }
.book-cover--accent { background: var(--accent-2); }
.book-cover--olive { background: #5c4a2a; }

.book-cover-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
}
.book-cover-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.25;
  text-wrap: balance;
}
.book-cover-foot {
  border-top: 1px solid rgba(242,241,230,0.3);
  padding-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.book-card h3 {
  margin-bottom: 0.35rem;
}
.book-card p {
  margin-bottom: 0;
  font-size: 0.98rem;
}

/* ---------- Tag list ---------- */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.tag-list li {
  padding: 0.9rem 1.4rem 0.9rem 0;
  margin-right: 1.4rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.98rem;
  color: var(--ink);
  flex: 0 0 auto;
}

/* ---------- Two column ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
}
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
}

.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1.75rem 2rem;
}
.callout h3 { margin-bottom: 0.5rem; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 3.5rem;
  align-items: start;
}
@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 2rem;
}
.contact-info h2 { font-size: 1.3rem; }
.contact-address {
  font-style: normal;
}
.contact-note {
  font-size: 0.92rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-top: 1rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-row label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.form-row input,
.form-row select,
.form-row textarea {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule-strong);
  padding: 0.6rem 0.1rem;
  border-radius: 0;
}
.form-row textarea {
  resize: vertical;
  min-height: 8rem;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.form-row--hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field-error {
  color: var(--accent-2);
  font-size: 0.85rem;
}

.notice {
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--rule);
}
.notice-success {
  border-left: 3px solid #3f4630;
}
.notice-error {
  border-left: 3px solid var(--accent);
  margin-bottom: 1.5rem;
}
.notice h2 { font-size: 1.3rem; }
.notice p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  background: var(--paper-2);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1fr;
  gap: 2.5rem;
  padding: 3rem 1.5rem 2rem;
}
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-brand p {
  font-size: 0.92rem;
  color: var(--ink-faint);
  margin-top: 0.6rem;
  margin-bottom: 0;
  max-width: 32ch;
}
.footer-nav, .footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.92rem;
}
.footer-nav a, .footer-contact a {
  text-decoration: none;
  color: var(--ink-soft);
}
.footer-nav a:hover, .footer-contact a:hover {
  color: var(--accent);
}
.footer-contact address {
  font-style: normal;
  font-size: 0.92rem;
  color: var(--ink-faint);
}

.footer-bottom {
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.footer-legal a, .footer-legal button {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--accent);
}
.cookie-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.1rem 1.5rem;
}
.cookie-inner p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 60ch;
  color: var(--paper);
}
.cookie-inner a {
  color: var(--paper);
  text-decoration-color: var(--accent);
}
.cookie-banner .btn-outline {
  border-color: var(--paper);
  color: var(--paper);
}
.cookie-banner .btn-outline:hover {
  background: var(--paper);
  color: var(--ink);
}
.cookie-banner .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.cookie-banner .btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ---------- Legal documents ---------- */

.legal {
  max-width: 72ch;
  margin: 0 auto;
}
.legal .updated {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 2rem;
}
.legal h2 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.legal h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.legal ul, .legal ol {
  padding-left: 1.3rem;
}
.legal li {
  margin-bottom: 0.5rem;
}
.legal strong {
  color: var(--ink);
}
