@font-face {
  font-family: 'DM Sans';
  src: url('../assets/dm-sans.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #efefed;
  --ink: #171815;
  --rail: clamp(36px, 18vw, 420px);
  --stage-height: 100dvh;
  font: 500 16px/1.4 'DM Sans', Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body, h1, p, ol { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid #285fbd; outline-offset: 4px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.portfolio {
  display: grid;
  grid-template-columns: minmax(150px, .65fr) minmax(0, 2fr);
  gap: 6vw;
  margin: 0 auto;
  max-width: 1560px;
  padding: clamp(36px, 6vw, 96px);
}
.sidebar { align-self: start; position: sticky; top: 7vh; z-index: 2; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { display: block; width: 98.8px; height: auto; }
h1 { margin-top: 22px; font-size: 30px; line-height: 1.1; font-weight: 560; letter-spacing: -.055em; }

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px 24px;
  list-style: none;
  padding: 0;
}
.projects a { display: block; }
.cover {
  display: block;
  width: 100%;
  aspect-ratio: 1.5;
  object-fit: cover;
  object-position: center top;
  background: #deded9;
  border-radius: 5px;
}
.caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 1px 0;
  font-size: 13px;
  letter-spacing: -.015em;
}
.caption small { display: block; margin-top: 2px; font-size: .92em; color: #50524c; }
.projects a:hover .caption { text-decoration: underline; text-underline-offset: 3px; }

/* The document is the scroll track. All ten links sit around one horizontal axle. */
.reel { overflow-anchor: none; overscroll-behavior-y: none; scrollbar-width: none; }
.reel::-webkit-scrollbar { display: none; }
.reel body { height: calc(100dvh + var(--travel)); }
.reel .portfolio {
  position: fixed;
  inset: 0;
  display: block;
  height: 100dvh;
  max-width: none;
  padding: 0;
  overflow: hidden;
}
.reel .sidebar { position: absolute; top: 50%; left: var(--rail); transform: translateY(-50%); }
.reel .stage {
  --cover-width: min(43vw, calc(var(--stage-height) * .43));
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}
.reel .projects {
  display: block;
  position: absolute;
  width: 0;
  height: 0;
  left: 58%;
  top: 50%;
}
.reel .projects li {
  position: absolute;
  width: var(--cover-width);
  transform: translate(-50%, -50%) translateY(calc(var(--stage-height) * var(--orbit-y))) scale(var(--scale))
             perspective(calc(var(--stage-height) * var(--focal-length))) rotateX(var(--tilt));
}
.reel .cover { aspect-ratio: 1.43; }
.reel .caption { background: var(--paper); font-size: clamp(12px, 1.45vh, 15px); }
.reel .rear { pointer-events: none; }
.reel .rear .cover { filter: brightness(.57); }
.reel .rear .caption { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .reel .projects li { transform: translate(-50%, -50%); }
}

@media (max-width: 700px) {
  :root {
    --inset: clamp(16px, 5vw, 28px);
    --top-bar: max(76px, calc(56px + env(safe-area-inset-top)));
    --stage-height: calc(100dvh - var(--top-bar) - env(safe-area-inset-bottom));
  }
  .portfolio { display: block; padding: 0 var(--inset) 30px; }
  .sidebar, .reel .sidebar {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--top-bar);
    flex-wrap: wrap;
    column-gap: 12px;
  }
  .brand img { width: 80.6px; }
  h1 { margin: 0; font-size: 25px; }
  .projects { grid-template-columns: 1fr; gap: 28px; }
  .reel .portfolio { padding-inline: var(--inset); }
  .reel .stage {
    --cover-width: min(76vw, calc(var(--stage-height) * .53));
    top: var(--top-bar);
    bottom: env(safe-area-inset-bottom);
  }
  .reel .projects { left: 50%; }
}
