/* ─── Tokens ───────────────────────────────────────────── */
:root {
  --ink:        #0A0908;
  --ink-alt:    #0F0E0C;
  --ink-deep:   #050403;
  --surface:    #161310;

  --paper:      #F2EDE4;
  --paper-alt:  #E8E1D2;

  --on-ink:        #EFE9DC;
  --on-ink-mid:    #B8B0A0;
  --on-ink-dim:    #6E665A;
  --on-ink-faint:  #3D372F;

  --on-paper:      #1A1815;
  --on-paper-mid:  #4A4339;
  --on-paper-dim:  #8A8275;

  --gold:       #C2933A;
  --gold-soft:  #D4AF6B;
  --gold-deep:  #8C6A1F;

  --rule-ink:        rgba(239, 233, 220, 0.10);
  --rule-ink-strong: rgba(239, 233, 220, 0.20);
  --rule-paper:      rgba(26, 24, 21, 0.14);

  --display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans:    'Inter Tight', 'Helvetica Neue', system-ui, sans-serif;
  --mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --display-opsz: 'opsz' 144, 'SOFT' 50;

  --max:    1200px;
  --pad-x:  clamp(28px, 5vw, 80px);
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; line-height: inherit; }

html { scroll-behavior: smooth; font-size: 17px; }
@media (min-width: 1100px) { html { font-size: 18px; } }

body {
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold); color: var(--ink); }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ─── Skip link ────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1.2rem;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ─── Action bar (Download PDF · Back) ─────────────────── */
.actionbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 9, 8, 0.86);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--rule-ink);
}
.actionbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 14px 0;
}
.actionbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-ink-mid);
  transition: color 220ms var(--ease);
}
.actionbar-brand:hover { color: var(--on-ink); }
.actionbar-mark {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  line-height: 0;
}
.actionbar-mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.actionbar-tag::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 1px;
  margin-right: 0.7rem;
  background: var(--gold);
  vertical-align: middle;
}
.actionbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.3rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  transition: background 220ms var(--ease), color 220ms var(--ease), border-color 220ms var(--ease), transform 220ms var(--ease);
}
.btn-primary {
  background: var(--gold);
  color: var(--ink);
}
.btn-primary:hover { background: var(--gold-soft); }
.btn-primary svg { width: 0.82rem; height: 0.82rem; }
.btn-ghost {
  color: var(--on-ink-mid);
  border-color: var(--rule-ink-strong);
}
.btn-ghost:hover { color: var(--on-ink); border-color: var(--gold); }

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
  border-radius: 1px;
}

/* ─── Identity header ──────────────────────────────────── */
.identity {
  padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 5vw, 64px);
  position: relative;
}
.identity-folio {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
  margin-bottom: 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.identity-folio::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--gold);
}
.identity-name {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: clamp(3rem, 7.4vw, 5.6rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--on-ink);
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.45ch;
}
.identity-name-given { font-weight: 400; }
.identity-name-family {
  font-style: italic;
  color: var(--gold);
}
.identity-rule {
  width: 56px;
  height: 1px;
  background: var(--gold);
  margin: 1.6rem 0 1.4rem;
  position: relative;
}
.identity-rule::after {
  content: '';
  position: absolute;
  right: -7px;
  top: -3px;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}
.identity-role {
  font-family: var(--display);
  font-variation-settings: 'opsz' 96;
  font-style: italic;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  font-weight: 400;
  color: var(--on-ink-mid);
  margin-bottom: 1.1rem;
}
.identity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
  margin-bottom: 2.4rem;
}
.identity-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
}
.identity-summary {
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--on-ink-mid);
  max-width: 56ch;
  letter-spacing: 0.005em;
}
.identity-summary em { color: var(--gold); font-style: italic; }

/* ─── Resume grid (main + aside) ──────────────────────── */
.resume-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(2.4rem, 5vw, 5rem);
  padding: clamp(40px, 5vw, 72px) 0;
  border-top: 1px solid var(--rule-ink);
}

/* ─── Section labels ──────────────────────────────────── */
.lbl {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.lbl::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--gold);
}
.resume-section { margin-bottom: clamp(2.4rem, 4vw, 3.6rem); }
.resume-section:last-child { margin-bottom: 0; }

.sec-title {
  font-family: var(--display);
  font-variation-settings: 'opsz' 96;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.014em;
  line-height: 1.1;
  color: var(--on-ink);
  margin-bottom: 2rem;
}
.sec-title em { font-style: italic; color: var(--gold); }

