/* Structural breakpoints only: collapsed navigation at 900px;
stacked content at 720px. */
@media(max-width:900px) {
  .nav-shell {
    grid-template-columns: 1fr auto;
  }
  .nav-center {
    display: none;
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    top: 58px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 13px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-center.is-open {
    display: flex;
  }
  .nav-center a {
    padding: 14px;
  }
  .contact-pill {
    display: none;
  }
  .menu-toggle {
    display: block;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    position: relative;
  }
  .menu-toggle i {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 1.5px;
    background: currentColor;
    top: 14px;
  }
  .menu-toggle i+i {
    top: 23px;
  }
  .grid-6 {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .about-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .about-list {
    grid-column: 1/-1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-2) 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .about-list li {
    margin: 0;
  }
  .service-scroller {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .section-head {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  }
  .section-head>a {
    justify-self: start;
  }
  .contact {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .contact-action {
    grid-column: 1/-1;
    justify-self: start;
  }
  .footer {
    gap: var(--space-2);
    grid-template-columns: 1fr auto;
  }
  .footer nav {
    flex-wrap: wrap;
  }
}
@media(max-width:720px) {
  .grid-2,.grid-3 {
    grid-template-columns: minmax(0,1fr);
  }
  .grid-6 {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .scroll-row {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-block: var(--space-1);
  }
  .scroll-row>* {
    flex: 0 0 min(85%,20rem);
    scroll-snap-align: start;
  }
  .contact-action {
    grid-column: auto;
  }
  .site-header {
    top: 22px;
  }
  .brand-mark {
    justify-self: start;
    min-width: 44px;
    width: auto;
    height: 44px;
  }
  .brand-mark:after {
    content: "KOVA";
    font-size: var(--heading-md);
    font-weight: 800;
    letter-spacing: -.07em;
  }
  .brand-mark img {
    display: none;
  }
  .nav-actions {
    gap: 6px;
  }
  .theme-toggle {
    height: 44px;
    min-width: 64px;
  }
  .hero {
    height: 706px;
    background: var(--bg);
  }
  :root[data-theme="light"] .hero {
    background: linear-gradient(155deg,#ffffff 58%,#f2f2f2 100%);
  }
  .hero-inner {
    width: 100%;
    padding-inline: var(--gutter);
  }
  .desktop-hero-title,.desktop-hero-copy,.hero-side {
    display: none;
  }
  .mobile-hero-copy {
    display: block;
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    top: 147px;
    z-index: 8;
  }
  .mobile-hero-copy .mobile-title {
    font-size: clamp(2.125rem,5.2vw,2.3125rem);
    line-height: .98;
    letter-spacing: -.052em;
    font-weight: 800;
    color: var(--text);
    margin: 0;
  }
  .mobile-hero-copy p:not(.mobile-title) {
    font-size: var(--text-sm);
    line-height: 1.58;
    color: var(--muted);
    margin: 16px 0 14px;
    max-width: 335px;
  }
  .mobile-primary,.mobile-secondary {
    display: flex;
    width: 100%;
  }
  .mobile-secondary {
    margin-top: var(--space-1);
  }
  .mobile-orbit {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 465px;
    height: 145px;
    overflow: hidden;
    z-index: 3;
  }
  .mobile-orbit img {
    position: absolute;
    width: 330px;
    max-width: none;
    left: 50%;
    top: 49%;
    transform: translate(-50%,-50%);
    filter: grayscale(1) drop-shadow(0 0 12px rgba(233,233,233,.36));
  }
  :root[data-theme="light"] .mobile-orbit img {
    filter: grayscale(1) contrast(1.15) brightness(.72) drop-shadow(0 0 10px rgba(77,77,77,.18));
  }
  .earth {
    display: none;
  }
  .hero-benefits {
    left: var(--gutter);
    right: var(--gutter);
    bottom: 16px;
    transform: none;
    width: auto;
    grid-template-columns: repeat(3,1fr);
  }
  .hero-benefits>div {
    display: block;
    text-align: center;
    padding: 0 10px;
    font-size: var(--text-xs);
    line-height: 1.25;
  }
  .hero-benefits>div+div {
    border-left: 1px solid var(--line);
  }
  .hero-benefits svg {
    display: block;
    margin: 0 auto 8px;
    width: 24px;
    height: 24px;
  }
  .ticker {
    display: none;
  }
  .about-grid {
    grid-template-columns: minmax(0,1fr);
  }
  .section-head {
    display: grid;
    grid-template-columns: 1fr auto;
    margin-bottom: 20px;
  }
  .section-head>div {
    grid-column: 1;
  }
  .section-head p,.section-head>a {
    display: none;
  }
  .section-head:after {
    content: "→";
    grid-column: 2;
    grid-row: 1;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: var(--heading-md);
    align-self: end;
  }
  .section-head h2,.results h2,.projects-copy h2,.contact h2 {
    font-size: var(--heading-md);
  }
  .service-scroller {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    gap: 12px;
    padding-right: 38px;
  }
  .service-card {
    flex: 0 0 172px;
    min-width: 0;
    scroll-snap-align: start;
    min-height: 226px;
  }
  .service-art {
    height: 116px;
  }
  .dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
  }
  .dots>* {
    width: 18px;
    height: 3px;
    border-radius: 3px;
    background: var(--line);
  }
  .dots b {
    background: var(--text);
  }
  .results {
    display: block;
    padding-block: var(--section-space);
    border-bottom: 1px solid var(--line2);
  }
  .results h2 {
    margin-bottom: 25px;
  }
  .metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .metrics>div {
    padding: 9px 0 16px;
    border-bottom: 1px solid var(--line2);
  }
  .metrics>div:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .metrics>div:nth-child(even) {
    padding-left: 24px;
  }
  .metrics strong {
    display: block;
    font-size: var(--heading-md);
    letter-spacing: -.04em;
  }
  .metrics span {
    display: block;
    font-size: var(--text-xs);
    margin-top: 2px;
  }
  .projects-grid {
    display: block;
  }
  .projects-copy .outline-btn {
    display: none;
  }
  .projects-copy h2 {
    margin-bottom: 20px;
  }
  .project-scroller {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    gap: 12px;
  }
  .project-card {
    flex: 0 0 88%;
    min-width: 0;
    scroll-snap-align: start;
  }
  .project-media {
    height: 174px;
  }
  .project-card>div:last-child {
    min-height: 68px;
  }
  .contact {
    display: block;
    padding-top: 31px;
    padding-bottom: 27px;
  }
  .contact h2 {
    font-size: var(--heading-md);
  }
  .contact>p {
    border: 0;
    padding: 0;
    font-size: var(--text-xs);
    margin: 13px 0 17px;
  }
  .contact-action {
    width: 100%;
    justify-content: center;
    background: var(--text);
    color: var(--inverse);
    border-color: var(--text);
    min-height: 44px;
  }
  .contact-action:hover {
    background: var(--text);
    opacity: .85;
  }
  .socials a {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
  }
  .socials {
    gap: var(--space-1);
  }
  .footer {
    min-height: 91px;
    grid-template-columns: 1fr auto;
    padding-block: var(--space-2);
    gap: 10px;
  }
  .footer-logo {
    font-size: var(--heading-md);
  }
  .footer-logo small,.footer nav {
    display: none;
  }
  .socials {
    justify-self: end;
  }
  .footer>small {
    grid-column: 2;
    text-align: right;
    font-size: var(--text-xs);
  }
}

/* Final mobile composition overrides — keep every section genuinely responsive. */
@media (max-width: 720px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  :root { --gutter: clamp(18px, 5vw, 24px); }

  /* Header: use the real K mark, not generated text. */
  .brand-mark:after { content: none !important; }
  .brand-mark img {
    display: block !important;
    width: 52px !important;
    height: 52px !important;
    max-width: none;
    object-fit: contain;
  }
  .brand-mark { width: 52px; height: 52px; }

  /* Hero: restore the KOVA artwork and the Earth on mobile. */
  .hero-stage4 {
    height: clamp(900px, 116svh, 1040px) !important;
    min-height: 900px !important;
  }
  .hero-stage4 .mobile-orbit { display: none !important; }
  .hero-stage4 .hero-title-original {
    display: grid !important;
    top: 360px !important;
    width: min(94vw, 620px) !important;
    height: 210px !important;
    z-index: 5;
  }
  .hero-stage4 .hero-title-original img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  .hero-stage4 .hero-earth-original {
    display: block !important;
    width: 150vw !important;
    max-width: none !important;
    bottom: -64px !important;
    z-index: 2;
  }
  .hero-stage4 .mobile-hero-copy {
    top: 145px !important;
    z-index: 8;
  }
  .hero-stage4 .mobile-hero-copy .mobile-title {
    font-size: clamp(2.5rem, 11vw, 4.25rem) !important;
    line-height: .92 !important;
    letter-spacing: -.06em !important;
  }
  .hero-stage4 .mobile-hero-copy p:not(.mobile-title) {
    max-width: 100% !important;
    font-size: clamp(.95rem, 4vw, 1.08rem) !important;
    line-height: 1.55 !important;
  }
  .hero-stage4 .mobile-primary { min-height: 58px; }
  .hero-stage4 .mobile-secondary {
    position: absolute;
    top: 600px;
    left: 0;
    right: 0;
    min-height: 54px;
    z-index: 12;
    background: color-mix(in srgb, var(--bg) 76%, transparent);
    backdrop-filter: blur(8px);
  }
  .hero-stage4 .hero-benefits {
    bottom: 108px !important;
    z-index: 12;
    background: color-mix(in srgb, var(--bg) 74%, transparent);
    backdrop-filter: blur(8px);
    padding-block: 12px;
  }
  .hero-stage4 .hero-benefits > div {
    padding-inline: 7px !important;
    font-size: clamp(.68rem, 3vw, .8rem) !important;
  }

  /* The endless ticker must also exist on phones. */
  .hero-stage4 + .ticker {
    display: block !important;
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    overflow: hidden !important;
  }
  .hero-stage4 + .ticker .ticker-track {
    display: flex !important;
    height: 56px !important;
    min-height: 56px !important;
    gap: 22px !important;
    padding-inline: 22px !important;
    font-size: 11px !important;
    animation-duration: 24s !important;
  }

  /* Horizontal carousels: clean viewport edges, predictable snap and no layout leakage. */
  .service-scroller,
  .project-scroller {
    width: calc(100% + var(--gutter)) !important;
    margin-right: calc(var(--gutter) * -1) !important;
    padding-right: var(--gutter) !important;
    scroll-snap-type: x mandatory !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .service-scroller::-webkit-scrollbar,
  .project-scroller::-webkit-scrollbar { display: none; }
  .service-card { flex-basis: min(78vw, 300px) !important; }
  .project-card { flex: 0 0 min(86vw, 350px) !important; }

  /* Dots use a class set by JS instead of relying on the first <b> forever. */
  .dots > * { background: var(--line) !important; transition: width .2s ease, background .2s ease, opacity .2s ease; opacity: .55; }
  .dots > *.is-active { background: var(--text) !important; opacity: 1; width: 24px; }

  /* Contact: keep the label on its own row so it can never overlap the address. */
  .contact-premium .contact-email,
  .contact-premium .contact-whatsapp {
    grid-template-columns: 42px minmax(0,1fr) 48px !important;
    column-gap: 14px !important;
    min-height: 104px !important;
    padding: 16px 14px !important;
  }
  .contact-premium .contact-email-label {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    margin: 0 0 7px !important;
    font-size: .68rem !important;
  }
  .contact-premium .contact-email strong {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    margin: 0 !important;
    font-size: clamp(.95rem, 4.3vw, 1.12rem) !important;
    line-height: 1.18 !important;
    overflow-wrap: anywhere;
  }
  .contact-premium .contact-email::before {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
  }
  .contact-premium .contact-email-arrow {
    grid-column: 3 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
  }
}

@media (max-width: 430px) {
  .hero-stage4 { min-height: 940px !important; height: 940px !important; }
  .hero-stage4 .hero-title-original { top: 385px !important; height: 190px !important; width: 96vw !important; }
  .hero-stage4 .mobile-secondary { top: 590px; }
  .hero-stage4 .hero-earth-original { width: 170vw !important; bottom: -48px !important; }
  .hero-stage4 .hero-benefits { bottom: 112px !important; }
  .project-card { flex-basis: 88vw !important; }
}

@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .hero-stage4 .mobile-hero-copy .mobile-title { font-size: 2.35rem !important; }
  .hero-stage4 .hero-title-original { top: 398px !important; height: 170px !important; }
  .hero-stage4 .mobile-secondary { top: 576px; }
  .contact-premium .contact-email,
  .contact-premium .contact-whatsapp { grid-template-columns: 36px minmax(0,1fr) 44px !important; column-gap: 10px !important; }
}
