:root {
  color-scheme: light dark;
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f2f4f3;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #5b6472;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --flash: #fde68a;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --header-height: 6.4rem;
  --body-font: "InterVariable", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono-font: "IBMPlexMonoVariable", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --serif-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #0f172a;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #14b8a6;
  --accent-soft: rgba(20, 184, 166, 0.16);
  --flash: #b45309;
  --shadow: 0 24px 56px rgba(2, 6, 23, 0.34);
}

@font-face {
  font-family: "InterVariable";
  src: url("/static/fonts/Inter-Variable.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}

@font-face {
  font-family: "IBMPlexMonoVariable";
  src: url("/static/fonts/IBMPlexMono-Variable.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 700;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--accent) 7%, transparent), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.6;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  align-items: end;
  padding: 1rem 2rem 1.15rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 0.22rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif-font);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

.role-line {
  margin: 0.32rem 0 0;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.45;
}

.header-tools {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.header-utility-group,
.header-actions-group,
.contact-box {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-utility-group,
.header-actions-group {
  gap: 0.6rem;
}

.header-utility-group {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions-group {
  padding-left: 0.9rem;
  margin-left: 0.15rem;
  border-left: 1px solid color-mix(in srgb, var(--border) 88%, var(--accent));
}

.contact-box {
  flex-wrap: nowrap;
  gap: 0.6rem;
}

.contact-reveal,
.theme-toggle,
.header-action,
.panel-toggle,
.sidebar-disclosure,
.skill-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.contact-reveal,
.theme-toggle,
.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.header-action {
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-2));
}

.contact-reveal.is-revealed {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.contact-reveal[data-reveal="phone"] {
  min-width: 10.75rem;
}

.contact-reveal[data-reveal="email"] {
  min-width: 15rem;
}

.contact-reveal[data-reveal="address"] {
  min-width: 14.5rem;
}

.contact-reveal a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(16rem, 0.8fr);
  gap: 1.5rem;
  align-items: start;
  max-width: 90rem;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

.main-column {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}

.sidebar-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1.15rem;
  box-shadow: var(--shadow);
  max-height: calc(100vh - var(--header-height) - 2rem);
  overflow: auto;
}

.sidebar-disclosure {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.55rem 0.2rem 0.8rem;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-disclosure-icon::before {
  content: "▾";
  color: var(--accent);
  font-size: 0.95rem;
}

.sidebar-disclosure[aria-expanded="false"] {
  padding-bottom: 0;
}

.sidebar-disclosure[aria-expanded="false"] .sidebar-disclosure-icon::before {
  content: "▸";
}

.sidebar-content {
  display: grid;
  gap: 1rem;
}

.sidebar-search,
.sidebar-head {
  display: grid;
  gap: 0.55rem;
}

.sidebar-search input {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.sidebar-divider {
  border-top: 1px solid var(--border);
}

.sidebar-head h2,
.sidebar-search h2,
.skill-group h3,
.competency-group h3,
.experience-card h3,
.experience-card h4,
.section-copy h3 {
  margin: 0;
}

.sidebar-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.skill-group + .skill-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.skill-group h3 {
  position: sticky;
  top: -0.1rem;
  z-index: 1;
  padding: 0.2rem 0 0.45rem;
  background: linear-gradient(180deg, var(--surface) 82%, transparent);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.skill-chip {
  padding: 0.52rem 0.82rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  background: transparent;
  border-color: color-mix(in srgb, var(--border) 76%, var(--accent));
  box-shadow: none;
}

.skill-chip:hover,
.contact-reveal:hover,
.theme-toggle:hover,
.sidebar-disclosure:hover,
.header-action:hover,
.panel-toggle:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
}

.sidebar-disclosure:hover {
  background: transparent;
  box-shadow: none;
}

.rebuild-button {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
}

.rebuild-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.skill-chip.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.14);
}

.cv-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cv-panel + .cv-panel {
  margin-top: 1rem;
}

.panel-toggle {
  width: 100%;
  padding: 1.05rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  font-size: 1.02rem;
  text-align: left;
  min-height: 3.6rem;
  gap: 1rem;
}

.panel-icon {
  width: 1.2rem;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
}

.panel-icon::before {
  content: "▸";
}

.cv-panel.is-open .panel-icon::before {
  content: "▾";
}

.panel-toggle:hover {
  background: color-mix(in srgb, var(--surface) 82%, var(--accent-soft));
}

.panel-toggle:focus-visible,
.contact-reveal:focus-visible,
.theme-toggle:focus-visible,
.sidebar-disclosure:focus-visible,
.header-action:focus-visible,
.skill-chip:focus-visible,
.sidebar-search input:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.panel-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 220ms ease;
}

.cv-panel.is-open .panel-body {
  max-height: 999rem;
}

.section-copy,
.section-groups,
.experience-list {
  padding: 0 1.2rem 1.2rem;
}

.section-copy > :first-child,
.section-groups > :first-child,
.experience-list > :first-child {
  margin-top: 0;
}

.section-copy p,
.section-copy li,
.competency-group li,
.experience-bullet,
.experience-card p {
  color: var(--text);
}

.section-copy p {
  margin: 0 0 1rem;
}

.section-copy ul,
.competency-group ul {
  padding-left: 1.2rem;
  margin: 0.65rem 0 0;
}

.section-copy li,
.competency-group li,
.experience-bullet {
  line-height: 1.45;
}

.competency-group + .competency-group,
.experience-card + .experience-card {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.competency-group h3,
.experience-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.experience-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.92rem;
}

.experience-body {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.experience-body h4 {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.experience-bullet {
  position: relative;
  padding-left: 1.1rem;
}

.experience-bullet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}

.is-dim {
  opacity: 0.32;
}

.search-hit {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow);
}

.keyword-flash {
  animation: flash 1.5s ease;
  border-radius: 0.4rem;
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--flash) 32%, transparent);
}

@keyframes flash {
  0% { background: var(--flash); }
  100% { background: transparent; }
}

.site-footer {
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 2rem 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 899px) {
  .site-header {
    grid-template-columns: 1fr;
    padding: 1.1rem 1rem;
    align-items: start;
  }

  .header-tools {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .header-utility-group,
  .header-actions-group {
    justify-content: flex-start;
  }

  .header-actions-group {
    padding-left: 0;
    margin-left: 0;
    border-left: 0;
    padding-top: 0.75rem;
    border-top: 1px solid color-mix(in srgb, var(--border) 88%, var(--accent));
  }

  .contact-box {
    flex-wrap: wrap;
  }

  .contact-reveal[data-reveal="phone"],
  .contact-reveal[data-reveal="email"],
  .contact-reveal[data-reveal="address"] {
    min-width: 0;
  }

  .page-shell {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 2.5rem;
  }

  .sidebar {
    position: static;
  }

  .sidebar-inner {
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
