@property --ink-2 {
  syntax: "<color>";
  inherits: true;
  initial-value: #47546a;
}
@property --ink-3 {
  syntax: "<color>";
  inherits: true;
  initial-value: #6f7a8c;
}

/* Tokens — signal colours are the CIE LAB axes */
:root {
  --paper: #edeff2;
  --panel: #e2e6ec;
  --screen: #f7f8fa;
  --ink: #101b2d;
  --ink-2: #47546a;
  --ink-3: #6f7a8c;
  --line: rgba(16, 27, 45, 0.14);
  --line-soft: rgba(16, 27, 45, 0.07);
  --blue: #3355d1;
  --blue-deep: #2440a8;
  --green: #23936a;
  --red: #d9434b;
  --amber: #c98f00;
  --accent: #3355d1;
  --on-accent: #ffffff;

  --display: "Unbounded", "Geist", system-ui, sans-serif;
  --sans: "Geist", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1200px;
  --header-h: 4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background: transparent;
}

html {
  background: var(--paper);
}

/* Ambient field: dot grid + slow signal lines, fixed behind every section */
.bg-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Instrument screens always stay light */
.project-viz {
  --ink: #101b2d;
  --ink-2: #47546a;
  --ink-3: #6f7a8c;
  --line: rgba(16, 27, 45, 0.14);
  --line-soft: rgba(16, 27, 45, 0.07);
}

.project-viz {
  box-shadow: 0 0 0 1px var(--line);
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 550;
  line-height: 1.15;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--accent);
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  transition: transform 0.45s var(--ease), background-color 0.3s, box-shadow 0.3s;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.logo {
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: background-color 0.25s, color 0.25s;
}

.logo:hover .logo-mark {
  background: var(--ink);
  color: var(--paper);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  position: relative;
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s;
}

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

.nav .nav-cta {
  margin-left: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  transition: background-color 0.2s;
}

.nav .nav-cta:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.nav-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  opacity: 0;
  transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.25s;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}

.nav-toggle span:first-child {
  top: 1rem;
}
.nav-toggle span:last-child {
  top: 1.45rem;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(0.225rem) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-0.225rem) rotate(-45deg);
}

/* Hero */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(2rem, 6vh, 4.5rem)) var(--gutter) clamp(2rem, 5vh, 3.5rem);
  display: flex;
  flex-direction: column;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.status-dot {
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--green);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green);
  animation: ping 2.2s var(--ease) infinite;
}

/* Hero: name + copy on the left, portrait on the right */
.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas:
    "label photo"
    "name photo"
    "copy photo";
  grid-template-rows: auto auto auto;
  align-content: center;
  column-gap: clamp(2rem, 5vw, 4.5rem);
}

.hero-label {
  grid-area: label;
  justify-self: start;
}

.hero-name {
  grid-area: name;
}

.hero-copy {
  grid-area: copy;
}

.portrait {
  grid-area: photo;
  align-self: center;
  justify-self: end;
  position: relative;
  width: clamp(240px, 29vw, 390px);
  margin-right: 20px;
  perspective: 1000px;
  cursor: none;
  -webkit-tap-highlight-color: transparent;
  --mx: 50%;
  --my: 42%;
}

.portrait:focus-visible {
  outline-offset: 8px;
}

/* offset second frame, like a registration mark */
.portrait-back {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  transform: translate(12px, 12px);
  transition: transform 0.6s var(--ease), opacity 0.4s;
  opacity: 0.55;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  padding: 7px;
  background: var(--screen);
  border: 1.5px solid var(--ink);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
  box-shadow: 0 1px 0 rgba(16, 27, 45, 0.04), 0 18px 40px -24px rgba(16, 27, 45, 0.35);
  will-change: transform;
}

