:root {
  color-scheme: dark;
  --bg: #060914;
  --bg-deep: #03050c;
  --surface: #0c1224;
  --surface-raised: #111a31;
  --text: #eef4ff;
  --muted: #9aa8c4;
  --cyan: #5cecff;
  --cyan-soft: rgb(92 236 255 / 12%);
  --violet: #9c7cff;
  --violet-soft: rgb(156 124 255 / 14%);
  --line: rgb(154 168 196 / 18%);
  --line-bright: rgb(92 236 255 / 38%);
  --shadow: 0 28px 80px rgb(0 0 0 / 34%);
  --max-width: 75rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 8%, rgb(83 54 171 / 22%), transparent 28rem),
    radial-gradient(circle at 15% 26%, rgb(0 183 204 / 10%), transparent 30rem),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.65;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(rgb(92 236 255 / 3.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(92 236 255 / 3.5%) 1px, transparent 1px);
  background-size: 4rem 4rem;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 92%);
  mask-image: linear-gradient(to bottom, black, transparent 92%);
  pointer-events: none;
  content: "";
}

::selection {
  color: var(--bg-deep);
  background: var(--cyan);
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  color: var(--bg);
  background: var(--cyan);
  border-radius: 0.35rem;
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

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

.site-header,
main,
footer {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 3rem), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5rem;
  border-bottom: 1px solid var(--line);
  background: rgb(6 9 20 / 76%);
  backdrop-filter: blur(18px);
}

