/* ===== Reset & base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  background-color: var(--marble);
  background-image:
    radial-gradient(1000px 700px at 10% -8%, var(--wash1), transparent 60%),
    radial-gradient(900px 680px at 94% 106%, var(--wash2), transparent 55%);
  min-height: 100vh;
  position: relative;
  transition: background-color 0.25s;
}
a { color: inherit; }
ul { margin: 0; }
::selection { background: #b8894f; color: #fdfbf5; }

/* ===== Theme tokens ===== */
:root,
html[data-theme="ivory"] {
  --gold: #b8894f;
  --gold-dk: #8f6431;
  --marble: #f5f1e7;
  --ink: #2b2520;
  --muted: #726858;
  --card: rgba(255, 253, 248, 0.55);
  --line: rgba(138, 101, 8, 0.16);
  --wash1: #fbf8f0;
  --wash2: #ece4d3;
  --contact-bg: #fdfbf5;
  --gold-text: #fdfbf5;
  --gold-btn-text: #201b15;
}
html[data-theme="onyx"] {
  --marble: #171310;
  --ink: #f0e9da;
  --muted: #a99d84;
  --card: rgba(255, 250, 238, 0.04);
  --line: rgba(184, 137, 79, 0.24);
  --wash1: rgba(184, 137, 79, 0.1);
  --wash2: rgba(184, 137, 79, 0.05);
  --contact-bg: #241d16;
}

/* faint paper texture, matches the two overlapping repeating-linear-gradients */
#texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  z-index: 0;
  background-image:
    repeating-linear-gradient(122deg, transparent 0px, transparent 34px, rgba(120,108,86,0.04) 34px, rgba(120,108,86,0.04) 35px),
    repeating-linear-gradient(58deg, transparent 0px, transparent 52px, rgba(120,108,86,0.03) 52px, rgba(120,108,86,0.03) 53px);
  mix-blend-mode: multiply;
}

/* ===== Shared type ===== */
h1, h2, h3, .label, .wordmark, .nav-link, .eyebrow span, .pill,
.btn, .timeline-date, .skill-card-title, .badge, .edu-year, .edu-degree,
.copyright, .monogram {
  font-family: Cinzel, serif;
}

.label {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-dk);
}

h1 {
  margin: 0;
  font-weight: 700;
  line-height: 1;
  font-size: clamp(44px, 6.4vw, 78px);
  letter-spacing: 0.5px;
  color: var(--ink);
}
h2 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(26px, 3vw, 36px);
  color: var(--ink);
}
h3 {
  margin: 0;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
}

/* ===== Layout helpers ===== */
main, footer.contact-section {
  position: relative;
  z-index: 2;
}
.nav-inner, .hero, .row-section, .contact-section {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}
.content-grid, .label-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
}
.label-row {
  padding-top: 50px;
  border-top: 1px solid var(--line);
}
.heading-row { margin-bottom: 44px; }
.row-section { padding-top: 0; padding-bottom: 90px; }
#experience, #skills, #education { padding-bottom: 100px; scroll-margin-top: 100px; }
#top { scroll-margin-top: 100px; }

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--marble) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.monogram {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold-dk);
  font-weight: 700;
  color: var(--gold-text);
  font-size: 14px;
  letter-spacing: 1px;
}
.monogram-small {
  width: 32px;
  height: 32px;
  background: var(--gold);
  color: var(--gold-btn-text);
  font-size: 12px;
}
.wordmark {
  font-weight: 600;
  letter-spacing: 2px;
  font-size: 13px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.nav-link {
  font-size: 11.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--gold-dk); }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold-dk); }
.theme-toggle svg { display: block; }
.theme-toggle svg[hidden] { display: none; }

