/* =====================================================================
   mobile.css — mobile-only refinements for index2.html
   Loaded after studio.css / section-backgrounds.css / page-extras.css.
   Everything here is scoped to small screens; desktop is untouched.
   ===================================================================== */

/* ---------- Hamburger menu: full-screen sheet (phones + small tablets) ---------- */
@media (max-width: 1000px) {
  /* NOTE: the header uses backdrop-filter, which turns it into the containing
     block for position:fixed children — so the sheet is positioned absolutely
     under the sticky header instead and sized with dvh. */
  .site-header {
    overflow: visible;
  }
  .site-header .navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 73px);
    height: calc(100dvh - 73px);
    max-height: none;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(70% 40% at 80% 0%, rgba(147, 51, 234, 0.22), transparent 70%),
      rgba(9, 9, 15, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 60;
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
  }
  .site-header .navigation.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    visibility: visible;
  }
  .site-header .navigation > a {
    display: flex;
    width: min(100%, 218px);
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 11px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 14px;
    border: 1px solid rgba(192, 132, 252, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: #efe9fa;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s, border-color 0.2s;
  }
  .site-header .navigation.is-open > a {
    opacity: 1;
    transform: none;
  }
  .site-header .navigation.is-open > a:nth-child(1) { transition-delay: 0.04s; }
  .site-header .navigation.is-open > a:nth-child(2) { transition-delay: 0.08s; }
  .site-header .navigation.is-open > a:nth-child(3) { transition-delay: 0.12s; }
  .site-header .navigation.is-open > a:nth-child(4) { transition-delay: 0.16s; }
  .site-header .navigation.is-open > a:nth-child(5) { transition-delay: 0.2s; }
  .site-header .navigation.is-open > a:nth-child(6) { transition-delay: 0.24s; }
  .site-header .navigation > a::after {
    content: "→";
    font-size: 1rem;
    color: #a89cc4;
    transition: transform 0.2s, color 0.2s;
  }
  .site-header .navigation > a.is-active,
  .site-header .navigation > a:active {
    background: rgba(147, 51, 234, 0.2);
    border-color: rgba(192, 132, 252, 0.4);
  }
  .site-header .navigation > a.is-active::after {
    color: #d8b4fe;
  }
  .site-header .menu-toggle {
    width: 46px;
    height: 46px;
    border-radius: 14px !important;
    border-color: rgba(192, 132, 252, 0.3);
    background: rgba(147, 51, 234, 0.12);
  }
  .site-header .menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 2px;
  }
  .site-header .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(4px) rotate(45deg);
  }
  .site-header .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }
  /* keep header solid while the sheet is open, lock scroll on body */
  html.menu-open,
  html.menu-open body {
    overflow: hidden;
    height: 100%;
  }
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  :root {
    --radius: 16px;
  }

  /* --- header --- */
  .site-header {
    background: rgba(9, 9, 15, 0.9);
  }
  .site-header .nav-wrap {
    height: 66px;
  }
  .site-header .navigation {
    height: calc(100vh - 66px);
    height: calc(100dvh - 66px);
  }
  .language-switch button {
    min-width: 40px;
    min-height: 34px;
  }

  /* --- hero: clean, light background --- */
  .hero {
    padding-top: 36px;
    min-height: auto;
  }
  #hero3d {
    opacity: 0.7;
  }
  .hero-atmosphere {
    background:
      radial-gradient(80% 45% at 50% 0%, rgba(147, 51, 234, 0.28), transparent 70%),
      radial-gradient(60% 40% at 100% 70%, rgba(236, 72, 153, 0.12), transparent 70%),
      #09090f;
  }
  .hero-atmosphere::before {
    background-image:
      radial-gradient(circle, rgba(216, 180, 254, 0.45) 1px, transparent 1.6px);
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse at 50% 20%, rgba(0, 0, 0, 0.55), transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 20%, rgba(0, 0, 0, 0.55), transparent 70%);
  }
  .hero-atmosphere::after {
    height: 120px;
  }
  .hero-grid {
    min-height: 0;
    gap: 8px;
  }
  .hero .eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    margin-bottom: 18px;
  }
  .hero h1 {
    font-size: clamp(2.15rem, 9.2vw, 2.9rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-bottom: 16px;
    text-wrap: balance;
  }
  .hero-description {
    font-size: 0.98rem;
    line-height: 1.65;
    color: #b9afd1;
  }
  .hero-note {
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
    margin-top: 16px;
  }
  .hero-visual {
    padding-top: 10px;
    padding-bottom: 24px;
    margin-top: 6px;
    perspective: none;
  }
  .hero-art {
    transform: none !important;
    animation: none !important;
    filter: drop-shadow(0 30px 40px rgba(147, 51, 234, 0.25));
  }
  .visual-topline,
  .visual-caption {
    display: none;
  }
  .hero-bottom {
    display: none;
  }

  /* --- sections: tighter rhythm, calmer decorations --- */
  .section {
    padding-block: 64px;
  }
  .restored-section::before {
    opacity: 0.45;
  }
  .restored-portfolio::after,
  .restored-stats::before,
  .restored-ai::before {
    display: none;
  }
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 30px;
  }
  .restored-section h2,
  .section h2 {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
    line-height: 1.12;
    text-wrap: balance;
  }

  /* --- portfolio previews: flat, no 3D tilt cost --- */
  .template-scene {
    margin-inline: 0;
    perspective: none;
    outline: 0;
  }
  .scene-tilt,
  .scene-float {
    transform: none !important;
    animation: none !important;
  }
  .template-scene img {
    border-radius: 14px;
  }
  .project-cta .button,
  .hero-actions .project-style-cta,
  .custom-apps-cta .project-style-cta {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
    min-height: 46px;
    padding: 10px 18px;
    font-size: 0.86rem;
  }
  .custom-apps-cta .project-style-cta {
    align-self: center;
    white-space: normal;
  }

  /* --- generic touch comfort --- */
  .button,
  .text-link,
  .navigation a,
  .language-switch button,
  .faq-item button,
  .accordion button {
    -webkit-tap-highlight-color: transparent;
  }
  .button {
    min-height: 50px;
  }
  input,
  textarea,
  select {
    font-size: 16px !important; /* prevents iOS zoom on focus */
  }
  .wa-form {
    padding: 22px 18px;
    border-radius: 20px;
  }
  .wa-submit {
    min-height: 54px;
    width: 100%;
  }
}

@media (max-width: 360px) {
  .hero h1 {
    font-size: 2rem;
  }
}
