/* Homepage only. The desktop layout and case-page breakpoints stay independent. */
html { scroll-padding-top: calc(var(--header) + env(safe-area-inset-top)); }

.home-nav-inner { gap: 8px; }
.home-identity { min-width: 0; flex-shrink: 1; }
.home-identity img { flex-shrink: 0; }
.identity-copy { margin-left: 24px; }
.identity-copy::before { left: -13px; }
.identity-copy > span { white-space: normal; }
.home-menu { min-width: 44px; flex-shrink: 0; }
#home-links {
  max-height: calc(100dvh - 76px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}
#home-links a, #home-links button { min-height: 44px; }
.hero-title { padding-top: max(90px, calc(13svh + env(safe-area-inset-top))); }
.title-final { --line-width: min(87vw, calc(100vw - 2 * var(--hero-edge)), 440px); }
.hero-scene::before { background-position: 75% center; }
.hero-role { margin-block: 24px 18px; }
.hero-reel { margin-top: 24px; }
.reel-row { grid-template-columns: minmax(0, 1fr) 44px; }
.reel-meta .hero-credit { width: 1px; height: 1px; padding: 0; margin: -1px; position: absolute; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.reel-meta #pause { margin-left: auto; }
.reel-next, .reel-meta button { min-width: 44px; min-height: 44px; }

@media (max-width: 700px) {
  main > .section { --edge: max(20px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  #contact { padding-block: clamp(42px, 12vw, 72px); }
  #profile, #expertise, #experience, #work {
    --edge: max(18px, env(safe-area-inset-left), env(safe-area-inset-right));
    padding-block: clamp(24px, 7vw, 32px);
  }
  main > :is(#profile, #experience, #work) > .eyebrow,
  #expertise .eyebrow { margin-bottom: 10px; font-size: .835rem; line-height: 1.4; }

  #profile .profile-grid {
    grid-template-columns: minmax(0, .33fr) minmax(0, .67fr);
    gap: 9px 13px;
  }
  #profile .profile-copy, #profile .profile-bio { display: contents; }
  #profile .portrait { grid-column: 1; grid-row: 1; padding: 5px; margin-bottom: 4px; }
  #profile .portrait img { width: 100%; }
  #profile .profile-identity { grid-column: 2; grid-row: 1; }
  #profile .profile-identity h3 { margin: 0 0 5px; font-size: clamp(1.18rem, 5vw, 1.4rem); }
  #profile .profile-copy p { grid-column: 1 / -1; margin: 0; font-size: .9rem; line-height: 1.55; }
  #profile .profile-identity p { color: #654d34; font-size: .85rem; }
  #profile .profile-bio > p { line-break: strict; text-wrap: pretty; }
  #profile .display {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 4px;
    padding-top: 11px;
    border-top: 1px solid #b5a99a;
    font-size: clamp(1.62rem, 7.4vw, 2.125rem);
    line-height: 1.02;
  }
  #profile .profile-mobile-break { display: none; }
  #profile .profile-process { font-style: italic; white-space: nowrap; }
  #expertise { grid-template-columns: minmax(0, 1fr); row-gap: 10px; padding-block: 21px; }
  #expertise .eyebrow { margin-bottom: 7px; }
  #expertise-title { margin: 0; font-size: clamp(1.75rem, 8vw, 2.2rem); line-height: 1.08; }
  #expertise-title span { display: inline-block; }
  #expertise .expertise-position { display: none; }
  #expertise .expertise-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #expertise .expertise-card:nth-child(n) {
    grid-column: 1;
    grid-template-columns: clamp(64px, 17vw, 73px) minmax(0, 1fr);
    gap: 11px;
    align-content: normal;
    align-items: center;
    min-height: 0;
    padding: 5px 0;
    border: 0;
    border-top: 1px solid #e9e6dc23;
    background: none;
  }
  #expertise .expertise-card::before,
  #expertise .expertise-copy h3::before { content: none; }
  #expertise .expertise-card:nth-child(n) .expertise-photo {
    position: static;
    z-index: auto;
    height: auto;
    aspect-ratio: 1;
    mask-image: none;
    -webkit-mask-image: none;
  }
  #expertise .expertise-copy { padding: 0; }
  #expertise .expertise-card .expertise-copy h3 { margin: 0 0 3px; font-size: .96rem; line-height: 1.2; }
  #expertise .expertise-copy h3 small { margin: 2px 0 0; font-size: .625rem; line-height: 1.22; }
  #expertise .expertise-copy p { min-height: 0; font-size: .835rem; line-height: 1.45; line-break: strict; }
  .home-full-copy { display: none; }
  .home-mobile-copy { display: inline; }
  #contact .display {
    font-size: clamp(1.9rem, 8.8vw, 4.2rem);
    line-height: 1.03;
    overflow-wrap: anywhere;
  }
  #experience .display, #work .display {
    font-size: clamp(1.65rem, 7.4vw, 2.1rem);
    line-height: 1.04;
  }

  #experience .section-head { display: block; margin-bottom: 7px; }
  .timeline-controls { justify-content: flex-end; gap: 5px; margin-top: 7px; }
  .timeline-controls button { min-width: 44px; min-height: 44px; padding: 3px 8px; }
  #era { margin-right: 4px; color: var(--muted); font-size: .78rem; }
  .timeline { gap: 10px; padding-bottom: 7px; overscroll-behavior-inline: contain; }
  .timeline article {
    --date-line: 18px;
    --date-gap: 5px;
    --card-top: 6px;
    flex-basis: calc(100% - 22px);
    padding-top: var(--card-top);
  }
  .timeline .timeline-date {
    margin-bottom: var(--date-gap);
    padding-inline: 13px;
    font-size: .77rem;
    line-height: var(--date-line);
    color: var(--case-gold, #c6a576);
  }
  .timeline-image { min-height: 174px; padding: 40px 14px 12px; }
  .timeline-caption h3 { margin-bottom: 4px; font-size: 1rem; line-height: 1.25; }
  .timeline-role, .timeline-clients { font-size: .82rem; line-height: 1.4; }
  .timeline-detail-trigger {
    inset-block-start: calc(-1 * (var(--date-line) + var(--date-gap) + var(--card-top)));
  }
  .timeline-detail-trigger .timeline-detail-label {
    top: auto;
    bottom: 100%;
    right: 0;
    transform: translateY(100%);
    padding: 3px 8px;
    border: 0;
    background: none;
    color: var(--fg);
    font-size: .76rem;
  }
  #experience > .note { margin-top: 5px; font-size: .75rem; }
  #experience-detail { --detail-limit: min(90dvh, 810px); }
  .experience-detail-layout { grid-template-rows: clamp(64px, 13dvh, 112px) minmax(0, 1fr); }
  .experience-detail-close { width: 44px; height: 44px; }
  .experience-detail-copy p { font-size: 1rem; }

  #work { padding-block: 21px; }
  #work .filters {
    display: grid;
    grid-template-columns: minmax(0, .78fr) minmax(0, .95fr) minmax(0, .92fr) minmax(0, .95fr) minmax(0, 1.27fr);
    gap: 4px;
    margin: 10px 0;
  }
  #work .filters button {
    min-height: 44px;
    min-width: 0;
    padding: 4px 2px;
    font-size: clamp(.56rem, 2.5vw, .7rem);
    line-height: 1.23;
    overflow-wrap: normal;
  }
  #work .filter-separator { display: none; }
  #work .filter-label { display: block; margin-top: 2px; font-size: .65rem; }
  #work .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #work .works:not(.is-filtered) .work,
  #work .works:not(.is-filtered) .work:first-child { grid-column: auto; }
  #work .works.is-filtered .work { grid-column: 1 / -1; }
  #work .work { position: relative; isolation: isolate; color: var(--fg); }
  #work .works:not(.is-filtered) .work img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
  #work .work[data-category="event"] img { object-position: center 32%; }
  #work .work[data-category="film"] img { object-position: 80% 35%; }
  #work .work[data-category="stills"] img { object-position: 56% 45%; }
  #work .work[data-category="livestream"] img { object-position: 54% 67%; }
  #work .work-caption {
    position: absolute;
    inset: auto 0 0;
    padding: 19px 8px 6px;
    background: linear-gradient(transparent, #161513e8);
    pointer-events: none;
  }
  #work .work-caption h3 { margin: 0; font-size: .87rem; line-height: 1.24; }
  #work .work-caption p { margin-top: 2px; color: #e2d6c6; font-size: .625rem; line-height: 1.2; }
  #work .card-view, #experience .card-view { display: none; }
  #more-works {
    --case-gap: 8px;
    margin-top: 12px;
    padding-top: 4px;
  }
  #more-works .media-heading { margin-bottom: 3px; gap: 4px; }
  #more-works h2 { font-size: .79rem; line-height: 1.2; letter-spacing: .035em; }
  #more-works .media-control { padding-inline: 6px; }
  #more-works .rail-rotation { font-size: .76rem; }
  #more-works .more-works-rail {
    --rail-width: calc((100% - 2 * var(--case-gap)) / 2.2);
    padding-bottom: 5px;
  }
  #more-works .rail-item img { aspect-ratio: 1.9; }
  #more-works .rail-item figcaption { margin-top: 4px; font-size: .755rem; line-height: 1.32; }
  #more-works .media-play-icon { width: 27px; height: 27px; inset: auto auto 5px 5px; }
  #contact .contact-row { display: grid; gap: 18px; margin-top: 24px; }
  #contact .cv-links a { min-height: 44px; }
  body > footer { padding-bottom: max(26px, env(safe-area-inset-bottom)); }
}
