/* Sections — hero, about, buttons, reveal, scroll progress */

/* —— Scroll progress —— */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  height: 2px;
  width: 100%;
  margin: 0;
  border: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.scroll-progress::-webkit-progress-bar {
  background: transparent;
}

.scroll-progress::-webkit-progress-value {
  background: var(--accent);
}

.scroll-progress::-moz-progress-bar {
  background: var(--accent);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1.2;
  transition:
    color 180ms var(--ease-out),
    background-color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    transform 220ms var(--ease-spring);
}

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

.btn--primary {
  background: var(--accent);
  color: #0b0a09;
  border: 1px solid var(--accent);
}

[data-theme="light"] .btn--primary {
  color: #ffffff;
}

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

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

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

/* —— Reveal —— */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 600ms var(--ease-out),
    transform 600ms var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 60ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* —— Section chrome —— */
.section {
  padding-block: var(--space-11);
}

.section__label {
  margin-bottom: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* —— Hero —— */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--header-h));
  padding-block: var(--space-9) var(--space-10);
  overflow: clip;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--space-8);
  align-items: center;
  width: 100%;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

.hero__eyebrow {
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin-bottom: var(--space-5);
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

.hero__lead {
  margin-bottom: var(--space-7);
  max-width: 52ch;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
}

.hero__stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-inline: var(--space-3);
  min-width: 0;
}

.hero__stat:first-child {
  padding-left: 0;
}

.hero__stat + .hero__stat {
  border-left: 1px solid var(--line);
}

.hero__stat-value {
  font-size: var(--step-1);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hero__stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.35;
  text-wrap: balance;
}

.hero__scope {
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  overflow: hidden;
  isolation: isolate;
}

.hero__scope-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__scope-readout {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  margin: 0;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--accent) 85%, var(--ink));
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius-sm);
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .hero__scope {
    position: absolute;
    inset: auto 0 0 0;
    top: 20%;
    z-index: 0;
    aspect-ratio: auto;
    height: auto;
    bottom: 8%;
    border: none;
    border-radius: 0;
    background: transparent;
    opacity: 0.28;
    pointer-events: none;
  }

  .hero__scope-readout {
    display: none;
  }

  .hero__content {
    max-width: none;
  }

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

  .hero__stat {
    padding: var(--space-3) var(--space-4) var(--space-3) 0;
  }

  .hero__stat:nth-child(2n + 1) {
    padding-left: 0;
  }

  .hero__stat:nth-child(2n) {
    border-left: 1px solid var(--line);
    padding-left: var(--space-4);
  }

  .hero__stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .hero__stats {
    grid-template-columns: 1fr;
  }

  .hero__stat {
    border-left: none !important;
    padding-inline: 0 !important;
    padding-block: var(--space-3);
  }

  .hero__stat + .hero__stat {
    border-top: 1px solid var(--line);
  }
}

/* —— About —— */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: var(--space-9);
  align-items: start;
}

.about__prose {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 62ch;
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--ink-muted);
}

.about__prose p {
  color: var(--ink-muted);
}

.about__prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.about__prose a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.about__aside {
  position: sticky;
  top: calc(var(--header-h) + var(--space-4));
}

.about__dl {
  margin: 0;
  border-top: 1px solid var(--line);
}

.about__dl > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

.about__dl dt {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.about__dl dd {
  margin: 0;
  color: var(--ink);
}

.about__dl a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.about__dl a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.about__dl a + a::before {
  content: ", ";
  color: var(--ink-muted);
  border: none;
}

@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .about__aside {
    position: static;
  }
}

