/* ==========================================================================
   Excel Knowledge Press — Design System
   One stylesheet, one brand, every page.
   ========================================================================== */

:root {
  /* Brand palette — fixed, do not extend */
  --navy: #0E2A47;
  --navy-2: #143B63;
  --gold: #C8A247;
  --white: #FFFFFF;
  --bg: #F6F7F9;
  --ink: #1A1A1A;

  /* Derived, used sparingly */
  --navy-04: rgba(14, 42, 71, 0.04);
  --navy-08: rgba(14, 42, 71, 0.08);
  --navy-14: rgba(14, 42, 71, 0.14);
  --gold-14: rgba(200, 162, 71, 0.14);
  --hairline: rgba(14, 42, 71, 0.12);
  --hairline-strong: rgba(14, 42, 71, 0.22);

  /* Type */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --max: 1200px;
  --reading: 750px;
  --gutter: clamp(24px, 5vw, 64px);

  /* Rhythm */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: 144px;

  --radius: 2px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

/* ---------- Focus & accessibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  z-index: 1000;
}
.skip-link:focus {
  left: var(--gutter);
  top: 12px;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type scale ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--navy); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 4vw, 4rem); line-height: 1.08; font-weight: 700; }
h2 { font-size: clamp(1.8rem, 2.6vw, 2.6rem); line-height: 1.15; }
h3 { font-size: clamp(1.3rem, 1.6vw, 1.6rem); line-height: 1.3; }
h4 { font-size: 1.1rem; line-height: 1.4; }
.lede { font-size: 1.2rem; line-height: 1.65; color: var(--navy-2); }
p { max-width: var(--reading); }
p.full-width { max-width: none; }

.eyebrow {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow .num { color: var(--navy); opacity: 0.35; font-variant-numeric: tabular-nums; }

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

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.reading {
  max-width: var(--reading);
}
section { padding-top: var(--space-6); padding-bottom: var(--space-6); }
section.tight { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.bg-tint { background: var(--bg); }
.bg-navy { background: var(--navy); color: var(--white); }
.bg-navy h1, .bg-navy h2, .bg-navy h3, .bg-navy h4 { color: var(--white); }
.bg-navy .eyebrow .num { color: var(--white); opacity: 0.45; }

.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #b8923c; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--hairline-strong); }
.btn-outline:hover { border-color: var(--navy); }
.bg-navy .btn-outline { color: var(--white); border-color: rgba(255,255,255,0.35); }
.bg-navy .btn-outline:hover { border-color: var(--white); }
.btn-text { padding: 0; border-bottom: 1px solid var(--gold); font-weight: 600; }
.btn-text:hover { border-color: var(--navy); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { height: 44px; width: auto; display: block; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand .imprint { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--navy); }
.brand .parent { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy-2); opacity: 0.6; }

.main-nav { display: flex; align-items: center; gap: var(--space-4); }
.main-nav ul { display: flex; gap: var(--space-3); }
.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--navy);
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms var(--ease);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { border-color: var(--gold); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .main-nav ul { display: none; }
  .nav-toggle {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid var(--hairline-strong);
    background: transparent;
    border-radius: var(--radius);
  }
  .main-nav.open ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 84px; left: 0; right: 0;
    background: var(--white);
    padding: var(--space-3) var(--gutter);
    border-bottom: 1px solid var(--hairline);
    gap: var(--space-2);
  }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.82); }
.site-footer a:hover { color: var(--gold); }
.footer-top { padding: var(--space-6) 0 var(--space-5); display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-4); }
.footer-top h4 { color: var(--white); font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--space-2); }
.footer-top ul li { margin-bottom: 10px; font-size: 0.95rem; }
.footer-brand { display: flex; flex-direction: column; }
.footer-brand-top { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.footer-logo { height: 38px; width: auto; display: block; }
.footer-brand .imprint { font-family: var(--font-display); font-size: 1.4rem; color: var(--white); font-weight: 700; }
.footer-brand p { color: rgba(255,255,255,0.65); margin-top: var(--space-2); font-size: 0.95rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding: var(--space-3) 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: rgba(255,255,255,0.55);
}
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

/* ---------- Hero ---------- */
.hero { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-6); align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: var(--space-5); } }
.hero h1 { margin-top: var(--space-2); }
.hero .lede { margin-top: var(--space-3); }
.hero-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }

/* Book spine motif — signature element:
   a set of vertical hairlines of varying weight/spacing standing in for
   a shelf of spines, used behind hero art and as a section divider */
