/* ==========================================================================
   Hipotek website — mobile presentation layer
   Loaded AFTER the page's own styles. Desktop (> 960px) is unchanged:
   everything outside the media queries below only hides the mobile-only
   elements and neutralises the mobile disclosure wrapper.
   Breakpoints: 960px (main mobile layer — the same width where the desktop
   menu already collapses) and 360px (narrow phones). app.js uses 960px too.
   ========================================================================== */

/* ---- Desktop defaults: mobile-only pieces stay out of the way ---------- */
.m-actions, .m-only, .mobile-intro, .m-short, .m-hero,
.m-modules, .m-login-panel, .mobile-dock { display: none; }
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: #fff; color: #123B93; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 24px #0c2a6e33; font-weight: 600; }
/* the tick lists are wrapped in <details class="rd"> for mobile; on desktop the wrapper is invisible */
details.rd { border: 0; padding: 0; }
details.rd > summary { display: none; }

@media (max-width: 960px) {
  :root {
    --m-pad: 20px;
    --m-header: 64px;
    --m-dock: 76px;
    --m-radius: 16px;
    --m-tint: #eef2fb;
  }

  html { scroll-padding-top: calc(var(--m-header) + 12px); }
  body { padding-bottom: calc(var(--m-dock) + env(safe-area-inset-bottom)); }
  .wrap { padding-left: max(var(--m-pad), env(safe-area-inset-left)); padding-right: max(var(--m-pad), env(safe-area-inset-right)); }
  .m-login-panel [hidden] { display: none !important; }

  /* ---- Compact header -------------------------------------------------- */
  header { background: color-mix(in srgb, var(--paper) 94%, transparent); }
  .nav { height: var(--m-header); gap: 12px; }
  .logo img { height: 26px; }
  .nav .cta { display: none; }
  .m-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .m-login {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
    border-radius: 999px; background: var(--navy); color: #fff; font-weight: 650; font-size: 15px; text-decoration: none;
  }
  .m-menu {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  }
  .m-menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .m-menu .i-close, .m-menu[aria-expanded="true"] .i-open { display: none; }
  .m-menu[aria-expanded="true"] .i-close { display: block; }
  .m-menu:focus-visible, .m-login:focus-visible, .mobile-dock a:focus-visible, .mm-grid a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

  /* Expandable menu panel (positioned against the sticky header, not fixed) */
  .nav nav { display: none; }
  .nav nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; left: 0; right: 0; top: 100%;
    max-height: calc(100dvh - var(--m-header)); overflow-y: auto;
    padding: 8px var(--m-pad) calc(24px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 24px 40px #0c2a6e1f;
    font-size: 17px; color: var(--ink);
  }
  .nav nav.open a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 550; }
  .nav nav.open a.m-only { display: flex; }
  .nav nav.open a.m-nav-cta { justify-content: center; margin-top: 18px; border: 0; border-radius: 12px; background: var(--orange); color: #fff; font-weight: 650; }
  body.menu-open { overflow: hidden; }

  /* ---- Hero: shorter, one clear action --------------------------------- */
  .hero { padding: 28px 0 8px; }
  .sun { display: none; }
  .eyebrow { font-size: 11.5px; letter-spacing: .05em; }
  h1 { font-size: clamp(36px, 9.6vw, 52px); line-height: 1.05; margin: 14px 0 14px; }
  .desktop-copy { display: none; }
  .mobile-intro { display: block; font-size: 19px; line-height: 1.45; color: var(--ink-2); margin: 0 0 22px; }
  .hero .actions { flex-direction: column; gap: 10px; }
  .hero .actions .btn { width: 100%; justify-content: center; }
  .hero .actions .btn.accent { min-height: 54px; font-size: 16.5px; border-radius: 12px; }
  .hero .actions .btn:not(.accent) { min-height: 48px; border-radius: 12px; background: transparent; }
  .proof { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 22px; font-size: 13.5px; }
  .stage { display: none; }
  .m-hero { display: block; margin: 26px calc(var(--m-pad) * -0.5) 0; }
  .m-hero img { width: 100%; height: auto; }

  /* ---- Dark module panel ------------------------------------------------ */
  .m-modules { display: block; padding: 34px 0 30px; margin-top: 18px; background: linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 100%); border-radius: 22px 22px 0 0; }
  .m-modules h2 { color: #fff; font-size: 26px; margin: 0 0 6px; }
  .m-modules-sub { margin: 0 0 18px; color: #c5d0ec; font-size: 15px; }
  .mm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mm-grid a {
    position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
    min-height: 112px; padding: 14px 14px 16px; border-radius: var(--m-radius);
    background: #ffffff12; border: 1px solid #ffffff26; color: #fff; text-decoration: none;
  }
  .mm-grid a:active { border-color: var(--orange); background: #ffffff1c; }
  @media (hover: hover) { .mm-grid a:hover { border-color: var(--orange); background: #ffffff1c; } }
  .mm-n { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: #ffb48f; }
  .mm-t { font-size: 16px; font-weight: 650; line-height: 1.25; padding-right: 22px; }
  .mm-grid svg { position: absolute; right: 12px; bottom: 14px; width: 18px; height: 18px; fill: none; stroke: #ffb48f; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* ---- Sections ---------------------------------------------------------- */
  section { padding: 46px 0; }
  section#how { padding-top: 40px; }
  h2 { font-size: clamp(28px, 7.4vw, 36px); }
  .kicker { font-size: 12px; }
  .sub { font-size: 16.5px; }

  /* Steps: compact numbered rows with the short copy */
  .steps { grid-template-columns: 1fr; gap: 10px; margin-top: 26px; }
  .step { display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 12px; padding: 16px 16px; border-radius: var(--m-radius); }
  .step::before { grid-row: span 2; font-size: 26px; margin: 0; line-height: 1.1; }
  .step h3 { font-size: 16.5px; margin: 0 0 2px; }
  .step p { font-size: 15px; }
  .d-long { display: none; }
  .m-short { display: inline; }

  /* Feature splits: picture first, details on request */
  .split, .split.rev { gap: 24px; }
  .shot { border-radius: 14px; }
  details.rd { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--m-radius); background: var(--card); padding: 0 16px; }
  details.rd > summary {
    display: flex; align-items: center; justify-content: space-between; min-height: 54px;
    font-weight: 650; font-size: 16px; list-style: none; cursor: pointer;
  }
  details.rd > summary::-webkit-details-marker { display: none; }
  details.rd > summary::after { content: "+"; color: var(--orange); font-size: 24px; line-height: 1; }
  details.rd[open] > summary::after { content: "–"; }
  details.rd ul.ticks { margin: 2px 0 18px; font-size: 15.5px; }

  /* Client portal band */
  .band { padding: 32px 20px; border-radius: 20px; }
  .grid4 { grid-template-columns: 1fr; gap: 8px; margin-top: 22px; }
  .feat { padding: 14px 16px; border-radius: 14px; }
  .feat h3 { font-size: 15px; }
  .feat p { font-size: 13.5px; line-height: 1.45; }
  .langs { gap: 8px; }
  .langs span { font-size: 13.5px; padding: 5px 12px; }

  /* Security */
  .sec { grid-template-columns: 1fr; gap: 10px; margin-top: 24px; }
  .sec div { padding: 16px 18px; border-radius: 14px; }
  .sec h3 { font-size: 16px; }
  .sec p { font-size: 14.5px; }

  /* Plans */
  .plans { gap: 12px; margin-top: 26px; }
  .plan { padding: 20px; border-radius: 18px; }
  .plan ul { margin-bottom: 18px; }
  .plan .btn { justify-content: center; min-height: 48px; border-radius: 12px; }

  /* FAQ */
  details:not(.rd) { padding: 14px 0; }
  details:not(.rd) summary { font-size: 16px; min-height: 44px; align-items: center; gap: 14px; }

  /* Login: one portal at a time */
  .m-login-panel { display: block; padding: 46px 0 8px; }
  .m-login-panel h2 { margin-bottom: 18px; }
  .portal-picker { display: grid; gap: 8px; margin-bottom: 14px; }
  .portal-picker label { font-size: 14px; font-weight: 650; color: var(--ink-2); }
  .portal-picker select {
    width: 100%; min-height: 52px; padding: 0 14px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 16px;
  }
  .portal-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 12px; }
  .portal-card h3 { margin: 0 0 4px; font-size: 18px; }
  .portal-card p { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }
  .portal-card .btn { width: 100%; justify-content: center; min-height: 52px; border-radius: 12px; }

  /* Final call to action */
  .final { padding: 52px 0 56px; }
  .final .btn { width: 100%; justify-content: center; min-height: 54px; border-radius: 12px; }

  /* Footer keeps the complete link set */
  footer { padding: 28px 0 24px; }
  footer nav { margin-left: 0; gap: 4px 18px; }
  footer nav a { display: inline-flex; align-items: center; min-height: 40px; }

  /* ---- Bottom navigation dock ----------------------------------------- */
  .mobile-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    background: #ffffffee; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 30px #0c2a6e0f;
  }
  .mobile-dock a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; border-radius: 12px; text-decoration: none;
    font-size: 11.5px; font-weight: 650; color: var(--muted);
  }
  .mobile-dock a[aria-current] { background: var(--m-tint); color: var(--navy); }
  @media (hover: hover) { .mobile-dock a:hover { background: var(--m-tint); color: var(--navy); } }
  .mobile-dock svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn { transition: none; }
    .btn:hover { transform: none; }
  }
}

/* ---- Narrow phones ------------------------------------------------------ */
@media (max-width: 360px) {
  :root { --m-pad: 16px; }
  .logo img { height: 22px; }
  .m-login { padding: 0 14px; font-size: 14px; }
  .m-menu-label { display: none; }
  h1 { font-size: 33px; }
  .mobile-intro { font-size: 17.5px; }
  .proof { grid-template-columns: 1fr; }
  .mm-t { font-size: 15px; }
  .mobile-dock a { font-size: 11px; }
}