.portrait-media {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.portrait-img,
.portrait-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

/* base: cool duotone print */
.portrait-img {
  filter: grayscale(1) contrast(1.12) brightness(1.04);
  transition: filter 0.6s var(--ease);
}

.portrait-tint {
  position: absolute;
  inset: 0;
  background: var(--blue);
  mix-blend-mode: screen;
  opacity: 0.24;
}

/* fine dot screen over the duotone, gone inside the lens */
.portrait-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(16, 27, 45, 0.22) 0.7px, transparent 1px);
  background-size: 4px 4px;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at var(--mx) var(--my), transparent calc(var(--lens) - 2px), #000 var(--lens));
  mask-image: radial-gradient(circle at var(--mx) var(--my), transparent calc(var(--lens) - 2px), #000 var(--lens));
}

/* Lens: full colour + magnification inside a circle that follows the cursor */
@property --lens {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.portrait {
  --lens: 0px;
  transition: --lens 0.55s var(--ease);
}

.portrait-lens {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(
    circle at var(--mx) var(--my),
    #000 calc(var(--lens) - 1.5px),
    transparent var(--lens)
  );
  mask-image: radial-gradient(circle at var(--mx) var(--my), #000 calc(var(--lens) - 1.5px), transparent var(--lens));
}

.portrait-color {
  transform: scale(1.35);
  transform-origin: var(--mx) var(--my);
}

.portrait-ring {
  position: absolute;
  left: var(--mx);
  top: var(--my);
  width: calc(var(--lens) * 2);
  height: calc(var(--lens) * 2);
  translate: -50% -50%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(16, 27, 45, 0.25), 0 10px 30px -6px rgba(16, 27, 45, 0.45),
    inset 0 0 18px rgba(255, 255, 255, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.portrait-ring::after {
  content: attr(data-zoom);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  translate: -50% 0;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  transition: transform 0.6s var(--ease);
}

.corner-tl {
  top: -7px;
  left: -7px;
  border-top-width: 2px;
  border-left-width: 2px;
  border-top-left-radius: 6px;
}
.corner-tr {
  top: -7px;
  right: -7px;
  border-top-width: 2px;
  border-right-width: 2px;
  border-top-right-radius: 6px;
}
.corner-bl {
  bottom: -7px;
  left: -7px;
  border-bottom-width: 2px;
  border-left-width: 2px;
  border-bottom-left-radius: 6px;
}
.corner-br {
  bottom: -7px;
  right: -7px;
  border-bottom-width: 2px;
  border-right-width: 2px;
  border-bottom-right-radius: 6px;
}

/* Active (mouse over / focus): lens opens, frame lifts */
.portrait.is-active {
  --lens: clamp(64px, 7vw, 110px);
}

.portrait.is-full {
  --lens: 900px;
}

.portrait.is-full .portrait-color {
  transform: scale(1.04);
}

.portrait.is-active .portrait-ring {
  opacity: 1;
}

.portrait.is-full .portrait-ring {
  opacity: 0;
}

.portrait.is-active .portrait-img {
  filter: grayscale(1) contrast(1.12) brightness(0.92) blur(1.5px);
}

.portrait.is-active .portrait-frame {
  box-shadow: 0 1px 0 rgba(16, 27, 45, 0.04), 0 30px 60px -28px rgba(16, 27, 45, 0.5);
}

.portrait.is-active .portrait-back {
  transform: translate(20px, 20px);
  opacity: 1;
}

.portrait.is-active .corner-tl {
  transform: translate(5px, 5px);
}
.portrait.is-active .corner-tr {
  transform: translate(-5px, 5px);
}
.portrait.is-active .corner-bl {
  transform: translate(5px, -5px);
}
.portrait.is-active .corner-br {
  transform: translate(-5px, -5px);
}

@media (hover: none) {
  .portrait {
    cursor: pointer;
  }
}

@keyframes portraitScan {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: calc(100% - 2px);
    opacity: 0;
  }
}

@keyframes portraitReveal {
  from {
    clip-path: inset(0 0 100% 0 round 14px);
  }
  to {
    clip-path: inset(0 0 0 0 round 14px);
  }
}

.portrait-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--blue);
  box-shadow: 0 0 18px 4px rgba(51, 85, 209, 0.45);
  opacity: 0;
  pointer-events: none;
}

.hero-name {
  margin-top: clamp(0.75rem, 2vh, 1.25rem);
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3rem, 8.2vw, 7.4rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-left: -0.04em;
}

.name-line {
  display: block;
  white-space: nowrap;
}

.name-line:nth-child(2) {
  padding-left: 0.62em;
}

.name-line .g {
  display: inline-block;
  transition: transform 0.35s var(--ease), color 0.35s;
}

.name-line .g:not(.is-scrambling):hover {
  transform: translateY(-0.07em);
  color: var(--accent);
}

.name-line .g.is-scrambling {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: -0.08em;
}

.hero-copy {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  max-width: 34rem;
}

.hero-role {
  font-size: 1.05rem;
  color: var(--ink);
}

.hero-lead {
  margin-top: 0.85rem;
  max-width: 40ch;
  color: var(--ink-2);
  font-size: 1.12rem;
  line-height: 1.55;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 2.9rem;
  padding: 0 1.35rem;
  border-radius: 999px;
  font-size: 0.97rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 82%, var(--ink));
}