/* —— Work —— */
.work__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.work-card {
  position: relative;
  padding: var(--space-6) var(--space-6) var(--space-6) var(--space-7);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    transform 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.work-card::before {
  content: "";
  position: absolute;
  top: var(--space-5);
  bottom: var(--space-5);
  left: 0;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.work-card:hover,
.work-card:focus,
.work-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 8px 28px color-mix(in srgb, var(--accent) 10%, transparent);
}

.work-card__role {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.work-card__org {
  margin: 0 0 var(--space-2);
  color: var(--ink);
  font-size: var(--step-0);
}

.work-card__meta {
  margin: 0 0 var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.work-card__body {
  margin: 0 0 var(--space-4);
  max-width: 68ch;
  color: var(--ink-muted);
  line-height: 1.65;
}

.work-card__link {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.work-card__link:hover {
  border-bottom-color: var(--accent);
}

/* —— Projects —— */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    transform 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.project-card:hover,
.project-card:focus,
.project-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 8px 28px color-mix(in srgb, var(--accent) 10%, transparent);
}

.project-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.project-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.status {
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
}

.status--shipped {
  color: var(--ok);
}

.status--prototype {
  color: var(--warn);
}

.status--dev {
  color: var(--ink-muted);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card__tags li {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.project-card__tags li:not(:last-child)::after {
  content: "·";
  margin-left: var(--space-2);
  color: var(--line);
}

.project-card__body {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--step-0);
  line-height: 1.6;
  flex: 1;
}

.project-card__link {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.project-card__link:hover {
  border-bottom-color: var(--accent);
}

/* —— DeskPulse demo —— */
.deskpulse {
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.deskpulse__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.deskpulse__play {
  min-height: 2.5rem;
}

.deskpulse__icon {
  width: 1.1rem;
  height: 1.1rem;
}

.deskpulse__mute {
  width: 2.5rem;
  height: 2.5rem;
}

.deskpulse__mute svg {
  width: 1.1rem;
  height: 1.1rem;
}

.deskpulse__mute[aria-pressed="true"] .deskpulse__mute-on {
  display: none;
}

.deskpulse__mute[aria-pressed="true"] .deskpulse__mute-off {
  display: block;
}

.deskpulse__mute .deskpulse__mute-off {
  display: none;
}

.deskpulse__canvas {
  display: block;
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}

.deskpulse__note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  line-height: 1.45;
}

.deskpulse__note.is-error {
  color: var(--warn);
}

@media (max-width: 768px) {
  .projects__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-card,
  .project-card {
    transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
  }

  .work-card:hover,
  .work-card:focus,
  .work-card:focus-within,
  .project-card:hover,
  .project-card:focus,
  .project-card:focus-within {
    transform: none;
  }
}

/* —— Research —— */
.research-paper {
  max-width: 52rem;
}

.research-paper__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

.research-paper__byline,
.research-paper__pub {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.research-paper__byline {
  color: var(--ink);
}

.research-paper__pub {
  margin-top: var(--space-2);
  color: var(--ink-muted);
}

.research-paper__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.research-paper__abstract {
  margin: var(--space-7) 0 0;
  max-width: 68ch;
  color: var(--ink-muted);
  line-height: 1.7;
}

.research-chart {
  margin-top: var(--space-7);
}

.research-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.research-chart__swatch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.research-chart__swatch::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 1px;
  background: currentColor;
}

.research-chart__swatch--lr {
  color: var(--ink-muted);
}

.research-chart__swatch--rf {
  color: var(--cool);
}

.research-chart__swatch--dnn {
  color: var(--accent);
}

.research-chart__frame {
  position: relative;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.research-chart__svg-host {
  width: 100%;
  min-height: 280px;
}

.research-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.research-chart__grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.research-chart__tick,
.research-chart__metric {
  fill: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.research-chart__bar {
  cursor: pointer;
  outline: none;
}

.research-chart__bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.research-chart__tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}

.research-chart__axis-note,
.research-chart__config {
  margin: var(--space-3) 0 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  line-height: 1.5;
}

.research-chart__config {
  margin-top: var(--space-2);
  text-transform: uppercase;
}

.research-note {
  margin-top: var(--space-7);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.research-note__label {
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.research-note__body {
  margin: 0;
  max-width: 68ch;
  color: var(--ink-muted);
  line-height: 1.65;
}

/* —— Teaching timeline —— */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: 50%;
  width: 1px;
  background: var(--line);
  transform: translateX(-50%);
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  margin-bottom: var(--space-8);
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__node {
  position: absolute;
  top: 0.45rem;
  left: 50%;
  z-index: 1;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  transform: translateX(-50%);
}

.timeline__card {
  grid-column: 1;
  justify-self: end;
  width: min(100%, 28rem);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.timeline__item:nth-child(even) .timeline__card {
  grid-column: 2;
  justify-self: start;
}

.timeline__when {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.timeline__body {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.65;
}

.timeline__stat {
  display: inline-block;
  margin: var(--space-4) 0 0;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.timeline__link {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.timeline__link:hover {
  border-bottom-color: var(--accent);
}

@media (max-width: 768px) {
  .timeline::before {
    left: 0.3rem;
    transform: none;
  }

  .timeline__item {
    display: block;
    padding-left: var(--space-6);
    margin-bottom: var(--space-6);
  }

  .timeline__node {
    left: 0;
    transform: none;
  }

  .timeline__card,
  .timeline__item:nth-child(even) .timeline__card {
    width: 100%;
    justify-self: stretch;
  }

  .research-chart__legend {
    gap: var(--space-3);
  }
}

/* —— Visually hidden —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Workbench —— */
.workbench__lede {
  max-width: 42rem;
  margin: 0 0 var(--space-7);
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-muted);
}

.workbench__stage {
  width: min(100%, 36rem);
  margin-inline: auto;
  aspect-ratio: 1 / 1;
}

.workbench__svg-host {
  width: 100%;
  height: 100%;
}

.workbench__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.workbench__arrow {
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
  stroke-linecap: round;
}

.workbench__arrows.is-animated .workbench__arrow {
  animation: workbench-dash 6s linear infinite;
}

@keyframes workbench-dash {
  to {
    stroke-dashoffset: -56;
  }
}

.workbench__node {
  cursor: pointer;
  outline: none;
}

.workbench__node-disk {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1.5;
  transition:
    fill 200ms var(--ease-out),
    stroke 200ms var(--ease-out),
    stroke-width 200ms var(--ease-out);
}

.workbench__node-label {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.workbench__node.is-active .workbench__node-disk {
  fill: color-mix(in srgb, var(--accent) 18%, var(--surface));
  stroke: var(--accent);
  stroke-width: 2;
}

.workbench__node.is-active .workbench__node-label {
  fill: var(--accent);
}

.workbench__svg.has-active .workbench__node.is-dimmed {
  opacity: 0.35;
}

.workbench__node:focus-visible .workbench__node-disk {
  stroke: var(--accent);
  stroke-width: 2;
}

.workbench__caption {
  min-height: 3.2em;
  margin: var(--space-5) auto 0;
  max-width: 40rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* —— Contact —— */
.contact__inner {
  max-width: 40rem;
}

.contact__title {
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  text-wrap: balance;
}

.contact__body {
  margin: 0 0 var(--space-7);
  color: var(--ink-muted);
  line-height: 1.65;
  max-width: 52ch;
}

.contact__email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.contact__email {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.contact__email:hover {
  border-bottom-color: var(--accent);
}

.contact__copy.is-copied {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
}

.contact__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition:
    transform 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.contact-card:hover,
.contact-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}

.contact-card__label {
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--ink);
}

.contact-card__meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

@media (max-width: 768px) {
  .contact__cards {
    grid-template-columns: 1fr;
  }
}

/* —— Command palette —— */
.palette-hint {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 80;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.palette-hint:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

@media (max-width: 768px) {
  .palette-hint {
    display: none;
  }
}

.palette {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: start center;
  padding: 12vh var(--gutter) var(--space-6);
}

.palette[hidden] {
  display: none;
}

.palette__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

.palette__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.palette__input {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  outline: none;
}

.palette__input::placeholder {
  color: var(--ink-muted);
}

.palette__list {
  max-height: min(50vh, 22rem);
  overflow: auto;
  padding: var(--space-2);
}

.palette__group {
  margin: var(--space-3) var(--space-3) var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.palette__item {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--step-0);
  cursor: pointer;
}

.palette__item.is-active,
.palette__item:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--ink);
}

.palette__empty {
  margin: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-muted);
}

body.palette-open,
body.terminal-open {
  overflow: hidden;
}

/* —— Terminal —— */
.terminal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.terminal[hidden] {
  display: none;
}

.terminal__panel {
  width: min(100%, 40rem);
  max-height: min(80vh, 32rem);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.terminal__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.terminal__title {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.terminal__close {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.terminal__close:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.terminal__screen {
  flex: 1;
  min-height: 12rem;
  overflow: auto;
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink);
}

.terminal__line {
  margin: 0 0 0.55rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal__line--cmd {
  color: var(--accent);
}

.terminal__form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.terminal__prompt {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ok);
}

.terminal__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .workbench__arrows.is-animated .workbench__arrow {
    animation: none;
  }

  .contact-card:hover,
  .contact-card:focus-visible {
    transform: none;
  }
}
