/* Mobile experience layer: handset navigation, hierarchy and touch controls.
   This file intentionally leaves the approved desktop presentation unchanged. */

@media (max-width: 800px) {
  :root { --mobile-header-height: 88px; }

  html { scroll-padding-top: calc(var(--mobile-header-height) + 12px); }
  body.menu-open { overflow: hidden; height: 100dvh; }

  .site-header {
    z-index: 100;
    background: #fafaf7;
    box-shadow: 0 1px 0 rgba(23, 34, 30, .10);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .header-inner {
    min-height: var(--mobile-header-height);
    height: var(--mobile-header-height);
    padding: 12px 0;
    flex-wrap: nowrap;
    gap: 12px;
  }

  .site-header .brand { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .site-header .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .site-header .brand-name {
    min-width: 0;
    font-size: clamp(1.22rem, 4.8vw, 1.45rem);
    line-height: 1.04;
  }
  .site-header .brand-descriptor {
    margin-top: 4px;
    font-size: .49rem !important;
    letter-spacing: .11em;
    white-space: nowrap;
  }

  .menu-toggle {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 9px 11px !important;
    font-size: .85rem !important;
  }

  .js #navigation.is-open {
    position: fixed;
    top: var(--mobile-header-height);
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(100dvh - var(--mobile-header-height));
    max-height: none;
    z-index: 101;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 12px max(18px, env(safe-area-inset-left)) calc(28px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-right));
    background: #fafaf7;
    border-top: 1px solid var(--line);
    box-shadow: 0 22px 40px rgba(17, 23, 21, .12);
  }

  .site-header nav > a {
    width: 100%;
    min-height: 56px;
    padding: 15px 4px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 1rem;
  }

  .site-header nav > a[aria-current] { text-underline-offset: 6px; }
  .site-header nav .button {
    display: inline-flex;
    justify-content: center;
    min-height: 54px;
    margin-top: 16px;
    padding: 14px 18px;
    border: 1px solid var(--wine);
  }

  body.menu-open .chat-launcher { visibility: hidden; pointer-events: none; }
}

@media (max-width: 700px) {
  .film-hero-visual {
    height: clamp(220px, 61vw, 270px);
  }

  .film-hero-video {
    position: static;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    transform: none;
    object-fit: cover;
    object-position: 50% 66%;
  }

  .film-hero-action-inner {
    width: calc(100% - 40px);
    padding: 27px 0 31px;
  }

  .film-hero-message h1 {
    max-width: 14ch;
    font-size: clamp(2.3rem, 9.6vw, 3.05rem);
    line-height: 1.04;
  }

  .film-hero-actions {
    width: 100%;
    gap: 16px;
    margin-top: 24px;
  }

  .film-hero-actions .button {
    width: 100%;
    min-height: 56px;
  }

  .film-hero-actions .text-link { margin-left: 2px; }

  .homepage-thesis { padding: 56px 0 60px; }
  .homepage-thesis .container { width: calc(100% - 40px); }
  .thesis-markers { margin-top: 31px; }

  .page-intro { padding: 46px 0 40px; }
  .page-intro h1 { font-size: clamp(2.55rem, 11vw, 3.25rem); }
  .page-intro .lead { font-size: 1rem; line-height: 1.7; }

  .checker-page { padding-top: 48px; }
  .case-form { padding: 24px 18px; }
  .form-heading { margin-bottom: 22px; padding-bottom: 18px; }
  .form-heading h3 { font-size: 1.35rem; }
  .form-grid { gap: 21px; }
  .field label { margin-bottom: 7px; }
  .field-help { margin-top: 8px; }
  #case-form > .button[type="submit"] {
    width: 100%;
    min-height: 58px;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    line-height: 1.35;
  }
  .case-result { padding: 20px; margin-top: 24px; }
  .summary-view textarea { min-height: 210px; }

  .chat-launcher {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    display: inline-grid;
    width: 52px;
    height: 52px;
    min-height: 52px;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
  }

  .chat-launcher::after {
    content: "Chat";
    color: #fff;
    font: 700 .66rem/1 var(--sans);
    letter-spacing: .02em;
  }

  .chat-panel {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 110;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    border-radius: 12px;
  }

  .chat-log {
    flex: 1 1 auto;
    max-height: none;
    padding-bottom: 14px;
  }

  .chat-heading { padding: 15px 16px; }
  .chat-quick { padding-bottom: 10px; }
  .chat-links { padding-bottom: 10px; }
  .chat-note { padding-bottom: 12px; }

  .site-footer { padding-bottom: 82px; }
}

@media (max-width: 480px) {
  :root { --mobile-header-height: 82px; }

  .container,
  .film-hero-action-inner,
  .homepage-thesis .container { width: calc(100% - 32px); }

  .site-header .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .site-header .brand { gap: 8px; }
  .site-header .brand-name { font-size: 1.18rem; }
  .site-header .brand-descriptor { font-size: .43rem !important; letter-spacing: .095em; }

  .menu-toggle { min-height: 44px; padding: 8px 10px !important; }

  .film-hero-action-inner { padding: 25px 0 29px; }
  .film-hero-message h1 { font-size: clamp(2.18rem, 9.6vw, 2.72rem); }
  .case-form { padding: 22px 16px; }
}

@media (max-height: 600px) and (max-width: 800px) {
  .js #navigation.is-open { padding-top: 6px; }
  .site-header nav > a { min-height: 48px; padding-block: 10px; }
  .site-header nav .button { min-height: 48px; margin-top: 10px; }
}
