:root {
  --bg: #0a0a0a;
  --fg: #f0f0f0;
  --muted: #8a8a8a;
  --hairline: #1f1f1f;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue",
    Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ---------- home: fixed sidebar + scrolling work ---------- */

:root {
  --sidebar-w: 22rem;
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Mono", Consolas,
    monospace;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  background: var(--bg);
  z-index: 5;
  overflow-y: auto;
  container-type: inline-size;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.sidebar-name {
  margin: 0;
  font-size: clamp(3rem, 24cqw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--fg);
}

.sidebar-time {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

.sidebar-time > span {
  margin: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sidebar-time > span + span::before {
  content: "·";
  opacity: 0.5;
  margin: 0 0.5rem;
}

.sidebar-weather:empty {
  display: none;
}

.sidebar-weather svg {
  vertical-align: -0.2em;
  width: 1.15em;
  height: 1.15em;
  stroke-width: 2;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.sidebar-bio {
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: 18rem;
}

.sidebar-bio p {
  margin: 0 0 1rem;
}

.sidebar-bio p:last-child {
  margin-bottom: 0;
}

.sidebar-bio a {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: border-color 200ms ease, color 200ms ease;
}

.sidebar-bio a:hover {
  color: var(--fg);
  border-color: var(--muted);
}

.sidebar-contact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.sidebar-contact a {
  transition: color 200ms ease;
}

.sidebar-contact a:hover {
  color: var(--fg);
}

.work-scroll {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.work-item {
  grid-column: span 1;
  cursor: grab;
  transition: opacity 200ms ease;
}

.work-item--full {
  grid-column: 1 / -1;
}

.work-item:active {
  cursor: grabbing;
}

.work-item.dragging {
  opacity: 0.35;
}

.work-image {
  display: block;
  width: 100%;
  background: var(--tint, #181818);
  border-radius: 12px;
}

img.work-image,
video.work-image {
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.work-item--card {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg, #1a1a1a);
  border-radius: 12px;
  overflow: hidden;
}

.work-item--card video.work-image {
  border-radius: 0;
  background: transparent;
}

@media (max-width: 800px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 1.5rem;
    gap: 1.75rem;
  }
  .work-scroll {
    margin-left: 0;
    grid-template-columns: 1fr;
  }
  .work-item,
  .work-item--full {
    grid-column: 1 / -1;
  }
  .sidebar-bio {
    max-width: none;
  }
  .sidebar-contact {
    gap: 0.5rem;
  }
  .sidebar-contact a {
    padding: 0.25rem 0;
  }
  .sidebar-bottom {
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    gap: 1.5rem;
  }
  .sidebar-bio {
    font-size: 0.9375rem;
  }
  .sidebar-bio p {
    margin-bottom: 0.75rem;
  }
  .work-scroll {
    gap: 8px;
  }
  .work-image {
    border-radius: 8px;
  }
  .work-item--card {
    border-radius: 8px;
  }
}

@media (pointer: coarse) {
  .work-item,
  .work-item:active {
    cursor: default;
  }
}

/* ---------- shared site header (used on /work, /project) ---------- */

.site-header {
  padding: 2rem;
  max-width: 72rem;
  margin: 0 auto;
}

.site-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 200ms ease;
}

.site-name:hover {
  color: var(--fg);
}

/* ---------- /work : the lobby ---------- */

.theater {
  max-width: 72rem;
  padding: 6vh 2rem 12vh;
  margin: 0 auto;
}

.marquee {
  margin: 0 0 6rem;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.posters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem 3rem;
}

.poster {
  display: block;
  transition: transform 400ms ease;
}

.poster:hover {
  transform: translateY(-4px);
}

.poster-art {
  aspect-ratio: 2 / 3;
  background: var(--poster-tint, #181818);
  display: flex;
  align-items: flex-end;
  padding: 1.75rem;
  transition: filter 400ms ease;
}

.poster:hover .poster-art {
  filter: brightness(1.1);
}

.poster-title {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.poster-meta {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (max-width: 800px) {
  .posters {
    grid-template-columns: 1fr 1fr;
    gap: 3rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .posters {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .theater {
    padding: 4vh 1.5rem 8vh;
  }
  .marquee {
    margin-bottom: 4rem;
  }
}

/* ---------- /project : trailer overlay ---------- */

.trailer {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  animation: trailer-exit 800ms 4200ms ease-out forwards;
}

.trailer-pretitle {
  margin: 0 0 1.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: pretitle 2200ms 300ms ease-out forwards;
}

.trailer-title {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  opacity: 0;
  animation: title-in 1400ms 2500ms ease-out forwards;
}

@keyframes pretitle {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes title-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes trailer-exit {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ---------- /project : case study ---------- */

.case-study {
  max-width: 38rem;
  margin: 0 auto;
  padding: 8vh 2rem 12vh;
  opacity: 0;
  animation: content-in 900ms 4500ms ease-out forwards;
}

@keyframes content-in {
  to {
    opacity: 1;
  }
}

.case-header {
  margin-bottom: 6rem;
}

.case-meta {
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.case-title {
  margin: 0 0 2rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.case-lede {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--fg);
}

.case-section {
  margin-bottom: 4rem;
}

.case-section h2 {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.case-section p {
  margin: 0;
}

.case-footer {
  margin-top: 8rem;
}

.back-link {
  font-size: 0.9375rem;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
  transition: color 200ms ease, border-color 200ms ease;
}

.back-link:hover {
  color: var(--fg);
  border-color: var(--muted);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .trailer {
    display: none;
  }
  .case-study {
    opacity: 1;
    animation: none;
  }
  .poster,
  .poster-art {
    transition: none;
  }
}
