/* Harmoni — Responsive & Mobile-first cinema
   Desktop: horizontal film · Mobile (≤900px): vertical scroll story
*/

/* ——— Tablet / compact desktop ——— */
@media (max-width: 1100px) {
  :root {
    --scene-pad-top: calc(var(--header-total) + 2rem);
  }

  .scene-inner-split {
    gap: 2rem;
  }

  .cinema-dots { left: calc(0.65rem + var(--safe-left)); }
  .cinema-dots button::after { display: none; }
}

@media (max-width: 980px) {
  :root {
    --header-h: 4.15rem;
    --header-total: calc(var(--header-h) + var(--safe-top));
    --scene-pad-top: calc(var(--header-total) + 1.75rem);
    --scene-pad-bottom: 4rem;
  }

  body.home.has-cursor,
  body.home.has-cursor a,
  body.home.has-cursor button { cursor: auto; }

  .home-cursor,
  .home-cursor-ring { display: none; }

  .cinema-counter {
    right: calc(1rem + var(--safe-right));
    bottom: calc(1.15rem + var(--safe-bottom));
    top: auto;
    left: auto;
  }
  .cinema-caption { display: none; }
  .cinema-hint { bottom: calc(1.2rem + var(--safe-bottom)); }
  .home-grid { opacity: 0.02; }

  .home-menu-btn { display: flex; }

  .home-nav-links {
    position: fixed;
    inset: auto 0 auto 0;
    top: var(--header-total);
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.75rem 1rem calc(1rem + var(--safe-bottom));
    background: rgba(2, 14, 11, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.45);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.4s var(--ease), opacity 0.35s, visibility 0.35s;
    max-height: min(72vh, 30rem);
    overflow-y: auto;
    z-index: 119;
  }

  .home-nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .home-nav-links > a {
    padding: 0.95rem 1.05rem;
    border-radius: 14px;
    font-size: 1.02rem;
  }

  .home-nav-links > a:not(.home-nav-cta):hover,
  .home-nav-links > a:not(.home-nav-cta):active {
    background: rgba(255, 255, 255, 0.07);
  }

  .home-nav-cta {
    text-align: center;
    margin-top: 0.4rem;
    justify-content: center;
    display: flex;
  }

  .scene-inner-split,
  .home-manifesto {
    grid-template-columns: 1fr;
  }

  .home-mock-frame,
  .home-mock:hover .home-mock-frame { transform: none; }

  @keyframes mock-float {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
  }

  .home-topic-rows a {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
}

/* ——— Dedicated mobile: vertical scroll experience ——— */
@media (max-width: 900px) {
  :root {
    --header-h: 3.75rem;
    --header-total: calc(var(--header-h) + var(--safe-top));
    --scene-pad-top: calc(var(--header-total) + 1.35rem);
    --scene-pad-bottom: calc(4.75rem + var(--safe-bottom));
    --r: 14px;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-total) + 0.85rem);
  }

  body.home {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
    min-height: 100dvh;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.home.nav-open {
    overflow: hidden;
  }

  .home-vignette {
    opacity: 0.4;
    background: radial-gradient(ellipse 95% 55% at 50% 18%, transparent 25%, rgba(0, 0, 0, 0.42) 100%);
  }

  .home-grid,
  .home-noise { display: none; }

  .home-wrap {
    width: min(100% - 1.35rem, var(--max));
  }

  .home-header {
    height: var(--header-total);
    background: rgba(2, 14, 11, 0.92);
  }

  .home-logo-mark svg {
    width: 32px;
    height: 32px;
  }

  .home-logo-text {
    font-size: 1.4rem;
  }

  .home-menu-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 11px;
    border-color: rgba(255, 255, 255, 0.22);
  }

  .home-menu-btn[aria-expanded="true"] span:first-child {
    transform: translateY(3.75px) rotate(45deg);
  }

  .home-menu-btn[aria-expanded="true"] span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
  }

  .home-menu-btn span {
    transition: transform 0.35s var(--ease);
  }

  /* Vertical stack — no horizontal film */
  .cinema {
    position: relative;
    inset: auto;
    overflow: visible;
    height: auto;
    width: 100%;
    direction: rtl;
  }

  .cinema-track {
    position: relative;
    left: auto;
    top: auto;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    height: auto;
    transform: none !important;
    will-change: auto;
  }

  .scene {
    position: relative;
    flex: none;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
    opacity: 1 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  }

  .scene:last-child { border-bottom: 0; }

  [data-parallax-content] {
    transform: none !important;
    will-change: auto;
  }

  .scene-inner {
    width: min(100% - 1.35rem, var(--max));
    height: auto;
    min-height: calc(100svh - var(--header-total));
    min-height: calc(100dvh - var(--header-total));
    justify-content: flex-start;
    padding-top: var(--scene-pad-top);
    padding-bottom: var(--scene-pad-bottom);
    overflow: visible;
  }

  .scene-inner-hero {
    width: min(100% - 1.35rem, 900px);
    max-width: none;
    justify-content: flex-end;
    padding-top: calc(var(--header-total) + 1.5rem);
    padding-bottom: calc(5.5rem + var(--safe-bottom));
  }

  .scene-inner-split {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: stretch;
  }

  .scene-inner-center {
    justify-content: center;
    text-align: center;
  }

  .scene-index {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    margin-bottom: 0.65rem;
    opacity: 1;
  }

  /* Hero — brand stays hero-level, fits under header */
  .home-brand {
    font-size: clamp(3.2rem, 17vw, 4.4rem);
    line-height: 0.88;
    margin-bottom: 0.3rem;
    opacity: 1;
    transform: none;
    filter: drop-shadow(0 0 28px rgba(62, 224, 196, 0.32));
  }

  .home-brand-en {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    margin-bottom: 1rem;
    opacity: 1;
  }

  .scene-hero h1 {
    font-size: clamp(1.35rem, 5.4vw, 1.75rem);
    max-width: none;
    line-height: 1.45;
    margin-bottom: 0.75rem;
    opacity: 1;
  }

  .home-lead {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1.45rem;
    max-width: none;
    opacity: 1;
    color: rgba(232, 246, 240, 0.72);
  }

  .home-actions {
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    opacity: 1;
  }

  .home-btn {
    width: 100%;
    min-height: 3.2rem;
    border-radius: 14px;
    font-size: 0.95rem;
    touch-action: manipulation;
  }

  .home-btn:hover { transform: none; }
  .home-btn:active { transform: scale(0.985); }

  .home-eyebrow,
  .scene-title,
  .scene-desc,
  .scene-copy h2 {
    opacity: 1;
    transform: none;
  }

  .scene-copy h2 {
    font-size: clamp(2.35rem, 11vw, 3.1rem);
  }

  .scene-desc {
    font-size: 0.95rem;
    max-width: none;
    margin-bottom: 1.25rem;
  }

  .home-product-list {
    gap: 0.4rem;
    margin-bottom: 1.35rem;
  }

  .home-product-list li {
    padding: 0.85rem 0.95rem;
    border-radius: 13px;
    opacity: 1;
    transform: none;
    background: rgba(255, 255, 255, 0.055);
  }

  .home-product-list li:hover { transform: none; }
  .home-product-list span { font-size: 0.9rem; }
  .home-product-list b { font-size: 0.8rem; }

  /* Product mock — show first as visual anchor */
  .home-mock {
    order: -1;
    max-width: 100%;
    margin-inline: auto;
    transform: none !important;
    opacity: 1 !important;
  }

  .home-mock-aura {
    inset: -3% -5%;
    filter: blur(22px);
    opacity: 0.85;
  }

  .home-mock-frame {
    border-radius: 16px;
    animation: none;
    border-color: rgba(255, 255, 255, 0.14);
  }

  .home-mock-body {
    grid-template-columns: 1fr;
    min-height: 200px;
  }

  .home-mock-side { display: none; }
  .home-mock-chart { height: 68px; margin-bottom: 0.75rem; }
  .home-mock-main { padding: 1rem; }

  .scene-title {
    font-size: clamp(1.85rem, 7.5vw, 2.4rem);
    margin-bottom: 0.75rem;
  }

  .home-manifesto {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 0.65rem;
  }

  .home-man {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 1.1rem 1rem;
    border-radius: 16px;
    opacity: 1;
    transform: none !important;
    background: rgba(255, 255, 255, 0.055);
  }

  .home-man:hover { transform: none; }

  .home-man-num {
    font-size: 2.15rem;
    margin-bottom: 0;
    line-height: 1;
  }

  .home-man h3 {
    font-size: 1.28rem;
    margin-bottom: 0.25rem;
  }

  .home-man p {
    font-size: 0.86rem;
    line-height: 1.7;
  }

  .home-topic-rows {
    gap: 0.4rem;
    max-width: none;
  }

  .home-topic-rows a {
    padding: 1rem 1.05rem;
    border-radius: 14px;
    opacity: 1;
    transform: none !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .home-topic-rows a:hover { transform: none; }
  .home-topic-rows a:active {
    background: rgba(62, 224, 196, 0.1);
    border-color: rgba(62, 224, 196, 0.28);
  }

  .home-topic-rows a span { font-size: 1.15rem; }
  .home-topic-rows a em { font-size: 0.78rem; }

  .home-topic-rows a:hover span,
  .home-topic-rows a:hover em { transform: none; }

  .scene-footer {
    margin-top: 2.25rem;
    gap: 0.65rem 1.1rem;
    font-size: 0.76rem;
    padding-top: 1.35rem;
  }

  /* Mobile chrome — dots/hint off; progress as bottom reading bar */
  .cinema-dots,
  .cinema-hint {
    display: none !important;
  }

  .cinema-hud {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 115;
    padding-bottom: var(--safe-bottom);
    background: linear-gradient(180deg, transparent, rgba(2, 14, 11, 0.55));
  }

  .cinema-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
  }

  .cinema-counter {
    right: calc(0.75rem + var(--safe-right));
    bottom: calc(0.7rem + var(--safe-bottom));
    padding: 0.38rem 0.7rem;
    font-size: 0.78rem;
    background: rgba(3, 20, 15, 0.82);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .depth-ring.r1 { width: min(72vw, 280px); height: min(72vw, 280px); }
  .depth-ring.r2 { width: min(92vw, 380px); height: min(92vw, 380px); }
  .depth-ring.r3 { width: min(112vw, 480px); height: min(112vw, 480px); }

  .scene-field { opacity: 0.8; }

  .scene-shade {
    background:
      linear-gradient(180deg, rgba(3, 20, 15, 0.55) 0%, rgba(3, 20, 15, 0.2) 28%, transparent 55%),
      linear-gradient(180deg, transparent 60%, rgba(3, 20, 15, 0.5) 100%);
  }
}

