:root {
  color-scheme: dark;
  --bg: #061225;
  --panel: rgba(9, 25, 52, 0.72);
  --panel-strong: rgba(11, 34, 72, 0.86);
  --line: rgba(139, 183, 255, 0.2);
  --line-strong: rgba(144, 197, 255, 0.42);
  --text: #eef6ff;
  --muted: #a9bdd8;
  --blue: #2f8cff;
  --blue-strong: #67b4ff;
  --cyan: #51e0ff;
  --ink: #05101f;
  --max: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  background:
    radial-gradient(circle at 18% 14%, rgba(47, 140, 255, 0.28), transparent 28rem),
    radial-gradient(circle at 82% 8%, rgba(81, 224, 255, 0.14), transparent 26rem),
    linear-gradient(180deg, #061225 0%, #07182f 44%, #061225 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  opacity: 0.26;
  background-image:
    linear-gradient(rgba(139, 183, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 183, 255, 0.09) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000, transparent 84%);
}

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

img {
  display: block;
  max-width: 100%;
}

.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  width: 22rem;
  height: 22rem;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(70, 161, 255, 0.18), transparent 64%);
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 220ms ease;
}

.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 30;
  width: min(calc(100% - 32px), var(--max));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px 0;
  transform: translateX(-50%);
}

.nav {
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(2, 8, 23, 0.22);
  backdrop-filter: blur(18px);
}

.nav {
  background: rgba(5, 16, 31, 0.68);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition: width 180ms ease, height 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.site-header.is-scrolled .brand {
  width: 56px;
  height: 56px;
  opacity: 0.72;
  transform: translateY(-4px);
}

.site-header.is-scrolled .brand:hover {
  opacity: 1;
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 12px 24px rgba(103, 180, 255, 0.2));
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 44px;
  padding: 0.28rem;
  border-radius: 999px;
}

.nav a {
  padding: 0.56rem 0.86rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(103, 180, 255, 0.12);
  transform: translateY(-1px);
}

.section-shell {
  width: min(calc(100% - 32px), var(--max));
  max-width: calc(100vw - 32px);
  margin: 0 auto;
}

