/* Homepage additions have no layout box outside the mobile breakpoint. */
.home-mobile-only { display: none; }
.home-visual,
.home-visual-photo { display: contents; }

@media (max-width: 640px) {
  .home .home-mobile-only { display: block; }
  .home { isolation: isolate; }
  .home .home-aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(120% 70% at 50% 110%, #351711, var(--bg) 70%);
  }
  .home-aurora i {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: home-aurora-drift 14s ease-in-out infinite alternate;
  }
  .home-aurora i:nth-child(1) { width: 340px; height: 260px; left: -120px; top: -60px; background: var(--primary); opacity: .4; }
  .home-aurora i:nth-child(2) { width: 300px; height: 300px; right: -140px; top: 160px; background: #ffae85; opacity: .22; animation-delay: -5s; }
  .home-aurora i:nth-child(3) { width: 360px; height: 220px; left: -60px; bottom: -40px; background: #e2334f; opacity: .24; animation-delay: -9s; }

  /* The blur stays on a pseudo-element to preserve the fixed menu viewport. */
  .home header.site {
    position: sticky;
    inset: auto;
    top: 8px;
    height: 52px;
    margin: 8px 12px 0;
    padding: 0;
    border: 1px solid rgb(255 255 255 / .2);
    border-radius: 999px;
    isolation: isolate;
  }
  .home header.site::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: rgb(15 10 9 / .36);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    box-shadow: 0 10px 30px -12px #0009, inset 0 1px 0 #ffffff1f;
  }
  .home header.site .bar { height: 100%; min-height: 0; padding: 0 4px 0 12px; gap: 8px; }
  .home header.site .brand { margin-right: auto; gap: 9px; font-size: 19px; letter-spacing: -.4px; }
  .home header.site .mark { width: 26px; height: 26px; box-shadow: 0 0 18px rgb(255 107 44 / .35); }
  .home header.site .bar > .btn { display: none; }
  .home header.site .menu > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: auto;
    min-width: 88px;
    height: 44px;
    padding: 0 13px;
    border-radius: 999px;
    border-color: rgb(255 255 255 / .2);
    background: rgb(255 255 255 / .1);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .home .home-menu-label { font-size: 14px; font-weight: 500; }
  .home header .menu nav { padding-top: calc(76px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .home header .menu nav .foot-h { text-transform: none; letter-spacing: normal; }

  .home .hero-home {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "lead" "photo" "stats" "cta" "micro";
    min-height: 0;
    padding: 16px 16px 0;
    overflow: visible;
    isolation: auto;
  }
  .home .hero-home::before,
  .home .hero-home::after { display: none; }
  .home .hero-home .hero-in { display: contents; }
  .home .hero-home .kicker,
  .home .hero-home .btn-stroke { display: none; }
  .home .hero-home h1 {
    grid-area: title;
    max-width: none;
    margin: 0;
    padding: 0;
    font-size: clamp(27px, 7.8vw, 32px);
    line-height: 1.08;
    letter-spacing: -.8px;
    font-weight: 700;
    color: var(--fg);
    background: none;
    -webkit-text-fill-color: currentColor;
    text-align: left;
    text-wrap: balance;
  }
  .home .hero-home .lead {
    grid-area: lead;
    max-width: none;
    margin: 8px 0 0;
    font-size: 15px;
    line-height: 1.4;
    color: var(--muted-fg);
    text-align: left;
    text-shadow: none;
  }
  .home .home-visual {
    grid-area: photo;
    display: block;
    position: relative;
    margin-top: 14px;
    padding: 8px;
    border: 1px solid rgb(255 255 255 / .2);
    border-radius: 28px;
    background: rgb(255 255 255 / .08);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    box-shadow: 0 30px 60px -30px #000c, inset 0 1px 0 #ffffff2e;
  }
  .home .home-visual-photo {
    display: block;
    position: relative;
    /* The existing two-line subtitle needs 21px more than the reference. */
    height: clamp(170px, calc(100svh - 447px), 320px);
    overflow: hidden;
    border-radius: 21px;
  }
  .home .hero-home .hero-img {
    position: static;
    z-index: auto;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 65% 20%;
    transform: none;
  }
  .home-visual-photo::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgb(15 10 9 / .6)); }
  .home-photo-chip,
  .home-photo-ring,
  .home-photo-info {
    position: absolute;
    z-index: 1;
    border: 1px solid rgb(255 255 255 / .25);
    background: rgb(15 10 9 / .35);
    -webkit-backdrop-filter: blur(14px) saturate(1.6);
    backdrop-filter: blur(14px) saturate(1.6);
  }
  .home .home-photo-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    top: 19px;
    left: 19px;
    height: 32px;
    padding: 0 12px 0 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
  }
  .home-photo-chip svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
  .home .home-photo-ring { display: grid; place-items: center; top: 19px; right: 19px; width: 62px; height: 62px; border-radius: 50%; }
  .home-photo-ring::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) 94%, #ffffff29 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  }
  .home-photo-ring b { font: 700 18px/1 var(--font-head); letter-spacing: -.3px; }
  .home .home-photo-info { left: 19px; right: 19px; bottom: 19px; padding: 10px 14px; border-radius: 18px; }
  .home-photo-info p { margin: 0; font: 700 24px/1.1 var(--font-head); letter-spacing: -.5px; }
  .home-photo-info > span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.4; color: #f3e4db; }

  .home .home-stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .home-stats p {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    margin: 0;
    padding: 8px 4px;
    border: 1px solid rgb(255 255 255 / .2);
    border-radius: 18px;
    background: rgb(255 255 255 / .08);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    color: var(--muted-fg);
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
  }
  .home-stats b { color: var(--fg); font: 700 19px/1.2 var(--font-head); letter-spacing: -.3px; white-space: nowrap; }
  .home .hero-home .ctas { grid-area: cta; display: block; width: 100%; max-width: none; margin: 14px 0 0; }
  .home .hero-home .ctas .btn-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(100deg, #ffd6bd, #ffae85 40%, #ff6b2c);
    box-shadow: 0 12px 34px -8px rgb(255 107 44 / .6), inset 0 1px 0 #ffffff99;
    color: var(--on-primary);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.2px;
    line-height: 1.3;
    white-space: normal;
  }
  .home .hero-home .ctas .home-desktop-only { display: none; }
  .home .hero-home .ctas svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .home .home-micro { grid-area: micro; max-width: none; margin: 8px 0 0; color: var(--muted-fg); font-size: 12px; line-height: 18px; text-align: center; }

  .home .home-next { display: grid; gap: 8px; padding: 24px 16px 0; }
  .home-next-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 8px 12px 8px 8px;
    border: 1px solid rgb(255 255 255 / .2);
    border-radius: 20px;
    background: rgb(255 255 255 / .08);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    text-decoration: none;
  }
  .home-next-row img { flex: none; width: 48px; height: 48px; object-fit: cover; object-position: 65% 15%; border-radius: 14px; }
  .home-next-row > span { flex: 1; min-width: 0; }
  .home-next-row b { display: block; color: var(--fg); font: 700 16px/1.3 var(--font-head); }
  .home-next-row small { display: block; margin-top: 2px; color: var(--muted-fg); font-size: 12px; line-height: 1.4; }
  .home-next-row em { color: var(--accent); font: 700 17px/1 var(--font-head); font-style: normal; }
  .home-next-row > svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted-fg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .home #services { scroll-margin-top: 76px; }
  .home nav.toc:not(.is-compact) { opacity: 0; visibility: hidden; pointer-events: none; }
}

@keyframes home-aurora-drift { to { transform: translate(40px, 30px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .home .home-aurora i { animation: none; } }
