:root {
  --accent: #e11d48;
  --gastrosync: #4f20a8;
  --linkedin: #0a66c2;
  --hot-sauce: #e2471b;
  --background: #fafafa;
  --text: #171717;
  --muted: #525252;
  --soft: #e5e5e5;
  --line: #f0f0f0;
  --faint: #a3a3a3;
  --dot: #d4d4d4;
  --accent-soft: #ffe4e6;
  --accent-ink: #881337;
  --matrix: #0b8a35;
  color-scheme: light dark;
  font-synthesis: none;
}

/* Follows the system setting; no toggle. */
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #fb7185;
    --gastrosync: #a78bfa;
    --linkedin: #4b9fea;
    --background: #0a0a0a;
    --text: #ededed;
    --muted: #a3a3a3;
    --soft: #262626;
    --line: #1c1c1c;
    --faint: #737373;
    --dot: #404040;
    --accent-soft: #4c0519;
    --accent-ink: #ffe4e6;
    --matrix: #22c55e;
  }

  /* Softens the photo so it doesn't glare against the dark page. */
  .portrait img {
    filter: brightness(0.85);
  }
}

/* "Increase contrast" in the system settings: darker grays, sturdier lines, no grain. */
@media (prefers-contrast: more) {
  :root {
    --text: #000;
    --muted: #262626;
    --faint: #525252;
    --soft: #737373;
    --line: #a3a3a3;
    --dot: #525252;
  }

  .grain {
    display: none;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --background: #000;
    --text: #fff;
    --muted: #e5e5e5;
    --faint: #a3a3a3;
    --soft: #737373;
    --line: #525252;
    --dot: #a3a3a3;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.page-shell {
  width: min(100%, 672px);
  min-height: 100vh;
  margin-inline: auto;
  padding: 12rem 1.5rem 6rem;
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3rem;
}

.profile-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.75rem;
}

/* Click the portrait to see the whole photo it was cropped from; the timeline rides down beside it. */
.portrait-wrap {
  --open-w: min(22rem, calc(100vw - 3rem));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 800ms;
  position: relative;
  flex: none;
  width: 10rem;
  height: 10rem;
  transition: width var(--dur) var(--ease), height var(--dur) var(--ease);
}

.portrait-wrap.is-open {
  width: var(--open-w);
  height: calc(var(--open-w) * 4 / 3);
}

.portrait {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--soft);
  border-radius: 1rem;
  background: var(--soft);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.06), 0 8px 20px -8px rgba(23, 23, 23, 0.18);
  color: inherit;
  font: inherit;
  cursor: zoom-in;
  container-type: inline-size;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow var(--dur) var(--ease);
}

/* Opened, the photo lifts a little further off the page. */
.portrait[aria-expanded="true"] {
  box-shadow: 0 2px 4px rgba(23, 23, 23, 0.06), 0 28px 56px -20px rgba(23, 23, 23, 0.3);
  cursor: zoom-out;
}

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

/* The crop is the 430px square at (208, 219) of the 1125×1500 full photo. */
.portrait-photo {
  position: absolute;
  top: -50.93%;
  left: -48.37%;
  width: 261.63%;
  aspect-ratio: 3 / 4;
  transition: top var(--dur) var(--ease), left var(--dur) var(--ease), width var(--dur) var(--ease);
}

.is-open .portrait-photo {
  top: 0;
  left: 0;
  width: 100%;
}

.portrait-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portrait-image {
  position: absolute;
  top: 14.6%;
  left: 18.49%;
  width: 38.22%;
  height: 28.67%;
  transition: opacity 300ms ease;
}

.is-open .portrait-image {
  opacity: 0;
  transition-delay: 150ms;
}

/* Opened, the photo shows where and when like an old camcorder display, sized to the photo so both fit on one line. */
.portrait-osd {
  position: absolute;
  right: 4.5cqw;
  bottom: 4cqw;
  left: 4.5cqw;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1em;
  color: #fff;
  font-family: "VT323", ui-monospace, monospace;
  font-size: 5.4cqw;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55), 0 0 6px rgba(255, 255, 255, 0.35);
  opacity: 0;
  transition: opacity 150ms ease;
}

