/* ============================================================
   Cartographica Neerlandica — 2026 Design System
   A museum-quality interface for antique cartography
   ============================================================ */

/* --- Custom Properties --- */
:root {
  /* Palette: inspired by aged vellum, iron-gall ink, and gold leaf */
  --ink:         #1a1a2e;
  --ink-light:   #2d2d44;
  --ink-muted:   #4a4a68;
  --vellum:      #f5f0e8;
  --vellum-dark: #e8e0d0;
  --parchment:   #faf7f2;
  --gold:        #b8860b;
  --gold-light:  #d4a843;
  --gold-pale:   #f0e6c8;
  --rust:        #8b4513;
  --rust-light:  #a0522d;
  --sepia:       #704214;
  --cream:       #fffdf7;
  --shadow:      rgba(26, 26, 46, 0.12);
  --shadow-lg:   rgba(26, 26, 46, 0.18);

  /* Typography */
  --font-display: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Source Serif 4', 'Georgia', serif;
  --font-ui:      'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Sizing scale */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --max-width:   1200px;
  --header-h:    72px;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.3s;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--parchment);
  line-height: 1.7;
  overflow-x: hidden;
}

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

a {
  color: var(--rust);
  text-decoration: none;
  transition: color var(--duration) var(--ease-out);
}
a:hover {
  color: var(--gold);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: var(--space-md);
}

.text-gold { color: var(--gold); }
.text-muted { color: var(--ink-muted); }
.text-center { text-align: center; }

.label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

/* --- Decorative Elements --- */
.flourish {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.flourish::before,
.flourish::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}
.flourish-icon {
  color: var(--gold);
  font-size: 1.2rem;
}

.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--vellum-dark), transparent);
  margin: var(--space-xl) 0;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}
.section--alt {
  background: var(--vellum);
}

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--vellum-dark);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.site-logo span {
  color: var(--gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}
.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--ink);
  stroke-width: 2;
  fill: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.site-nav a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  background: var(--gold-pale);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  filter: sepia(30%) saturate(80%);
  transition: opacity 0.6s var(--ease-out);
}
.hero:hover .hero-bg {
  opacity: 0.45;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 26, 46, 0.7) 0%,
    rgba(26, 26, 46, 0.4) 50%,
    rgba(26, 26, 46, 0.8) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  max-width: 800px;
}
.hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--cream);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}
.hero-content .subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--gold-light);
  font-style: italic;
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}
.hero-content .hero-tagline {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: rgba(255, 253, 247, 0.6);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
}
.btn--primary {
  background: var(--gold);
  color: var(--cream);
}
.btn--primary:hover {
  background: var(--gold-light);
  color: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(184, 134, 11, 0.3);
}
.btn--outline {
  background: transparent;
  color: var(--cream);
  border: 1.5px solid rgba(255, 253, 247, 0.3);
}
.btn--outline:hover {
  border-color: var(--gold-light);
  color: var(--gold-light);
}
.btn--dark {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--vellum-dark);
}
.btn--dark:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Cards --- */
.card {
  background: var(--cream);
  border: 1px solid var(--vellum-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--duration) var(--ease-out);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px var(--shadow);
  border-color: var(--gold-pale);
}
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--vellum);
}
.card-body {
  padding: var(--space-lg);
}
.card-body h3 {
  margin-bottom: var(--space-sm);
}
.card-body p {
  font-size: 0.95rem;
  color: var(--ink-muted);
}

/* --- Map Table (Stocklist) --- */
.map-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--vellum-dark);
  border-radius: var(--radius-md);
  background: var(--cream);
}

.map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.map-table thead {
  background: var(--ink);
  color: var(--vellum);
}
.map-table th {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  white-space: nowrap;
}
.map-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--vellum-dark);
  vertical-align: middle;
}
.map-table tbody tr {
  transition: background var(--duration) var(--ease-out);
}
.map-table tbody tr:hover {
  background: var(--gold-pale);
}
.map-table .price {
  font-weight: 600;
  color: var(--sepia);
  white-space: nowrap;
}
.map-table .stock-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.map-table .map-links {
  display: flex;
  gap: var(--space-sm);
}
.map-table .map-links a {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--vellum);
  color: var(--rust);
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}
.map-table .map-links a:hover {
  background: var(--gold);
  color: var(--cream);
}

/* --- Map Grid (alternative card view) --- */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.map-card {
  background: var(--cream);
  border: 1px solid var(--vellum-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--duration) var(--ease-out);
}
.map-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px var(--shadow-lg);
}
.map-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--vellum);
  position: relative;
}
.map-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.map-card:hover .map-card-img img {
  transform: scale(1.05);
}
.map-card-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--gold-light);
}
.map-card-body {
  padding: var(--space-lg);
}
.map-card-body h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}
.map-card-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: var(--space-md);
}
.map-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--vellum-dark);
  background: var(--vellum);
}
.map-card-price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sepia);
}

/* --- Description Page --- */
.description-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.description-image {
  position: sticky;
  top: calc(var(--header-h) + var(--space-lg));
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--vellum-dark);
  box-shadow: 0 8px 32px var(--shadow);
}
.description-image img {
  width: 100%;
}

.description-details {
  padding: var(--space-lg) 0;
}
.description-details h1 {
  margin-bottom: var(--space-lg);
}

