@import url('https://unpkg.com/normalize.css') layer(normalize);
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Space+Mono:wght@400;700&display=swap');

@layer normalize, base, nav, reveal, sections, responsive;

@layer base {
  :root {
    --bg: #f7f7f2;
    --grid-bg:
      linear-gradient(90deg, rgba(8, 9, 10, 0.05) 1px, transparent 1px) 0 0 / 64px 64px,
      linear-gradient(rgba(8, 9, 10, 0.045) 1px, transparent 1px) 0 0 / 64px 64px,
      var(--bg);
    --ink: #08090a;
    --muted: #62625e;
    --dark: #07080a;
    --paper: #ffffff;
    --line: rgba(8, 9, 10, 0.18);
    --accent: #9b1833;
    --accent-2: #4d3a66;
    --radius: 8px;
    --gutter: clamp(1rem, 4vw, 4rem);
    --font-size-min: 14;
    --font-size-max: 20;
    --font-ratio-min: 1.1;
    --font-ratio-max: 1.33;
    --font-width-min: 375;
    --font-width-max: 1500;
    color-scheme: light;
    font-family: 'Geist', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    scroll-behavior: auto;
  }

  * {
    box-sizing: border-box;
  }

  html.lenis,
  html.lenis body {
    height: auto;
  }

  html {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .lenis.lenis-smooth {
    scroll-behavior: auto !important;
  }

  .lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
  }

  body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--paper);
    cursor: default;
  }

  body.menu-open {
    overflow: hidden;
  }

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

  button {
    font: inherit;
  }

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

  :where(.fluid) {
    --fluid-min: calc(var(--font-size-min) * pow(var(--font-ratio-min), var(--font-level, 0)));
    --fluid-max: calc(var(--font-size-max) * pow(var(--font-ratio-max), var(--font-level, 0)));
    --fluid-preferred: calc((var(--fluid-max) - var(--fluid-min)) / (var(--font-width-max) - var(--font-width-min)));
    --fluid-type: clamp(
      (var(--fluid-min) / 16) * 1rem,
      ((var(--fluid-min) / 16) * 1rem) - (((var(--fluid-preferred) * var(--font-width-min)) / 16) * 1rem) + (var(--fluid-preferred) * 100vi),
      (var(--fluid-max) / 16) * 1rem
    );
    font-size: var(--fluid-type);
  }

  .site-frame {
    position: fixed;
    inset: 0;
    z-index: 50;
    border: 5px solid var(--ink);
    pointer-events: none;
  }

  .page-wipe {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    background: var(--dark);
    clip-path: circle(0 at 0 0);
    will-change: clip-path, opacity;
  }

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

@layer nav {
  .topbar {
    position: fixed;
    inset: 1.35rem 1.35rem auto;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    pointer-events: none;
  }

  .brand-mark,
  .motion-pill,
  .menu-button,
  .site-menu {
    pointer-events: auto;
  }

  .brand-mark {
    display: inline-flex;
    gap: 0.18rem;
  }

  .brand-mark span {
    display: grid;
    place-items: center;
    width: 2.05rem;
    aspect-ratio: 1;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: var(--paper);
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
  }

  .motion-pill,
  .menu-button,
  .site-menu a {
    border: 2px solid currentColor;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: lowercase;
    box-shadow: 0 6px 0 rgba(8, 9, 10, 0.13);
  }

  .motion-pill {
    padding: 0.65rem 1.1rem;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-left: auto;
    padding: 0.65rem 0.95rem 0.65rem 1.05rem;
    color: var(--ink);
    cursor: pointer;
  }

  .menu-button svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
  }

  .site-menu {
    position: absolute;
    top: 3.6rem;
    right: 0;
    display: grid;
    gap: 0.35rem;
    opacity: 0;
    transform: translateY(-0.75rem);
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
  }

  .site-menu a {
    padding: 0.75rem 1.1rem;
    text-align: right;
  }

  body.menu-open .site-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