.btn-ghost {
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

/* Entrance: one orchestrated sequence on first load */
.hero.is-entering .hero-anim {
  opacity: 0;
  transform: translateY(14px);
}

.hero.is-ready .hero-anim {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--ease) var(--d, 0s), transform 0.8s var(--ease) var(--d, 0s);
}

.hero.is-entering .portrait-frame {
  clip-path: inset(0 0 100% 0 round 14px);
}

.hero.is-entering .portrait-back,
.hero.is-entering .corner {
  opacity: 0;
}

.hero.is-ready .portrait-frame {
  animation: portraitReveal 1.2s var(--ease) 0.3s backwards;
}

.hero.is-ready .portrait-back {
  transition: opacity 0.6s var(--ease) 1.1s, transform 0.6s var(--ease);
}

.hero.is-ready .corner {
  transition: opacity 0.5s var(--ease) 1.25s, transform 0.6s var(--ease);
}

.hero.is-ready .portrait-scan {
  animation: portraitScan 1.2s var(--ease) 0.3s 1 both;
}

.hero-meta {
  margin-top: auto;
  padding-top: clamp(2rem, 6vh, 3.5rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: 1rem clamp(2rem, 6vw, 5rem);
}

.meta-item dt {
  font-size: 0.85rem;
  color: var(--ink-3);
}

.meta-item dd a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease);
}

.meta-item dd a:hover {
  background-size: 100% 1px;
}

/* Ticker */
.ticker {
  overflow: hidden;
  border-block: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 38s linear infinite;
}

.ticker-track span {
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
  white-space: nowrap;
}

.ticker-track span::after {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 3.2rem;
  border-radius: 50%;
  background: var(--paper);
  opacity: 0.35;
  vertical-align: 0.15em;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

/* Sections: sticky title column + body */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4.5rem, 11vw, 8rem) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.section-title {
  font-family: var(--display);
  font-weight: 500;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  align-self: start;
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  letter-spacing: -0.02em;
}

.section-body {
  min-width: 0;
}

/* About — words light up as you read */
.about-text {
  font-size: clamp(1.5rem, 2.7vw, 2.25rem);
  line-height: 1.32;
  letter-spacing: -0.018em;
  max-width: 30ch;
}

.about-text .w {
  opacity: 0.18;
  transition: opacity 0.35s linear;
}

.about-text .w.is-lit {
  opacity: 1;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline-rail {
  position: absolute;
  top: 0.5rem;
  bottom: 0;
  left: 0.3rem;
  width: 1.5px;
  background: var(--line);
}

.timeline-rail span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 50% 0;
  transform: scaleY(var(--progress, 0));
}

.job {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 1.25rem 2.5rem;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.job::before {
  content: "";
  position: absolute;
  left: calc(-2rem + 0.3rem - 5px);
  top: 0.45rem;
  width: 11.5px;
  height: 11.5px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-3);
  background: var(--paper);
  transition: border-color 0.3s, background-color 0.3s;
}

.job.is-reached::before {
  border-color: var(--accent);
  background: var(--accent);
}

.job-aside time {
  display: block;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
}

.job-place {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: var(--ink-3);
}

.job-body h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  letter-spacing: -0.02em;
}

.job-company {
  margin-top: 0.35rem;
  color: var(--accent);
}

