/* Plan M Interieur. One stylesheet, no build step. The design and its reasons are in DESIGN.md.
   The recurring shape is the logo itself: a black M standing in front of a coloured field that sticks out
   on the left, above and below. Photos take the place of the M (.motief). */

@font-face {
  font-family: "Jost";
  src: url("/static/fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --wit: #fff;
  --zwart: #000;                /* the M of the logo */
  --tekst: #1d2730;
  --zacht: #55626c;
  --blauw: #5f8fb4;             /* Pantone 7454 C, the field of the logo */
  --blauw-licht: #dfe8f0;
  --blauw-diep: #2e5d80;        /* the same blue, dark enough for text on white (7:1) */
  --zand: #d9c89e;              /* Pantone 7501 C */
  --zand-licht: #f1ebdb;
  --lijn: rgb(0 0 0 / .14);

  --letter: "Jost", "Century Gothic", "Avenir Next", Avenir, system-ui, sans-serif;
  --kantlijn: clamp(1.25rem, 5vw, 4rem);
  --breed: 78rem;
  --ruim: clamp(4.5rem, 10vw, 9rem);
  --rond-foto: clamp(1.25rem, 3.2vw, 2.75rem);
  --rond-vlak: clamp(2rem, 6vw, 4.75rem);
  --kolomwit: clamp(1.25rem, 2.4vw, 2.25rem);
  --zacht-uit: cubic-bezier(.2, .75, .25, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--wit);
  color: var(--tekst);
  font: 400 1.125rem/1.6 var(--letter);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
@media (min-width: 48rem) { body { font-size: 1.1875rem; } }

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
address { font-style: normal; }

:focus-visible { outline: 3px solid var(--blauw-diep); outline-offset: 3px; border-radius: 2px; }

/* ---------- type ---------- */

h1, h2 { color: var(--zwart); font-weight: 300; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 1.3rem + 4.4vw, 4.6rem); line-height: 1.05; }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); line-height: 1.1; }
h3 { color: var(--zwart); font-size: clamp(1.5rem, 1.3rem + .8vw, 1.9rem); font-weight: 400; line-height: 1.2; text-wrap: balance; }
p { max-width: 36em; text-wrap: pretty; }
.lead { font-size: clamp(1.2rem, 1.1rem + .45vw, 1.4rem); line-height: 1.5; max-width: 31em; }

.tekstlink {
  text-decoration: underline;
  text-decoration-color: var(--blauw);
  text-decoration-thickness: 2px;
  text-underline-offset: .28em;
  transition: text-decoration-color .2s, color .2s;
}
.tekstlink:hover { color: var(--blauw-diep); text-decoration-color: currentColor; }

.knop {
  display: inline-flex;
  align-items: center;
  padding: .72em 1.5em .78em;
  border-radius: 99rem;
  background: var(--zwart);
  color: var(--wit);
  font-weight: 500;
  text-decoration: none;
  transition: background-color .25s;
}
.knop:hover { background: var(--blauw-diep); }
.knop:focus-visible { border-radius: 99rem; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .6em 1.2em;
  border-radius: 99rem;
  background: var(--zwart);
  color: var(--wit);
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- frame ---------- */

.binnen { width: min(100% - 2 * var(--kantlijn), var(--breed)); margin-inline: auto; }
.sectie { padding-block: 0 var(--ruim); }

.kop { padding-block: clamp(1rem, 2.4vw, 1.75rem); }
.kop-binnen { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kop-logo { flex: none; display: block; border-radius: .5rem; }
.kop-logo img { width: auto; height: clamp(4rem, 7vw, 6rem); }
.menu ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem clamp(1rem, 2.6vw, 2.25rem); }
.menu a {
  display: block;
  padding: .45em 0 .3em;
  border-bottom: 2px solid transparent;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: border-color .2s;
}
.menu a:hover { border-color: var(--blauw); }

.voet { border-top: 1px solid var(--lijn); padding-block: 2rem 2.75rem; color: var(--zacht); font-size: 1rem; }
.voet ul { display: flex; flex-wrap: wrap; gap: .35rem 2.25rem; }

/* ---------- the logo's shape, with a photo in the place of the M ---------- */

/* Measured from the logo: the field is 58% as wide as the M, sticks out 6.3% on the left and about 6% above,
   and continues below the M, where the logo has its name. Here the caption title stands on that lower part.
   Three columns: the part of the field that sticks out, the part behind the photo, the rest of the photo. */
.motief {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: grid;
  grid-template-columns: 6.3% 51.7% minmax(0, 1fr);
  grid-template-rows: auto auto auto;
}
.motief-vlak {
  position: absolute;
  z-index: -1;
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  inset: 0;
  border-radius: 6.5rem;
  border-radius: 20cqw;
  background: var(--blauw);
  transform-origin: 50% 42%;
}
.motief-zand .motief-vlak { background: var(--zand); }
.motief-beeld { grid-column: 2 / 4; grid-row: 1; margin-top: 6%; border-radius: var(--rond-foto); overflow: hidden; }
.motief-beeld img { width: 100%; }
.motief-tekst {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
  align-items: start;
  font-size: .95rem;
  line-height: 1.4;
}
.motief-tekst strong { grid-column: 1; grid-row: 1; padding: .9rem 1rem 1.5rem 0; color: var(--zwart); font-size: 1.0625rem; font-weight: 500; }
.motief-tekst > span { grid-column: 1 / 3; grid-row: 2; padding-top: .85rem; color: var(--zacht); }   /* narrow: under the field */
@container (min-width: 30rem) {
  .motief-tekst > span { grid-column: 2; grid-row: 1; padding: .95rem 0 1.5rem 1.1rem; }               /* wide: next to it */
}

/* The field comes out from behind the photo: once when the page opens, and with the scroll further down. */
@keyframes vlak-uit { from { transform: translateX(11%) scaleY(.6); } }
@keyframes tekst-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .opening .motief-vlak { animation: vlak-uit 1.1s var(--zacht-uit) .15s backwards; }
  .opening .motief-tekst { animation: tekst-in .7s ease .85s backwards; }
  @supports (animation-timeline: view()) {
    .project .motief-vlak { animation: vlak-uit linear backwards; animation-timeline: view(); animation-range: entry 10% cover 38%; }
  }
}