@layer reveal {
  .reveal {
    --start: 50vh;
    --space: 0vh;
    --hue: 348;
    --accent-dynamic: hsl(var(--hue) 73% 42%);
    --font-level: 4;
    --font-size-min: 24;
    position: sticky;
    top: calc((var(--count) - 1) * -1lh);
    z-index: 2;
    width: 100%;
    margin-bottom: 0;
    line-height: 1.08;
    background: var(--grid-bg);
    background-attachment: fixed, fixed, scroll;
  }

  .reveal-inner {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-height: calc(var(--count) * 1lh + var(--start));
    padding-top: calc(var(--start) - 0.5lh);
  }

  .reveal h1 {
    position: sticky;
    top: calc(var(--start) - 0.5lh);
    height: fit-content;
    margin: 0;
    font-size: inherit;
    font-weight: 680;
    letter-spacing: 0;
  }

  .reveal ul {
    padding: 0;
    margin: 0;
    list-style: none;
    font-weight: 680;
  }

  .reveal li {
    --dimmed: rgba(8, 9, 10, 0.18);
    scroll-snap-align: center;
    color: transparent;
    background: linear-gradient(
      180deg,
      var(--dimmed) 0 calc(var(--start) - 0.5lh),
      var(--accent-dynamic) calc(var(--start) - 0.55lh) calc(var(--start) + 0.55lh),
      var(--dimmed) calc(var(--start) + 0.5lh)
    );
    background-attachment: fixed;
    background-clip: text;
  }
}