.job-body ul {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.6rem;
  max-width: 64ch;
}

.job-body li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--ink-2);
}

.job-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.5rem;
  height: 1.5px;
  background: var(--ink-3);
}

/* Projects */
.projects {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.project-viz {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: var(--screen);
}

.project-viz canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.project-content h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  letter-spacing: -0.02em;
}

.project-content p {
  margin-top: 0.85rem;
  color: var(--ink-2);
  max-width: 58ch;
}

.tech-list {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-list li {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
}

/* Skills */
.skills-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.view-toggle {
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.view-toggle:hover {
  border-color: var(--ink);
}

.view-toggle[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.skills-list {
  border-top: 1.5px solid var(--ink);
}

.skill-group {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.skill-group dt {
  color: var(--ink);
}

.skill-group dd {
  color: var(--ink-2);
}

.skills-json {
  margin: 0;
  padding: clamp(1rem, 3vw, 1.75rem);
  border-radius: 10px;
  background: #1a2640;
  border: 1px solid var(--line);
  color: #c9d1e0;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: fadeIn 0.35s var(--ease);
}

.skills-json .k {
  color: #9db1ff;
}
.skills-json .s {
  color: #7fd3ae;
}
.skills-json .p {
  color: #6f7a8c;
}

.skills-json .caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  vertical-align: -0.18em;
  background: #c9d1e0;
  animation: blink 1s steps(1) infinite;
}

/* Education */
.edu-list {
  display: grid;
  border-top: 1.5px solid var(--ink);
}

.edu {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 0.5rem 2.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.edu time {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding-top: 0.3rem;
}

.edu-body h3 {
  font-size: 1.35rem;
  letter-spacing: -0.015em;
}

.edu-degree {
  margin-top: 0.3rem;
  color: var(--ink-2);
}

.edu-meta {
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* Contact */
.contact {
  padding-bottom: clamp(4.5rem, 10vw, 7rem);
}

.contact-lead {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 40ch;
}

.contact-email {
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.contact-email a {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.15rem, 3.2vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.25s;
}

.contact-email a:hover {
  color: var(--accent);
  background-size: 100% 2px;
}

.copy-btn {
  font: inherit;
  font-size: 0.88rem;
  min-width: 7.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.copy-btn:hover {
  border-color: var(--ink);
}

.copy-btn.is-done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.contact-links {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.contact-links a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s, border-color 0.2s;
}

.contact-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.contact-location {
  margin-top: 2.5rem;
  font-size: 0.92rem;
  color: var(--ink-3);
}

/* Footer */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem var(--gutter) 2.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-3);
}

.site-footer a {
  text-decoration: none;
}

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

/* Keyframes */
@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  80%,
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label label"
      "name name"
      "copy photo";
    align-content: start;
  }

  .hero-name {
    font-size: clamp(3rem, 12vw, 7rem);
  }

  .hero {
    min-height: auto;
  }

  .portrait {
    align-self: start;
    margin-top: clamp(1.75rem, 4vw, 2.5rem);
    width: clamp(200px, 30vw, 280px);
  }

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

  .section-title {
    position: static;
  }

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

  .project-viz {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
    z-index: 2;
  }

  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.25rem;
    padding: var(--gutter);
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    font-size: 1.9rem;
    padding: 0.3rem 0;
    color: var(--ink);
    letter-spacing: -0.02em;
  }

  .nav .nav-cta {
    margin: 1rem 0 0;
    font-size: 1.1rem;
    padding: 0.6rem 1.4rem;
  }

  .nav-indicator {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-meta {
    grid-template-columns: 1fr;
  }

  .job,
  .edu,
  .skill-group {
    grid-template-columns: 1fr;
  }

  .job {
    gap: 0.75rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "name"
      "photo"
      "copy";
  }

  .portrait {
    justify-self: start;
    width: min(72vw, 300px);
    margin-top: 2rem;
  }

  .hero-name {
    font-size: 14.5vw;
  }

  .name-line:nth-child(2) {
    padding-left: 0.3em;
  }
}

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

  .about-text .w {
    opacity: 1;
  }
}