.spine-motif {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg);
  border: 1px solid var(--hairline);
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.spine-motif::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    var(--navy-08) 0px, var(--navy-08) 1px,
    transparent 1px, transparent 34px
  );
  opacity: 0.5;
}
.spine-cover {
  position: relative;
  width: 62%;
  aspect-ratio: 5 / 7.5;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  margin-bottom: 8%;
  box-shadow: 0 24px 48px -20px rgba(14,42,71,0.45);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 9% 8%;
}
.spine-cover .mark { width: 28px; height: 3px; background: var(--gold); }
.spine-cover .cover-title { font-family: var(--font-display); color: var(--white); font-size: 1.1rem; line-height: 1.3; font-weight: 700; }
.spine-cover .cover-author { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.7); }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--hairline);
  background: var(--white);
  padding: var(--space-4);
  transition: border-color 180ms var(--ease);
}
.card:hover { border-color: var(--hairline-strong); }
.card h3 { margin-top: var(--space-2); }
.card p { margin-top: var(--space-2); font-size: 0.98rem; color: var(--navy-2); }

.book-card { display: flex; flex-direction: column; }
.book-card .cover-thumb {
  aspect-ratio: 5/7.5;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  padding: 12%; display: flex; flex-direction: column; justify-content: space-between;
  margin-bottom: var(--space-3);
}
.book-card .cover-thumb .mark { width: 22px; height: 2.5px; background: var(--gold); }
.book-card .cover-thumb .cover-title { font-family: var(--font-display); color: var(--white); font-weight: 700; font-size: 0.95rem; }
.book-card .cover-thumb.is-future { background: var(--bg); border: 1px dashed var(--hairline-strong); }
.book-card .cover-thumb.is-future .cover-title { color: var(--navy-2); }
.book-card .card-actions { margin-top: var(--space-3); display: flex; gap: var(--space-2); align-items: center; }

/* Real cover photography — replaces the CSS spine-cover mock wherever
   the actual print cover is available */
.cover-photo {
  aspect-ratio: 5 / 7.5;
  overflow: hidden;
  box-shadow: 0 24px 48px -20px rgba(14,42,71,0.45);
  margin-bottom: 0;
}
.cover-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-card .cover-photo { margin-bottom: var(--space-3); box-shadow: none; border: 1px solid var(--hairline); }

.author-photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.author-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Insights / blog ---------- */
.article-card { padding-bottom: var(--space-4); border-bottom: 1px solid var(--hairline); }
.article-card:last-child { border-bottom: none; }
.article-meta { display: flex; gap: var(--space-2); align-items: center; font-size: 0.85rem; color: var(--navy-2); margin-top: var(--space-1); }
.category-pill {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold-14);
  border-radius: 999px;
}

/* ---------- Forms ---------- */
.field { margin-bottom: var(--space-3); }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}
.field textarea { min-height: 140px; resize: vertical; }
.field .hint { font-size: 0.82rem; color: var(--navy-2); margin-top: 6px; }

/* ---------- Newsletter ---------- */
.newsletter { display: flex; gap: var(--space-2); max-width: 480px; }
.newsletter input { flex: 1; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 0.85rem; color: var(--navy-2); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs .sep { opacity: 0.4; }

/* ---------- Table of contents preview ---------- */
.toc-list { border-top: 1px solid var(--hairline); }
.toc-list li {
  display: flex; justify-content: space-between; gap: var(--space-2);
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.98rem;
}
.toc-list .toc-num { color: var(--gold); font-weight: 600; min-width: 32px; }
.toc-list .toc-title { flex: 1; color: var(--navy); }
.toc-list .toc-page { color: var(--navy-2); font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-item summary {
  padding: var(--space-3) 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--gold); font-size: 1.4rem; font-family: var(--font-body); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding-bottom: var(--space-3); color: var(--navy-2); }

/* ---------- 404 / empty states ---------- */
.empty-state { text-align: center; padding: var(--space-7) 0; }
.empty-state .eyebrow { justify-content: center; }
.empty-state h1 { margin-top: var(--space-2); }
.empty-state p { margin: var(--space-3) auto 0; }
.empty-state .hero-actions { justify-content: center; }

/* ---------- Search ---------- */
.search-form { display: flex; gap: var(--space-2); max-width: 640px; }
.search-form input { flex: 1; }
.search-result { padding: var(--space-3) 0; border-bottom: 1px solid var(--hairline); }
.search-result .path { font-size: 0.8rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Utility ---------- */
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.center { text-align: center; }
.stat { font-family: var(--font-display); font-size: 2.2rem; color: var(--navy); font-weight: 700; }
.stat-label { font-size: 0.85rem; color: var(--navy-2); margin-top: 4px; }