.is-open .portrait-osd {
  opacity: 1;
  animation: osd-on 500ms steps(1) 650ms both;
}

/* The display switching on: a couple of flickers, then steady. */
@keyframes osd-on {
  0% { opacity: 0; }
  20% { opacity: 1; }
  35% { opacity: 0.2; }
  50% { opacity: 1; }
  65% { opacity: 0.5; }
  80% { opacity: 1; }
}

/* Hint that the portrait opens: it peeks out past the crop once after load, and again on hover with a mouse. */
.portrait-photo {
  transform-origin: 37.6% 28.9%;
}

@media (hover: hover) {
  .portrait-photo {
    transition: top var(--dur) var(--ease), left var(--dur) var(--ease), width var(--dur) var(--ease), transform 600ms var(--ease);
  }

  .has-full:not(.is-open) .portrait:is(:hover, :focus-visible) .portrait-photo {
    transform: scale(0.86);
  }
}

.hint-peek:not(.is-open) .portrait-photo {
  animation: hint-peek 1.8s ease-in-out;
}

@keyframes hint-peek {
  40%,
  60% {
    transform: scale(0.86);
  }
}

/* Opening and closing, the photo is picked up like a print: it lifts and tilts mid-move, then lands flat. */
.is-opening .portrait {
  animation: grow-lift var(--dur) ease-in-out;
}

.is-closing .portrait {
  animation: grow-drop var(--dur) ease-in-out;
}

@keyframes grow-lift {
  40% {
    box-shadow: 0 2px 4px rgba(23, 23, 23, 0.06), 0 40px 60px -20px rgba(23, 23, 23, 0.4);
    transform: translateY(-0.5rem) rotate(-2.5deg) scale(1.03);
  }
}

@keyframes grow-drop {
  40% {
    box-shadow: 0 2px 4px rgba(23, 23, 23, 0.06), 0 30px 50px -20px rgba(23, 23, 23, 0.35);
    transform: translateY(-0.25rem) rotate(2deg) scale(1.02);
  }
}

/* Mini timeline beside the portrait: previous, now, next. */
.whereabouts {
  position: relative;
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0 0 0.25rem 1.1rem;
  color: var(--faint);
  font-size: 0.875rem;
  line-height: 1.5;
  list-style: none;
}

.whereabouts[hidden] {
  display: none;
}

.whereabouts::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  bottom: 0.7rem;
  left: 0.2rem;
  width: 1px;
  background: var(--soft);
  transition: opacity 250ms ease 400ms;
}

.whereabouts li {
  position: relative;
  animation: whereabouts-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.whereabouts li:nth-child(2) {
  animation-delay: 80ms;
}

.whereabouts li:nth-child(3) {
  animation-delay: 160ms;
}

@keyframes whereabouts-in {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
}

.whereabouts li::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  left: -1.1rem;
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid var(--dot);
  border-radius: 50%;
  background: var(--background);
  transition: opacity 250ms ease 400ms;
}

.whereabouts [aria-current] {
  color: var(--text);
  font-weight: 500;
}

.whereabouts [aria-current]::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.whereabouts span {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 400;
}

.intro-copy {
  display: grid;
  gap: 1.5rem;
}

h1 {
  margin: 0;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bio {
  display: grid;
  gap: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.125rem, 2.7vw, 1.25rem);
  font-weight: 300;
  line-height: 1.625;
}

.bio p {
  margin: 0;
}

.bio strong,
.bio a {
  color: var(--text);
  font-weight: 500;
}

.text-link {
  position: relative;
  text-decoration: none;
}

.text-link::after {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--soft);
  content: "";
}