/* ===== Buttons / pills ===== */
.btn {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 28px;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
}
.btn-solid {
  color: var(--gold-text);
  background: var(--gold-dk);
}
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(90,64,25,0.3); }
.btn-small {
  font-size: 11px;
  letter-spacing: 1.6px;
  padding: 10px 20px;
}
.btn-small:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(90,64,25,0.28); }
.btn-outline {
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-dk); }
.btn-gold {
  color: var(--gold-btn-text);
  background: var(--gold);
  padding: 16px 28px;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.24); }

.pill {
  font-size: 16px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
}

/* ===== Hero ===== */
.hero {
  padding-top: 70px;
  padding-bottom: 90px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.eyebrow-rule {
  height: 1px;
  width: 44px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.eyebrow span {
  font-size: 11.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-dk);
}
.lede {
  margin: 26px 0 0;
  max-width: 520px;
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 34px;
}
.hero-portrait {
  position: relative;
  justify-self: center;
}
.portrait-frame {
  padding: 6px;
  border-radius: 24px;
  background: linear-gradient(155deg, var(--gold), var(--gold-dk));
  box-shadow: 0 18px 40px rgba(60,44,10,0.16);
}
.portrait-inner {
  width: clamp(200px, 18vw, 240px);
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid var(--marble);
  background: linear-gradient(160deg, #efe8d8, #d8cdb4);
}
.portrait-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== Summary text ===== */
.summary-text {
  margin: 0;
  max-width: 720px;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
}

/* ===== Experience timeline ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 38px;
}
.timeline-item {
  position: relative;
  padding-left: 26px;
  border-left: 2px solid var(--line);
}
.timeline-dot {
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--marble);
}
.timeline-dot-current { background: var(--gold-dk); }
.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}
.timeline-date {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--gold-dk);
  white-space: nowrap;
}
.timeline-org {
  margin-top: 4px;
  font-size: 16px;
  font-style: italic;
  color: var(--muted);
}
.timeline-item ul {
  margin-top: 14px;
  padding-left: 20px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
}

/* ===== Skills ===== */
.skills-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.skill-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
}
.skill-card-title {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
}
.skill-card-list {
  font-size: 16px;
  line-height: 1.9;
  color: var(--muted);
}
.badges {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.badge {
  font-size: 12px;
  letter-spacing: 1px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
}

/* ===== Education ===== */
.edu-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.edu-year {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--gold-dk);
  margin-bottom: 8px;
}
.edu-degree {
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
}
.edu-school {
  margin-top: 4px;
  font-size: 16px;
  font-style: italic;
  color: var(--muted);
}
.edu-footnote {
  margin: 30px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
}

/* ===== Contact ===== */
.contact-section {
  margin-top: 60px;
  padding-bottom: 60px;
  scroll-margin-top: 100px;
}
.contact-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 54px 48px;
  border-radius: 10px;
  background: var(--contact-bg);
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px rgba(0,0,0,0.14);
  transition: background 0.25s;
}
.contact-panel .label { margin-bottom: 14px; }
.contact-panel h2 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 34px); }
.contact-location { font-size: 17px; color: var(--muted); }
.contact-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.copyright {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ===== Scroll reveal ===== */
@keyframes jhc-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
[data-reveal] { animation: jhc-in 0.01ms both; }
@supports (animation-timeline: view()) {
  [data-reveal] {
    animation: jhc-in 1ms linear both;
    animation-timeline: view();
    animation-range: entry 4% cover 22%;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { animation: none !important; opacity: 1 !important; transform: none !important; }
}
@media print {
  [data-reveal] { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 46px;
    padding-bottom: 60px;
    gap: 36px;
  }
  .hero-portrait { justify-self: start; }
  .content-grid, .label-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .content-grid .spacer { display: none; }
  .skills-cards, .edu-cards {
    grid-template-columns: 1fr;
  }
  .nav-inner { padding-top: 14px; padding-bottom: 14px; }
  .nav-links { gap: 16px; }
  .contact-panel { padding: 36px 28px; }
}

@media print {
  .nav, .theme-toggle { display: none; }
  #texture { display: none; }
}
