:root {
  --bg: #f4f3ef;
  --surface: #fcfbf7;
  --surface-alt: #e8edf0;
  --text: #162c45;
  --muted: #506070;
  --accent: #17324d;
  --accent-strong: #0e2439;
  --border: #cbd4db;
  --shadow: 0 10px 30px rgba(23, 50, 77, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, #e1eaf0 0%, transparent 42%),
    radial-gradient(circle at 90% 20%, #e8edf0 0%, transparent 36%),
    var(--bg);
  line-height: 1.65;
}

h1,
h2,
h3,
.brand,
.button {
  font-family: "Sora", "Avenir Next", sans-serif;
  letter-spacing: -0.02em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.container {
  width: min(980px, 92vw);
  margin: 0 auto;
}

.section {
  padding: 3.5rem 0;
}

/* Section padding already clears most of the sticky header. */
main[id],
section[id] {
  scroll-margin-top: 1.25rem;
}

.section.alt {
  background: color-mix(in srgb, var(--surface-alt) 70%, white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(244, 243, 239, 0.86);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--surface-alt);
  outline: none;
}

a:focus-visible,
.button:focus-visible,
summary:focus-visible,
.nav-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 3px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
}

.hero {
  padding-top: 4.25rem;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  margin-bottom: 0.8rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  max-width: 18ch;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.lead {
  max-width: 54ch;
  color: var(--muted);
}

p,
li {
  max-width: 72ch;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-block;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.button.primary {
  background: var(--accent);
  color: var(--surface);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--accent-strong);
}

.button.ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}

.button.ghost:hover,
.button.ghost:focus-visible {
  border-color: var(--accent);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 1.2rem;
}

.timeline,
.grid {
  display: grid;
  gap: 1rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.card-head {
  margin-bottom: 0.7rem;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.skills-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.skills-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}

.cert-areas {
  display: grid;
  gap: 1rem;
}

.cert-area-group {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: clip;
}

.cert-area-group > summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  position: relative;
}

.cert-area-group > summary::-webkit-details-marker {
  display: none;
}

.cert-area-group > summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-strong);
  font-weight: 700;
}

.cert-area-group[open] > summary::after {
  content: "-";
}

.cert-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
  align-items: start;
  padding: 0.8rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.cert-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: clip;
  align-self: start;
}

.cert-card summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  position: relative;
}

.cert-card summary::-webkit-details-marker {
  display: none;
}

.cert-card summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-strong);
  font-weight: 700;
}

.cert-card[open] summary::after {
  content: "-";
}

.cert-title {
  font-family: "Sora", "Avenir Next", sans-serif;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 420ms ease-out,
    transform 420ms ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.cert-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.cert-detail {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0.9rem 0.9rem;
  font-size: 0.95rem;
}

.cert-badge-image {
  display: block;
  width: min(180px, 100%);
  height: auto;
  margin: 0.35rem 0 0.65rem;
}

a {
  color: var(--accent-strong);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    right: 4vw;
    top: 3.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    min-width: 190px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .cert-area-group > summary::after {
    right: 0.85rem;
  }
}

@media print {
  .site-header,
  .hero-actions,
  .nav-toggle {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .section {
    padding: 1rem 0;
  }

  .card,
  .skills-list li {
    box-shadow: none;
    border: 1px solid #bbb;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
