/* Ruimtekatten 3.1 responsive refinement.
 * Loaded last so these rules form one predictable tablet/mobile layer.
 */

html{overflow-x:hidden}
body{overflow-wrap:anywhere}
img,svg,video,iframe{max-width:100%;height:auto}
.site-main,.home-layout,.entry-content,.prose{min-width:0}
.site-container,.site-header>.container,.site-footer>.container,body:not(.home) .container{
  width:min(1440px,calc(100% - clamp(32px,8vw,128px)));
}
.button,.mobile-toggle,.nav-links a{min-height:44px}
.button{max-width:100%;text-align:center}

@media(max-width:1200px){
  body.nav-open{overflow:hidden}
  .site-header{isolation:isolate}
  .nav{min-height:68px}
  .mobile-toggle{
    display:grid;place-items:center;width:48px;height:48px;padding:0;
    border:1px solid rgba(127,233,230,.35);background:#10172a;color:#fff;
    cursor:pointer;font-size:1.45rem;line-height:1;
  }
  .nav-links{
    display:none;position:absolute;z-index:60;top:100%;left:0;right:0;
    max-height:calc(100dvh - 68px);overflow-y:auto;overscroll-behavior:contain;
    padding:18px max(5vw,20px) 24px;background:rgba(8,13,23,.98);
    border-bottom:1px solid var(--line);box-shadow:0 18px 35px rgba(0,0,0,.38);
  }
  .nav-links.open{display:flex;flex-direction:column;align-items:stretch;gap:4px}
  .nav-links ul{width:100%;flex-direction:column;align-items:stretch;gap:4px}
  .nav-links li{width:100%}
  .nav-links a{display:flex;align-items:center;width:100%;padding:10px 12px;border-radius:12px}
  .nav-links a:hover,.nav-links a:focus-visible{background:#18223d;color:var(--accent2)}
  .nav-links .sub-menu,
  .nav-links li:hover>.sub-menu,
  .nav-links li:focus-within>.sub-menu{
    display:grid;position:static;width:100%;padding:0 0 6px 16px;background:transparent;
  }
}

@media(min-width:721px) and (max-width:1024px){
  .site-container,.site-header>.container,.site-footer>.container,body:not(.home) .container{
    width:calc(100% - 64px);
  }
  .section,.home-layout .section{padding-block:clamp(42px,6vw,64px)}
  .grid-3,.home-layout .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .footer-grid{grid-template-columns:minmax(0,1.6fr) repeat(2,minmax(150px,.7fr));gap:28px}
  .rk-crew-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
  .rk-crew-card{width:auto;max-width:none;min-width:0}
  .rk-profile-hero{grid-template-columns:minmax(240px,.8fr) minmax(0,1.2fr);gap:32px}
  .rk-profile-facts{grid-template-columns:repeat(2,minmax(0,1fr))}

  body.home .home-layout .hero,
  body.home .home-layout .rk-home-hero{border-radius:20px;overflow:hidden}
  body.home .home-layout .hero::before,
  body.home .home-layout .rk-home-hero::before{
    width:100%;aspect-ratio:1597/985;background-position:center top;background-size:contain;
  }
  body.home .home-layout .hero>.container,
  body.home .home-layout .rk-home-hero>.container{padding:clamp(28px,5vw,48px)}
  body.home .home-layout .hero h1,
  body.home .home-layout .rk-home-hero h1{font-size:clamp(2.35rem,6vw,3.6rem)}
}

@media(max-width:720px){
  .site-container,.site-header>.container,.site-footer>.container,body:not(.home) .container{
    width:calc(100% - 32px);
  }
  .nav{min-height:64px}
  .rk-brand{min-width:0}
  .rk-brand-icon{width:38px;height:38px;flex:0 0 38px}
  .rk-wordmark{overflow:hidden;font-size:clamp(.72rem,3.6vw,.9rem);letter-spacing:.07em;text-overflow:ellipsis}
  .nav-links{max-height:calc(100dvh - 64px)}

  h1,.prose h1{font-size:clamp(2rem,10vw,3.2rem);line-height:1.08}
  h2{font-size:clamp(1.55rem,7vw,2.25rem)}
  .lead{font-size:1.05rem;line-height:1.6}
  .section,.home-layout .section{padding-block:40px}
  .section-head{margin-bottom:22px}
  .card,.rk-section,.rk-home-cta{padding:22px;border-radius:18px}
  .grid,.home-layout .grid,.grid-2,.grid-3{
    display:grid;grid-template-columns:minmax(0,1fr);gap:16px;overflow:visible;padding-bottom:0;
  }
  .home-layout .grid>.card{width:auto;max-width:none}
  .lab-banner{grid-template-columns:1fr;padding:24px;border-radius:20px}
  .lab-banner .button{width:100%}

  body.home .home-layout .hero,
  body.home .home-layout .rk-home-hero{border-radius:18px;overflow:hidden}
  body.home .home-layout .hero::before,
  body.home .home-layout .rk-home-hero::before{
    width:100%;aspect-ratio:4/5;background-image:url('assets/images/hero-visual.jpg');
    background-position:center top;background-size:cover;border-radius:0;
  }
  body.home .home-layout .hero>.container,
  body.home .home-layout .rk-home-hero>.container{padding:26px 20px 30px}
  body.home .home-layout .hero h1,
  body.home .home-layout .rk-home-hero h1{font-size:clamp(2rem,9.5vw,3rem);line-height:1.12;margin-bottom:18px}
  body.home .home-layout .hero .lead,
  body.home .home-layout .rk-home-hero .lead{font-size:1rem;line-height:1.6;margin-bottom:18px}
  body.home .home-layout .hero .kicker,
  body.home .home-layout .rk-home-hero .kicker{font-size:.72rem;line-height:1.35}
  body.home .home-layout .hero .actions,
  body.home .home-layout .rk-home-hero .actions{display:grid;grid-template-columns:1fr;width:100%;gap:10px;margin-top:22px}
  body.home .home-layout .actions .button{width:100%!important;min-height:50px;padding:12px 16px}

  .rk-crew-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;overflow:visible;padding-bottom:0}
  .rk-crew-card{width:100%;max-width:440px;margin-inline:auto}
  .rk-crew-card:hover,.rk-crew-card:focus-within{transform:none}
  .rk-crew-sidebar{margin-bottom:28px}
  .rk-crew-sidebar-inner{margin-inline:-16px;padding:14px 16px;border-radius:0;border-inline:0}
  .rk-crew-side-nav{gap:8px;margin-inline:-2px;padding-inline:2px}
  .rk-crew-side-link{flex-basis:168px}
  .rk-profile-hero{grid-template-columns:1fr;gap:24px}
  .rk-profile-image-wrap{max-width:440px;margin-inline:auto}
  .rk-profile-facts,.rk-profile-content-grid{grid-template-columns:1fr}
  .rk-profile-question{padding:24px 20px}
  .rk-profile-pager{grid-template-columns:1fr}
  .rk-profile-pager a:last-child{text-align:left}

  .search-form{flex-direction:column}
  .search-form button{min-height:46px}
  .footer-grid{grid-template-columns:1fr;gap:28px}
  .site-footer{padding:42px 0;margin-top:32px}
}

@media(max-width:420px){
  .site-container,.site-header>.container,.site-footer>.container,body:not(.home) .container{width:calc(100% - 24px)}
  .rk-wordmark{max-width:52vw}
  .card,.rk-section,.rk-home-cta{padding:19px}
  body.home .home-layout .hero>.container,
  body.home .home-layout .rk-home-hero>.container{padding-inline:16px}
  .rk-profile-facts div,.rk-profile-panel{padding:19px}
  .rk-profile-pager a{padding:14px 16px}
}

@media(hover:none){
  .rk-crew-card:hover,.rk-crew-side-link:hover{transform:none}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}