@layer sections {
  main {
    position: relative;
    z-index: 3;
    background: var(--paper);
  }

  .section-shell {
    position: relative;
    min-height: 100vh;
    padding: clamp(6rem, 10vw, 10rem) var(--gutter);
    overflow: hidden;
  }

  .section-number {
    margin: 0 0 1rem;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.78rem, 1.2vw, 0.95rem);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
  }

  .section-heading {
    width: min(960px, 100%);
  }

  .section-heading h2,
  .contact h2 {
    margin: 0;
    font-size: clamp(2.6rem, 7vw, 7.8rem);
    font-weight: 760;
    line-height: 0.93;
    letter-spacing: 0;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 0.64fr) minmax(300px, 0.36fr);
    align-items: end;
    gap: clamp(1.5rem, 3vw, 4rem);
    min-height: 112vh;
    padding-top: clamp(5.5rem, 8vw, 7rem);
    padding-bottom: clamp(10rem, 16vw, 17rem);
    margin-bottom: clamp(4rem, 9vw, 9rem);
    background: var(--paper);
    transform-origin: 50% 72%;
  }

  .hero h2 {
    margin: 0;
    max-width: 62vw;
    font-size: clamp(6rem, 15.8vw, 19rem);
    font-weight: 860;
    line-height: 0.78;
    letter-spacing: 0;
  }

  .hero-subtitle {
    width: min(760px, 100%);
    margin: clamp(1.2rem, 2vw, 1.8rem) 0 0;
    font-size: clamp(1.45rem, 2.5vw, 3.05rem);
    font-weight: 680;
    line-height: 1.08;
  }

  .hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: clamp(1.4rem, 3vw, 2.2rem);
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.72rem, 1vw, 0.88rem);
    font-weight: 700;
    text-transform: uppercase;
  }

  .hero-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 0.74rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 5px 0 rgba(8, 9, 10, 0.12);
  }

  .hero-metrics strong {
    color: var(--accent);
  }

  .portrait-stage {
    align-self: center;
    position: relative;
    z-index: 1;
    justify-self: end;
    margin-top: clamp(5rem, 11vw, 11rem);
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) rotate(1.2deg) translateX(1.5vw);
    transition: transform 300ms ease;
  }

  .portrait-stage:hover {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) rotate(-0.4deg) translateX(1vw) translateY(-0.4rem);
  }

  .portrait-photo {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    width: min(28vw, 405px);
    min-width: 285px;
    aspect-ratio: 0.98;
    border: 9px solid var(--accent-2);
    border-radius: 4.3rem 3.7rem 1.35rem 1.55rem;
    background:
      radial-gradient(circle at 52% 28%, rgba(255, 255, 255, 0.22) 0 15%, transparent 15.5%),
      linear-gradient(148deg, #222 0 46%, #747268 46.5% 58%, #111216 58.5%);
    box-shadow: 1.2rem 1.1rem 0 var(--ink);
  }

  .portrait-photo::before {
    content: '';
    position: absolute;
    top: 13%;
    left: 50%;
    width: 29%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(-50%);
  }

  .portrait-sweep {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: rgba(255, 255, 255, 0.32);
    stroke-width: 50;
    stroke-linecap: round;
  }

  .portrait-initials {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44%;
    aspect-ratio: 1;
    border: 4px solid var(--paper);
    border-radius: 50%;
    color: var(--paper);
    font-size: clamp(3.5rem, 7.5vw, 6.8rem);
    font-weight: 860;
  }

  .portrait-caption {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.2rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
  }

  .scroll-cue {
    position: absolute;
    right: var(--gutter);
    bottom: 2rem;
    display: grid;
    place-items: center;
    width: 3.3rem;
    aspect-ratio: 1;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
    box-shadow: 0 7px 0 rgba(8, 9, 10, 0.18);
  }

  .scroll-cue svg {
    width: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .ribbon-section {
    position: relative;
    z-index: 5;
    min-height: 118vh;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
    background: var(--dark);
    color: var(--ink);
    isolation: isolate;
  }

  .ribbon-section::before {
    content: '';
    position: absolute;
    inset: -1px 0 0;
    z-index: -1;
    background: var(--dark);
    transform: none;
    transform-origin: 0 0;
  }

  .ribbon {
    position: absolute;
    left: -18vw;
    width: 142vw;
    height: clamp(8rem, 18vw, 15.5rem);
    border: 0;
    border-radius: 0.65rem;
    background: var(--paper);
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.34),
      0 0.85rem 0 rgba(255, 255, 255, 0.18),
      0 1.4rem 0 rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    will-change: translate, transform;
    transition: box-shadow 220ms ease;
  }

  .ribbon:hover {
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.5),
      0 0.95rem 0 rgba(255, 255, 255, 0.2);
  }

  .ribbon span {
    display: block;
    padding-left: 19vw;
    font-size: clamp(7.4rem, 18.5vw, 18rem);
    font-weight: 860;
    line-height: 0.78;
  }

  .ribbon-one {
    top: 3%;
    transform: rotate(-4deg);
  }

  .ribbon-two {
    top: 35%;
    transform: rotate(6deg);
  }

  .ribbon-three {
    top: 67%;
    transform: rotate(-5deg);
  }

  .ribbon-note {
    position: absolute;
    right: var(--gutter);
    bottom: 13vh;
    z-index: 4;
    display: grid;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.72);
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.72rem, 1.1vw, 0.9rem);
    font-weight: 700;
    text-align: right;
    text-transform: uppercase;
  }

  .ribbon-thread,
  .ribbon-blob {
    position: absolute;
    left: 0;
    pointer-events: none;
  }

  .ribbon-thread {
    right: 0;
    bottom: 7vh;
    z-index: 2;
    width: 100%;
    height: 42vh;
    fill: none;
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 4;
    animation: threadDrift 8s ease-in-out infinite alternate;
  }

  .ribbon-blob {
    bottom: -1px;
    z-index: 3;
    width: 110%;
    height: 48vh;
    margin-left: -5%;
    fill: var(--dark);
    filter: drop-shadow(0 -2px 0 rgba(255, 255, 255, 0.18));
    animation: blobBreathe 7s ease-in-out infinite alternate;
  }

  .ribbon-blob path {
    transform-origin: 50% 80%;
  }

  .ribbon-section .ribbon-one,
  .ribbon-section .ribbon-two {
    z-index: 1;
  }

  .ribbon-section .ribbon-three {
    z-index: 4;
  }

  .ribbon-note {
    z-index: 5;
  }

  .ribbon-section::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    z-index: 6;
    height: 5rem;
    background: linear-gradient(0deg, var(--dark), transparent);
    pointer-events: none;
  }

  .dark-panel {
    background: var(--dark);
    color: var(--paper);
  }

  .dark-panel .section-number {
    color: #d7d2d4;
  }

  .about {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
    gap: clamp(2rem, 6vw, 7rem);
    align-items: end;
    min-height: 82vh;
  }

  .about-code-mark {
    position: absolute;
    right: max(var(--gutter), 5vw);
    top: clamp(6rem, 13vw, 10rem);
    width: clamp(16rem, 28vw, 30rem);
    fill: none;
    stroke: rgba(255, 255, 255, 0.76);
    stroke-width: 18;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    animation: codeFloat 5.5s ease-in-out infinite alternate;
  }

  .about-code-mark .code-panel {
    fill: rgba(255, 255, 255, 0.055);
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 3;
  }

  .about-code-mark .code-slash {
    stroke: var(--paper);
  }

  .about-code-mark .code-cursor {
    stroke: var(--accent);
    stroke-width: 10;
    animation: cursorPulse 1.2s ease-in-out infinite alternate;
  }

  .story-text {
    display: grid;
    gap: 1.2rem;
    font-size: clamp(1.05rem, 1.7vw, 1.4rem);
    font-weight: 520;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.76);
  }

  .story-text p {
    margin: 0;
  }

  .skills {
    display: grid;
    align-content: center;
    gap: clamp(3rem, 6vw, 5.5rem);
    min-height: 112vh;
    background: var(--paper);
  }

  .skills::after {
    content: '';
    position: absolute;
    right: var(--gutter);
    bottom: clamp(1.5rem, 4vw, 3rem);
    width: clamp(7rem, 16vw, 14rem);
    aspect-ratio: 1;
    border: 1px dashed rgba(8, 9, 10, 0.24);
    border-radius: 50%;
    box-shadow: inset 0 0 0 clamp(1.7rem, 4vw, 3.6rem) var(--paper);
    pointer-events: none;
  }

  .skill-marquee {
    display: none;
    width: max-content;
    gap: 1.3rem;
    transform: translateX(-5vw);
    color: transparent;
    -webkit-text-stroke: 2px var(--ink);
    font-size: clamp(3rem, 10vw, 9rem);
    font-weight: 820;
    line-height: 0.9;
    white-space: nowrap;
    animation: drift 18s linear infinite;
  }

  .skill-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    width: 100%;
  }

  .skill-grid article {
    position: relative;
    display: flex;
    min-height: 430px;
    flex-direction: column;
    padding: clamp(1.4rem, 3.4vw, 2.6rem);
    border-right: 2px solid var(--ink);
    transition: background 180ms ease, transform 180ms ease;
  }

  .skill-grid article:hover {
    background:
      linear-gradient(135deg, rgba(155, 24, 51, 0.08), transparent 45%),
      var(--paper);
    transform: translateY(-0.35rem);
  }

  .skill-grid article:last-child {
    border-right: 0;
  }

  .skill-grid span,
  .timeline time {
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
  }

  .skill-grid h3,
  .signal-board h3,
  .timeline h3 {
    margin: 1rem 0 0.65rem;
    font-size: clamp(1.45rem, 3vw, 2.4rem);
    line-height: 1;
  }

  .skill-grid p,
  .signal-board p,
  .timeline p {
    margin: 0;
    color: var(--muted);
    font-size: clamp(0.98rem, 1.4vw, 1.08rem);
    line-height: 1.45;
  }

  .skill-scale {
    height: 0.75rem;
    margin-top: 2rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    overflow: hidden;
    background: transparent;
  }

  .skill-scale i {
    display: block;
    width: var(--level);
    height: 100%;
    background:
      repeating-linear-gradient(90deg, var(--ink) 0 8px, var(--accent) 8px 16px);
    transform-origin: left;
    animation: scaleIn 900ms ease both;
  }

  .skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 1.8rem;
  }

  .skill-tags small,
  .signal-mark {
    display: inline-flex;
    width: fit-content;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    padding: 0.42rem 0.65rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
  }

  .story {
    display: grid;
    gap: clamp(3rem, 7vw, 6rem);
    padding-top: clamp(8rem, 12vw, 12rem);
  }

  .wave-top,
  .wave-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    fill: var(--paper);
    pointer-events: none;
  }

  .wave-top {
    top: -1px;
  }

  .wave-bottom {
    bottom: -1px;
    fill: var(--bg);
  }

  .timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 2px solid rgba(255, 255, 255, 0.32);
  }

  .timeline article {
    min-height: 320px;
    padding: clamp(1.1rem, 2.5vw, 2rem);
    border-right: 2px solid rgba(255, 255, 255, 0.32);
  }

  .timeline article:last-child {
    border-right: 0;
  }

  .timeline h3 {
    color: var(--paper);
  }

  .timeline p {
    color: rgba(255, 255, 255, 0.66);
  }

  .credentials {
    display: grid;
    align-content: center;
    gap: clamp(2rem, 6vw, 5rem);
    min-height: 96vh;
    background: var(--bg);
  }

  .credentials::after {
    content: none;
  }

  .signal-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: transparent;
    border: 2px solid var(--ink);
  }

  .signal-board article {
    position: relative;
    display: flex;
    min-height: 430px;
    flex-direction: column;
    padding: clamp(1.4rem, 4vw, 3rem);
    background: var(--paper);
    overflow: visible;
  }

  .signal-board article + article {
    border-left: 2px solid var(--ink);
  }

  .signal-code {
    width: fit-content;
    border-bottom: 2px solid var(--accent);
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
  }

  .signal-board p + p {
    margin-top: 0.65rem;
  }

  .signal-mark {
    margin-top: auto;
    color: var(--accent);
  }

  .contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
    min-height: 95vh;
    padding-bottom: clamp(8rem, 12vw, 12rem);
  }

  .contact-links {
    display: grid;
    gap: 0.85rem;
  }

  .contact-links a {
    display: block;
    padding: 1rem 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.32);
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.9rem, 1.6vw, 1.05rem);
    overflow-wrap: anywhere;
    transition: color 180ms ease, padding-left 180ms ease;
  }

  .contact-links a:hover,
  .contact-links a:focus-visible {
    color: #f2a8b7;
    padding-left: 0.75rem;
  }

  footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.3rem var(--gutter) 1.6rem;
    background: var(--bg);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
  }

  @keyframes drift {
    to {
      transform: translateX(-28vw);
    }
  }

  @keyframes slowSpin {
    to {
      rotate: 360deg;
    }
  }

  @keyframes floatDraw {
    from {
      transform: translateY(0) rotate(-2deg);
    }

    to {
      transform: translateY(1rem) rotate(3deg);
    }
  }

  @keyframes codeFloat {
    from {
      transform: translateY(0) rotate(-1.5deg);
    }

    to {
      transform: translateY(0.8rem) rotate(1.5deg);
    }
  }

  @keyframes cursorPulse {
    from {
      opacity: 0.25;
    }

    to {
      opacity: 1;
    }
  }

  @keyframes threadDrift {
    from {
      transform: translateX(-2vw) translateY(0);
    }

    to {
      transform: translateX(2vw) translateY(1.4rem);
    }
  }

  @keyframes blobBreathe {
    from {
      transform: translateY(0) scaleY(1);
    }

    to {
      transform: translateY(-1.2rem) scaleY(1.08);
    }
  }

  @keyframes scaleIn {
    from {
      transform: scaleX(0);
    }
  }

  @supports (animation-timeline: view()) {
    .hero {
      opacity: 0;
      transform: translateY(90px) scale(0.9);
      animation: heroRise both ease-out;
      animation-timeline: view();
      animation-range: entry 40% entry 95%;
    }
  }

  @keyframes heroRise {
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  [data-reveal] {
    opacity: 0;
    transform: translateY(48px);
    transition: opacity 700ms ease, transform 700ms ease;
  }

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

@layer responsive {
  @media (max-width: 920px) {
    .hero,
    .about,
    .contact {
      grid-template-columns: 1fr;
    }

    .hero {
      min-height: auto;
      padding-bottom: clamp(7rem, 16vw, 10rem);
    }

    .hero h2 {
      max-width: 100%;
    }

    .portrait-stage {
      width: fit-content;
      margin-left: 0;
      margin-top: 1rem;
      transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    }

    .portrait-stage:hover {
      transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-0.25rem);
    }

    .portrait-photo {
      width: min(82vw, 330px);
    }

    .skill-grid,
    .timeline,
    .signal-board {
      grid-template-columns: 1fr;
    }

    .skill-grid article,
    .timeline article {
      min-height: auto;
      border-right: 0;
      border-bottom: 2px solid currentColor;
    }

    .timeline article {
      border-bottom-color: rgba(255, 255, 255, 0.32);
    }

    .skill-grid article:last-child,
    .timeline article:last-child {
      border-bottom: 0;
    }

    .signal-board article + article {
      border-top: 2px solid var(--ink);
      border-left: 0;
    }

    .ribbon-section {
      min-height: 104vh;
      margin-top: 0;
      margin-bottom: 0;
    }

    .ribbon-note {
      bottom: 10vh;
    }

    .about-code-mark {
      opacity: 0.5;
      right: -5rem;
      top: 4rem;
    }
  }

  @media (max-width: 640px) {
    .site-frame {
      border-width: 3px;
    }

    .topbar {
      inset: 0.85rem 0.85rem auto;
    }

    .motion-pill {
      display: none;
    }

    .brand-mark span {
      width: 1.8rem;
    }

    .menu-button {
      padding: 0.56rem 0.78rem 0.56rem 0.86rem;
    }

    .reveal {
      --start: 46vh;
      --space: 22vh;
      --font-size-min: 18;
      --font-size-max: 17;
    }

    .reveal-inner {
      justify-content: flex-start;
      padding-left: var(--gutter);
    }

    .section-shell {
      min-height: auto;
      padding-top: 5.8rem;
      padding-bottom: 5.8rem;
    }

    .hero {
      min-height: auto;
      align-content: end;
      gap: 1.2rem;
      padding-bottom: 7.5rem;
      margin-bottom: 3.5rem;
    }

    .hero h2 {
      max-width: 100%;
      font-size: clamp(4.8rem, 25vw, 8rem);
    }

    .portrait-photo {
      min-width: 0;
    }

    .hero-subtitle {
      font-size: 1.18rem;
      line-height: 1.14;
    }

    .hero-metrics {
      gap: 0.4rem;
    }

    .hero-metrics span {
      padding: 0.5rem 0.6rem;
      font-size: 0.66rem;
    }

    .scroll-cue {
      bottom: 1rem;
    }

    .ribbon-section {
      min-height: 86vh;
      margin-top: 0;
      margin-bottom: 0;
    }

    .ribbon {
      left: -54vw;
      width: 220vw;
      height: clamp(5.8rem, 30vw, 8.2rem);
    }

    .ribbon span {
      padding-left: 46vw;
      font-size: clamp(4.5rem, 28vw, 7rem);
    }

    .ribbon-one {
      top: 7%;
    }

    .ribbon-two {
      top: 35%;
    }

    .ribbon-three {
      top: 63%;
    }

    .ribbon-thread {
      height: 30vh;
      bottom: 8vh;
    }

    .ribbon-blob {
      width: 150%;
      height: 38vh;
      margin-left: -25%;
    }

    .ribbon-note {
      right: 1rem;
      bottom: 7vh;
      font-size: 0.64rem;
    }

    .skills::after,
    .credentials::after {
      opacity: 0.45;
      right: -2rem;
      bottom: 1rem;
    }

    .skill-tags {
      padding-top: 1.2rem;
    }

    .skill-grid article,
    .signal-board article {
      min-height: 300px;
    }

    footer {
      flex-direction: column;
    }
  }

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