@font-face {
  font-family: "Inter Tight";
  src: url("/assets/fonts/inter-tight.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0b0c;
  --surface: #161618;
  --line: #29292d;
  --text: #f4f3f0;
  --muted: #9b9a97;
  --accent: #e8b872;
  --gutter: clamp(16px, 4vw, 56px);
  --gap: clamp(8px, 1.4vw, 20px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; /* no blue flash on tap */
  scrollbar-gutter: stable;
}

/* Replaces the browser's blue text selection */
::selection {
  background: var(--text);
  color: var(--bg);
}

html.is-locked {
  overflow: hidden;
  scrollbar-gutter: auto;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  display: block;
  max-width: 100%;
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
}

.skip:focus {
  top: 12px;
}

/* Header */
.site-header {
  padding: clamp(40px, 8vw, 104px) var(--gutter) clamp(28px, 4vw, 56px);
}

.name {
  margin: 0;
  font-size: clamp(2.75rem, 10.5vw, 9rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.role {
  margin: clamp(14px, 2vw, 24px) 0 0;
  font-size: clamp(1rem, 1.7vw, 1.375rem);
  line-height: 1.5;
  color: var(--muted);
}

.role strong {
  font-weight: 500;
  color: var(--text);
}

.role .icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin: 0 0.25em 0 0.05em;
  vertical-align: -0.2em;
  color: var(--accent);
}

/* The sentence is two unbreakable parts: it sits on one line if it fits,
   otherwise it splits only between them */
.role-part {
  display: inline-block;
  white-space: nowrap;
}

.name-break {
  display: none;
}

.details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px clamp(18px, 2.4vw, 32px);
  margin: clamp(22px, 3vw, 36px) 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.975rem;
}

.details li,
.details a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.details .icon {
  color: var(--muted);
  transition: color 0.2s;
}

.details .contact span {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  overflow-wrap: anywhere;
  transition: border-color 0.2s;
}

.details .contact:hover span {
  border-color: var(--text);
}

.details .resume {
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--text);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.details .resume .icon {
  color: inherit;
}

.details .resume:hover {
  background: var(--text);
  color: var(--bg);
}

.resume-short {
  display: none;
}

/* Small screens: one row of tap targets, so the work sits higher up the page */
@media (max-width: 599px) {
  .site-header {
    padding-top: 32px;
    padding-bottom: 22px;
  }

  .name {
    font-size: min(14.5vw, 4.75rem);
    line-height: 1;
  }

  .name-break {
    display: inline;
  }

  .role {
    margin-top: 12px;
    /* Shrinks only on the narrowest phones, so the second line never wraps */
    font-size: min(0.975rem, calc((100vw - 2 * var(--gutter)) / 16.6));
  }

  .details {
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 18px;
  }

  .details .location,
  .contact span,
  .resume-long {
    display: none;
  }

  .resume-short {
    display: inline;
  }

  .details .contact,
  .details .resume {
    height: 44px;
    justify-content: center;
  }

  .details .contact {
    width: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    transition: border-color 0.2s;
  }

  .details .contact .icon {
    color: var(--text);
  }

  .details .contact:hover {
    border-color: var(--text);
  }

  .details .resume {
    padding: 0 18px 0 14px;
  }
}

/* The narrowest phones: the resume button becomes icon-only so all four fit */
@media (max-width: 319px) {
  .resume-short {
    display: none;
  }

  .details .resume {
    width: 44px;
    padding: 0;
  }
}

/* Tabs */
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: clamp(20px, 3vw, 36px);
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 15px 0 14px;
  color: var(--muted);
  transition: color 0.2s;
}

.tab sup {
  align-self: flex-start;
  margin-left: -3px;
  font-size: 0.7em;
  font-variant-numeric: tabular-nums;
}

.tab:hover,
.tab[aria-selected="true"] {
  color: var(--text);
}

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: var(--text);
}

/* Galleries */
main {
  flex: 1;
  padding: var(--gap) var(--gutter) clamp(48px, 6vw, 80px);
}

.grid {
  display: grid;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid-videos {
  grid-template-columns: repeat(auto-fill, minmax(clamp(136px, 21vw, 260px), 1fr));
  row-gap: clamp(20px, 2.4vw, 32px);
}

@media (max-width: 479px) {
  .grid-videos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-photos {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.tile {
  display: block;
  width: 100%;
  text-align: left;
}

/* Tapping or double-clicking controls shouldn't select anything */
button,
.tile {
  -webkit-user-select: none;
  user-select: none;
}

.frame {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate; /* keeps the rounded corners clean while the image scales */
  background: var(--surface);
  border-radius: 4px;
}

.grid-videos .frame {
  aspect-ratio: 9 / 16;
}

.grid-photos .frame {
  aspect-ratio: 3 / 2;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  transition: transform 1s var(--ease);
}

.play {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgb(11 11 12 / 62%);
  border-radius: 50%;
  transition: transform 0.5s var(--ease), background 0.3s ease;
}

.play svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .frame img {
    will-change: transform;
  }

  .tile:hover .frame img,
  .tile:focus-visible .frame img {
    transform: scale(1.04);
  }

  .tile:hover .play,
  .tile:focus-visible .play {
    background: rgb(11 11 12 / 82%);
    transform: scale(1.08);
  }
}

.tile-title {
  display: block;
  margin-top: 10px;
  font-size: 0.975rem;
  line-height: 1.3;
}

.tile-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  padding: 20px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

/* Viewer */
.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
}

.viewer::backdrop {
  background: #000;
}

.viewer-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: env(safe-area-inset-top) 8px 0 var(--gutter);
}

.viewer-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.975rem;
}

.viewer-count {
  margin-left: 10px;
  color: #a5a4a1;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.icon-btn .icon {
  width: 22px;
  height: 22px;
}

.icon-btn:hover {
  background: rgb(255 255 255 / 12%);
}

.viewer-stage {
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  min-height: 0;
  padding: 0 0 12px;
  overflow: hidden;
}

/* The outgoing and incoming items share one cell while they slide */
.viewer-stage > img,
.viewer-stage > video,
.viewer-error {
  grid-area: 1 / 1;
}

.viewer-stage img,
.viewer-stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-height: 0;
  object-fit: contain;
  background: #000;
}

.viewer-stage video {
  height: 100%;
}

.viewer-stage img {
  touch-action: pan-y pinch-zoom;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  background: rgb(0 0 0 / 45%);
}

.viewer-nav:hover {
  background: rgb(40 40 40 / 85%);
}

.viewer-prev {
  left: 8px;
}

.viewer-next {
  right: 8px;
}

.viewer-error {
  max-width: 34ch;
  padding: 0 24px;
  text-align: center;
  color: #d0cfcc;
}

@media (max-width: 767px) {
  .viewer-stage {
    padding-bottom: 0;
  }
}

/* No zooming for visitors who ask for less motion; a soft fade instead */
@media (prefers-reduced-motion: reduce) {
  .frame img {
    transition: opacity 0.3s ease;
  }

  .play {
    transition: background 0.3s ease;
  }

  .tile:hover .frame img,
  .tile:focus-visible .frame img {
    transform: none;
    opacity: 0.86;
  }

  .tile:hover .play,
  .tile:focus-visible .play {
    transform: none;
  }
}

/* 404 */
.not-found {
  flex: 1;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: var(--gutter);
  text-align: center;
}

.not-found h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.not-found a {
  border-bottom: 1px solid var(--muted);
  justify-self: center;
}
