/* Haerkens Timmerwerken */

@font-face {
  font-family: "Barlow Condensed";
  src: url("../assets/fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../assets/fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree-var.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --paper: #f1f0ec;
  --paper-2: #e6e4dd;
  --ink: #1c1d1f;
  --ink-2: #45464a;
  --line: #cfccc3;
  --oak: #8a5a2b;
  --rule: #f2c230;
  --rule-deep: #d9a915;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Figtree", system-ui, sans-serif;

  --wrap: min(1320px, 100% - 2 * var(--gutter));
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 4px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(242, 194, 48, 0.35);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-family: var(--display); font-weight: 700; line-height: 0.95; letter-spacing: -0.01em; text-transform: uppercase; }
p { margin: 0; }

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

.wrap { width: var(--wrap); margin-inline: auto; }
.h2 { font-size: clamp(2.4rem, 5vw, 4.25rem); max-width: 16ch; text-wrap: balance; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

/* ---------- Duimstok (folding ruler) ---------- */
.ruler {
  --tick: rgba(28, 29, 31, 0.85);
  background-color: var(--rule);
  background-image:
    /* joints of the folding ruler, every 200px */
    linear-gradient(90deg, rgba(28, 29, 31, 0.28) 0 2px, transparent 2px),
    /* 10 cm ticks */
    repeating-linear-gradient(90deg, var(--tick) 0 2px, transparent 2px 100px),
    /* 5 cm ticks */
    repeating-linear-gradient(90deg, var(--tick) 0 1.5px, transparent 1.5px 50px),
    /* 1 cm ticks */
    repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 10px);
  background-size: 200px 100%, 100% 62%, 100% 44%, 100% 26%;
  background-repeat: repeat-x;
  background-position: 0 0;
}

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 6px; z-index: 60; pointer-events: none;
}
.progress__fill {
  height: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background-size: 200px 100%, 100% 100%, 100% 70%, 100% 40%;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border: 2px solid transparent; border-radius: var(--radius);
  font: 700 1.125rem/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms, color 200ms, border-color 200ms, box-shadow 200ms;
}
.btn:active { transform: scale(0.97); transition-duration: 80ms; }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 1rem; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #000; box-shadow: 0 8px 24px -10px rgba(28, 29, 31, 0.55); }
.btn--rule { background: var(--rule); color: var(--ink); }
.btn--rule:hover { background: var(--rule-deep); }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(241, 240, 236, 0.82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(28, 29, 31, 0.08);
}
.nav__inner {
  width: var(--wrap); margin-inline: auto; height: 72px;
  display: flex; align-items: center; gap: 24px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.nav__brand img { width: 58px; height: auto; }
.nav__brand span { font: 700 1.05rem/0.95 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-weight: 600; font-size: 0.975rem; text-decoration: none; padding: 8px 0;
  background: linear-gradient(var(--rule-deep), var(--rule-deep)) 0 100% / 0 3px no-repeat;
  transition: background-size 260ms var(--ease-out);
}
.nav__links a:hover { background-size: 100% 3px; }
.nav__toggle { display: none; }

@media (max-width: 860px) {
  .nav__inner { height: 64px; gap: 12px; }
  .nav__brand img { width: 48px; }
  .nav__toggle {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
    background: transparent; border: 2px solid var(--ink); border-radius: var(--radius);
    font: 700 1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); cursor: pointer;
  }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 20px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    transform-origin: top; transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 200ms, transform 260ms var(--ease-out), visibility 0s 260ms;
  }
  .nav__links.is-open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .nav__links a { display: block; padding: 14px 0; font-size: 1.25rem; font-family: var(--display); text-transform: uppercase; font-weight: 700; }
  .btn--sm span { display: none; }
  .btn--sm { padding: 0 13px; }
}
@media (max-width: 400px) {
  .nav__brand span { font-size: 0.95rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 48fr) minmax(0, 52fr);
  min-height: calc(100dvh - 72px);
  max-height: 900px;
}
.hero__copy {
  align-self: center;
  padding: 48px var(--gutter) 88px max(var(--gutter), calc((100vw - 1320px) / 2));
}
.hero__title { font-size: clamp(3rem, 4.7vw, 5.25rem); line-height: 0.92; }
.hero__title .line > span { white-space: nowrap; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title .line > span { display: inline-block; }
.hero__rotator-line { margin-top: 0.08em; }
.hero__rotator {
  display: inline-block; position: relative;
  background: var(--rule); color: var(--ink);
  padding: 0.08em 0.2em 0.02em; border-radius: var(--radius);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hero__word { display: inline-block; white-space: nowrap; }
.hero__sub { margin-top: 28px; max-width: 38ch; font-size: 1.1875rem; color: var(--ink-2); }
.hero__cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero__media { margin: 0; position: relative; overflow: hidden; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 30%; }
.hero__ruler { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; transform-origin: 0 50%; }

@media (max-width: 959px) {
  .hero { grid-template-columns: 1fr; min-height: 0; max-height: none; }
  .hero__copy { padding: 40px var(--gutter) 36px; order: 1; }
  .hero__media { order: 2; aspect-ratio: 4 / 3.4; }
  .hero__ruler { position: relative; order: 3; height: 24px; }
  .hero__title { font-size: clamp(2.5rem, 10.5vw, 4rem); }
  .hero__title .line > span { white-space: normal; }
  .hero__sub { font-size: 1.0625rem; margin-top: 20px; }
}

/* ---------- Services ---------- */
.services { padding: clamp(80px, 10vw, 140px) 0; }
.services .h2 { margin-bottom: clamp(40px, 5vw, 64px); }
.services__grid {
  display: grid; gap: clamp(16px, 2vw, 24px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto auto;
}
.svc { background: #fbfaf7; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 rgba(28, 29, 31, 0.06), 0 12px 32px -24px rgba(60, 50, 30, 0.35); }
.svc--tall { grid-row: span 2; display: flex; flex-direction: column; }
.svc--tall .svc__img { flex: 1; min-height: 360px; }
.svc--wide { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.svc--wide .svc__img { position: relative; min-height: 300px; }
.svc--wide .svc__img img { position: absolute; inset: 0; }
.svc--wide .svc__body { align-self: center; }
.svc__img { overflow: hidden; background: var(--paper-2); }
.svc__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.svc:hover .svc__img img { transform: scale(1.04); }
.svc__body { padding: clamp(24px, 3vw, 36px); }
.svc h3 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); margin-bottom: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 7px 12px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 0.975rem; font-weight: 500; background: var(--paper);
}
.svc__note { margin-top: 20px; color: var(--ink-2); max-width: 40ch; }

@media (max-width: 959px) {
  .services__grid { grid-template-columns: 1fr; }
  .svc--tall { grid-row: auto; }
  .svc--tall .svc__img { aspect-ratio: 4 / 3; min-height: 0; flex: none; }
  .svc--wide { grid-template-columns: 1fr; }
  .svc--wide .svc__img { aspect-ratio: 16 / 10; min-height: 0; }
}

/* ---------- About ---------- */
.about { padding: clamp(80px, 10vw, 140px) 0; background: var(--paper-2); }
.about__grid {
  display: grid; gap: clamp(32px, 5vw, 72px);
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 3.2fr);
  align-items: start;
}
.about__facts { display: grid; gap: 40px; position: sticky; top: 120px; }
.fact { display: grid; gap: 6px; border-top: 3px solid var(--ink); padding-top: 14px; }
.fact__num { font-variant-numeric: tabular-nums; font: 700 clamp(4.5rem, 8vw, 7.5rem)/0.85 var(--display); letter-spacing: -0.02em; }
.fact__label { font-weight: 600; color: var(--ink-2); }
.about__text .h2 { margin-bottom: 28px; }
.about__text p + p { margin-top: 18px; }
.about__text p { max-width: 58ch; }
.about__sign { margin-top: 28px !important; font: 700 1.5rem/1 var(--display); text-transform: uppercase; color: var(--oak); }
.about__img { margin: 0; border-radius: var(--radius); overflow: hidden; margin-top: clamp(0px, 8vw, 120px); }
.about__img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

@media (max-width: 959px) {
  .about__grid { grid-template-columns: 1fr 1fr; }
  .about__facts { position: static; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 20px; }
  .about__text { grid-column: 1 / -1; }
  .about__img { grid-column: 1 / -1; margin-top: 0; }
  .about__img img { aspect-ratio: 4 / 3; }
}

/* ---------- Before / after ---------- */
.compare { padding: clamp(80px, 10vw, 140px) 0; }
.compare__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.compare__text p { margin-top: 20px; max-width: 38ch; color: var(--ink-2); font-size: 1.125rem; }
.ba {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 720 / 860; max-height: 80vh; justify-self: end; width: 100%;
  max-width: 620px; touch-action: pan-y; user-select: none; background: var(--paper-2);
}
.ba__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 4px; margin-left: -2px;
  background: var(--rule); pointer-events: none;
}
.ba__handle span {
  position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: var(--rule); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 160ms var(--ease-out);
}
.ba__handle span::before, .ba__handle span::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -7px;
  border: 7px solid transparent;
}
.ba__handle span::before { left: 7px; border-right-color: var(--ink); }
.ba__handle span::after { right: 7px; border-left-color: var(--ink); }
.ba.is-dragging .ba__handle span { transform: scale(1.1); }
.ba__label {
  position: absolute; top: 16px; padding: 6px 12px; border-radius: var(--radius);
  background: rgba(28, 29, 31, 0.78); color: #fff;
  font: 700 1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; pointer-events: none;
}
.ba__label--l { left: 16px; }
.ba__label--r { right: 16px; }
.ba__range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
}
.ba:has(.ba__range:focus-visible) { outline: 3px solid var(--rule-deep); outline-offset: 4px; }

