/* Keep the desktop composition; reflow content and controls on narrow screens. */
@media (max-width: 899px) {
  html {
    min-width: 0;
    -webkit-text-size-adjust: 100%;
  }

  .portfolio {
    --gutter: 12px;
    --column: calc(100cqw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    --page-width: 100cqw;
    --offset: calc(12px + env(safe-area-inset-left, 0px));
    min-height: 0;
    padding-top: calc(72px + env(safe-area-inset-top, 0px));
  }

  .site-meta {
    top: calc(10px + env(safe-area-inset-top, 0px));
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    font-size: 12px;
    line-height: 22px;
  }

  .site-meta-value { min-width: auto; padding: 0; }
  .site-meta-item:last-child .site-meta-value { min-width: auto; }
  .site-meta-label, .site-meta-item:last-child .site-meta-label { min-width: auto; }

  .cover { height: clamp(180px, 45vw, 240px); }
  .cover-hover-hint { display: none; }
  .cover .morph-slider-btn { width: 44px; height: 44px; }

  .intro {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-height: 0;
    padding: 120px 0 28px;
  }

  .avatar { top: -52px; }
  .identity { position: relative; left: auto; top: auto; gap: 22px; min-width: 0; }
  h1 { font-size: 32px; line-height: 38px; letter-spacing: 1.6px; }
  .tagline { width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 16px; line-height: 24px; letter-spacing: .3px; }

  .tagline-editor { display: grid; width: 100%; gap: 20px; }
  .tagline-editor .tagline-toolbar,
  .tagline-editor[data-placement="below"] .tagline-toolbar {
    position: relative;
    top: auto;
    left: auto;
    width: max-content;
    max-width: 100%;
    height: 52px;
    gap: 0;
    padding: 4px;
  }
  .tt-frame { bottom: auto; height: calc(100% - 61px); }
  .tagline-toolbar button { min-width: 44px; height: 44px; }
  .tagline-toolbar .tt-font-trigger { width: 88px !important; }
  .tt-font-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
  .tt-toggle { font-size: 18px; }
  .tt-divider { display: none; }
  .tt-swatch { width: 14px; height: 14px; }
  .tt-option { height: 44px; font-size: 16px; }
  .tt-paint-grid { grid-template-columns: repeat(5, 44px); gap: 0; }
  .tt-swatch-option { width: 44px; height: 44px; }

  .bio, .about-copy { font-size: 17px; line-height: 28px; }
  .about-copy { padding-top: 24px; padding-bottom: 28px; gap: 16px; }
  .curiosity { font-size: 22px; line-height: 34px; }
  .curiosity::before { top: 5px; }
  .contact-row { height: auto; margin-top: 0; flex-direction: column; align-items: flex-start; gap: 12px; }
  .downloads { gap: 12px; }
  .document-button { height: 44px; font-size: 16px; }
  .document-button:first-child { width: 88px; }
  .document-button:last-child { width: 140px; }
  .email { justify-content: flex-start; height: 44px; width: auto; padding: 0; font-size: 15px; }

  .section-heading { height: 64px; }
  .experience-heading { height: auto; min-height: 64px; flex-wrap: wrap; gap: 12px; padding-top: 16px; padding-bottom: 16px; }
  #experience-filter { max-width: 100%; }
  #experience-filter .rubber-segment { --rs-h: 50px !important; --rs-font: 15px !important; }
  .experience-heading .rubber-segment__item { width: 84px; }
  .subheading { font-size: 18px; }
  .entry-heading { align-items: flex-start; }
  .company-logo { margin-top: 4px; }
  .entry-title { flex-direction: column; align-items: flex-start; gap: 4px; }
  .entry-title h4 { display: block; white-space: normal; overflow-wrap: anywhere; font-size: 17px; line-height: 28px; }
  .entry-title h4 > span + span { margin-left: 4px; }
  .entry-title .entry-link { margin-left: 6px; }
  .date { width: auto; font-size: 14px; line-height: 24px; }
  .work-entries .entry-title { display: block; }
  .work-entries .entry-title h4 { display: inline; }
  .work-entries .entry-title .entry-link { margin-left: 0; }
  .work-entries .date { display: inline-block; margin-left: 0; line-height: 28px; }
  .work-entries .company-logo { width: 40px; height: 40px; border-radius: 10px; }
  .work-entries .bohrium-background { width: 100%; height: 100%; }
  .work-entries .bohrium-mark { left: 8.8px; top: 17.2px; width: 22.4px; height: 13.6px; }
  .work-entries .bohrium-detail { left: 18.6px; top: 8.8px; width: 12.6px; height: 4.6px; }
  .work-entries .notionpin-entry-artwork { left: 10px; top: 7.5px; transform: scale(1.25); transform-origin: top left; }
  .entry-description { font-size: 17px; line-height: 28px; overflow-wrap: anywhere; }
  .projects-empty { font-size: 16px; line-height: 26px; }

  .footer-hero { height: 320px; padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .footer-slogan { zoom: .48; }
  /* The visual tag scales with the slogan; its tap area remains finger-sized. */
  .footer-badge::after { content: ""; position: absolute; inset: -16px 0; }
  .bottom-nav { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); gap: 6px; padding: 8px; border-radius: 16px; }
  .bottom-nav .bottom-nav-control { min-width: 44px; width: 44px; height: 44px; border-radius: 10px; }
  .bottom-nav-control svg { width: 20px; height: 20px; }
  .hover-card { max-width: calc(100vw - 24px); }
  .hover-card-titles { white-space: normal; }
  .progressive-blur { max-height: 100px; }
}

@media (min-width: 360px) and (max-width: 899px) { .footer-slogan { zoom: .56; } }
@media (min-width: 400px) and (max-width: 899px) { .footer-slogan { zoom: .62; } }
@media (min-width: 480px) and (max-width: 899px) {
  .portfolio { padding-top: calc(48px + env(safe-area-inset-top, 0px)); }
  .site-meta { flex-direction: row; gap: 24px; }
  .footer-slogan { zoom: .75; }
  .footer-hero { height: 360px; }
}
@media (min-width: 600px) and (max-width: 899px) { .footer-slogan { zoom: .92; } }

@media (pointer: coarse) {
  button, [role="button"] { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
  .document-button, .bottom-nav-control { touch-action: manipulation; }
}

@media (max-width: 899px) and (hover: none) and (pointer: coarse) {
  .work-entries .concat-button[data-auto-hover] .concat-button-shell-hover { opacity: 1; }
}