/* ---------- photos ---------- */

.foto-raam { position: relative; border-radius: var(--rond-foto); overflow: hidden; }
.foto-raam img { width: 100%; }
.foto figcaption, .vergelijk-bij {
  margin-top: .85rem;
  color: var(--zacht);
  font-size: .95rem;
  line-height: 1.45;
  max-width: 34em;
}

/* The short description that stands on a photo (Marnix: say on the first photo what you are looking at). */
.op-foto {
  position: absolute;
  bottom: clamp(.6rem, 1.6vw, 1.1rem);
  max-width: min(48%, 17rem);
  padding: .42em .95em .5em;
  border-radius: 1.25em;
  background: var(--wit);
  color: var(--zwart);
  font-size: clamp(.78rem, .72rem + .28vw, .94rem);
  line-height: 1.25;
}
.op-foto b { font-weight: 500; }
.op-foto-voor { left: clamp(.6rem, 1.6vw, 1.1rem); }
.op-foto-na { right: clamp(.6rem, 1.6vw, 1.1rem); background: var(--zwart); color: var(--wit); }

/* ---------- voor en na in one frame ---------- */

/* Two photos of the same spot on top of each other; --pos is where the 'voor' photo ends. The range input is the
   real control (keyboard, screen reader); dragging is added by site.js. Without scripts zonder-script.css puts the
   two photos next to each other. */