@media (max-width: 959px) {
  .compare__grid { grid-template-columns: 1fr; }
  .ba { justify-self: stretch; max-width: none; max-height: none; }
}

/* ---------- Work (horizontal pan) ---------- */
.work { padding: clamp(80px, 10vw, 120px) 0 clamp(56px, 6vw, 80px); background: var(--ink); color: var(--paper); overflow: hidden; }
.work__head { margin-bottom: clamp(32px, 4vw, 56px); }
.work .h2 { max-width: 20ch; }
.work__track { display: flex; gap: clamp(12px, 1.6vw, 24px); padding-inline: max(var(--gutter), calc((100vw - 1320px) / 2)); width: max-content; align-items: flex-end; }
.shot { flex: none; }
.shot img { border-radius: var(--radius); object-fit: cover; height: min(62vh, 560px); width: auto; }
.shot--l img { aspect-ratio: 4 / 3; }
.shot--p img { aspect-ratio: 3 / 4; }
.shot p { margin-top: 12px; font: 600 1.125rem/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.04em; color: #d6d4cd; }

@media (max-width: 959px) {
  .work__viewport { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .work__viewport::-webkit-scrollbar { display: none; }
  .shot { scroll-snap-align: start; scroll-margin-left: var(--gutter); }
  .shot img { height: 58vw; max-height: 420px; }
  .shot--p img { height: 58vw; }
}

/* ---------- Contact ---------- */
.contact { position: relative; background: var(--ink); color: var(--paper); padding: 0 0 clamp(80px, 10vw, 120px); }
.contact__ruler { height: 30px; margin-bottom: clamp(64px, 8vw, 112px); transform-origin: 0 50%; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); }
.contact__lead { margin: 20px 0 36px; color: #d6d4cd; max-width: 38ch; font-size: 1.125rem; }
.contact__phone {
  display: inline-block; font: 700 clamp(2.6rem, 5.5vw, 4.5rem)/1 var(--display);
  color: var(--rule); text-decoration: none; letter-spacing: 0.01em;
  background: linear-gradient(var(--rule), var(--rule)) 0 100% / 0 4px no-repeat; padding-bottom: 6px;
  transition: background-size 300ms var(--ease-out);
}
.contact__phone:hover { background-size: 100% 4px; }
.contact__mail { display: block; margin-top: 14px; font-size: 1.1875rem; font-weight: 600; text-underline-offset: 5px; overflow-wrap: anywhere; }
.contact__mail:hover { color: var(--rule); }
.contact__addr { margin-top: 32px; font-style: normal; color: #d6d4cd; line-height: 1.7; }

.form { display: grid; gap: 18px; align-content: start; background: #26272a; padding: clamp(24px, 3vw, 40px); border-radius: var(--radius); }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 0.975rem; color: #ecebe6; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--paper);
  background: #1c1d1f; border: 1.5px solid #6d6e72; border-radius: var(--radius);
  transition: border-color 200ms;
}
.field input:hover, .field textarea:hover { border-color: #9a9ba0; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--rule); outline-offset: 1px; border-color: var(--rule); }
.field textarea { resize: vertical; min-height: 120px; }
.form .btn { justify-self: start; margin-top: 6px; }
.form__msg { min-height: 1.6em; color: var(--rule); font-weight: 600; }

@media (max-width: 959px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__ruler { height: 24px; }
}

/* ---------- Footer ---------- */
.footer { background: #141517; color: #bdbbb4; padding: 40px 0; font-size: 0.95rem; }
.footer__grid { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 32px; align-items: center; }
.footer__grid img { width: 72px; background: #f1f0ec; border-radius: var(--radius); padding: 6px; }
.footer a { text-underline-offset: 4px; }
.footer a:hover { color: var(--rule); }
.footer__copy { justify-self: end; }
@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr; gap: 16px; }
  .footer__copy { justify-self: start; }
}

/* ---------- Motion baseline ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
