:root {
  color-scheme: dark;
  --bg: #141414;
  --text: #f5f2eb;
  --muted: #bdb9b1;
  --accent: #e4fd64;
  --line: #3b3b36;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 system-ui, sans-serif; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
h1, h2, h3, p, dl, dd { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 2.5rem, 74rem); margin-inline: auto; }
.header, .footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.4rem; }
.header { border-bottom: 1px solid var(--line); }
.brand { font-size: 1.55rem; font-weight: 850; letter-spacing: -.08em; text-decoration: none; }
.brand > span:first-child { color: var(--accent); }
nav { display: flex; gap: clamp(1rem, 4vw, 2.5rem); }
nav a, .footer a { text-decoration-thickness: 1px; text-underline-offset: .3em; }
.hero { display: grid; justify-items: center; text-align: center; gap: clamp(1.5rem, 4vw, 2.5rem); padding-block: clamp(2rem, 5vw, 3.5rem); }
.label { margin-bottom: 1.2rem; color: var(--accent); text-transform: uppercase; font-size: .875rem; font-weight: 650; letter-spacing: .12em; }
h1 { font-size: clamp(2.35rem, 7vw, 5.2rem); line-height: .83; letter-spacing: -.09em; }
h1 em { color: var(--accent); font: italic 1em/.83 Georgia, serif; }
.intro { max-width: 54ch; margin: 1.4rem auto 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); }
.cta { display: inline-block; margin-top: 1.6rem; padding: .7rem 1.1rem; background: var(--accent); color: #141414; font-weight: 750; text-decoration: none; }
.cta:hover { background: var(--text); }
.section { border-top: 1px solid var(--line); padding-block: clamp(2.75rem, 6vw, 5rem); }
h2 { font-size: clamp(2.3rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -.065em; margin-bottom: 1.65rem; }
.projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.6rem, 4vw, 3rem); max-width: 74rem; margin-inline: auto; }
.project h3 { margin-top: .75rem; font-size: 1.125rem; }
.player { display: grid; place-items: center; aspect-ratio: 16 / 9; background: #222720; color: var(--muted); border: 1px solid var(--line); }
.project:nth-child(2) .player { background: #292522; }
.project:nth-child(3) .player { background: #24242b; }
.player iframe { width: 100%; height: 100%; border: 0; }
.skills > div { padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: #191919; }
.skills dt { font-weight: 750; color: var(--accent); }
.skills dd, .footer { color: var(--muted); }
.footer { border-top: 1px solid var(--line); }
@media (max-width: 44rem) {
  .hero, .projects { grid-template-columns: 1fr; }
  .projects { gap: 1.6rem; }
}
@media (max-width: 30rem) {
}

.portrait {
  width: clamp(6rem, 14vw, 9rem);
  aspect-ratio: 1;
  border: 2px solid var(--accent);
  outline: 1px solid var(--line);
  outline-offset: 6px;
  border-radius: 50%;
  overflow: hidden;
  background: #33352f;
}
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.video-link {
  display: inline-block;
  margin-top: .3rem;
  color: var(--muted);
  text-underline-offset: .25em;
}

nav { flex-wrap: wrap; justify-content: flex-end; }
.project { border: 1px solid var(--line); border-radius: .85rem; background: #191919; padding: .75rem; }
.projects[data-focus="0"] .project:has([data-video="0"]),
.projects[data-focus="1"] .project:has([data-video="1"]),
.projects[data-focus="2"] .project:has([data-video="2"]) { border-color: var(--accent); }
.player { overflow: hidden; border-radius: .55rem; }
button.player-preview { border: 0; padding: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.player-preview:focus-visible, .player iframe:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

.shorts h2, #skills h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.shorts p { color: var(--muted); }
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.skills dt { color: var(--accent); }
.skills ul { padding-left: 1.15rem; margin: .6rem 0 0; }
.skills li + li { margin-top: .3rem; }
.player-preview { display: grid; place-items: center; position: relative; width: 100%; height: 100%; }
.player-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-preview span { z-index: 1; background: #141414; padding: .45rem .75rem; border-radius: .35rem; }
@media (max-width: 44rem) {
  .skills { grid-template-columns: 1fr; }
}


@media (min-width: 44.001rem) and (prefers-reduced-motion: no-preference) {
  .project { transition: border-color 360ms ease; }
}
.intro-highlight { text-decoration: underline var(--accent); text-underline-offset: .24em; }

.intro strong { color: var(--text); }
.hero {
  --hero-size: 1;
  --hero-spacing: 1;
}
body.is-scrolled .hero {
  --hero-size: .72;
  --hero-spacing: .52;
}
.hero {
  gap: calc(clamp(1.5rem, 4vw, 2.5rem) * var(--hero-spacing));
  padding-block: calc(clamp(2rem, 5vw, 3.5rem) * var(--hero-spacing));
}
.hero h1 { font-size: calc(clamp(2.35rem, 7vw, 5.2rem) * var(--hero-size)); }
.hero .portrait { width: calc(clamp(6rem, 14vw, 9rem) * var(--hero-size)); }
#work {
  width: min(calc(100vw - 2.5rem), 100%);
  margin-inline: auto;
}
@media (min-width: 58rem) {
  #work {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100vw - 4rem), 74rem);
  }
  body.is-scrolled #work { width: min(calc(100vw - 2.5rem), 83rem); }
}
.project:focus-within { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .project:hover {
    position: relative;
    z-index: 1;
    border-color: var(--accent);

  }
  .skills > div:hover { border-color: var(--accent); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero { transition: padding 520ms ease, gap 520ms ease; }
  .hero h1 { transition: font-size 520ms ease; }
  .hero .portrait, #work { transition: width 520ms ease; }
  .project { transition: transform 240ms ease, border-color 240ms ease; }
  .cta, .skills > div { transition: background-color 220ms ease, border-color 220ms ease, transform 220ms ease; }
  .cta:hover { transform: translateY(-3px); }
  .player-preview img { transition: transform 300ms ease; }
  .player-preview:hover img { transform: scale(1.04); }
}


@media (prefers-reduced-motion: no-preference) {
  .hero > div { animation: hero-enter 540ms ease-out both; }
  .hero > div + div { animation-delay: 80ms; }
  .project { transition: transform 340ms ease, border-color 340ms ease, box-shadow 340ms ease; }
  @keyframes hero-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (hover: hover) and (pointer: fine) and (min-width: 44.001rem) {
  .project:hover { box-shadow: 0 14px 32px #0008; }
}
@media (max-width: 44rem) {
  .project:hover { transform: translateY(-4px) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .hero { transition: padding 220ms ease-out, gap 220ms ease-out; }
  .hero h1 { transition: font-size 220ms ease-out; }
  .hero .portrait, #work { transition: width 220ms ease-out; }
  .project { transition: transform 220ms ease-out, border-color 220ms ease-out; }
}

@media (hover: hover) and (pointer: fine) and (min-width: 44.001rem) {
  .projects[data-focus]:has(> .project:hover) > .project:not(:hover) {
    border-color: var(--line);
  }
}


#contact h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: .85rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-links a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: .85rem;
  text-decoration: none;
  background: #191919;
}
.contact-links a:hover, .contact-links a:focus-visible { border-color: var(--accent); }
.contact-links svg { width: 1.4rem; height: 1.4rem; flex: none; fill: var(--accent); }
.contact-links strong, .contact-links span span { display: block; }
.contact-links span span { color: var(--muted); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .contact-links a { transition: border-color 200ms ease, transform 200ms ease; }
  
}

@media (hover: hover) and (pointer: fine) {
  .project .player-preview img {
    transition: transform 460ms cubic-bezier(.25, .46, .45, .94), filter 460ms ease;
  }
  .project:hover .player-preview img {
    transform: scale(1.09);
    filter: brightness(1.12);
  }
  .project .player-preview span {
    transition: background-color 250ms ease, color 250ms ease, transform 250ms ease;
  }
  .project:hover .player-preview span {
    transform: translateY(-4px);
    background-color: var(--accent);
    color: var(--bg);
  }
}
@keyframes scroll-reveal {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scroll-fade {
  from { opacity: .65; }
  to { opacity: 1; }
}
.is-revealed {
  animation: scroll-reveal 640ms ease-in-out both;
  animation-delay: var(--reveal-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .is-revealed { animation: scroll-fade 200ms ease-out both; }
  .project:hover .player-preview img, .project:hover .player-preview span { transform: none; }
}

#shorts { border-top: 0; }
.reveal-pending:not(:focus-within) { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .reveal-pending:not(:focus-within) { opacity: .65; }
}
.is-revealed:focus-within { animation: none; }

.player-preview span {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 50%;
  color: var(--accent);
}
.player-preview span::after {
  content: "";
  margin-left: .2rem;
  border-block: .52rem solid transparent;
  border-left: .78rem solid currentColor;
}

.projects, .skills { align-items: center; }
.project, .player-preview img, .skills > div { transform-origin: center; }

#work-title { margin-bottom: 80px; }


@media (prefers-reduced-motion: reduce) {
  .contact-links a { transition-duration: 220ms; }
}

/* Reserve room for one expanded card so its neighbors can keep their width. */
@media (hover: hover) and (pointer: fine) and (min-width: 44.001rem) {

  .skills {
    --card-width: calc((100% - 1.7rem) / 3.1);
    display: flex;
    justify-content: center;
  }
  .skills > div {
    flex: 0 0 var(--card-width);
    min-width: 0;
  }
  .skills > div:hover {
    flex-basis: calc(var(--card-width) * 1.1);
    padding-block: 1.35rem;
  }
}
@media (hover: hover) and (pointer: fine) and (min-width: 32rem) {
  .contact-links {
    --card-width: calc((100% - .85rem) / 2.2);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  .contact-links > li { flex: 0 0 var(--card-width); min-width: 0; }
  .contact-links > li:hover { flex-basis: calc(var(--card-width) * 1.2); }
  .contact-links > li:hover a { padding-block: 1.2rem; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 58rem) {
  .contact-links { --card-width: calc((100% - 2.55rem) / 4.2); }
}
.project, .skills > div, .contact-links > li, .contact-links a {
  transition: flex-basis 420ms ease-in-out, padding 420ms ease-in-out, border-color 420ms ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  .project, .skills > div, .contact-links > li, .contact-links a { transition-duration: 220ms; }
}