.vergelijk {
  position: relative;
  aspect-ratio: var(--verhouding, 4 / 3);
  border-radius: var(--rond-foto);
  overflow: hidden;
  background: var(--blauw-licht);
  cursor: ew-resize;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  --pos: 50%;
}
.vergelijk[data-intro] { --pos: 0%; }
.motief-beeld .vergelijk { border-radius: 0; }
.laag { position: absolute; inset: 0; pointer-events: none; }
.laag picture, .laag img { display: block; width: 100%; height: 100%; }
.laag img { object-fit: cover; }
.laag-voor { z-index: 1; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.vergelijk-schuif {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.vergelijk-greep { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.vergelijk-greep::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: var(--wit);
}
.vergelijk-greep::after {
  content: "";
  position: absolute;
  top: 50%;
  left: clamp(2rem, var(--pos), 100% - 2rem);
  width: 3.25rem;
  height: 3.25rem;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--wit) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 7.5 4 12l4.5 4.5M15.5 7.5 20 12l-4.5 4.5'/%3E%3C/svg%3E") center / 1.55rem no-repeat;
  box-shadow: 0 1px 2px rgb(0 0 0 / .25), 0 6px 20px rgb(0 0 0 / .2);
  transition: scale .2s var(--zacht-uit);
}
.vergelijk:hover .vergelijk-greep::after, .vergelijk.is-vast .vergelijk-greep::after { scale: 1.08; }
.vergelijk-schuif:focus-visible + .vergelijk-greep::after { outline: 3px solid var(--wit); outline-offset: 3px; box-shadow: 0 0 0 3px var(--zwart); }

/* ---------- opening ---------- */

.opening { padding-block: clamp(1.25rem, 3.5vw, 3.5rem) var(--ruim); }
.opening-raster { display: grid; gap: clamp(2.75rem, 6vw, 5rem); align-items: center; }
.opening-tekst > * + * { margin-top: 1.4rem; }
.acties { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.9rem; }
.opening-tekst .acties { margin-top: 2.1rem; }
@media (min-width: 60rem) {
  .opening-raster { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

/* ---------- werk ---------- */

.sectie-kop > * + * { margin-top: 1rem; }
.werk .sectie-kop { margin-bottom: clamp(3rem, 7vw, 5.5rem); }

.project {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--kolomwit);
  row-gap: clamp(2.5rem, 5.5vw, 4.75rem);
  align-items: start;
}
.project + .project { margin-top: var(--ruim); }
.project > * { grid-column: 1 / -1; }
.project-tekst > * + * { margin-top: 1rem; }
.project-tekst .project-jaar { margin-top: .3rem; color: var(--zacht); }
.eetkamer-voor { width: 68%; margin-left: auto; }

@media (min-width: 60rem) {
  .project-deventer .project-tekst { grid-column: 1 / 6; grid-row: 1; padding-top: clamp(0rem, 3vw, 3rem); }
  .project-deventer .eetkamer-na { grid-column: 7 / 13; grid-row: 1 / 3; }
  .project-deventer .eetkamer-voor { grid-column: 2 / 6; grid-row: 2; align-self: end; width: auto; margin-left: 0; margin-bottom: 1.6rem; }
  .project-deventer .wand { grid-column: 1 / 6; grid-row: 3; }
  .project-deventer .kastenwand { grid-column: 6 / 13; grid-row: 3; align-self: end; }
  .project-deventer .tuinhuis { grid-column: 1 / 8; grid-row: 4; }
  .project-deventer .houtopslag { grid-column: 9 / 13; grid-row: 4; }

  .project-badkamer { align-items: center; }
  .project-badkamer .badkamer { grid-column: 2 / 7; grid-row: 1; }
  .project-badkamer .project-tekst { grid-column: 8 / 13; grid-row: 1; }

  .project-woonhuis .project-tekst { grid-column: 1 / 7; grid-row: 1; }
  .project-woonhuis .eetkamer { grid-column: 1 / 9; grid-row: 2 / 4; }
  .project-woonhuis .keuken { grid-column: 9 / 13; grid-row: 2; }
  .project-woonhuis .wandmeubel { grid-column: 9 / 13; grid-row: 3; }
}

/* ---------- diensten ---------- */

.paneel {
  border-radius: var(--rond-vlak);
  background: var(--blauw-licht);
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 6vw, 5rem) clamp(2.75rem, 6vw, 5.25rem);
}
.paneel > p { margin-top: 1rem; }
.dienstenlijst { display: grid; gap: 2rem clamp(1.5rem, 3vw, 3rem); margin-top: clamp(2.25rem, 4.5vw, 3.75rem); }
.dienstenlijst dt { color: var(--zwart); font-size: clamp(1.5rem, 1.3rem + .8vw, 1.9rem); font-weight: 300; line-height: 1.2; }
.dienstenlijst dd { margin-top: .6rem; font-size: 1.0625rem; line-height: 1.5; }
@media (min-width: 40rem) { .dienstenlijst { grid-template-columns: 1fr 1fr; } }
@media (min-width: 70rem) { .dienstenlijst { grid-template-columns: repeat(4, 1fr); } }

/* ---------- over ---------- */

.over-raster { display: grid; gap: 1.5rem; }
@media (min-width: 60rem) {
  .over-raster { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--kolomwit); align-items: baseline; }
  .over-raster h2 { grid-column: 1 / 6; }
  .over-tekst { grid-column: 6 / 13; }
}

/* ---------- contact: his own business card ---------- */

.contact-raster { display: grid; gap: 2.5rem; align-items: center; }
.contact-tekst > * + * { margin-top: 1rem; }
.registratie { color: var(--zacht); font-size: 1rem; }
.kaartje {
  display: grid;
  justify-items: center;
  gap: .3rem;
  border-radius: var(--rond-vlak);
  background: var(--zand-licht);
  padding: clamp(2.25rem, 6vw, 3.5rem) clamp(1.25rem, 4vw, 3rem) clamp(2.5rem, 6vw, 3.75rem);
  text-align: center;
}
.kaartje-logo { width: min(48%, 11.5rem); margin-bottom: 1.5rem; }
.kaartje-naam { color: var(--zwart); font-size: clamp(1.5rem, 1.3rem + .8vw, 1.9rem); font-weight: 300; line-height: 1.2; margin-bottom: .5rem; }
.kaartje span { display: block; }
.kaartje a { text-decoration-color: var(--zwart); text-decoration-thickness: 1px; text-underline-offset: .3em; }
.kaartje a:hover { color: var(--blauw-diep); text-decoration-color: currentColor; }
.kaartje-tel { margin-top: .5rem; }
@media (min-width: 60rem) {
  .contact-raster { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--kolomwit); }
  .contact-tekst { grid-column: 1 / 6; }
  .kaartje { grid-column: 7 / 12; }
}

/* ---------- text pages (privacy, 404) ---------- */

.tekstpagina { padding-block: clamp(1.5rem, 4vw, 4rem) var(--ruim); }
.tekstpagina .binnen { max-width: 44rem; }
.tekstpagina h1 { font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.5rem); }
.tekstpagina h2 { margin-top: 2.75rem; font-size: clamp(1.4rem, 1.25rem + .6vw, 1.7rem); font-weight: 400; letter-spacing: 0; }
.tekstpagina p { margin-top: .9rem; }
.tekstpagina .bijgewerkt { color: var(--zacht); }
.tekstpagina .acties { margin-top: 2.25rem; }
.nw { white-space: nowrap; }

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