:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f0f3f7;
  --surface-strong: #e8edf3;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #c27803;
  --accent-2: #0891b2;
  --shadow: 0 24px 70px rgba(17, 24, 39, 0.12);
  --card-shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
  --hero-wash:
    radial-gradient(circle at 12% 20%, rgba(37, 99, 235, 0.16), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(8, 145, 178, 0.14), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 78%);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090d14;
  --surface: #101722;
  --surface-soft: #141d2a;
  --surface-strong: #182232;
  --text: #f4f7fb;
  --muted: #a7b1c2;
  --line: #243247;
  --primary: #60a5fa;
  --primary-strong: #93c5fd;
  --accent: #f6bd4b;
  --accent-2: #22d3ee;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  --card-shadow: 0 20px 70px rgba(0, 0, 0, 0.36);
  --hero-wash:
    radial-gradient(circle at 16% 18%, rgba(37, 99, 235, 0.24), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(34, 211, 238, 0.16), transparent 30%),
    linear-gradient(180deg, #0b111c 0%, var(--bg) 82%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--hero-wash);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 42%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 42%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 70%);
  pointer-events: none;
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 54px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.1);
}

.brand,
.nav,
.hero-actions,
.contact-actions,
.tags,
.terminal-top {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  border-radius: 8px;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 28%, transparent);
}

.nav {
  gap: clamp(14px, 3vw, 32px);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
}

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

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

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--text) 8%, transparent);
}

.sun,
.moon {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
}

.sun {
  background: #f6bd4b;
  box-shadow: 0 0 0 5px rgba(246, 189, 75, 0.2);
}

.moon {
  display: none;
  background: var(--surface);
  box-shadow: inset -6px -3px 0 var(--primary-strong);
}

[data-theme="dark"] .sun {
  display: none;
}

[data-theme="dark"] .moon {
  display: block;
}

.hero {
  position: relative;
  min-height: 92vh;
  overflow: hidden;
  padding: 138px clamp(18px, 5vw, 72px) 64px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 28%;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.38;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  max-width: 1180px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 5.4vw, 5.2rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 3.5vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
  line-height: 1.25;
}

.hero-text {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
}

.availability-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.availability-line span,
.contact-trigger span {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
}

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

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--text) 7%, transparent);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--text) 12%, transparent);
}

.button.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  border-color: var(--primary);
}

.button.secondary {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.terminal-panel {
  width: min(100%, 430px);
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.terminal-top {
  gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.terminal-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
}

.terminal-top span:nth-child(2) {
  background: var(--accent);
}

.terminal-top span:nth-child(3) {
  background: var(--primary);
}

.terminal-body {
  padding: 22px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
}

.terminal-body p {
  margin-bottom: 11px;
}

.terminal-body span {
  color: var(--primary);
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 86px clamp(18px, 5vw, 32px);
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: none;
  padding-top: 0;
  padding-bottom: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.stat {
  padding: 34px clamp(18px, 5vw, 58px);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  margin-bottom: 5px;
  font-size: clamp(1.45rem, 2.8vw, 2.12rem);
  line-height: 1;
}

.stat span,
.section-heading p,
.skill-group p,
.timeline-item p,
.contact-section p,
.project-content p {
  color: var(--muted);
}

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

.section-heading.compact {
  margin-bottom: 0;
}

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

.project-card,
.skill-group,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--card-shadow);
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card-featured {
  grid-column: span 2;
}

.project-card-featured .project-visual {
  aspect-ratio: 16 / 7;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 44%, var(--line));
  box-shadow: var(--shadow);
}

.project-visual {
  position: relative;
  display: block;
  min-height: 190px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 220ms ease;
}

.project-card:hover .project-visual img {
  transform: scale(1.035);
}

.project-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}

.tags {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tags span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: color-mix(in srgb, var(--text) 70%, var(--muted));
  font-size: 0.78rem;
  font-weight: 750;
}

.project-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  margin-top: auto;
  padding-top: 20px;
  color: var(--primary);
  font-weight: 800;
}

.project-link:hover {
  color: var(--primary-strong);
}

.expertise-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  gap: clamp(32px, 7vw, 90px);
  align-items: start;
}

.expertise-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.expertise-list article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.expertise-list article > span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
}

.expertise-list h3 {
  margin-bottom: 6px;
}

.expertise-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.skill-groups {
  display: grid;
  gap: 16px;
}

.skill-group {
  padding: 24px;
  box-shadow: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.skill-group:hover {
  transform: translateX(4px);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
}

.timeline {
  display: grid;
  gap: 18px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 30px;
  width: 1px;
  background: linear-gradient(to bottom, var(--primary), var(--line), transparent);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  padding: 26px;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  margin-top: 7px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 15%, transparent);
}

.timeline-meta {
  margin-bottom: 14px;
  color: var(--accent) !important;
  font-size: 0.92rem;
  font-weight: 800;
}

.timeline-item ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.timeline-item li {
  padding-left: 4px;
}

.role-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.role-heading span {
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

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

.testimonial-grid blockquote {
  margin: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--card-shadow);
}

.testimonial-grid p {
  color: var(--text);
}

.testimonial-grid cite {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 800;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  margin: 58px clamp(18px, 5vw, 72px);
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 92%, transparent), color-mix(in srgb, var(--surface) 92%, transparent));
  box-shadow: var(--shadow);
}

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

.contact-section p {
  max-width: 600px;
}

.contact-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.contact-list a,
.contact-list span {
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.contact-list a:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.contact-launcher {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 20;
  display: grid;
  justify-items: end;
  gap: 12px;
}

.contact-trigger {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, #22c55e 46%, var(--line));
  border-radius: 8px;
  color: #ffffff;
  background: #137a3f;
  box-shadow: 0 18px 45px rgba(7, 65, 34, 0.28);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.contact-trigger:hover {
  background: #0f6935;
}

.contact-trigger span {
  background: #8ef0ad;
  box-shadow: 0 0 0 5px rgba(142, 240, 173, 0.18);
}

.contact-popover {
  position: relative;
  display: none;
  width: min(390px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.contact-launcher.is-open .contact-popover {
  display: block;
  animation: contact-in 160ms ease-out;
}

.contact-popover h2 {
  margin-bottom: 10px;
  font-size: 1.55rem;
}

.contact-popover > p:not(.eyebrow) {
  margin-bottom: 18px;
  color: var(--muted);
}

.contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.contact-prompts {
  display: grid;
  gap: 9px;
}

.contact-prompts a {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 0.9rem;
  font-weight: 750;
}

.contact-prompts a:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}

.contact-popover-links {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
}

@keyframes contact-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

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

  .nav {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 112px;
  }

  .hero-grid,
  .split,
  .expertise-section,
  .stats-band,
  .project-grid,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }

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

  .project-card-featured .project-visual {
    aspect-ratio: 16 / 10;
  }

  .terminal-panel {
    justify-self: start;
  }

  .contact-section,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: clamp(2.65rem, 13vw, 3.4rem);
    line-height: 1.02;
  }

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

  .terminal-body {
    font-size: 0.82rem;
  }

  .role-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .contact-launcher {
    right: 12px;
    bottom: 12px;
  }

  .contact-popover {
    position: fixed;
    right: 12px;
    bottom: 70px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 94px);
    padding: 22px;
    overflow-y: auto;
    background: var(--surface);
  }

  .contact-popover h2 {
    padding-right: 34px;
    font-size: 1.35rem;
  }

  .contact-trigger {
    min-height: 46px;
    padding: 0 14px;
    font-size: 0.88rem;
  }
}

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