/* Shared responsive behavior, loaded after page-specific styles. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

main,
section,
.container,
.nav-wrap,
.hero-grid,
.projects-grid,
.feature-grid,
.process-grid,
.studio-grid,
.footer-grid,
.content-grid,
.contact-grid,
.case-intro-grid,
.case-story-grid,
.case-showcase-grid,
.case-facts,
.services-content > .container,
.about-story-grid,
.about-process-grid,
.terms-content-grid {
  min-width: 0;
}

h1,
h2,
h3,
p,
li,
dd,
a,
span {
  overflow-wrap: break-word;
}

@media (max-width: 1024px) {
  .container,
  .site-header .container,
  .hero .container,
  .site-footer .container,
  .projects-page main .container,
  .services-page main .container,
  .about-page main .container,
  .contact-page main .container,
  .privacy-page main .container,
  .terms-page main .container,
  .error-page main .container {
    width: min(calc(100% - 40px), 1340px);
  }

  .case-intro-grid,
  .case-story-grid,
  .case-showcase-grid,
  .case-tp .case-showcase-grid {
    grid-template-columns: 1fr;
  }

  .case-intro-grid {
    gap: 46px;
  }
  .case-story-grid,
  .case-showcase-grid {
    gap: 38px;
  }
  .case-visual {
    width: 100%;
    max-width: 800px;
  }
  .case-tp .case-showcase-image {
    order: initial;
  }
  .case-legacy .case-facts {
    width: 100%;
    margin-left: 0;
  }
  .case-legacy .case-story-copy {
    padding-left: 0;
    border-left: 0;
  }
}

/* Vanaf tabletbreedte krijgt de navigatie bewust het mobiele menu. */
@media (max-width: 960px) {
  html.menu-open,
  body.menu-open {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .site-header {
    position: relative;
  }

  .nav-wrap {
    position: relative;
    min-height: 76px;
    gap: 12px;
  }

  .site-header .brand {
    position: relative;
    z-index: 42;
    order: 1;
    margin: 0 !important;
    transform: translateY(2px);
  }

  .site-header .brand img {
    width: 156px;
    max-height: 58px;
  }

  .language-switcher {
    position: relative;
    z-index: 42;
    order: 2;
    margin-left: auto;
  }

  .menu-toggle {
    position: relative;
    z-index: 42;
    display: inline-flex;
    order: 3;
    min-width: 92px;
    min-height: 44px;
    margin-left: 0;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    gap: 10px;
    transition:
      border-color 0.2s ease,
      background-color 0.2s ease;
  }

  .menu-toggle:hover,
  .menu-toggle[aria-expanded="true"] {
    border-color: rgba(199, 168, 255, 0.55);
    background: rgba(140, 82, 255, 0.1);
  }

  .menu-toggle-icon {
    position: relative;
    width: 18px;
    height: 12px;
  }

  .menu-toggle-icon i {
    position: absolute;
    right: 0;
    width: 18px;
    height: 1px;
    background: currentColor;
    transition:
      top 0.22s ease,
      transform 0.22s ease;
  }

  .menu-toggle-icon i:first-child {
    top: 2px;
  }
  .menu-toggle-icon i:last-child {
    top: 9px;
  }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon i:first-child {
    top: 6px;
    transform: rotate(45deg);
  }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon i:last-child {
    top: 6px;
    transform: rotate(-45deg);
  }

  .site-nav {
    position: fixed;
    z-index: 40;
    inset: 0;
    display: flex;
    order: 4;
    margin: 0;
    padding: max(116px, 15vh) max(20px, calc((100vw - 760px) / 2));
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow-y: auto;
    border: 0;
    background:
      radial-gradient(
        circle at 82% 18%,
        rgba(140, 82, 255, 0.18),
        transparent 28%
      ),
      radial-gradient(
        circle at 12% 84%,
        rgba(224, 173, 69, 0.07),
        transparent 24%
      ),
      rgba(9, 11, 14, 0.99);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition:
      opacity 0.22s ease,
      visibility 0.22s ease,
      transform 0.22s ease;
  }

  .site-nav::before {
    content: "";
    position: absolute;
    top: 76px;
    right: 20px;
    left: 20px;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      var(--line) 12% 88%,
      transparent
    );
  }

  .site-nav::after {
    content: "RDM / DESIGN + CODE";
    position: absolute;
    right: 20px;
    bottom: 24px;
    color: #696e78;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.16em;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .site-nav a {
    width: min(100%, 620px);
    min-height: 64px;
    padding: 15px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f2eee8;
    font-size: clamp(2rem, 6vw, 3.7rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
  }

  .site-nav a::before {
    display: inline-block;
    width: 34px;
    color: var(--gold);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    vertical-align: middle;
  }

  .site-nav a:nth-child(1)::before {
    content: "01";
  }
  .site-nav a:nth-child(2)::before {
    content: "02";
  }
  .site-nav a:nth-child(3)::before {
    content: "03";
  }
  .site-nav a:nth-child(4)::before {
    content: "04";
  }
  .site-nav a:nth-child(5)::before {
    content: "05";
  }
  .site-nav a::after {
    right: auto;
    bottom: 8px;
    width: 0;
  }
  .site-nav a:hover::after,
  .site-nav a[aria-current="page"]::after {
    width: 64px;
  }
  .nav-cta {
    display: none;
  }

  .hero {
    padding: 48px 0 50px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero h1 {
    max-width: 720px;
    font-size: clamp(3rem, 8vw, 4.6rem);
  }

  .hero-copy > p:not(.eyebrow) {
    max-width: 650px;
    font-size: 1rem;
  }

  .hero-preview {
    aspect-ratio: 16 / 9;
  }

  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service,
  .service:first-child {
    min-height: 210px;
    padding: 28px 20px;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 16px;
    border-top: 0;
    border-right: 1px solid var(--line);
    border-left: 0;
  }

  .service:first-child {
    border-left: 1px solid var(--line);
  }
  .service-icon {
    width: 40px;
    height: 40px;
  }
  .service h2 {
    font-size: 1rem;
  }
  .service p,
  .service .text-link {
    font-size: 0.78rem;
    line-height: 1.55;
  }

  .section,
  .services-strip + .section,
  .section-alt:has(.feature-grid),
  .section-alt + .section,
  .section-alt:has(.studio-grid) {
    padding: 64px 0;
  }

  .section-head,
  .services-strip + .section .section-head,
  .section-alt .section-head {
    margin-bottom: 28px;
  }

  .section h2 {
    font-size: clamp(2.1rem, 5vw, 3rem);
  }

  .projects-grid {
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .project-card {
    min-height: 0;
  }
  .project-image {
    aspect-ratio: 4 / 2.55;
  }
  .project-body {
    flex: 1;
    height: auto;
    padding: 20px;
  }
  .project-body h3 {
    margin: 0.6rem 0;
    font-size: 1.12rem;
  }
  .project-body p,
  .project-body .text-link {
    font-size: 0.8rem;
    line-height: 1.5;
  }
  .project-body .text-link {
    margin-top: 1rem;
  }

  .feature-grid,
  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-top: 1.5rem;
  }

  .feature,
  .feature:nth-child(3),
  .step,
  .step:nth-child(3) {
    min-height: 180px;
    padding: 24px;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }

  .feature:nth-child(odd),
  .step:nth-child(odd) {
    border-left: 0;
  }
  .feature:nth-child(-n + 2),
  .step:nth-child(-n + 2) {
    border-top: 0;
  }
  .feature svg {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
  }
  .feature h3,
  .step h3 {
    font-size: 1rem;
  }
  .feature p,
  .step p {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .studio-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .studio-visual {
    grid-column: 1 / -1;
    min-height: 240px;
  }

  .studio-copy p,
  .studio-copy .text-link {
    font-size: 0.84rem;
  }

  .cta {
    padding: 38px 0;
  }
  .cta-inner {
    grid-template-columns: 1fr auto;
    gap: 22px;
  }
  .cta-inner p {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.9rem;
  }

  .site-footer {
    height: auto !important;
    padding: 38px 0 22px;
    overflow: visible !important;
  }

  .footer-grid {
    height: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 44px;
  }

  .footer-grid > div:last-child {
    grid-column: auto;
  }
  .footer-brand img {
    width: min(100%, 320px);
  }
  .footer-grid h3 {
    margin-bottom: 12px;
    font-size: 0.8rem;
  }
  .footer-grid p,
  .footer-grid a,
  .footer-grid li {
    font-size: 0.78rem;
    line-height: 1.55;
  }
  .footer-grid li {
    margin: 0.4rem 0;
  }
  .footer-bottom {
    height: auto;
    margin-top: 28px;
    padding-top: 16px;
    font-size: 0.72rem;
  }

  .projects-hero,
  .services-hero,
  .about-page .about-hero,
  .contact-hero,
  .privacy-hero,
  .terms-hero,
  .not-found {
    min-height: auto;
  }

  .projects-hero-grid,
  .services-hero-grid,
  .about-page .about-hero-grid,
  .contact-hero-grid,
  .privacy-hero-grid,
  .terms-hero-grid,
  .error-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 64px 0 70px;
  }

  .projects-hero-summary,
  .services-hero-summary,
  .about-hero-summary,
  .contact-hero-note,
  .privacy-hero-summary,
  .terms-hero-summary,
  .error-routes {
    width: min(100%, 500px);
  }

  .about-story-grid,
  .about-process-grid,
  .contact-form-section .contact-grid,
  .terms-content-grid {
    grid-template-columns: 1fr;
  }

  .about-story-grid,
  .about-process-grid,
  .contact-form-section .contact-grid,
  .terms-content-grid {
    gap: 40px;
  }
  .contact-form-section .contact-details,
  .terms-index {
    position: static;
  }
}

@media (max-width: 680px) {
  .container,
  .site-header .container,
  .hero .container,
  .site-footer .container,
  .projects-page main .container,
  .services-page main .container,
  .about-page main .container,
  .contact-page main .container,
  .privacy-page main .container,
  .terms-page main .container,
  .error-page main .container {
    width: calc(100% - 32px);
  }

  .nav-wrap {
    min-height: 68px;
    gap: 8px;
  }
  .site-header .brand img {
    width: 136px;
    max-height: 52px;
  }
  .language-switcher {
    gap: 3px;
    font-size: 0.6rem;
  }
  .language-switcher button,
  .language-switcher a {
    min-width: 27px;
    min-height: 40px;
    padding: 5px 1px;
  }
  .menu-toggle {
    min-width: 84px;
    min-height: 42px;
    padding: 0.5rem 0.62rem;
    font-size: 0.76rem;
  }
  .site-nav {
    padding-inline: 20px;
  }
  .site-nav::before {
    top: 68px;
    right: 16px;
    left: 16px;
  }
  .site-nav::after {
    right: 16px;
    bottom: 18px;
  }
  .site-nav a {
    min-height: 58px;
    font-size: clamp(1.85rem, 10vw, 3rem);
  }

  .hero {
    padding: 42px 0 46px;
  }
  .hero-grid {
    gap: 30px;
  }
  .hero h1 {
    font-size: clamp(2.45rem, 12vw, 3.45rem);
    line-height: 1.01;
  }
  .hero h1 span {
    font-size: 0.5em;
    line-height: 1.25;
  }
  .hero-preview {
    aspect-ratio: 4 / 3;
  }
  .preview-copy {
    padding: 8%;
  }
  .preview-copy::before,
  .preview-copy::after {
    display: none;
  }
  .preview-copy strong {
    max-width: 82%;
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .actions,
  .case-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .actions .button,
  .case-actions .button {
    width: 100%;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
  .service,
  .service:first-child {
    min-height: 0;
    padding: 28px 0;
    border: 0;
    border-top: 1px solid var(--line);
  }
  .service:first-child {
    border-top: 0;
  }

  .section,
  .services-strip + .section,
  .section-alt:has(.feature-grid),
  .section-alt + .section,
  .section-alt:has(.studio-grid) {
    padding: 54px 0;
  }

  .section-head,
  .projects-overview-head,
  .about-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .projects-grid,
  .feature-grid,
  .process-grid,
  .studio-grid,
  .cta-inner,
  .footer-grid,
  .form-grid,
  .case-meta,
  .about-columns,
  .about-value-grid,
  .services-content > .container,
  .services-intro,
  .services-promise,
  .services-promise ul,
  .terms-index nav {
    grid-template-columns: 1fr;
  }

  .feature,
  .feature:nth-child(3),
  .step,
  .step:nth-child(3) {
    min-height: 0;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .feature:first-child,
  .step:first-child {
    border-top: 0;
  }

  .studio-visual {
    grid-column: auto;
    min-height: 220px;
  }
  .cta-inner p {
    grid-column: auto;
    grid-row: auto;
  }
  .cta .button {
    width: 100%;
  }

  .footer-grid {
    gap: 26px;
  }
  .footer-grid > div:last-child {
    grid-column: auto;
  }
  .footer-brand img {
    width: min(100%, 270px);
  }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .projects-hero,
  .services-hero,
  .about-page .about-hero,
  .contact-hero,
  .privacy-hero,
  .terms-hero,
  .not-found {
    min-height: auto;
    background-position: 62% center;
  }

  .projects-hero-grid,
  .services-hero-grid,
  .about-page .about-hero-grid,
  .contact-hero-grid,
  .privacy-hero-grid,
  .terms-hero-grid,
  .error-grid {
    gap: 28px;
    padding: 50px 0 58px;
  }

  .projects-hero h1,
  .services-hero h1,
  .about-page .about-hero-copy h1,
  .contact-hero h1,
  .privacy-hero h1,
  .terms-hero h1,
  .error-copy h1 {
    font-size: clamp(2.45rem, 12vw, 3.45rem);
    line-height: 1;
  }

  .projects-hero-summary,
  .services-hero-summary,
  .about-hero-summary,
  .contact-hero-note,
  .privacy-hero-summary,
  .terms-hero-summary,
  .error-routes {
    padding: 20px;
  }

  .services-content,
  .contact-form-section,
  .privacy-content-section,
  .terms-content-section {
    padding: 56px 0 62px;
  }

  .services-content .service-detail {
    min-height: 0;
    padding: 25px 22px;
  }
  .services-promise {
    padding: 25px 22px;
  }
  .contact-form-panel {
    padding: 24px 18px;
  }
  .contact-form-panel button[type="submit"] {
    width: 100%;
  }
  .terms-block {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }
  .terms-contact {
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
  }
  .terms-contact .button {
    width: 100%;
  }

  .case-masthead {
    padding: 48px 0 58px;
  }
  .case-title {
    font-size: clamp(3rem, 15vw, 4.65rem);
  }
  .case-lead {
    margin-top: 22px;
    font-size: 1rem;
  }
  .case-facts,
  .case-principles {
    grid-template-columns: 1fr;
  }
  .case-facts > div,
  .case-facts > div:first-child {
    padding: 18px;
    border-top: 1px solid var(--case-line);
    border-left: 0;
  }
  .case-facts > div:first-child {
    border-top: 0;
  }
  .case-story,
  .case-showcase {
    padding: 62px 0;
  }
  .case-story h2,
  .case-showcase h2 {
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }
  .case-principle,
  .case-principle + .case-principle {
    padding: 24px 0;
    border-top: 1px solid var(--case-line);
    border-left: 0;
  }
  .case-showcase-image,
  .case-showcase-image img,
  .case-legacy .case-showcase-image,
  .case-legacy .case-showcase-image img {
    min-height: 280px;
  }
  .case-visual figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .case-next .container {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .container,
  .site-header .container,
  .hero .container,
  .site-footer .container,
  .projects-page main .container,
  .services-page main .container,
  .about-page main .container,
  .contact-page main .container,
  .privacy-page main .container,
  .terms-page main .container,
  .error-page main .container {
    width: calc(100% - 24px);
  }

  .site-header .brand img {
    width: 118px;
  }
  .language-switcher span {
    display: none;
  }
  .language-switcher {
    gap: 0;
  }
  .language-switcher button,
  .language-switcher a {
    min-width: 25px;
  }
  .menu-toggle {
    min-width: 52px;
    padding-inline: 0.5rem;
  }
  .menu-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .menu-toggle,
  .menu-toggle-icon i {
    transition: none !important;
  }
}