.section-shell:not(.hero) {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

.hero {
  position: relative;
  min-height: min(860px, 86vh);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 2rem;
  padding: 112px 0 34px;
}

.hero-bg {
  position: absolute;
  inset: 84px 0 8px auto;
  z-index: -1;
  width: min(1040px, 84vw);
  background:
    linear-gradient(90deg, rgba(6, 18, 37, 0.92), rgba(6, 18, 37, 0.12) 45%, rgba(6, 18, 37, 0.78)),
    image-set(
      url("/static/assets/images/hero-bg-1280.webp") type("image/webp"),
      url("/static/assets/images/hero-bg-1280.jpg") type("image/jpeg")
    ) center / cover;
  opacity: 0.86;
  transform: none;
  mask-image:
    radial-gradient(ellipse at 62% 48%, #000 0%, #000 43%, rgba(0, 0, 0, 0.84) 56%, transparent 82%),
    linear-gradient(to bottom, transparent 0%, #000 12%, #000 76%, transparent 100%);
  mask-composite: intersect;
  -webkit-mask-image:
    radial-gradient(ellipse at 62% 48%, #000 0%, #000 43%, rgba(0, 0, 0, 0.84) 56%, transparent 82%),
    linear-gradient(to bottom, transparent 0%, #000 12%, #000 76%, transparent 100%);
  -webkit-mask-composite: source-in;
}

.hero-content {
  max-width: 780px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.85rem;
  color: var(--blue-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 900px;
  margin-bottom: 1rem;
  font-size: clamp(4rem, 12vw, 9.6rem);
  line-height: 0.82;
  letter-spacing: 0;
  text-wrap: balance;
}

h2 {
  max-width: 860px;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

h3 {
  font-size: 1.16rem;
  line-height: 1.15;
}

.hero-copy {
  max-width: 720px;
  margin-bottom: 1.8rem;
  color: #d7e8ff;
  font-size: clamp(1.05rem, 1.8vw, 1.34rem);
  overflow-wrap: anywhere;
}

.hero-actions,
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.78rem;
}

.button,
.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.78rem 1.05rem;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: var(--ink);
  box-shadow: 0 20px 54px rgba(47, 140, 255, 0.35);
}

.button.secondary,
.button.ghost,
.contact-link {
  background: rgba(7, 24, 47, 0.7);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.button:hover,
.contact-link:hover {
  border-color: rgba(103, 180, 255, 0.82);
  transform: translateY(-2px);
}

.hero-panel {
  display: grid;
  align-self: center;
}

.stack-group,
.project-card,
.compact-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(2, 8, 23, 0.26);
  backdrop-filter: blur(20px);
}

.snapshot-list {
  display: grid;
  gap: 0.82rem;
  margin: 0;
}

.snapshot-list > div {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  min-width: 0;
  min-height: 88px;
  border: 1px solid rgba(139, 183, 255, 0.16);
  border-radius: 8px;
  padding: 0.85rem;
  background:
    linear-gradient(145deg, rgba(47, 140, 255, 0.14), rgba(6, 18, 37, 0.34)),
    rgba(3, 14, 31, 0.54);
  box-shadow: 0 20px 70px rgba(2, 8, 23, 0.26);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.snapshot-list > div::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: linear-gradient(to bottom, var(--blue), var(--cyan));
  opacity: 0.82;
}

.snapshot-list > div:hover {
  border-color: rgba(103, 180, 255, 0.48);
  background: rgba(12, 42, 86, 0.42);
  transform: translateX(-3px);
}

.metric {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--cyan);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.snapshot-list dt {
  margin: 0;
  color: var(--cyan);
  font-size: 2.18rem;
  font-weight: 950;
  line-height: 0.92;
}

.snapshot-list dd {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.snapshot-list dd span {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 850;
}

.project-card p,
.compact-card p,
.timeline p,
.intro p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: start;
  padding: 68px 0 34px;
}

.intro p {
  max-width: 920px;
  font-size: 1.08rem;
}

.intro-copy {
  min-width: 0;
}

.intro-copy h2 {
  max-width: 760px;
  font-size: clamp(2.35rem, 4.25vw, 3.75rem);
  line-height: 1;
}

.profile-portrait {
  position: relative;
  width: min(100%, 360px);
  margin: 0;
  justify-self: end;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.profile-portrait::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  border-radius: 6px;
  background: linear-gradient(to bottom, transparent 58%, rgba(6, 18, 37, 0.42));
  pointer-events: none;
}

.profile-portrait img {
  width: 100%;
  height: clamp(340px, 34vw, 440px);
  border-radius: 8px;
  object-fit: cover;
  object-position: 50% 14%;
  filter: saturate(0.92) contrast(1.04);
}

.profile-portrait picture {
  display: block;
}

.section-heading {
  padding: 68px 0 24px;
}

.stack-section .section-heading {
  padding: 48px 0 16px;
}

.stack-section h2 {
  max-width: none;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.62rem;
}

.stack-group {
  min-height: 132px;
  padding: 0.7rem;
  background:
    linear-gradient(145deg, rgba(47, 140, 255, 0.11), rgba(6, 18, 37, 0.34)),
    rgba(9, 25, 52, 0.62);
  box-shadow: 0 18px 54px rgba(2, 8, 23, 0.2);
}

.stack-group h3 {
  margin-bottom: 0.62rem;
  color: #eaf4ff;
  font-size: 1.02rem;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.stack-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 28px;
  border: 1px solid rgba(139, 183, 255, 0.16);
  border-radius: 999px;
  padding: 0.26rem 0.42rem;
  background: rgba(255, 255, 255, 0.045);
  color: #dcecff;
  font-size: 0.72rem;
  font-weight: 750;
  transition: transform 160ms ease, background 160ms ease;
}

.stack-chip:hover {
  background: rgba(103, 180, 255, 0.11);
  transform: translateY(-2px);
}

.stack-chip img,
.text-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.text-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(103, 180, 255, 0.18);
  color: var(--blue-strong);
  font-size: 0.58rem;
  font-weight: 900;
}

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

.project-card {
  position: relative;
  min-height: 420px;
  padding: 1.18rem;
  overflow: hidden;
}

.project-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, rgba(47, 140, 255, 0.16), transparent 42%);
  opacity: 0;
  transition: opacity 220ms ease;
}

.project-card:hover::before {
  opacity: 1;
}

.project-card > * {
  position: relative;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.project-meta span,
.timeline span {
  color: var(--blue-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.project-meta span {
  border: 1px solid rgba(103, 180, 255, 0.24);
  border-radius: 999px;
  padding: 0.26rem 0.52rem;
  background: rgba(103, 180, 255, 0.08);
}

.project-card ul {
  margin: 1rem 0;
  padding-left: 1.1rem;
  color: #c7dbf5;
}

.project-card li + li {
  margin-top: 0.38rem;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 1rem;
}

.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  min-height: 29px;
  border: 1px solid rgba(103, 180, 255, 0.22);
  border-radius: 999px;
  padding: 0.3rem 0.52rem;
  background: rgba(103, 180, 255, 0.07);
  color: #dcecff;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tech-chip:hover {
  border-color: rgba(103, 180, 255, 0.5);
  background: rgba(103, 180, 255, 0.13);
  transform: translateY(-1px);
}

.tech-chip img,
.tech-chip .text-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.tech-chip-icon-only {
  justify-content: center;
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.tech-chip-icon-only:hover {
  background: transparent;
  transform: translateY(-1px) scale(1.08);
}

.tech-chip-icon-only img,
.tech-chip-icon-only .text-icon {
  width: 22px;
  height: 22px;
}

.tech-chip-icon-only .text-icon {
  border-radius: 0;
  background: transparent;
  font-size: 0.56rem;
}

.compact-tech-list {
  margin-top: 0.9rem;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.86rem;
}

.compact-card {
  padding: 1rem;
}

.timeline-section {
  padding-bottom: 24px;
}

.timeline {
  position: relative;
  max-width: 860px;
  padding-left: 1rem;
}

.timeline::before {
  position: absolute;
  top: 0.65rem;
  bottom: 0.65rem;
  left: 0.3rem;
  width: 1px;
  content: "";
  background: linear-gradient(to bottom, transparent, var(--blue), transparent);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 1rem;
  padding: 0 0 1.6rem;
}

.timeline-dot {
  width: 13px;
  height: 13px;
  margin-top: 0.38rem;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 8px rgba(81, 224, 255, 0.08);
}

.timeline h3 {
  margin-bottom: 0.24rem;
}

.timeline strong {
  display: block;
  margin-bottom: 0.5rem;
  color: #dbeafe;
}

.contact {
  margin-top: 72px;
  margin-bottom: 72px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: clamp(1.2rem, 4vw, 3rem);
  background:
    linear-gradient(135deg, rgba(47, 140, 255, 0.22), rgba(81, 224, 255, 0.06)),
    var(--panel-strong);
  box-shadow: 0 28px 100px rgba(2, 8, 23, 0.34);
}

.contact h2 {
  max-width: 920px;
}

.site-footer {
  width: min(calc(100% - 32px), var(--max));
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: 28px 0 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js .hero .reveal {
  opacity: 1;
  transform: none;
}

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

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.tilt-card:hover {
  border-color: rgba(103, 180, 255, 0.52);
  background: rgba(10, 34, 72, 0.82);
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .cursor-glow {
    display: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: 28px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .snapshot-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .snapshot-list > div {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .stack-grid,
  .project-grid,
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 820px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-portrait {
    justify-self: start;
    max-width: 340px;
  }
}

@media (max-width: 720px) {
  .site-header {
    width: min(calc(100% - 24px), var(--max));
    justify-content: center;
    padding: 12px 0;
  }

  .brand {
    display: none;
  }

  .nav {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav a {
    flex: 0 0 auto;
    padding-inline: 0.74rem;
  }

  .hero {
    padding-top: 88px;
    padding-bottom: 22px;
  }

  .intro {
    gap: 1.3rem;
  }

  .profile-portrait {
    justify-self: start;
    max-width: 320px;
  }

  .hero-bg {
    inset: 74px -16px auto -16px;
    width: auto;
    height: 52vh;
    transform: none;
  }

  .hero-panel,
  .snapshot-list,
  .stack-grid,
  .project-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .snapshot-list > div {
    gap: 0.62rem;
    padding: 0.78rem;
  }

  .snapshot-list dd {
    font-size: 0.92rem;
  }

  .project-card {
    min-height: auto;
  }

  .section-heading {
    padding-top: 68px;
  }

  .contact-row {
    display: grid;
  }

  .contact-link {
    justify-content: flex-start;
  }

  .site-footer {
    flex-direction: column;
  }
}

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

  .cursor-glow {
    display: none;
  }
}