.wordmark {
  position: relative;
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: var(--text);
  background: linear-gradient(145deg, var(--cyan-soft), var(--violet-soft));
  border: 1px solid var(--line-bright);
  border-radius: 0.65rem;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.wordmark::after {
  position: absolute;
  right: -0.6rem;
  bottom: -0.6rem;
  width: 1.2rem;
  height: 1.2rem;
  background: var(--violet);
  border-radius: 50%;
  box-shadow: 0 0 1.5rem var(--violet);
  content: "";
}

nav ul {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a,
footer a {
  position: relative;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 180ms ease;
}

nav a::after {
  position: absolute;
  right: 0;
  bottom: -0.45rem;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

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

nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  min-height: calc(100vh - 5rem);
  padding-block: clamp(5rem, 10vw, 9rem);
}

.hero-copy > * {
  animation: reveal-up 650ms both;
}

.hero-copy > :nth-child(2) {
  animation-delay: 70ms;
}

.hero-copy > :nth-child(3) {
  animation-delay: 140ms;
}

.hero-copy > :nth-child(4) {
  animation-delay: 210ms;
}

.hero-copy > :nth-child(5) {
  animation-delay: 280ms;
}

.hero-copy > :nth-child(6) {
  animation-delay: 350ms;
}

.eyebrow,
.project-index,
.section-number,
.education-date {
  margin: 0 0 0.75rem;
  color: var(--cyan);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  display: inline-block;
  width: 1.7rem;
  height: 1px;
  margin-right: 0.75rem;
  background: var(--cyan);
  box-shadow: 0 0 0.7rem var(--cyan);
  vertical-align: middle;
  content: "";
}

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

h1,
h2,
h3 {
  text-wrap: balance;
}

h1,
h2 {
  line-height: 0.96;
  letter-spacing: -0.055em;
}

h1 {
  max-width: 9ch;
  margin-bottom: 1.6rem;
  font-size: clamp(3.2rem, 9.5vw, 8.1rem);
  font-weight: 820;
  overflow-wrap: normal;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(3rem, 6.8vw, 5.75rem);
  font-weight: 780;
}

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

.timeline-item h3 span {
  color: var(--cyan);
  text-shadow: 0 0 1.5rem rgb(92 236 255 / 45%);
}

.role {
  max-width: 38rem;
  margin-bottom: 1rem;
  font-size: clamp(1.35rem, 3vw, 2.05rem);
  font-weight: 680;
  line-height: 1.25;
  text-wrap: balance;
}

.hero-meta {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.35rem 0.7rem;
  color: #c5d1e9;
  background: var(--cyan-soft);
  border: 1px solid rgb(92 236 255 / 20%);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.intro {
  max-width: 41rem;
  font-size: clamp(1rem, 1.7vw, 1.17rem);
}

.intro strong {
  color: var(--text);
  font-weight: 750;
}

.intro,
.timeline-item p,
.project-card p,
.skill-grid p,
.education-grid p,
.contact-copy {
  color: var(--muted);
}

.hero-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 2rem;
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 3.15rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--bg-deep);
  background: linear-gradient(105deg, var(--cyan), #a4f6ff);
  border-color: transparent;
  box-shadow: 0 0.7rem 2rem rgb(92 236 255 / 18%);
}

.button-primary:hover {
  box-shadow: 0 0.9rem 2.5rem rgb(92 236 255 / 28%);
}

.button-secondary {
  color: #d9e4f8;
  background: rgb(17 26 49 / 55%);
}

.button-secondary:hover {
  color: var(--text);
  border-color: var(--line-bright);
}

.hero-portrait {
  position: relative;
  width: min(23rem, 100%);
  aspect-ratio: 4 / 5;
  justify-self: end;
  margin: 0;
  padding: 1px;
  background: linear-gradient(145deg, var(--cyan), var(--violet));
  border-radius: 1.25rem;
  box-shadow:
    0 0 0 0.45rem rgb(6 9 20 / 78%),
    0 0 3.5rem rgb(92 236 255 / 12%),
    var(--shadow);
  isolation: isolate;
  animation: reveal-scale 800ms 220ms both;
}

.hero-portrait::before,
.hero-portrait::after {
  position: absolute;
  z-index: -1;
  content: "";
}

.hero-portrait::before {
  inset: -1.15rem;
  border: 1px dashed rgb(92 236 255 / 28%);
  border-radius: 1.8rem;
}

.hero-portrait::after {
  right: -2rem;
  bottom: -2rem;
  width: 9rem;
  height: 9rem;
  background: rgb(156 124 255 / 18%);
  border-radius: 50%;
  filter: blur(2rem);
}

.hero-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: var(--surface);
  border-radius: calc(1.25rem - 1px);
}

.section {
  padding-block: clamp(5.5rem, 10vw, 9rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 5rem;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(4.5rem, 0.22fr) 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: clamp(3.25rem, 7vw, 5.5rem);
}

.section-heading h2 {
  color: transparent;
  background: linear-gradient(100deg, var(--text) 15%, #aabbd9 90%);
  -webkit-background-clip: text;
  background-clip: text;
}

.section-number {
  padding-top: 0.5rem;
  color: var(--violet);
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(11rem, 0.3fr) 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  overflow: hidden;
  padding: clamp(1.6rem, 4vw, 2.5rem);
  background:
    linear-gradient(110deg, rgb(17 26 49 / 90%), rgb(12 18 36 / 72%)) padding-box,
    linear-gradient(110deg, rgb(92 236 255 / 38%), transparent 45%, rgb(156 124 255 / 30%)) border-box;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 16%);
}

.timeline-item::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 7rem;
  height: 7rem;
  background: radial-gradient(circle at top right, var(--violet-soft), transparent 70%);
  content: "";
  pointer-events: none;
}

.timeline-item h3 {
  margin-bottom: 0.85rem;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

.timeline-meta {
  color: #c1cee5;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
}

.timeline-meta p,
.timeline-item p {
  margin-bottom: 0.3rem;
}

.timeline-meta p:first-child {
  color: var(--cyan);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.project-card {
  position: relative;
  display: flex;
  min-height: 22rem;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(1.6rem, 3vw, 2.2rem);
  background: linear-gradient(145deg, rgb(17 26 49 / 78%), rgb(8 13 27 / 92%));
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.project-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent 45%, var(--violet));
  content: "";
  opacity: 0.75;
}

.project-card::after {
  position: absolute;
  right: -5rem;
  bottom: -5rem;
  width: 11rem;
  height: 11rem;
  background: var(--violet-soft);
  border-radius: 50%;
  filter: blur(1.2rem);
  content: "";
  pointer-events: none;
}

.project-card:hover {
  border-color: var(--line-bright);
  box-shadow:
    0 1.8rem 5rem rgb(0 0 0 / 35%),
    0 0 2.5rem rgb(92 236 255 / 6%);
  transform: translateY(-4px);
}

.project-card h3 {
  max-width: 20ch;
  margin-bottom: 1rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
}

.project-card p,
.project-card h3,
.project-card ul {
  position: relative;
  z-index: 1;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: auto 0 0;
  padding: 1.5rem 0 0;
  list-style: none;
}

.tag-list li {
  padding: 0.27rem 0.58rem;
  color: #b9c8e2;
  background: rgb(92 236 255 / 6%);
  border: 1px solid rgb(92 236 255 / 14%);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.skill-grid article {
  position: relative;
  padding: 1.8rem;
  background: rgb(12 18 36 / 74%);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.skill-grid article::before {
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-bottom: 1.4rem;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 1rem rgb(92 236 255 / 28%);
  content: "";
}

.skill-grid h3 {
  margin-bottom: 0.85rem;
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.education-grid article {
  position: relative;
  min-height: 14rem;
  overflow: hidden;
  padding: clamp(1.6rem, 3vw, 2.2rem);
  background:
    linear-gradient(135deg, rgb(92 236 255 / 6%), transparent 50%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

.education-grid article::after {
  position: absolute;
  right: 1.5rem;
  bottom: 1.2rem;
  color: rgb(156 124 255 / 12%);
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  content: "01";
}

.education-grid article:nth-child(2)::after {
  content: "02";
}

.education-grid h3 {
  position: relative;
  z-index: 1;
  margin-bottom: 0.6rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.education-grid p {
  position: relative;
  z-index: 1;
  margin-bottom: 0.25rem;
}

.education-grid .education-date {
  color: var(--cyan);
}

.contact {
  position: relative;
  overflow: hidden;
  margin-block: clamp(4rem, 8vw, 7rem);
  padding-inline: clamp(1.5rem, 6vw, 5rem);
  background:
    radial-gradient(circle at 50% 0%, rgb(92 236 255 / 11%), transparent 45%),
    linear-gradient(135deg, rgb(17 26 49 / 80%), rgb(8 13 27 / 88%));
  border: 1px solid var(--line-bright);
  border-radius: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.contact::after {
  position: absolute;
  bottom: -8rem;
  left: 50%;
  width: 22rem;
  height: 12rem;
  background: rgb(156 124 255 / 12%);
  border-radius: 50%;
  filter: blur(2.5rem);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.contact .eyebrow::before {
  display: none;
}

.contact h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
}

.contact-copy {
  position: relative;
  z-index: 1;
  max-width: 38rem;
  margin-inline: auto;
  font-size: 1.08rem;
}

.contact-links {
  position: relative;
  z-index: 1;
  justify-content: center;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

footer p {
  margin-bottom: 0;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-scale {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 58rem) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: 5.5rem;
  }

  .hero-copy {
    max-width: 48rem;
  }

  .hero-portrait {
    width: min(21rem, 72vw);
    justify-self: center;
    margin: 1rem auto 0;
  }

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

@media (max-width: 44rem) {
  .site-header,
  main,
  footer {
    width: min(calc(100% - 2rem), var(--max-width));
  }

  .site-header {
    position: relative;
    align-items: flex-start;
    padding-block: 1rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(3rem, 16vw, 4.5rem);
  }

  nav {
    max-width: calc(100% - 3.6rem);
    overflow-x: auto;
    padding-block: 0.8rem;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav ul {
    width: max-content;
    gap: 1rem;
  }

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

  .project-card {
    min-height: 20rem;
  }

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

  .section-number {
    margin-bottom: 0;
  }

  .contact {
    margin-block: 3rem;
  }

  footer {
    flex-direction: column;
  }
}

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

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