/* ——— Small phones ——— */
@media (max-width: 560px) {
  :root {
    --header-h: 3.55rem;
    --header-total: calc(var(--header-h) + var(--safe-top));
    --scene-pad-top: calc(var(--header-total) + 1.15rem);
    --scene-pad-bottom: calc(4.5rem + var(--safe-bottom));
  }

  .home-wrap,
  .scene-inner,
  .scene-inner-hero {
    width: min(100% - 1.15rem, var(--max));
  }

  .home-brand {
    font-size: clamp(2.85rem, 16.5vw, 3.75rem);
  }

  .scene-hero h1 { font-size: 1.32rem; }
  .home-lead { font-size: 0.9rem; }

  .scene { min-height: auto; }
  .scene-inner { min-height: auto; }

  .scene-inner-hero {
    min-height: calc(100svh - var(--header-total));
    min-height: calc(100dvh - var(--header-total));
    justify-content: flex-end;
    padding-top: calc(var(--header-total) + 1.25rem);
    padding-bottom: calc(5rem + var(--safe-bottom));
  }

  .scene-product .scene-inner,
  .scene-about .scene-inner,
  .scene-topics .scene-inner,
  .scene-contact .scene-inner {
    min-height: auto;
    padding-top: calc(var(--header-total) + 1.5rem);
    padding-bottom: calc(3.25rem + var(--safe-bottom));
  }

  .home-eyebrow {
    font-size: 0.7rem;
    margin-bottom: 0.65rem;
    letter-spacing: 0.1em;
  }

  .home-nav-links { padding-inline: 0.7rem; }

  .home-mock-stats { gap: 0.45rem; }
  .home-mock-stats > div { padding: 0.65rem 0.5rem; }
}

