/* ──────────────────────────────────────────────────────────────────────
   Shared brand tokens + nav + footer for the three inner-page directions.
   Each direction loads this file alongside its own direction-X.css.
   ────────────────────────────────────────────────────────────────────── */

/* ─── Local fonts ───────────────────────────────────────────────────── */
/* DM Sans — variable weight 300–600, latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* DM Sans — variable weight 300–600, latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* DM Serif Display — normal, latin-ext */
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* DM Serif Display — normal, latin */
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* DM Serif Display — italic, latin-ext */
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* DM Serif Display — italic, latin */
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink:           #1B1F2E;
  --ink-dk:        #2d3348;
  --ink-2:         #4A4E5A;
  --ink-3:         #6B7280;
  --panel-dark:    #1B1F2E;

  --brass:         #B8893A;
  --brass-dk:      #966E24;

  --warm:          #E8E4DA;
  --warm-mid:      #D9D4C8;
  --surface:       #F7F4EE;

  --border:        rgba(27, 31, 46, 0.09);
  --border-strong: rgba(27, 31, 46, 0.18);

  --fd: 'DM Serif Display', Georgia, serif;
  --fs: 'DM Sans', Verdana, sans-serif;

  --border-dark:   rgba(255, 255, 255, 0.08);
  --t-fast:        0.15s ease;
  --t-base:        0.25s ease;
}

/* ─── Theme icon swap ───────────────────────────────────────────── */
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-icon-moon { display: none; }
  html:not([data-theme="light"]) .theme-icon-sun { display: block; }
}

/* ─── Dark mode ─────────────────────────────────────────────────── */
[data-theme="dark"] {
  --ink:           #E8E4DA;
  --ink-2:         #B4AFA6;
  --ink-3:         #7A7670;
  --panel-dark:    #0D1018;
  --brass:         #C9973F;
  --brass-dk:      #B8893A;
  --warm:          #1C1F2E;
  --warm-mid:      #252836;
  --surface:       #131620;
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:           #E8E4DA;
    --ink-2:         #B4AFA6;
    --ink-3:         #7A7670;
    --panel-dark:    #0D1018;
    --brass:         #C9973F;
    --brass-dk:      #B8893A;
    --warm:          #1C1F2E;
    --warm-mid:      #252836;
    --surface:       #131620;
    --border:        rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
  }
}

/* Invert black-fill SVG images in dark mode */
[data-theme="dark"] .c-illustration-sculpture img { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .c-illustration-sculpture img { filter: invert(1); }
}

/* ─── Reset + base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--fs);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent stray sub-pixel horizontal overflow from triggering iOS Safari's
   two-axis scroll mode, which causes hard stops in vertical touch momentum.
   The backup site had this and scrolled smoothly; the new CSS dropped it. */
body { overflow-x: clip; }

a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
button { font-family: var(--fs); cursor: pointer; border: none; background: none; padding: 0; }