.text-link::before {
  position: absolute;
  z-index: 1;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.text-link:hover::before,
.text-link:focus-visible::before {
  transform: scaleX(1);
}

.gastrosync-link,
.linkedin-link {
  transition: color 200ms ease;
}

.gastrosync-link::before {
  background: var(--gastrosync);
}

.gastrosync-link:hover,
.gastrosync-link:focus-visible {
  color: var(--gastrosync);
}

.gastrosync-link:focus-visible {
  outline-color: var(--gastrosync);
}

.linkedin-link::before {
  background: var(--linkedin);
}

.linkedin-link:hover,
.linkedin-link:focus-visible {
  color: var(--linkedin);
}

.linkedin-link:focus-visible {
  outline-color: var(--linkedin);
}

.hot-sauce-link {
  isolation: isolate;
  white-space: nowrap;
  transition: color 200ms ease;
}

.hot-sauce-link::before {
  height: 2px;
  background: linear-gradient(90deg, #b91c1c, var(--hot-sauce), #f97316, #facc15, #f97316, var(--hot-sauce), #b91c1c);
  background-size: 200% 100%;
}

.hot-sauce-link:hover,
.hot-sauce-link:focus-visible {
  color: var(--hot-sauce);
  background: linear-gradient(0deg, #9f1d0f, var(--hot-sauce) 40%, #f97316 70%, #f59e0b);
  background-size: 100% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hot-sauce-flicker 900ms ease-in-out infinite alternate;
}

.hot-sauce-link:hover::before,
.hot-sauce-link:focus-visible::before {
  animation: hot-sauce-burn 1.2s linear infinite;
}

.hot-sauce-link:focus-visible {
  outline-color: var(--hot-sauce);
}

.hot-sauce-fire {
  position: absolute;
  z-index: -1;
  inset: -0.2em 0 0;
  pointer-events: none;
}

.hot-sauce-fire::before {
  position: absolute;
  inset: 10% -25% -10%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 80%, rgba(249, 115, 22, 0.28), rgba(226, 71, 27, 0) 70%);
  content: "";
  opacity: 0;
  transition: opacity 250ms ease;
}

.hot-sauce-fire b,
.hot-sauce-fire i {
  position: absolute;
  left: var(--x);
  opacity: 0;
}

.hot-sauce-fire b {
  bottom: 0;
  width: 0.55em;
  height: var(--h);
  margin-left: -0.275em;
  border-radius: 50% 50% 35% 35% / 65% 65% 35% 35%;
  background: linear-gradient(0deg, rgba(226, 71, 27, 0.55), rgba(249, 115, 22, 0.4) 55%, rgba(250, 204, 21, 0));
  filter: blur(1.5px);
  transform-origin: 50% 100%;
}

.hot-sauce-fire i {
  bottom: 0.1em;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, #fef3c7 0%, #fbbf24 35%, #f97316 55%, rgba(226, 71, 27, 0) 72%);
}

.hot-sauce-link:hover .hot-sauce-fire::before,
.hot-sauce-link:focus-visible .hot-sauce-fire::before {
  opacity: 1;
}

.hot-sauce-link:hover .hot-sauce-fire b,
.hot-sauce-link:focus-visible .hot-sauce-fire b {
  animation: hot-sauce-flame 700ms ease-in-out var(--d) infinite alternate;
}

.hot-sauce-link:hover .hot-sauce-fire i,
.hot-sauce-link:focus-visible .hot-sauce-fire i {
  animation: hot-sauce-ember 1.3s ease-out var(--d) infinite;
}

@keyframes hot-sauce-flicker {
  0% {
    background-position: 50% 0%;
    filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.25));
  }

  45% {
    filter: drop-shadow(0 -1px 6px rgba(249, 115, 22, 0.55));
  }

  100% {
    background-position: 50% 100%;
    filter: drop-shadow(0 -2px 4px rgba(226, 71, 27, 0.4));
  }
}

@keyframes hot-sauce-burn {
  to {
    background-position: -200% 0;
  }
}

@keyframes hot-sauce-flame {
  0% {
    opacity: 0.5;
    transform: scale(0.7, 0.6) skewX(-4deg);
  }

  100% {
    opacity: 0.9;
    transform: scale(1, 1.1) skewX(5deg);
  }
}

@keyframes hot-sauce-ember {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(1);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--drift), -3em) scale(0.25);
  }
}

