/* 手机端沿用桌面视觉，按触控和可用空间重新排布。 */
@media (max-width: 760px) {
  :root { --edge: clamp(18px, 5.1vw, 32px); --site-nav-height: 106px; --site-nav-inset: 10px; }
  html { -webkit-text-size-adjust: 100%; }
  .site-header { padding-inline: 0; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .site-nav {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'brand music' 'links links'; gap: 8px 14px;
    min-height: 0; padding-inline: var(--edge); align-items: center;
  }
  .site-nav-actions { display: contents; }
  .site-nav .brand { grid-area: brand; width: clamp(94px, 28vw, 124px); min-height: 44px; margin: 0; }
  .site-nav .brand .signature-mark { display: block; width: 100%; margin: 0; }
  .site-nav .music-controls { grid-area: music; justify-self: end; gap: 0; padding: 2px; }
  .music-controls button { inline-size: 40px; min-block-size: 40px; }
  .music-controls [data-music-mode] { margin-inline-start: 0; }
  .site-nav .pill-nav {
    grid-area: links; width: 100%; justify-content: space-between;
    gap: 2px; padding: 3px; box-sizing: border-box;
  }
  .site-nav .pill-nav :is(a, :where(.performance-choice)) { flex: 1; min-width: 0; min-height: 42px; padding: 0 8px; font-size: 13px; }
  .site-nav .pill-nav .pill-label-roll { pointer-events: none; }
  .ribbon { height: 320svh; }
  .ribbon-message { padding-inline: var(--edge); }
  .ribbon-message h1 { font-size: clamp(34px, 9.8vw, 58px); line-height: 1.18; row-gap: .23em; }
  .ribbon-message p { max-width: 23em; font-size: 15px; line-height: 1.75; }
  .ribbon-foot { bottom: max(22px, env(safe-area-inset-bottom, 0px)); gap: 12px; }
  .chapter-intro { min-height: 360px; padding: 64px var(--edge) 48px; }
  .chapter-intro .section-head { gap: 34px; }
  /* 与桌面保持同一行标题和同一比例的右下英文遮挡。 */
  .chapter-intro .section-head h2 { max-width: none; font-size: clamp(22px, 7.2vw, 42px); line-height: 1.16; white-space: nowrap; text-wrap: nowrap; }
  .chapter-intro .english-underlay::before, .chapter-intro .english-underlay > .signature-ink { width: var(--english-width, 4.35em); inset-block-start: 42%; inset-inline-end: -.58em; }
  .chapter-intro .section-head p { max-width: 24em; font-size: 16px; line-height: 1.8; }
  #work-intro { min-height: 360px; padding-block: 64px 48px; }
  #work > .wrap { padding-block: 0 58px; }
  #work .film-orbit { height: clamp(310px, 84vw, 440px); }
  #work .film-orbit .film { flex-basis: 82%; }
  #work .film-orbit .play { width: 46px; height: 46px; top: 43%; }
  #work .film-orbit-copy { inset: auto 18px 23%; }
  #work .film-orbit-copy h3 { font-size: clamp(19px, 5.2vw, 28px); line-height: 1.3; }
  #work .film-orbit-copy .meta { display: block; font-size: 12px; line-height: 1.5; }
  .film-orbit-controls { margin-top: 18px; gap: 20px; }
  .film-orbit-controls button { min-width: 46px; min-height: 46px; }
  #photo.wrap { padding-block: 0 64px; }
  #profile .profile-layout { padding-top: 56px; gap: 26px; }
  #profile-title { font-size: clamp(38px, 10vw, 58px); }
  #profile .profile-portrait { width: clamp(180px, 53vw, 270px); }
  #profile .profile-copy { padding: 0; }
  #profile .profile-copy > :is(p, .profile-egg-text) { font-size: 17px; line-height: 1.85; text-align: start; }
  #profile .profile-actions .profile-download { grid-column: 1 / -1; }
  #about > .wrap { padding-block: 54px 64px; }
  #about .section-head { margin-bottom: 28px; }
  #about .bio { gap: 32px; }
  #about .bio h4 { font-size: 20px; margin-bottom: 12px; }
  #about .bio li { font-size: 16px; line-height: 1.7; padding-block: 15px; }
  #about .bio time { font-size: 13px; }
  .guestbook { min-height: 660px; padding-block: 46px 32px; }
  .guestbook-head { flex-direction: column; gap: 24px; }
  .guestbook-heading h2 { font-size: clamp(42px, 11vw, 62px); }
  .postcard-floats { min-height: 340px; margin-block-start: 30px; }
  .postcard-floats .postcard-float-quote { font-size: 18px; }
  /* 左侧信息上下排布，右侧签名单独占列，避免窄屏互相挤压。 */
  .profile-scene > footer .wrap {
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(78px, 21vw, 104px);
    grid-template-areas: 'title logo' 'top logo'; column-gap: clamp(24px, 6vw, 40px); row-gap: 4px;
    align-items: center; padding-block: 28px max(28px, env(safe-area-inset-bottom, 0px));
  }
  .profile-scene > footer .wrap > strong {
    grid-area: title; align-self: end; font-size: clamp(12px, 3.5vw, 15px); line-height: 1.6;
  }
  .profile-scene > footer .wrap > p { grid-area: top; align-self: start; margin: 0; font-size: 13px; line-height: 1.5; }
  .profile-scene > footer .wrap > p > a { display: inline-flex; align-items: center; min-height: 44px; }
  .profile-scene > footer .signature-final { position: static; grid-area: logo; justify-self: end; align-self: center; width: 100%; inset: auto; }
  html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; overscroll-behavior: none; }
  .circular-dialog .lightbox { gap: 12px; padding: max(14px, env(safe-area-inset-top, 0px)) 14px max(18px, env(safe-area-inset-bottom, 0px)); }
  .circular-dialog .viewer-bar p { font-size: 14px; line-height: 1.5; }
  .circular-dialog .viewer-pill button { width: 46px; min-width: 46px; height: 46px; }
  .photo-library { width: calc(100% - 20px); max-height: calc(100dvh - 28px); border-radius: 18px; }
  .photo-library .photo-library-header { gap: 12px; padding: 16px; }
  .photo-library-header h2 { font-size: 24px; }
  .photo-library .photo-library-grid { padding: 0 12px 16px; --library-gap: 10px; }
  .photo-library .photo-library-close, .guest-close { min-width: 44px; min-height: 44px; }
  .postcard-list-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 28px); }
  .postcard-list-dialog .guest-dialog-head { padding: 16px; }
  .guest-dialog-head h2 { font-size: 25px; }
  .postcard-list-scroll { padding: 16px; }
  .work-player { width: calc(100% - 20px); padding: 6px; border-radius: 14px; }
  .postcard-dialog { overscroll-behavior: contain; }
  #guest-compose[open] { height: var(--mobile-viewport-height, 100dvh); top: var(--mobile-viewport-top, 0px); bottom: auto; }
  #guest-compose .postcard-shell { padding-block: max(18px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-bottom, 0px)); }
  /* 沿用桌面的单排胶囊，仅收紧手机上的横向间距。 */
  .postcard-tools { display: inline-flex; align-items: center; flex-wrap: nowrap; width: max-content; max-width: 100%; border-radius: 99px; padding: 3px 4px; gap: 1px; }
  .postcard-tools button { flex: 0 1 auto; min-width: 0; min-height: 42px; padding-inline: 7px; font-size: 12px; white-space: nowrap; }
  .postcard-tools button[data-postcard-step] { flex: 0 0 30px; width: 30px; }
  .postcard-toolbar { margin-top: 16px; }
  .postcard-picker-head button, button.postcard-pill, .postcard-draft-prompt button { min-height: 44px; }
  .postcard-picker-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #guest-form :is(input:not([type='checkbox']), textarea) { font-size: 16px; scroll-margin-block: 26px; }
  #guest-form input:not([type='checkbox']) { min-height: 46px; }
  #guest-form .postcard-consent { align-items: center; min-height: 44px; font-size: 12px; line-height: 1.6; }
  #guest-form .postcard-consent input { width: 20px; height: 20px; }
  .postcard-thanks, .postcard-draft-prompt { padding: 36px 22px; gap: 18px; }
  .postcard-thanks h3, .postcard-draft-prompt h3 { font-size: 28px; line-height: 1.3; }
  .postcard-thanks p, .postcard-draft-prompt p { font-size: 15px; line-height: 1.85; }
  @media (prefers-reduced-motion: no-preference) {
    [data-scroll-motion] { --content-distance: 36px; }
    [data-content-ready][data-content-phase='active'] [data-motion-item] { transition-duration: 620ms; transition-delay: calc(var(--motion-index, 0) * 55ms); }
    /* 触屏以按压反馈补足鼠标悬停，离开时立即复位。 */
    .postcard-wall-item:active .postcard-foil { opacity: .26; }
    .edge-glow:active::after { opacity: .55; background: linear-gradient(135deg, #f4e5de85, transparent 45%, #f836323d); }
  }
}
@media (max-width: 360px) {
  .site-nav { gap: 7px 8px; }
  .site-nav .brand { width: 90px; }
  .music-controls button { inline-size: 38px; }
  .site-nav .pill-nav :is(a, :where(.performance-choice)) { padding-inline: 5px; font-size: 12px; }
  .postcard-number { font-size: 9px; gap: 7px; letter-spacing: .16em; }
  .postcard-tools button { font-size: 11px; padding-inline: 5px; }
  .postcard-tools button[data-postcard-step] { flex-basis: 28px; width: 28px; }
}

@media (max-width: 1024px) and (hover: none) {
  .site-nav a:hover, .brand:hover { text-decoration: none; }
  .site-nav .pill-nav :is(a, :where(.performance-choice)):hover:not([aria-current]):not(:focus-visible) { color: #f4f1ea; }
  .site-nav .pill-nav :is(a, :where(.performance-choice)):hover:not([aria-current]):not(:focus-visible)::before { transform: translateY(110%); }
  .site-nav .pill-nav :is(a, :where(.performance-choice)):hover .pill-label { opacity: 1; transform: none; }
  .site-nav .pill-nav :is(a, :where(.performance-choice)):hover .pill-label-roll { opacity: 0; transform: translateY(125%); }
  /* 保留景深边缘，减少移动设备上的重复背景采样。 */
  .drift-wall-blur span:nth-child(2), .drift-wall-blur span:nth-child(3) { display: none; }
  .drift-wall-blur span:nth-child(4) { --blur: 8px; --blur-start: 26%; --blur-peak: 78%; }
  .viewport-edge > span:last-child { backdrop-filter: blur(8px); }
}

@media (max-width: 610px) {
  #guest-compose { width: calc(100% - 24px); max-width: none; }
  #guest-compose .postcard-stage[data-orientation='landscape'] .postcard-form-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #guest-compose .postcard-stage[data-orientation='landscape'] .postcard-recipient {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: 12px;
    padding: 14px 0 0; border-inline-start: 0; border-block-start: 1px solid #e4d4c92b;
  }
  .postcard-stage[data-orientation='landscape'] .postcard-recipient label[for='postcard-name'] { grid-column: 1; grid-row: 1; }
  .postcard-stage[data-orientation='landscape'] #postcard-name { grid-column: 1; grid-row: 2; }
  .postcard-stage[data-orientation='landscape'] .postcard-recipient label[for='postcard-email'] { grid-column: 2; grid-row: 1; }
  .postcard-stage[data-orientation='landscape'] #postcard-email { grid-column: 2; grid-row: 2; }
  .postcard-stage[data-orientation='landscape'] :is(#postcard-email-help, .postcard-consent, .postcard-send) { grid-column: 1 / -1; }
  #guest-form .postcard-send .postcard-pill { min-height: 44px; }
}

/* 手机横放时将导航合并为一行，为画面和输入留出高度。 */
@media (min-width: 620px) and (orientation: landscape) and (max-height: 500px) and (max-width: 1024px) and (pointer: coarse) {
  :root { --site-nav-height: 50px; --site-nav-inset: 8px; --edge: clamp(18px, 3vw, 28px); }
  .site-header { padding: calc(8px + env(safe-area-inset-top, 0px)) 0 0; }
  .site-nav { display: grid; width: 100%; grid-template-columns: 86px minmax(0, 1fr) 168px; grid-template-areas: 'brand links music'; gap: 12px; min-height: 0; padding-inline: var(--edge); }
  .site-nav-actions { display: contents; }
  .site-nav .brand { grid-area: brand; width: 86px; min-height: 44px; }
  .site-nav .brand .signature-mark { display: block; width: 100%; margin: 0; }
  .site-nav .music-controls { grid-area: music; justify-self: end; gap: 0; padding: 2px; }
  .music-controls button { inline-size: 40px; min-block-size: 40px; }
  .music-controls [data-music-mode] { margin-inline-start: 0; }
  .site-nav .pill-nav { grid-area: links; width: 100%; gap: 1px; padding: 3px; }
  .site-nav .pill-nav :is(a, :where(.performance-choice)) { min-width: 0; min-height: 42px; flex: 1; padding-inline: 7px; font-size: 13px; }
  .chapter-intro, #work-intro { min-height: 280px; padding-block: 48px 38px; }
  .chapter-intro .section-head { gap: 24px; }
  .chapter-intro .section-head h2 { font-size: 38px; }
  .chapter-intro .section-head p { font-size: 16px; }
  .ribbon-message h1 { font-size: 42px; }
  .ribbon-foot { bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; overscroll-behavior: none; }
  #guest-compose[open] { height: var(--mobile-viewport-height, 100dvh); top: var(--mobile-viewport-top, 0px); bottom: auto; }
  .postcard-dialog { overscroll-behavior: contain; }
  .circular-dialog .lightbox { padding-block: 10px; gap: 6px; }
  .circular-dialog .viewer-footer { gap: 4px; }
}


.nav-disclosure { display: contents; }
.mobile-nav-toggle,
.mobile-music-detail { display: none; }

[data-navigation-menu] .nav-disclosure {
  --nav-toggle-width: 86px;
  --nav-toggle-height: 44px;
  --nav-glass-tint: var(--portfolio-frosted, #101013ed);
  --nav-menu-ease: cubic-bezier(.2, .72, .25, 1);
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  isolation: isolate;
}

[data-navigation-menu] .mobile-nav-toggle {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  inline-size: var(--nav-toggle-width);
  min-block-size: var(--nav-toggle-height);
  padding: 0 10px;
  border: 1px solid #ffffff20;
  border-radius: 100px;
  background: var(--nav-glass-tint);
  color: #f4f1ea;
  font: 650 13px/1 var(--heading-font);
  pointer-events: auto;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, scale 130ms ease;
}

[data-navigation-menu] .mobile-nav-toggle[aria-expanded='true'] {
  background: var(--nav-glass-tint);
  border-color: #ffffff2e;
}

[data-navigation-menu] .mobile-nav-toggle:active { scale: .96; }

.mobile-nav-symbol {
  display: grid;
  place-items: center;
  width: 14px;
  height: 16px;
}

.mobile-nav-symbol::before,
.mobile-nav-symbol::after {
  content: '';
  grid-area: 1 / 1;
  width: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 220ms var(--nav-menu-ease);
}

.mobile-nav-symbol::before { transform: translateY(-2.5px); }
.mobile-nav-symbol::after { transform: translateY(2.5px); }
.mobile-nav-toggle[aria-expanded='true'] .mobile-nav-symbol::before { transform: rotate(45deg); }
.mobile-nav-toggle[aria-expanded='true'] .mobile-nav-symbol::after { transform: rotate(-45deg); }

[data-navigation-menu] .site-nav-actions {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: -4px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  inline-size: max-content;
  padding: 3px calc(var(--nav-toggle-width) + 11px) 3px 6px;
  border: 1px solid #ffffff1f;
  border-radius: 999px;
  background: var(--nav-glass-tint);
  box-shadow: 0 6px 16px #0003;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%);
  clip-path: inset(0 0 0 100% round 999px);
  transition: clip-path 320ms var(--nav-menu-ease), opacity 200ms ease,
    visibility 0s linear 320ms;
}

[data-navigation-menu] .nav-disclosure[data-open] .site-nav-actions {
  opacity: 1;
  visibility: visible;
  clip-path: inset(0 round 999px);
  pointer-events: auto;
  transition-delay: 0s;
}

[data-navigation-menu] .site-nav .site-nav-actions :is(.pill-nav, .music-controls) {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

[data-navigation-menu] .site-nav .site-nav-actions .pill-nav { gap: 2px; }
[data-navigation-menu] .site-nav .site-nav-actions .pill-nav :is(a, :where(.performance-choice)) {
  border-radius: 999px;
  min-height: var(--nav-toggle-height);
  padding-inline: clamp(10px, 1.15vw, 17px);
}

[data-navigation-menu] .site-nav .site-nav-actions .music-controls {
  padding-inline-start: 7px;
  border-inline-start: 1px solid #ffffff24;
  border-radius: 0;
}

[data-navigation-menu] .music-controls [data-music-mode] { margin-inline-start: 0; }
[data-navigation-menu] .nav-disclosure button:focus-visible {
  outline: 2px solid #f4f1ea;
  outline-offset: -3px;
}
[data-navigation-menu] .site-nav .site-nav-actions .pill-nav :is(a, :where(.performance-choice)):is([aria-current='location'], :hover, :focus-visible) {
  color: #f4f1ea;
}

[data-navigation-menu] .site-nav .site-nav-actions .pill-nav :is(a, :where(.performance-choice))::before {
  background: #ffffff14;
}

[data-navigation-menu] .site-nav .music-controls [data-music-toggle] {
  color: #f4f1ea;
  background: #ffffff15;
}

[data-navigation-menu] .site-nav .music-controls [data-music-toggle][aria-pressed='true'] { color: #f29a9d; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  [data-navigation-menu] .nav-disclosure :is(.mobile-nav-toggle, .site-nav-actions) {
    -webkit-backdrop-filter: blur(12px) saturate(.85);
    backdrop-filter: blur(12px) saturate(.85);
  }
}

@media (min-width: 761px) {
  [data-navigation-menu] .mobile-nav-toggle[aria-expanded='true'] {
    background: #ffffff12;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 760px),
  (orientation: landscape) and (max-height: 500px) and (max-width: 1024px) and (pointer: coarse) {
  :root[data-navigation-menu] { --site-nav-height: 48px; --site-nav-inset: 10px; }
  [data-navigation-menu] .site-nav {
    --nav-safe-left: max(var(--edge), env(safe-area-inset-left, 0px));
    --nav-safe-right: max(var(--edge), env(safe-area-inset-right, 0px));
    display: flex;
    min-height: var(--site-nav-height);
    padding-left: var(--nav-safe-left);
    padding-right: var(--nav-safe-right);
  }

  [data-navigation-menu] .nav-disclosure .mobile-nav-toggle {
    gap: 7px;
    inline-size: auto;
    min-inline-size: 44px;
    min-block-size: 44px;
    padding: 0 2px 0 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .mobile-nav-toggle .mobile-nav-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .mobile-nav-toggle .mobile-nav-caption {
    display: block;
    color: #f4f1ea;
    font: 650 9px/1 var(--heading-font);
    letter-spacing: .14em;
  }

  .mobile-nav-toggle .mobile-nav-symbol {
    position: relative;
    inline-size: 24px;
    block-size: 24px;
  }
  .mobile-nav-toggle .mobile-nav-symbol::before,
  .mobile-nav-toggle .mobile-nav-symbol::after { display: none; }
  .mobile-nav-toggle .mobile-nav-glyph {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 200ms var(--nav-menu-ease), transform 230ms var(--nav-menu-ease);
  }
  .mobile-nav-toggle .mobile-nav-glyph-close {
    color: var(--accent-red);
    opacity: 0;
    transform: rotate(-22deg) scale(.82);
  }
  .mobile-nav-toggle[aria-expanded='true'] .mobile-nav-glyph-menu { opacity: 0; transform: translateX(3px); }
  .mobile-nav-toggle[aria-expanded='true'] .mobile-nav-glyph-close { opacity: 1; transform: none; }
  [data-navigation-menu] .site-nav .pill-nav-dot { background: var(--accent-red); }
  [data-navigation-menu] .site-nav .site-nav-actions .pill-nav :is(a, :where(.performance-choice))[aria-current='location']::before {
    background: rgb(var(--accent-rgb) / .16);
  }
  [data-navigation-menu] .site-nav .music-controls [data-music-toggle][aria-pressed='true'] {
    color: var(--accent-red);
  }

  [data-navigation-menu] .site-nav-actions {
    inset: calc(100% + 8px) 0 auto auto;
    display: grid;
    gap: 6px;
    inline-size: min(346px, calc(100vw - var(--nav-safe-left) - var(--nav-safe-right)));
    max-block-size: max(0px, calc(var(--mobile-viewport-height, 100dvh) - 76px
      - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 6px;
    border-color: #ffffff15;
    border-radius: 16px;
    background: #151414f5;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: translateY(-6px) scale(.97);
    transform-origin: top right;
    clip-path: none;
    transition-property: transform, opacity, visibility;
  }

  [data-navigation-menu] .nav-disclosure[data-open] .site-nav-actions {
    clip-path: none;
    transform: none;
  }

  [data-navigation-menu] .site-nav .site-nav-actions .pill-nav {
    grid-area: auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }

  [data-navigation-menu] .site-nav .site-nav-actions .pill-nav :is(a, :where(.performance-choice)) {
    padding-inline: 4px;
    font-size: clamp(12px, 3.3vw, 14px);
  }

  [data-navigation-menu] .site-nav .site-nav-actions .music-controls {
    grid-area: auto;
    justify-self: stretch;
    justify-content: center;
    gap: 5px;
    padding-block-start: 5px;
    padding-inline-start: 0;
    border-inline-start: 0;
    border-block-start: 1px solid #ffffff20;
  }

  [data-navigation-menu] .site-nav-actions .mobile-music-detail {
    display: grid;
    flex: 1;
    min-width: 0;
    padding-inline: 6px;
    gap: 1px;
  }

  .mobile-music-label {
    color: #b7b1ae;
    font: 550 10px/1.35 var(--heading-font);
  }

  .mobile-music-track {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 600 12px/1.4 var(--heading-font);
  }

  [data-navigation-menu] .site-nav .music-controls button {
    flex: 0 0 44px;
    inline-size: 44px;
    min-block-size: 44px;
  }

  #photo.wrap .gallery-heading {
    position: static;
    display: grid;
    grid-template: "title action" auto "total action" auto / minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 10px;
    margin: 0 0 12px;
    padding-left: max(var(--edge), env(safe-area-inset-left, 0px));
    padding-right: max(var(--edge), env(safe-area-inset-right, 0px));
  }

  #photo .gallery-heading .gallery-title {
    grid-area: title;
    position: relative;
    isolation: isolate;
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 0;
    color: #f4f1ea;
    font: 740 clamp(20px, 5.25vw, 26px)/1.18 var(--heading-font);
    letter-spacing: -.02em;
    text-shadow: 0 .08em .14em #000;
  }
  #photo .gallery-heading .archive-photo-total {
    display: block;
    grid-area: total;
    margin: 1px 0 0;
    color: #bdb1ad;
    font: 600 9px/1.4 var(--heading-font);
    letter-spacing: .14em;
    font-variant-numeric: tabular-nums;
  }
  #photo .archive-photo-total [data-archive-photo-count] { color: var(--accent-red); }

  #photo.wrap .gallery-heading .waterfall-toggle[data-frosted-action] {
    grid-area: action;
    justify-self: end;
    flex: none;
    min-inline-size: 44px;
    min-block-size: 44px;
    padding: 0 0 0 4px;
    border: 0;
    border-radius: 0;
    color: #f4f1ea;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #photo .gallery-heading .waterfall-toggle::after,
  #photo .gallery-heading .gallery-desktop-label { display: none; }
  #photo .gallery-heading .gallery-mobile-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font: 620 13px/1 var(--heading-font);
  }
  #photo .gallery-action-divider { margin-inline-end: 2px; color: #bdb1ad; }

  #photo.wrap .drift-wall-frame {
    --mobile-wall-fade-top: clamp(46px, 9svh, 82px);
    mask-image: linear-gradient(to bottom,
      transparent 0,
      #0004 calc(var(--mobile-wall-fade-top) * .32),
      #000c calc(var(--mobile-wall-fade-top) * .69),
      #000 var(--mobile-wall-fade-top),
      #000 calc(100% - 36px),
      transparent 100%);
  }
  #photo.wrap .drift-wall-frame:has(:focus-visible) { mask-image: none; }
  #photo .drift-wall-blur { display: none; }
  @media (prefers-reduced-motion: reduce) {
    #photo.wrap .drift-wall-frame { mask-image: none; }
  }

  #photo-library.photo-library.collection-dialog {
    --library-safe-top: max(8px, env(safe-area-inset-top, 0px));
    --library-safe-right: max(10px, env(safe-area-inset-right, 0px));
    --library-safe-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    --library-safe-left: max(10px, env(safe-area-inset-left, 0px));
    inset: var(--library-safe-top) var(--library-safe-right) var(--library-safe-bottom) var(--library-safe-left);
    width: min(1040px, calc(100% - var(--library-safe-left) - var(--library-safe-right)));
    max-height: min(88dvh, calc(var(--mobile-viewport-height, 100dvh) - var(--library-safe-top) - var(--library-safe-bottom)));
  }
  .circular-dialog {
    height: var(--mobile-viewport-height, 100dvh);
    top: var(--mobile-viewport-top, 0px);
    bottom: auto;
  }
  .circular-dialog .lightbox {
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-navigation-menu] .site-nav-actions,
  [data-navigation-menu] .mobile-nav-toggle,
  .mobile-nav-symbol::before,
  .mobile-nav-symbol::after,
  .mobile-nav-toggle .mobile-nav-glyph { transition: none; }
}

@media (max-width: 760px),
  (orientation: landscape) and (max-height: 500px) and (max-width: 1024px) and (pointer: coarse) {
  :root {
    --editorial-rule: #f4eee127;
    --editorial-accent: var(--accent-red);
    --editorial-muted: #bdb1ad;
    --editorial-ease: cubic-bezier(.22, .72, .24, 1);
  }
  .editorial-action .editorial-extra { display: inline; }
  .editorial-desktop { display: none; }
  :is(#stage.ribbon-stage .ribbon-foot > a,
      #profile .profile-copy .profile-actions > .profile-action,
      #guestbook .guestbook-head .guestbook-actions > button).editorial-action[data-frosted-action] {
    display: flex;
    align-items: center;
    gap: 8px;
    min-inline-size: 44px;
    min-block-size: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #f4f1ea;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    text-decoration: none;
    white-space: nowrap;
    font: 600 14px/1.25 var(--heading-font);
    transition: color 200ms var(--editorial-ease);
  }
  .editorial-action[data-frosted-action]::after { display: none; }
  :is(#stage.ribbon-stage .ribbon-foot > a,
      #profile .profile-copy .profile-actions > .profile-action,
      #guestbook .guestbook-head .guestbook-actions > button).editorial-action[data-frosted-action]:active {
    color: #fff;
    scale: 1;
  }
  .editorial-action .editorial-icon {
    display: block;
    flex: none;
    inline-size: 17px;
    block-size: 17px;
  }
  .editorial-action .editorial-arrow {
    --arrow-x: 2.5px;
    --arrow-y: -2.5px;
    transition: transform 210ms var(--editorial-ease);
  }
  .editorial-action:active .editorial-arrow { transform: translate(var(--arrow-x), var(--arrow-y)); }
  .editorial-action .editorial-advance { --arrow-y: 2.5px; }
  .editorial-action .editorial-download-arrow { --arrow-x: 0; --arrow-y: 4px; }
  .editorial-action :is(.editorial-accent, .editorial-arrow),
  #photo .gallery-mobile-label svg { color: var(--editorial-accent); }
  #photo .gallery-mobile-label svg { transition: transform 210ms var(--editorial-ease); }
  #photo .waterfall-toggle:active svg { transform: translate(2.5px, -2.5px); }

  :is(.editorial-action, #photo .waterfall-toggle, #work .film-orbit-controls [data-film-step])::before {
    content: "";
    position: absolute;
    inset: auto 0 5px;
    height: 1px;
    pointer-events: none;
    background: var(--editorial-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 210ms var(--editorial-ease);
  }
  :is(.editorial-action, #photo .waterfall-toggle, #work .film-orbit-controls [data-film-step]):is(:active, :focus-visible)::before {
    transform: scaleX(1);
  }

  #stage .ribbon-foot {
    inset-inline: max(var(--edge), env(safe-area-inset-left, 0px)) max(var(--edge), env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }
  #stage .ribbon-foot > a.editorial-action {
    margin-inline-start: auto;
    opacity: var(--ribbon-link-opacity, 1);
  }
  #stage .ribbon-foot .editorial-accent { fill: currentColor; }
  #stage:has(> .land-grid:not([hidden])) .ribbon-foot {
    top: calc(var(--ribbon-card-bottom, 100% - var(--ribbon-cards-reserve)) + 12px);
    bottom: auto;
  }
  #stage:has(> .land-grid:not([hidden])) .ribbon-foot > p { display: none; }
  .ribbon-static #stage { --ribbon-card-top: 32%; --ribbon-cards-reserve: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .ribbon-static #stage .land-grid { inset-block: var(--ribbon-card-top) var(--ribbon-cards-reserve); }
  #stage :is(.archive-reel-label, .archive-reel-perforation, .ribbon-mobile-kicker) {
    position: absolute;
    display: block;
    z-index: 3;
    inset-inline: max(var(--edge), env(safe-area-inset-left, 0px)) max(var(--edge), env(safe-area-inset-right, 0px));
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms var(--editorial-ease), visibility 0s linear 220ms;
  }
  #stage:has(> .land-grid:not([hidden])) :is(.archive-reel-label, .archive-reel-perforation, .ribbon-mobile-kicker) {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
  #stage .archive-reel-label {
    top: calc(var(--ribbon-card-top, 32%) - 23px);
    color: var(--editorial-muted);
    font: 600 9px/1.25 var(--heading-font);
    letter-spacing: .12em;
  }
  #stage .archive-reel-perforation {
    top: calc(var(--ribbon-card-bottom, 100% - var(--ribbon-cards-reserve)) + 5px);
    height: 5px;
    background:
      radial-gradient(ellipse 2.5px 1.5px at 4px 50%, #080808 90%, transparent) 0 0 / 12px 100% repeat-x,
      #f4eee123;
    border-radius: 1px;
  }
  #stage .ribbon-mobile-kicker {
    top: calc(var(--ribbon-card-bottom, 100% - var(--ribbon-cards-reserve)) + 34px);
    transform: translateY(-50%);
    color: var(--editorial-muted);
    font: 550 10px/1.25 var(--heading-font);
    letter-spacing: .14em;
  }

  #work .film-orbit-controls:not([hidden]) {
    display: grid;
    grid-template: "prev counter next" 44px "index index index" minmax(44px, auto) / 1fr auto 1fr;
    align-items: center;
    row-gap: 0;
    column-gap: 10px;
    width: min(100% - 2 * var(--edge), 410px);
    margin-inline: auto;
  }
  #work .film-orbit-controls button[data-film-step][data-frosted-action] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #work .film-orbit-controls [data-film-step]::after { display: none; }
  #work .film-orbit-controls [data-film-step="-1"] { grid-area: prev; justify-self: start; }
  #work .film-orbit-controls [data-film-step="1"] { grid-area: next; justify-self: end; }
  #work .archive-step-label {
    display: inline;
    color: #bdb1ad;
    font: 600 10px/1 var(--heading-font);
    letter-spacing: .10em;
  }
  #work .archive-step-arrow {
    color: var(--accent-red);
    transition: transform 210ms var(--editorial-ease);
  }
  #work [data-film-step="-1"]:active .archive-step-arrow { transform: translateX(-4px); }
  #work [data-film-step="1"]:active .archive-step-arrow { transform: translateX(4px); }
  #work .film-orbit-status {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    min-width: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #work .archive-film-counter {
    grid-area: counter;
    display: flex;
    gap: .62em;
    margin: 0;
    color: #d9d0cb;
    font: 650 12px/1 var(--heading-font);
    letter-spacing: .12em;
    font-variant-numeric: tabular-nums;
  }
  #work .archive-film-current { color: var(--accent-red); }
  #work .archive-film-index {
    grid-area: index;
    display: flex;
    min-inline-size: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  #work .archive-film-index::-webkit-scrollbar { display: none; }
  #work .archive-film-index button {
    position: relative;
    display: block;
    flex: 1 0 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  #work .archive-film-index button::before {
    content: "";
    position: absolute;
    inset: calc(50% - 1px) 4px auto;
    height: 2px;
    background: #f4f1ea42;
    transition: background-color 210ms var(--editorial-ease);
  }
  #work .archive-film-index button[aria-current]::before { background: var(--accent-red); }
  #work .archive-film-index button:focus-visible { outline-offset: -3px; }
  #work .film-orbit .play { color: var(--accent-red); }

  #profile .profile-layout { row-gap: clamp(18px, 5vw, 26px); }
  #profile .archive-profile-role {
    display: block;
    margin-bottom: 12px;
    padding-inline-start: 10px;
    border-inline-start: 1px solid rgb(var(--accent-rgb) / .65);
    color: #d5c9c3;
    font: 650 10px/1.25 var(--heading-font);
    letter-spacing: .12em;
  }
  #profile .archive-profile-role span { color: var(--accent-red); }
  :is(#photo-library, #guest-all).collection-dialog[open] { --collection-ink: var(--accent-red); }
  .circular-dialog .viewer-pill [data-photo-tilt][aria-pressed="true"],
  .circular-dialog .viewer-pill .viewer-heart[aria-pressed="true"] { color: var(--accent-red); }

  #profile .profile-copy .profile-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 24px;
    border-bottom: 1px solid var(--editorial-rule);
  }
  #profile .profile-contact-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding-block: 0 10px;
    color: #e0d6d0;
    font: 600 12px/1.35 var(--heading-font);
  }
  #profile .profile-contact-title [lang="en"] {
    color: var(--editorial-muted);
    font-size: 10px;
    letter-spacing: .14em;
  }
  #profile .profile-contact-title [aria-hidden] { color: var(--editorial-accent); }
  #profile .profile-copy .profile-actions > .profile-action.editorial-action {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
    text-align: start;
    min-block-size: 47px;
    border-top: 1px solid var(--editorial-rule);
  }
  #profile .editorial-action .editorial-arrow,
  #profile .editorial-action .editorial-format { margin-inline-start: auto; }
  #profile .editorial-action .editorial-format + .editorial-arrow { margin-inline-start: 0; }
  #profile .editorial-format {
    color: var(--editorial-muted);
    font: 550 10px/1 var(--heading-font);
    letter-spacing: .11em;
  }

  #guestbook .guestbook-actions {
    align-self: stretch;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--editorial-rule);
  }
  #guestbook .guestbook-actions .editorial-desktop { display: none; }
  #guestbook .guestbook-head .guestbook-actions > [data-guest-all].editorial-action { color: var(--editorial-muted); }
  #guestbook .guestbook-head .guestbook-actions > [data-guest-all].editorial-action:active { color: #fff; }

  @media (prefers-reduced-motion: reduce) {
    #stage :is(.archive-reel-label, .archive-reel-perforation, .ribbon-mobile-kicker),
    .editorial-action .editorial-arrow,
    #photo .gallery-mobile-label svg,
    #work .archive-step-arrow,
    #work .archive-film-index button::before,
    :is(.editorial-action, #photo .waterfall-toggle, #work .film-orbit-controls [data-film-step])::before {
      transition: none;
    }
    .editorial-action:active .editorial-arrow,
    #photo .waterfall-toggle:active svg,
    #work [data-film-step]:active .archive-step-arrow { transform: none; }
  }
}
