:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --surface: #ffffff;
  --ink: #181a1f;
  --muted: #616873;
  --line: #dcd5c8;
  --teal: #0d6b68;
  --teal-dark: #084b49;
  --coral: #d8583c;
  --ochre: #b98521;
  --shadow: 0 24px 70px rgba(24, 26, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(13, 107, 104, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(13, 107, 104, 0.06) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

button.button {
  cursor: pointer;
}

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

.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: rgba(247, 244, 237, 0.86);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  border-color: rgba(24, 26, 31, 0.08);
  box-shadow: 0 12px 28px rgba(24, 26, 31, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 36px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-size: 0.76rem;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 32px);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.nav a {
  transition: color 160ms ease;
}

.nav a:hover {
  color: var(--ink);
}

.section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(310px, 0.72fr);
  align-items: stretch;
  gap: 28px;
  min-height: calc(100vh - 78px);
  padding: clamp(54px, 9vw, 104px) 0 38px;
}

.hero-copy {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 54px) 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(3.4rem, 9vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

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

h3 {
  font-size: 1.12rem;
  line-height: 1.3;
}

.lead {
  max-width: 680px;
  color: #343941;
  font-size: clamp(1.08rem, 2vw, 1.38rem);
  line-height: 1.7;
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(24, 26, 31, 0.12);
}

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

.button.secondary {
  background: rgba(255, 255, 255, 0.62);
}

.signal-panel {
  align-self: center;
  padding: 22px;
  background: var(--surface);
  border: 1px solid rgba(24, 26, 31, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.availability {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--teal-dark);
  font-size: 0.92rem;
  font-weight: 750;
}

.pulse {
  width: 10px;
  height: 10px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(216, 88, 60, 0.14);
}

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

.metric-grid div {
  min-height: 112px;
  padding: 16px;
  background: #f2efe7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-grid strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.45rem;
}

.metric-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.intro-band {
  margin-bottom: 96px;
  padding: clamp(24px, 4vw, 42px);
  background: var(--teal);
  color: #fff;
  border-radius: 8px;
}

.intro-band p {
  max-width: 900px;
  margin-bottom: 0;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  line-height: 1.45;
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.content-state {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

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

.project-card {
  min-height: 270px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid rgba(24, 26, 31, 0.1);
  border-radius: 8px;
}

.project-card.featured {
  grid-column: span 2;
  background: #182022;
  color: #fff;
}

.project-card p,
.timeline-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.repo-card {
  display: flex;
  flex-direction: column;
}

.repo-card a {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-top: auto;
  padding-top: 22px;
  color: var(--teal);
  font-weight: 800;
}

.project-card.featured.repo-card a {
  color: #fff;
}

.project-card-link {
  color: inherit;
}

.project-card-link .project-card {
  height: 100%;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.project-card-link:hover .project-card {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(24, 26, 31, 0.12);
}

.project-card.featured p {
  color: rgba(255, 255, 255, 0.76);
}

.project-meta {
  margin-bottom: 36px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.split,
.skills-section,
.contact {
  padding-top: 98px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 48px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.timeline-item time {
  color: var(--ochre);
  font-size: 0.92rem;
  font-weight: 800;
}

.timeline-item h3 {
  margin-bottom: 8px;
}

.timeline-content {
  max-width: 740px;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-list span {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid rgba(24, 26, 31, 0.12);
  border-radius: 8px;
  color: #303640;
  font-weight: 750;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding-bottom: 96px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(20px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 650;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(24, 26, 31, 0.16);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  box-shadow: 0 14px 28px rgba(24, 26, 31, 0.18);
}

.mail-dialog {
  width: min(620px, calc(100% - 28px));
  padding: 0;
  border: 1px solid rgba(24, 26, 31, 0.12);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(24, 26, 31, 0.28);
}

.mail-dialog::backdrop {
  background: rgba(24, 26, 31, 0.42);
  backdrop-filter: blur(4px);
}

.mail-form {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
}

.mail-dialog-head,
.mail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mail-dialog h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.mail-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.mail-form input,
.mail-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fbfaf7;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}

.mail-form textarea {
  resize: vertical;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
}

.page-hero {
  padding: clamp(54px, 9vw, 104px) 0 54px;
}

.page-hero h1 {
  max-width: 900px;
}

.page-hero .lead {
  max-width: 760px;
}

.jam-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 96px;
}

.status-pill {
  display: inline-flex;
  width: max-content;
  margin-top: auto;
  padding-top: 22px;
  color: var(--ochre);
  font-weight: 800;
}

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

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

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 42px;
  }

  .hero-copy {
    min-height: auto;
  }

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

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

  .project-card.featured {
    grid-column: auto;
  }

  .timeline-item,
  .contact {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .section {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    padding: 14px;
  }

  .nav {
    gap: 16px;
    font-size: 0.88rem;
  }

  h1 {
    font-size: 3.05rem;
  }

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

  .button,
  .contact-actions,
  .mail-actions {
    width: 100%;
  }

  .mail-dialog-head,
  .mail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .footer {
    flex-direction: column;
    padding: 22px 14px;
  }
}