/* ─── Experience entries ──────────────────────────────── */
.xp-list { list-style: none; }
.xp-item {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule-ink);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.6rem;
  align-items: start;
}
.xp-item:first-child { padding-top: 0; }
.xp-item:last-child  { border-bottom: none; padding-bottom: 0; }
.xp-meta { display: flex; flex-direction: column; gap: 0.45rem; }
.xp-company {
  font-family: var(--display);
  font-variation-settings: 'opsz' 36;
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--on-ink);
  line-height: 1.2;
}
.xp-dates {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
  line-height: 1.7;
}
.xp-class {
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
  margin-top: 0.2rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule-ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
}
.xp-class::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--gold);
  display: inline-block;
}
.xp-role {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}
.xp-desc {
  font-size: 0.95rem;
  line-height: 1.74;
  color: var(--on-ink-mid);
  letter-spacing: 0.005em;
  margin-bottom: 0.85rem;
}
.xp-desc:last-child { margin-bottom: 0; }
.xp-bullets {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
}
.xp-bullets li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--on-ink-mid);
  margin-bottom: 0.45rem;
}
.xp-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.74em;
  width: 8px;
  height: 1px;
  background: var(--gold);
}
.xp-bullets li:last-child { margin-bottom: 0; }

/* ─── Education entries (similar to xp but tighter) ──── */
.edu-list { list-style: none; }
.edu-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.4rem;
  align-items: baseline;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--rule-ink);
}
.edu-row:first-child { padding-top: 0; }
.edu-row:last-child  { border-bottom: none; padding-bottom: 0; }
.edu-school {
  font-family: var(--display);
  font-variation-settings: 'opsz' 36;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--on-ink);
  margin-bottom: 0.25rem;
}
.edu-degree {
  font-size: 0.92rem;
  color: var(--on-ink-mid);
  line-height: 1.55;
}
.edu-degree em { color: var(--gold); font-style: italic; }
.edu-year {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
  white-space: nowrap;
  padding-top: 4px;
}

/* ─── Selected certifications (table) ─────────────────── */
.cert-table { list-style: none; }
.cert-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.6rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule-ink);
}
.cert-row:first-child { padding-top: 0; }
.cert-row:last-child  { border-bottom: none; }
.cert-name {
  font-family: var(--display);
  font-variation-settings: 'opsz' 14;
  font-size: 0.96rem;
  color: var(--on-ink);
  letter-spacing: 0.005em;
}
.cert-issuer {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
  white-space: nowrap;
}

/* ─── Aside (sidebar) ──────────────────────────────────── */
.aside-section {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule-ink);
}
.aside-section:first-child { padding-top: 0; }
.aside-section:last-child  { border-bottom: none; padding-bottom: 0; }

.aside-head {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.aside-head::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--gold);
}
.aside-list { list-style: none; }
.aside-list li {
  padding: 0.42rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--on-ink);
  border-bottom: 1px dotted var(--rule-ink);
}
.aside-list li:last-child { border-bottom: none; }
.aside-list li .aside-key {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
  display: block;
  margin-bottom: 0.15rem;
}
.aside-list li .aside-val {
  font-family: var(--display);
  font-variation-settings: 'opsz' 14;
  font-size: 0.98rem;
  color: var(--on-ink);
  letter-spacing: 0.005em;
}
.aside-list li .aside-val em { color: var(--gold); font-style: italic; }
.aside-list a {
  transition: color 200ms var(--ease);
  border-bottom: 1px solid transparent;
}
.aside-list a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Domain ledger */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem 1rem;
}
.domain-cell {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--rule-ink);
}
.domain-cell-key {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
}
.domain-cell-val {
  font-family: var(--display);
  font-variation-settings: 'opsz' 36, 'SOFT' 30;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--gold);
  line-height: 1.18;
}

