:root {
  color-scheme: light;
  --paper: #f7f2e8;
  --paper-soft: #fffaf0;
  --ink: #17211f;
  --muted: #596760;
  --line: rgba(23, 33, 31, 0.13);
  --line-strong: rgba(23, 33, 31, 0.22);
  --green: #16735f;
  --blue: #285aa9;
  --gold: #a46b14;
  --red: #ad493d;
  --shadow: 0 24px 70px rgba(23, 33, 31, 0.12);
  --radius: 8px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(23, 33, 31, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 33, 31, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(22, 115, 95, 0.09), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(40, 90, 169, 0.08), transparent 27%),
    var(--paper);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
}

body::selection {
  background: rgba(22, 115, 95, 0.2);
}

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

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 50;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(23, 33, 31, 0.1);
  background: rgba(247, 242, 232, 0.84);
  backdrop-filter: blur(18px);
}

.nav,
.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
  border-radius: var(--radius);
  color: var(--green);
  font-weight: 850;
}

.brand strong,
.brand span {
  display: block;
  white-space: nowrap;
}

.brand strong {
  font-size: 0.96rem;
  line-height: 1.1;
}

.brand span {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  border-radius: var(--radius);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active {
  color: var(--ink);
  background: rgba(255, 250, 240, 0.78);
  outline: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-soft);
  color: var(--ink);
  font-weight: 720;
  line-height: 1;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(22, 115, 95, 0.48);
  box-shadow: 0 14px 34px rgba(23, 33, 31, 0.12);
  outline: none;
}

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

.button.small {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.88rem;
}

.mobile-toggle {
  display: none;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
}

.mobile-toggle span,
.mobile-toggle span::before,
.mobile-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.mobile-toggle span {
  position: relative;
}

.mobile-toggle span::before,
.mobile-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.mobile-toggle span::before {
  top: -6px;
}

.mobile-toggle span::after {
  top: 6px;
}

.section {
  position: relative;
  padding: 96px 0;
}

.section.tight {
  padding-top: 70px;
}

.hero {
  min-height: calc(100vh - 72px);
  padding: 72px 0 44px;
  display: grid;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.65fr);
  gap: clamp(32px, 6vw, 84px);
  align-items: center;
}

.eyebrow,
.section-kicker {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 820;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  background: currentColor;
}

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

h1 {
  max-width: 920px;
  margin-bottom: 24px;
  font-size: clamp(3.2rem, 9vw, 7.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 760px;
  color: #35413d;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 34px 0 0;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 48px;
  border: 1px solid var(--line);
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.focus-strip div {
  min-height: 112px;
  padding: 18px;
  background: rgba(255, 250, 240, 0.76);
}

.focus-strip b {
  display: block;
  margin-bottom: 7px;
  font-size: 1.15rem;
}

.focus-strip span,
.section-head p,
.timeline-top p,
.proof-card span,
.project-card p,
.education-item p,
.contact-panel p,
.work-aside p {
  color: var(--muted);
}

.hero-panel {
  position: relative;
  min-height: 620px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.82), rgba(255, 250, 240, 0.58)),
    rgba(255, 250, 240, 0.72);
  box-shadow: var(--shadow);
  overflow: hidden;
}

#signal-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.profile-card {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 20px;
  padding: 22px;
  border: 1px solid rgba(23, 33, 31, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(18px);
}

.profile-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  object-fit: cover;
}

.profile-head h2 {
  margin-bottom: 4px;
  font-size: 1.36rem;
  line-height: 1.1;
}

.profile-head p {
  margin: 0;
}

.status-line {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.status-line div {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 12px;
  align-items: baseline;
}

.status-line dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-line dd {
  margin: 0;
  font-weight: 760;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(280px, 0.5fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 34px;
}

.section-kicker {
  margin: 0 0 12px;
}

.section-head p {
  margin-bottom: 0;
  font-size: 1.03rem;
}

.proof-grid,
.project-grid,
.skills-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.proof-card,
.project-card,
.timeline-item,
.skill-group,
.education-item,
.contact-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.73);
}

