:root {
  --ink: #172025;
  --muted: #5d6a70;
  --line: #d9e0e4;
  --paper: #f5f7f6;
  --white: #ffffff;
  --surface: #ffffff;
  --surface-soft: #eef3f2;
  --accent: #1f5d6b;
  --accent-dark: #153e49;
  --accent-soft: rgba(31, 93, 107, 0.1);
  --warm: #b48158;
  --shadow: 0 18px 60px rgba(23, 32, 37, 0.12);
  --shadow-strong: 0 26px 90px rgba(23, 32, 37, 0.18);
}

[data-theme="dark"] {
  --ink: #eef5f4;
  --muted: #a7b7ba;
  --line: #2e3a3e;
  --paper: #101518;
  --white: #161d21;
  --surface: #182125;
  --surface-soft: #111a1d;
  --accent: #8dc1cd;
  --accent-dark: #c4e8ed;
  --accent-soft: rgba(141, 193, 205, 0.14);
  --warm: #d6a777;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  --shadow-strong: 0 30px 100px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
  transition: background 240ms ease, color 240ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 34%),
    linear-gradient(245deg, color-mix(in srgb, var(--warm) 9%, transparent), transparent 38%);
}

a {
  color: inherit;
  text-decoration: none;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transform: scaleX(0);
  transform-origin: left;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 700;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  color: var(--muted);
  font-size: 0.94rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
}

.nav-links a:hover,
.brand:hover {
  color: var(--accent);
}

.theme-toggle:hover,
.social-row a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.hero {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: center;
  gap: clamp(32px, 7vw, 96px);
  min-height: calc(100vh - 69px);
  padding: clamp(56px, 8vw, 104px) clamp(20px, 5vw, 72px) clamp(42px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::after {
  position: absolute;
  right: clamp(20px, 5vw, 72px);
  bottom: 32px;
  width: min(42vw, 520px);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), var(--warm));
  opacity: 0.55;
}

.hero-copy {
  max-width: 920px;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.social-row a,
.social-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.social-row a {
  color: var(--accent-dark);
}

.eyebrow,
.section-label {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 900px;
  margin-bottom: 24px;
  font-size: clamp(3.25rem, 7.2vw, 7.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.role-rotator {
  position: relative;
  display: inline-block;
  color: var(--accent-dark);
  transition: opacity 180ms ease, transform 180ms ease;
}

.role-rotator::after {
  position: absolute;
  right: 0;
  bottom: 0.05em;
  left: 0;
  height: 0.11em;
  content: "";
  background: color-mix(in srgb, var(--warm) 42%, transparent);
  z-index: -1;
}

.role-rotator.is-changing {
  opacity: 0;
  transform: translateY(8px);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.hero-text {
  max-width: 700px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 12px;
  max-width: 720px;
  margin-top: 34px;
}

.hero-stats div {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero-stats strong {
  display: block;
  margin-bottom: 2px;
  font-size: 1.7rem;
  line-height: 1;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 20px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(23, 32, 37, 0.12);
}

.button.primary {
  color: var(--white);
  background: var(--ink);
}

[data-theme="dark"] .button.primary {
  color: #101518;
  background: #eef5f4;
}

.button.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button.secondary {
  color: var(--ink);
  background: transparent;
}

.button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.portrait-panel {
  position: relative;
  display: grid;
  gap: 22px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-strong);
  transform: rotate(1.2deg);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.portrait-panel:hover {
  transform: rotate(0deg) translateY(-4px);
}

.portrait-panel img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  background: #1b2226;
}

.portrait-name {
  margin-bottom: 2px;
  font-size: 1.2rem;
  font-weight: 700;
}

.portrait-role {
  margin-bottom: 0;
  color: var(--muted);
}

.portrait-meta {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.portrait-meta div {
  display: grid;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.portrait-meta span {
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portrait-meta strong {
  font-size: 0.98rem;
  line-height: 1.35;
}

.section {
  padding: clamp(64px, 9vw, 112px) clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.two-column,
.skills-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 6vw, 84px);
}

.section-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.profile-card {
  padding: clamp(24px, 4vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.interest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.interest-list span {
  padding: 8px 10px;
  color: var(--accent-dark);
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 700;
}

.section-copy p:last-child {
  margin-bottom: 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 42px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 20px;
  min-height: 190px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.timeline-item:hover,
.skill-clusters article:hover,
.venture-grid article:hover,
.credentials-panel:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.timeline-item p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.timeline-item.current h3::after {
  content: "Current";
  display: inline-flex;
  margin-left: 10px;
  padding: 3px 8px;
  color: var(--accent-dark);
  background: rgba(31, 93, 107, 0.1);
  border-radius: 999px;
  font-size: 0.7rem;
  vertical-align: middle;
}

.timeline-date,
.stack-list span {
  color: var(--warm);
  font-size: 0.86rem;
  font-weight: 700;
}

.item-meta {
  margin-bottom: 8px;
  font-weight: 700;
}

.item-meta a,
.venture-grid h3 a {
  color: var(--accent-dark);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: color 160ms ease, background-size 160ms ease;
}

.item-meta a:hover,
.venture-grid h3 a:hover {
  color: var(--warm);
  background-size: 100% 2px;
}

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(32px, 6vw, 84px);
  align-items: start;
  background: var(--surface);
}

.venture-section {
  background:
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 5%, transparent)),
    var(--paper);
}

.venture-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.venture-grid article {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.venture-grid span {
  margin-bottom: auto;
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 700;
}

.venture-grid h3 {
  font-size: 1.25rem;
}

.venture-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.stack-list {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

.stack-list article {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.stack-list p {
  margin-bottom: 5px;
  color: var(--muted);
}

.credentials-panel {
  display: grid;
  gap: 18px;
  padding: 28px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.metric {
  display: grid;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.metric strong {
  font-size: 1.15rem;
}

.metric span {
  color: var(--muted);
}

.skill-clusters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.skill-clusters article {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.skill-clusters h3 {
  margin-bottom: 16px;
}

.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: start;
}

.skill-grid span {
  padding: 10px 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: clamp(64px, 9vw, 112px) clamp(20px, 5vw, 72px);
  color: var(--white);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%),
    var(--ink);
}

.contact-section .section-label {
  color: #8dc1cd;
}

.contact-section h2 {
  max-width: 900px;
}

.contact-section .button.primary {
  color: var(--ink);
  background: var(--white);
  border-color: var(--white);
}

.contact-section .button.secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.45);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(20px, 5vw, 72px);
  color: var(--muted);
  background: var(--paper);
}

.footer p {
  margin-bottom: 0;
}

.footer a {
  font-weight: 700;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .two-column,
  .split-band,
  .skills-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .portrait-panel {
    max-width: 430px;
  }

  .contact-section {
    align-items: start;
  }

  .hero-stats,
  .timeline,
  .skill-clusters,
  .venture-grid {
    grid-template-columns: 1fr;
  }

  .portrait-panel {
    transform: none;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: clamp(2.5rem, 16vw, 4.2rem);
  }

  .hero::after {
    display: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: auto;
  }

  .button {
    width: 100%;
  }

  .social-row a,
  .social-row span {
    width: 100%;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