.detail-row {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--vellum-dark);
}
.detail-label {
  flex: 0 0 200px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.detail-value {
  flex: 1;
  font-size: 0.95rem;
}

/* --- Atlas Editions Grid --- */
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}
.atlas-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--cream);
  border: 1px solid var(--vellum-dark);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
  color: var(--ink);
}
.atlas-card:hover {
  border-color: var(--gold);
  background: var(--gold-pale);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
  color: var(--ink);
}
.atlas-card-year {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}
.atlas-card-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* --- Feature Blocks --- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}
.feature {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}
.feature h3 {
  margin-bottom: var(--space-sm);
}
.feature p {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin: 0 auto;
}

/* --- Book Promo --- */
.book-promo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2xl);
  align-items: center;
  padding: var(--space-2xl);
  background: var(--ink);
  border-radius: var(--radius-lg);
  color: var(--cream);
}
.book-promo h2 {
  color: var(--cream);
}
.book-promo p {
  color: rgba(255, 253, 247, 0.8);
}
.book-promo .price-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  margin: var(--space-md) 0;
}
.book-promo-image {
  width: 200px;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* --- Contact Block --- */
.contact-block {
  background: var(--vellum);
  border-radius: var(--radius-md);
  padding: var(--space-2xl);
  text-align: center;
}
.contact-grid {
  display: flex;
  gap: var(--space-2xl);
  justify-content: center;
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}
.contact-item {
  text-align: center;
}
.contact-item .label {
  display: block;
  margin-bottom: var(--space-xs);
}
.contact-item a,
.contact-item span {
  font-size: 1.1rem;
  font-weight: 600;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--ink-muted);
  padding: var(--space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.breadcrumb a {
  color: var(--ink-muted);
}
.breadcrumb a:hover {
  color: var(--gold);
}
.breadcrumb .sep {
  opacity: 0.4;
}

/* --- Page Header (non-hero) --- */
.page-header {
  padding: var(--space-2xl) 0;
  background: var(--ink);
  color: var(--cream);
  text-align: center;
}
.page-header h1 {
  color: var(--cream);
  margin-bottom: var(--space-sm);
}
.page-header p {
  color: var(--gold-light);
  font-style: italic;
  font-size: 1.1rem;
  margin: 0 auto;
}

/* --- Prose (long-form text) --- */
.prose {
  max-width: 900px;
}
.prose h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}
.prose h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}
.prose p + p {
  margin-top: var(--space-md);
}
.prose ul, .prose ol {
  margin: var(--space-md) 0;
  padding-left: var(--space-xl);
}
.prose li {
  margin-bottom: var(--space-sm);
}
.prose blockquote {
  border-left: 3px solid var(--gold);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--ink-muted);
}

/* --- Steps (ordering process) --- */
.steps {
  counter-reset: step;
}
.step {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}
.step h3 {
  margin-bottom: var(--space-sm);
}
.step p {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* --- Links page --- */
.link-card {
  padding: var(--space-lg);
  background: var(--cream);
  border: 1px solid var(--vellum-dark);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  transition: all var(--duration) var(--ease-out);
}
.link-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px var(--shadow);
}
.link-card h3 {
  font-size: 1.05rem;
  margin-bottom: var(--space-xs);
}
.link-card h3 a {
  color: var(--ink);
}
.link-card h3 a:hover {
  color: var(--gold);
}
.link-card p {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0;
}

/* --- Footer --- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 253, 247, 0.6);
  padding: var(--space-2xl) 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}
.footer-brand {
  max-width: 320px;
}
.footer-brand .site-logo {
  color: var(--cream);
  margin-bottom: var(--space-md);
  display: block;
}
.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.6;
}
.footer-links h4 {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: var(--space-md);
}
.footer-links a {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: rgba(255, 253, 247, 0.6);
  padding: var(--space-xs) 0;
  transition: color var(--duration) var(--ease-out);
}
.footer-links a:hover {
  color: var(--cream);
}
.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 253, 247, 0.1);
  font-size: 0.8rem;
  text-align: center;
}

/* --- Region chips (stocklist navigation) --- */
.region-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}
.region-chip {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  background: var(--vellum);
  color: var(--ink-muted);
  border: 1px solid var(--vellum-dark);
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
}
.region-chip:hover,
.region-chip.active {
  background: var(--gold);
  color: var(--cream);
  border-color: var(--gold);
}

/* --- Stocklist section headers --- */
.stocklist-section {
  margin-bottom: var(--space-lg);
}
.stocklist-section h2 {
  margin-bottom: 0;
}

/* Subcontinent h3 headers between tables */
.map-table-wrapper + h3,
.stocklist-section + h3 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  color: var(--ink-muted);
  font-weight: 400;
  font-style: italic;
}

/* Space above first table after section header */
.stocklist-section + .map-table-wrapper,
.stocklist-section + h3 + .map-table-wrapper {
  margin-top: var(--space-lg);
}

/* Space between consecutive tables */
.map-table-wrapper + .map-table-wrapper {
  margin-top: var(--space-xl);
}

/* Space below tables */
.map-table-wrapper {
  margin-bottom: var(--space-lg);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .description-page {
    grid-template-columns: 1fr;
  }
  .description-image {
    position: static;
  }
  .book-promo {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .book-promo-image {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  .nav-toggle {
    display: block;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--vellum-dark);
    flex-direction: column;
    padding: var(--space-md);
    box-shadow: 0 12px 32px var(--shadow);
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    padding: var(--space-md);
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .footer-inner {
    flex-direction: column;
  }

  .step {
    grid-template-columns: 44px 1fr;
  }
  .step::before {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

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

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

/* --- Subtle animation on scroll (applied via JS) --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Print styles --- */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle,
  .btn {
    display: none;
  }
  body {
    color: #000;
    background: #fff;
  }
  .hero {
    min-height: auto;
    background: none;
  }
  .hero-content h1 {
    color: #000;
  }
}