.experiments {
  display: grid;
  width: 100%;
  gap: 1rem;
}

.experiments h2 {
  margin: 0;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.experiment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Fixed height: the hover scramble's glyphs come from a taller fallback font. */
.experiment-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.experiment-list a {
  color: var(--text);
  font-weight: 500;
}

.experiment-list time {
  flex-shrink: 0;
  color: var(--faint);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.oracle-link {
  transition: color 200ms ease, text-shadow 200ms ease;
}

.oracle-link::before {
  background: var(--matrix);
}

.oracle-link:hover,
.oracle-link:focus-visible {
  color: var(--matrix);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.45);
}

.oracle-link:focus-visible {
  outline-color: var(--matrix);
}

/* Speed that slows into stillness: the underline races, then decelerates to a stop. */
.speed-link {
  --dawn: #c2541c;
  transition: color 1.2s ease, letter-spacing 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.speed-link::before {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--dawn) 0 10px, transparent 10px 16px);
}

.speed-link:hover,
.speed-link:focus-visible {
  color: var(--dawn);
  letter-spacing: 0.015em;
}

.speed-link:hover::before,
.speed-link:focus-visible::before {
  animation: speed-settle 1.8s cubic-bezier(0.05, 0.7, 0.2, 1) both;
}

.speed-link:focus-visible {
  outline-color: var(--dawn);
}

@keyframes speed-settle {
  from {
    background-position: -480px 0;
  }

  to {
    background-position: 0 0;
  }
}

.connections {
  width: 100%;
}

/* Columns sized to their content and spread edge to edge, so the long email address never spills past the column. */
.social-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 1.5rem;
}

.social-grid a,
.social-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.social-grid svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: var(--faint);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  transition: fill 200ms ease, stroke 200ms ease;
}

.social-grid a:nth-child(-n+3) svg path:first-child {
  fill: currentColor;
  stroke: none;
}

.social-grid a:hover,
.social-grid a:focus-visible {
  color: var(--text);
  transform: translateY(-2px);
}

/* Each network's icon takes its own color on hover. */
.social-grid a[href*="linkedin"] {
  --brand: var(--linkedin);
}

.social-grid a[href*="x.com"] {
  --brand: #1d9bf0;
}

.social-grid a[href*="github"] {
  --brand: #8250df;
}

.social-grid a:hover svg,
.social-grid a:focus-visible svg {
  color: var(--brand, var(--accent));
  stroke: var(--brand, var(--accent));
}

.social-grid a:focus-visible {
  outline-color: var(--brand, var(--accent));
}

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

.grain {
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

@media (max-width: 640px) {
  .page-shell {
    padding-top: 6rem;
  }

  .profile {
    gap: 3rem;
  }

  /* Opened, the photo takes the full width and the timeline drops below it, close like a caption. */
  .profile-head {
    row-gap: 1.25rem;
  }

  .portrait-wrap {
    --open-w: calc(100vw - 3rem);
    width: 8rem;
    height: 8rem;
  }

  /* Below the open photo, the timeline spreads into columns: label on top, place below. */
  .timeline-below .whereabouts {
    flex-basis: 100%;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 1rem;
    padding: 0;
  }

  .timeline-below .whereabouts::before,
  .timeline-below .whereabouts li::before {
    opacity: 0;
    transition-delay: 0s;
  }

  /* While the photo shrinks back, the timeline waits in its final spot beside the small photo. */
  .timeline-docking .whereabouts {
    position: absolute;
    top: 8rem;
    left: 9.75rem;
    width: max-content;
    translate: 0 -100%;
  }

  .timeline-below .whereabouts li {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.375rem;
    line-height: 1.25rem;
  }

  .timeline-below .whereabouts span {
    margin-left: 0;
    font-size: 0.6875rem;
    line-height: 1rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .timeline-below .whereabouts [aria-current] span {
    color: var(--accent);
  }

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

@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;
  }

  .hot-sauce-fire {
    display: none;
  }

  .whereabouts li {
    animation: none;
  }
}