/* ——— Very small / SE ——— */
@media (max-width: 380px) {
  .home-brand {
    font-size: clamp(2.5rem, 15vw, 3.1rem);
  }

  .scene-hero h1 { font-size: 1.22rem; }

  .home-btn {
    min-height: 3rem;
    padding-inline: 1.2rem;
    font-size: 0.9rem;
  }

  .home-man {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .home-man-num { font-size: 1.85rem; }
}

/* ——— Landscape phones ——— */
@media (max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
  .scene { min-height: auto; }

  .scene-inner-hero {
    min-height: auto;
    padding-top: calc(var(--header-total) + 0.85rem);
    padding-bottom: 2.25rem;
  }

  .home-brand {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }

  .home-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .home-btn {
    width: auto;
    flex: 1 1 auto;
    min-height: 2.85rem;
  }

  .cinema-counter { display: none; }
}

/* Short desktop viewports — keep content clear of fixed header */
@media (min-width: 901px) and (max-height: 760px) {
  :root {
    --scene-pad-top: calc(var(--header-total) + 1.5rem);
    --scene-pad-bottom: 3.5rem;
  }

  .home-brand {
    font-size: clamp(3.4rem, 9vw, 7rem);
  }

  .scene-inner {
    justify-content: flex-start;
    padding-top: var(--scene-pad-top);
  }

  .scene-hero h1 {
    font-size: clamp(1.45rem, 2.8vw, 2rem);
  }

  .home-lead { margin-bottom: 1.25rem; }
}