.proof-card {
  min-height: 174px;
  padding: 20px;
}

.proof-card strong {
  display: block;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.92;
}

.work-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 28px;
  align-items: start;
}

.work-aside {
  position: sticky;
  top: 102px;
  padding: 22px;
  border-left: 4px solid var(--green);
  background: rgba(255, 250, 240, 0.62);
}

.work-aside h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item,
.project-card {
  padding: 26px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.timeline-item:hover,
.project-card:hover,
.project-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(22, 115, 95, 0.34);
  box-shadow: 0 18px 44px rgba(23, 33, 31, 0.09);
}

.timeline-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.timeline-top h3,
.project-card h3 {
  margin-bottom: 8px;
  font-size: 1.55rem;
  line-height: 1.12;
}

.timeline-top time {
  color: var(--muted);
  white-space: nowrap;
  font-weight: 750;
}

.impact-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.impact-list li {
  position: relative;
  padding-left: 24px;
  color: #31403b;
}

.impact-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 9px;
  height: 9px;
  border: 2px solid var(--green);
  border-radius: 2px;
  transform: translateY(-50%) rotate(45deg);
}

.tech-line,
.skill-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tech-line {
  margin-top: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 6px;
  background: rgba(247, 242, 232, 0.75);
  color: #384944;
  font-size: 0.83rem;
  font-weight: 700;
}

.project-card {
  display: grid;
  min-height: 318px;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.repo-footnote {
  margin: 14px 0 0;
  font-size: 0.86rem;
}

.project-card .button {
  align-self: end;
  width: fit-content;
  margin-top: 22px;
}

.skill-group,
.education-item {
  padding: 22px;
}

.skill-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 1.22rem;
}

.skill-group h3::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--green);
}

.skill-group:nth-child(2) h3::before,
.skill-group:nth-child(5) h3::before {
  background: var(--blue);
}

.skill-group:nth-child(3) h3::before,
.skill-group:nth-child(6) h3::before {
  background: var(--gold);
}

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

.education-item h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.education-item p {
  margin-bottom: 0;
}

.contact-section {
  padding-bottom: 46px;
}

.contact-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 5vw, 48px);
  background:
    linear-gradient(135deg, rgba(22, 115, 95, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(173, 73, 61, 0.08), transparent 38%),
    rgba(255, 250, 240, 0.84);
}

.contact-panel h2 {
  max-width: 780px;
  margin-bottom: 16px;
}

.contact-panel p {
  max-width: 680px;
  margin-bottom: 0;
  font-size: 1.04rem;
}

.contact-actions {
  display: grid;
  gap: 10px;
  min-width: 190px;
}

footer {
  padding: 28px 0 42px;
  color: var(--muted);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

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

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

@media (max-width: 1040px) {
  .hero-grid,
  .section-head,
  .work-layout,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-panel {
    min-height: 520px;
  }

  .work-aside {
    position: static;
  }

  .proof-grid,
  .project-grid,
  .skills-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .nav {
    min-height: 66px;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 74px;
    display: none;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 250, 240, 0.99);
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: grid;
  }

  .nav-actions .button:not(.mobile-toggle) {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand span {
    white-space: normal;
  }

  .section {
    padding: 72px 0;
  }

  .hero {
    padding-top: 54px;
  }

  .focus-strip,
  .proof-grid,
  .project-grid,
  .skills-wrap,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .timeline-top {
    display: grid;
  }

  .timeline-top time {
    white-space: normal;
  }

  .hero-panel {
    min-height: 500px;
  }

  .profile-card {
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 18px;
  }

  .status-line div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .footer-row {
    display: grid;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 3rem;
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .profile-head {
    grid-template-columns: 58px 1fr;
  }

  .avatar {
    width: 58px;
    height: 58px;
  }

  .project-card,
  .timeline-item,
  .skill-group,
  .education-item,
  .proof-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