/* ─── Footer (ported from styles.css — proven mobile-safe) ── */
.resume-foot {
  padding: 1.8rem 0;
  border-top: 1px solid var(--rule-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 2rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
}
.resume-foot-sig {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--on-ink-mid);
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 920px) {
  html { font-size: 16px; }
  :root { --pad-x: clamp(22px, 5vw, 40px); }

  .actionbar-tag { display: none; }
  .actionbar-brand-text { display: none; }
  .btn { padding: 0.6rem 1rem; font-size: 0.6rem; }

  .resume-grid {
    grid-template-columns: 1fr;
    gap: 2.4rem;
  }

  .xp-item {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .xp-class { align-self: flex-start; }

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

  .resume-foot { flex-direction: column; gap: 0.6rem; text-align: center; padding: 2rem 0; }
}
@media (max-width: 480px) {
  .identity-name { font-size: clamp(2.6rem, 13vw, 4rem); }
}

/* ─── Print stylesheet (Save as PDF) ──────────────────── */
@page {
  size: A4 portrait;
  margin: 14mm 14mm 14mm 14mm;
}

@media print {
  :root {
    --ink:           #ffffff;
    --ink-alt:       #ffffff;
    --on-ink:        #1A1815;
    --on-ink-mid:    #4A4339;
    --on-ink-dim:    #7A6E5E;
    --on-ink-faint:  #9A9080;
    --rule-ink:        rgba(26, 24, 21, 0.18);
    --rule-ink-strong: rgba(26, 24, 21, 0.32);
    --gold:       #8C6A1F;
    --gold-soft:  #A07F2F;
    --gold-deep:  #6E521A;
  }

  html, body {
    background: #ffffff !important;
    color: #1A1815 !important;
    font-size: 9.6pt;
    line-height: 1.45;
  }

  .skip-link,
  .actionbar { display: none !important; }

  .container {
    max-width: none;
    padding: 0 !important;
  }

  .identity {
    padding: 0 0 14pt;
  }
  .identity-folio { color: #6E521A; margin-bottom: 8pt; }
  .identity-folio::before { background: #8C6A1F; }
  .identity-name { font-size: 28pt; line-height: 0.96; }
  .identity-name-family { color: #8C6A1F; }
  .identity-rule { background: #8C6A1F; margin: 8pt 0 6pt; }
  .identity-rule::after { background: #8C6A1F; }
  .identity-role { font-size: 11pt; margin-bottom: 6pt; color: #4A4339; }
  .identity-meta { font-size: 6.5pt; gap: 0.5em; margin-bottom: 10pt; color: #6E665A; }
  .identity-meta-sep { background: #8C6A1F; }
  .identity-summary { font-size: 9.4pt; line-height: 1.5; color: #1A1815; max-width: none; }
  .identity-summary em { color: #8C6A1F; }

  .resume-grid {
    grid-template-columns: 1fr 200pt;
    gap: 22pt;
    padding: 0;
    border-top: 1px solid rgba(26,24,21,0.30);
    padding-top: 14pt;
  }

  .resume-section { margin-bottom: 14pt; break-inside: avoid; }
  .lbl { color: #8C6A1F; margin-bottom: 6pt; font-size: 6.6pt; }
  .lbl::before { background: #8C6A1F; }
  .sec-title { font-size: 13pt; margin-bottom: 8pt; color: #1A1815; }
  .sec-title em { color: #8C6A1F; }

  .xp-item {
    grid-template-columns: 100pt 1fr;
    padding: 7pt 0;
    gap: 10pt;
    border-color: rgba(26,24,21,0.18);
    break-inside: avoid;
  }
  .xp-item:first-child { padding-top: 0; }
  .xp-company { font-size: 11pt; color: #1A1815; }
  .xp-dates { font-size: 6pt; color: #6E665A; }
  .xp-class { font-size: 5.6pt; color: #8C6A1F; border-color: rgba(26,24,21,0.18); padding-top: 4pt; }
  .xp-class::before { background: #8C6A1F; }
  .xp-role { font-size: 7pt; color: #8C6A1F; margin-bottom: 5pt; }
  .xp-desc { font-size: 8.6pt; color: #1A1815; line-height: 1.5; margin-bottom: 4pt; }
  .xp-bullets li { font-size: 8.4pt; color: #1A1815; line-height: 1.45; margin-bottom: 2pt; padding-left: 12pt; }
  .xp-bullets li::before { background: #8C6A1F; top: 0.72em; }

  .edu-row { padding: 6pt 0; break-inside: avoid; border-color: rgba(26,24,21,0.18); }
  .edu-school { font-size: 10pt; color: #1A1815; }
  .edu-degree { font-size: 8.4pt; color: #4A4339; }
  .edu-degree em { color: #8C6A1F; }
  .edu-year { font-size: 6.4pt; color: #6E665A; }

  .cert-row { padding: 5pt 0; border-color: rgba(26,24,21,0.18); break-inside: avoid; }
  .cert-name { font-size: 8.6pt; color: #1A1815; }
  .cert-issuer { font-size: 6pt; color: #6E665A; }

  .aside-section { padding: 8pt 0; border-color: rgba(26,24,21,0.18); break-inside: avoid; }
  .aside-head { font-size: 6.4pt; color: #8C6A1F; margin-bottom: 6pt; }
  .aside-head::before { background: #8C6A1F; }
  .aside-list li { font-size: 8.4pt; padding: 3pt 0; color: #1A1815; border-color: rgba(26,24,21,0.14); }
  .aside-list li .aside-key { font-size: 5.8pt; color: #6E665A; }
  .aside-list li .aside-val { font-size: 8.6pt; color: #1A1815; }
  .aside-list li .aside-val em { color: #8C6A1F; }
  .aside-list a { color: #1A1815; }
  .domain-cell { padding: 3pt 0; border-color: rgba(26,24,21,0.18); }
  .domain-cell-key { font-size: 5.4pt; color: #6E665A; }
  .domain-cell-val { font-size: 8.4pt; color: #8C6A1F; }

  .resume-foot {
    border-color: rgba(26,24,21,0.30);
    padding: 8pt 0 0;
    margin-top: 10pt;
    font-size: 6pt;
    color: #6E665A;
  }
  .resume-foot-sig { font-size: 9pt; color: #4A4339; }

  a { color: inherit; }
  a[href^="http"]::after {
    content: ' [' attr(href) ']';
    font-size: 0.7em;
    color: #999;
    word-break: break-all;
  }
  a[href^="https://www.linkedin.com"]::after { content: ''; }

  .resume-foot a::after { content: ''; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