/* ─── Site nav ──────────────────────────────────────────────────── */
.cv-nav {
  background: var(--panel-dark);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid color-mix(in srgb, var(--brass) 25%, transparent);
  position: sticky;
  top: 0;
  z-index: 100;
}
.cv-nav-wordmark { display: flex; align-items: center; }
.cv-nav-spacer { flex: 1; }
.cv-nav-actions { display: flex; align-items: center; gap: 22px; }
.cv-nav-icon {
  width: 16px;
  height: 16px;
}
.cv-nav-contact {
  background: var(--brass);
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 18px;
  transition: background var(--t-fast), transform var(--t-fast);
}
.cv-nav-contact:hover { background: var(--brass-dk); color: var(--ink); text-decoration: none; transform: translateY(-1px); }
.cv-nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--t-fast);
}
.cv-nav-icon-btn:hover { color: var(--brass); }
.cv-nav-link {
  font-family: var(--fs);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  transition: color var(--t-fast);
}
.cv-nav-link:hover { color: #fff; }
.cv-nav-link[aria-current="page"] { color: var(--brass); }

@media (max-width: 640px) {
  .cv-nav-link, .cv-nav-contact { display: none; }
}
@media (max-width: 1024px) {
  .cv-nav { transition: transform 0.3s ease; }
  .nav-hidden { transform: translateY(-100%); }
}
/* iOS WebKit re-evaluates the sticky nav's position on every scroll frame
   on this layout, producing continuous full-viewport Layout invalidation
   that halts touch-scroll momentum. On touch devices the nav scrolls with
   the page instead (no sticky cost). Detected via (hover:none) which
   matches touchscreens even when iPad reports as desktop. */
@media (hover: none) {
  .cv-nav { position: static; }
}

/* ─── Site footer ───────────────────────────────────────────────── */
.cv-foot {
  background: var(--panel-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 56px 64px 24px;
}
.cv-foot-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cv-foot-tag {
  font-family: var(--fd);
  font-size: 22px;
  color: #fff;
  line-height: 1.25;
  margin-top: 18px;
  letter-spacing: -0.01em;
  max-width: 22ch;
}
.cv-foot-email {
  font-family: var(--fd);
  font-style: italic;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 14px;
  display: inline-block;
}
.cv-foot-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-end;
}
.cv-foot-nav a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.cv-foot-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.cv-foot-bar-links { display: flex; gap: 24px; margin-left: auto; }
.cv-foot-bar #back-to-top { margin-left: 32px; }

@media (max-width: 768px) {
  .cv-foot { padding: 48px 32px 24px; }
  .cv-foot-body { grid-template-columns: 1fr; }
  .cv-foot-nav { align-items: flex-start; }
  .cv-foot-bar { flex-wrap: wrap; gap: 10px 0; }
  .cv-foot-bar > span:first-child { width: 100%; }
  .cv-foot-bar-links { margin-left: 0; gap: 16px; flex-wrap: wrap; }
  .cv-foot-bar #back-to-top { margin-left: auto; }
}
@media (max-width: 640px) {
  .cv-foot { padding: 40px 24px 20px; }
}


/* ─── Search overlay ────────────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 31, 46, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.search-overlay.open { opacity: 1; pointer-events: all; }

.search-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 580px;
  margin: 0 24px;
  box-shadow: 0 20px 60px rgba(27, 31, 46, 0.22);
  transition: border-color 0.15s ease;
}
.search-modal:focus-within { border-color: var(--brass); }

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.search-input-icon { color: var(--ink-3); flex-shrink: 0; display: flex; }

.search-input {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--fs);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}
.search-input:focus { outline: none; }
.search-input::placeholder { color: var(--ink-3); }
.search-input::-webkit-search-cancel-button { display: none; }

.search-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color var(--t-fast);
}
.search-close-btn:hover { color: var(--ink); }

.search-results { overflow-y: auto; max-height: 360px; }

.search-result {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--t-fast);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover,
.search-result.focused { background: var(--warm); text-decoration: none; }

.search-result-section {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 3px;
}

.search-result-title {
  display: block;
  font-family: var(--fd);
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 4px;
}

.search-result-desc {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.55;
  font-weight: 300;
}

.search-empty {
  padding: 24px 20px;
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 300;
  text-align: center;
}

.search-hint {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

.search-hint kbd {
  font-family: var(--fs);
  font-size: 9px;
  background: var(--warm);
  border: 1px solid var(--border);
  padding: 1px 5px;
  margin-right: 4px;
  color: var(--ink-2);
}

/* ─── Breadcrumb ────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-family: var(--fs);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.breadcrumb a {
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover { color: var(--brass); }

.breadcrumb-sep {
  color: var(--brass);
  font-size: 10px;
  line-height: 1;
}

.breadcrumb-current { color: var(--ink-2); }

@media (max-width: 600px) {
  .breadcrumb > * { display: none; }
  .breadcrumb a:last-of-type {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ink-2);
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .breadcrumb a:last-of-type::before {
    content: '←';
    margin-right: 8px;
    color: var(--brass);
    font-size: 15px;
    line-height: 1;
  }
}

/* ─── Hero eyebrow ──────────────────────────────────────────────── */
.hero-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.hero-rule { width: 32px; height: 1px; background: var(--brass); flex-shrink: 0; }
.hero-eyebrow-text {
  font-family: var(--fs);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ─── Essay header ──────────────────────────────────────────────── */
.essay-header {
  padding-bottom: 40px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.essay-header .hero-eyebrow { margin-bottom: 24px; }

.essay-title {
  font-family: var(--fd);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.08;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.essay-subtitle {
  font-family: var(--fs);
  font-size: 17px;
  font-weight: 300;
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 20px;
}

/* ─── Page header (legal + utility pages) ───────────────────────── */
.page-header {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 72px 48px 56px;
}

.page-header-inner {
  max-width: 720px;
}

.page-header-title {
  font-family: var(--fd);
  font-size: clamp(36px, 4.5vw, 62px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.07;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  margin-top: 20px;
}

.page-header-sub {
  font-family: var(--fd);
  font-size: 19px;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.65;
  max-width: 580px;
}

@media (max-width: 900px) {
  .page-header { padding: 48px 24px 40px; }
}

/* ─── Page body — full width (legal) ────────────────────────────── */
.page-body--full {
  display: block;
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 48px 96px;
  background: var(--surface);
}

@media (max-width: 900px) {
  .page-body--full { padding: 48px 24px 72px; }
}

/* ─── Legal sections ─────────────────────────────────────────────── */
.legal-meta {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ink-3);
  letter-spacing: 0.10em;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.legal-section {
  margin-top: 40px;
}

.legal-section h2 {
  font-family: var(--fs);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
  scroll-margin-top: 80px;
}

.legal-section p {
  font-size: 14px;
  line-height: 1.78;
  color: var(--ink-2);
  font-weight: 300;
  margin-bottom: 12px;
}

.legal-section a {
  color: var(--brass-dk);
  text-decoration: none;
}

.legal-section a:hover { text-decoration: underline; }

/* ─── Legal cross-link footer bar ───────────────────────────────── */
.legal-nav {
  display: flex;
  gap: 24px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.legal-nav a {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--t-fast);
}

.legal-nav a:hover { color: var(--ink); text-decoration: none; }

.essay-meta { font-size: 10px; color: var(--ink-2); letter-spacing: 0.04em; }

/* ─── Essay request / download block ────────────────────────────── */
.request-block {
  background: var(--warm);
  border-left: 2px solid var(--brass);
  padding: 32px 36px;
  margin-top: 48px;
}

.request-block-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  display: block;
  margin-bottom: 16px;
}

.request-block p {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  font-weight: 300;
  margin-bottom: 24px;
}

.btn-primary {
  font-family: var(--fs);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--surface);
  background: var(--brass);
  padding: 13px 28px;
  text-decoration: none;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  display: inline-block;
}
.btn-primary:hover { background: var(--brass-dk); color: var(--surface); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.14); }

/* ─── Arrow component ────────────────────────────────────────────── */
.arrow {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 7px;
  flex-shrink: 0;
  vertical-align: middle;
  transition: transform 0.2s ease;
}
.arrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 22px;
  height: 1px;
  background: var(--brass);
}
.arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--brass);
  border-right: 1px solid var(--brass);
  transform: rotate(45deg);
}

@media (max-width: 700px) {
  .request-block { padding: 24px 20px; }
}

/* ─── Print ──────────────────────────────────────────────────────── */
@media print {
  .cv-nav, .cv-foot, .cv-foot-bar,
  #back-to-top, #reading-progress,
  .cookie-consent, .essay-end, .essay-coll { display: none !important; }

  body { background: white; color: black; font-size: 12pt; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #555; }
  a[href^="#"]::after,
  a[href^="javascript"]::after { content: ""; }
}
