/* Tekenburo Kanon. Basis: IBM Carbon-structuur (rechte hoeken, Plex, strak grid),
   kleuren uit de huisstijl: antraciet, aluminium, wit. Oranje alleen in het logo en de focusring. */

@import url("../fonts.css");

:root {
  --canvas: #f4f4f2;
  --surface: #eaeae7;
  --surface-2: #dfdfdb;
  --ink: #151617;
  --ink-2: #4b4e52;
  --ink-3: #6b6e72;
  --line: #d3d3cf;
  --line-strong: #151617;
  --btn: #151617;
  --btn-ink: #f4f4f2;
  --btn-hover: #2e3033;
  --accent: #ff4000;
  --focus: #e03800;
  --header-bg: rgb(244 244 242 / 0.78);

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --header-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #131415;
    --surface: #1c1d1f;
    --surface-2: #26282a;
    --ink: #ececea;
    --ink-2: #b4b6b8;
    --ink-3: #8f9295;
    --line: #2f3134;
    --line-strong: #ececea;
    --btn: #ececea;
    --btn-ink: #131415;
    --btn-hover: #ffffff;
    --focus: #ff5a1f;
    --header-bg: rgb(19 20 21 / 0.78);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--canvas); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 30;
  background: var(--btn); color: var(--btn-ink); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 1.125em; height: 1.125em; flex: none; fill: currentColor; }

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 12px 20px;
  border: 1px solid var(--btn); border-radius: 0;
  background: var(--btn); color: var(--btn-ink);
  font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn:active { transform: scale(0.97); }
.btn .icon { transition: transform 240ms var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.btn--small { min-height: 40px; padding: 8px 14px; font-size: 0.875rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand__icon { width: 38px; height: auto; }
.brand__word { width: 96px; height: 43px; }
.nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav a:not(.btn) {
  position: relative; text-decoration: none; font-size: 0.9375rem; color: var(--ink-2);
  padding-block: 6px; transition: color 160ms ease;
}
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 260ms var(--ease);
}
.nav a:not(.btn):hover { color: var(--ink); }
.nav a:not(.btn):hover::after { transform: scaleX(1); }
.menu-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: 0; cursor: pointer;
}
.menu-toggle .icon { width: 22px; height: 22px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 880px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--canvas); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden;
    transition: opacity 200ms ease, transform 260ms var(--ease), visibility 0s linear 260ms;
  }
  .nav.is-open {
    opacity: 1; transform: none; pointer-events: auto; visibility: visible;
    transition: opacity 200ms ease, transform 260ms var(--ease), visibility 0s;
  }
  .nav a:not(.btn) { padding: 14px 0; font-size: 1.125rem; color: var(--ink); border-bottom: 1px solid var(--line); }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn { margin-top: 20px; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(48px, 7vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: center; }
.hero__text { grid-column: 1 / span 6; }
.hero h1 {
  font-weight: 300; font-size: clamp(2.375rem, 4vw, 3.5rem);
  line-height: 1.1; letter-spacing: -0.025em; max-width: 18ch; text-wrap: balance;
}
.hero__sub { margin-top: 24px; max-width: 42ch; font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); line-height: 1.55; color: var(--ink-2); }
.hero__ctas { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero__drawing { grid-column: 7 / span 6; }

.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(8px, 1.4vw, 16px);
}
.sheet svg { display: block; width: 100%; height: auto; overflow: visible; }
.d-line { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.d-thick { stroke-width: 2.4; }
.d-thin { fill: none; stroke: var(--ink-3); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.d-fold { fill: none; stroke: var(--ink-2); stroke-width: 0.9; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.d-cut { fill: none; stroke: var(--ink-3); stroke-width: 0.9; stroke-dasharray: 14 3 2 3; vector-effect: non-scaling-stroke; }
.d-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.d-text { font-family: var(--mono); font-size: 11px; fill: var(--ink-2); letter-spacing: 0.04em; }
.d-text--small { font-size: 9.5px; fill: var(--ink-3); }
.d-text--strong { font-weight: 500; fill: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .js .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s var(--ease) forwards; animation-delay: calc(300ms + var(--i, 0) * 110ms); }
  .js .appear { opacity: 0; animation: appear 700ms ease forwards; animation-delay: calc(300ms + var(--i, 0) * 110ms); }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes appear { to { opacity: 1; } }
}

@media (max-width: 960px) {
  .hero__text, .hero__drawing { grid-column: 1 / -1; }
  .hero__drawing { margin-top: 24px; }
}

/* ---------- Panorama ---------- */
.panorama { overflow: hidden; height: clamp(180px, 24vw, 380px); background: var(--surface-2); }
.panorama img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .panorama img { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 60%; }
    @keyframes settle { from { transform: scale(1.12); } to { transform: scale(1); } }
  }
}

/* ---------- Secties ---------- */
.section { padding-block: clamp(72px, 10vw, 136px); }
.section--tint { background: var(--surface); }
.section-title { font-weight: 300; font-size: clamp(2rem, 3.4vw, 2.875rem); line-height: 1.12; letter-spacing: -0.02em; }
.section-intro { margin-top: 16px; max-width: 52ch; color: var(--ink-2); font-size: 1.0625rem; }

/* Over */
.lead {
  font-weight: 300; font-size: clamp(1.625rem, 2.9vw, 2.5rem); line-height: 1.25; letter-spacing: -0.015em;
  max-width: 30ch; text-wrap: pretty;
}
.about__grid {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px;
  border-top: 1px solid var(--line-strong); padding-top: 28px;
}
.about__body { grid-column: 1 / span 5; color: var(--ink-2); font-size: 1.0625rem; max-width: 46ch; }
.facts { grid-column: 7 / span 6; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 6px; }
.facts dt { order: 2; font-size: 0.875rem; color: var(--ink-2); line-height: 1.4; }
.facts dd { order: 1; margin: 0; font-family: var(--mono); font-size: clamp(1.25rem, 1.8vw, 1.5rem); font-weight: 500; letter-spacing: -0.01em; }
@media (max-width: 860px) {
  .about__body, .facts { grid-column: 1 / -1; }
  .facts { margin-top: 12px; }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; gap: 20px; }
}

/* Werkzaamheden */
.work { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.work__media { grid-column: 1 / span 5; position: sticky; top: calc(var(--header-h) + 32px); }
.work__media figure { margin: 0; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 5; }
.work__media img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.work__content { grid-column: 7 / span 6; }
.services { list-style: none; margin: 40px 0 0; padding: 0; }
.service { padding-block: 28px; border-top: 1px solid var(--line); }
.service h3 { font-size: 1.375rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.service p { margin-top: 8px; color: var(--ink-2); max-width: 46ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em;
  padding: 4px 8px; border: 1px solid var(--line); color: var(--ink-2);
}
.delivery {
  margin-top: 8px; padding: 24px; background: var(--canvas); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.delivery p { max-width: 34ch; }
.formats { display: flex; gap: 10px; }
.format {
  display: grid; place-items: center; width: 64px; height: 76px;
  border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 0.875rem; font-weight: 500;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  position: relative;
}
.format::after {
  content: ""; position: absolute; top: -1px; right: -1px; width: 17px; height: 17px;
  background: linear-gradient(to bottom left, transparent 50%, var(--line-strong) 50%, var(--line-strong) calc(50% + 1px), transparent calc(50% + 1px));
}
@media (max-width: 960px) {
  .work__media, .work__content { grid-column: 1 / -1; }
  .work__media { position: static; }
  .work__media figure { aspect-ratio: 16 / 10; }
}

/* Projecten */
.projects__head { max-width: 640px; }
.gallery {
  margin-top: clamp(36px, 5vw, 56px);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: clamp(150px, 15vw, 230px); gap: 12px;
}
.tile { position: relative; overflow: hidden; background: var(--surface-2); padding: 0; border: 0; border-radius: 0; cursor: zoom-in; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease), filter 400ms ease; }
.tile:hover img { transform: scale(1.035); }
.tile:active img { transform: scale(1.01); }
.tile--a { grid-column: span 4; grid-row: span 2; }
.tile--b { grid-column: span 2; grid-row: span 2; }
.tile--c { grid-column: span 2; grid-row: span 2; }
.tile--d { grid-column: span 4; }
.tile--e { grid-column: span 2; }
.tile--f { grid-column: span 2; }
@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 44vw; gap: 8px; }
  .tile--a, .tile--d { grid-column: span 2; grid-row: span 1; }
  .tile--b, .tile--c, .tile--e, .tile--f { grid-column: span 1; grid-row: span 1; }
  .tile--b { grid-row: span 2; }
  .tile--c { grid-row: span 2; }
}

.lightbox {
  width: min(1200px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; background: transparent; overflow: visible;
}
.lightbox::backdrop { background: rgb(10 10 11 / 0.86); }
.lightbox img { width: 100%; max-height: calc(100dvh - 96px); object-fit: contain; }
.lightbox__close {
  position: fixed; top: 16px; right: 16px; width: 44px; height: 44px;
  display: grid; place-items: center; background: transparent; border: 1px solid rgb(255 255 255 / 0.35);
  color: #fff; border-radius: 0; cursor: pointer;
}
.lightbox__close .icon { width: 22px; height: 22px; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lb-in 260ms var(--ease); }
  .lightbox[open]::backdrop { animation: appear 220ms ease; }
  @keyframes lb-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
}

/* Contact */
.contact { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.contact__info { grid-column: 1 / span 5; }
.contact__form { grid-column: 7 / span 6; }
.phone-link {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 36px;
  font-size: clamp(1.75rem, 3vw, 2.375rem); font-weight: 300; letter-spacing: -0.015em;
  text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 6px;
  transition: gap 260ms var(--ease);
}
.phone-link .icon { width: 0.8em; height: 0.8em; }
.phone-link:hover { gap: 20px; }
.details { margin: 40px 0 0; display: grid; gap: 20px; }
.details div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; }
.details dt { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-3); padding-top: 2px; }
.details dd { margin: 0; }
.details a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.details a:hover { text-decoration-thickness: 2px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 0.875rem; font-weight: 500; }
.field label span { font-weight: 400; color: var(--ink-3); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--canvas); border: 0; border-bottom: 1px solid var(--ink-3); border-radius: 0;
  outline: none; transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { border-bottom-color: var(--ink); box-shadow: inset 0 -1px 0 var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.field .error { display: none; font-size: 0.8125rem; color: #b42318; }
.field.has-error input, .field.has-error textarea { border-bottom-color: #b42318; box-shadow: inset 0 -1px 0 #b42318; }
.field.has-error .error { display: block; }
@media (prefers-color-scheme: dark) {
  .field .error { color: #ff8a80; }
  .field.has-error input, .field.has-error textarea { border-bottom-color: #ff8a80; box-shadow: inset 0 -1px 0 #ff8a80; }
}
.form__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.form__status { font-size: 0.9375rem; color: var(--ink-2); }
.form__status[data-state="ok"] { color: var(--ink); }
.btn[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
@media (max-width: 960px) {
  .contact__info, .contact__form { grid-column: 1 / -1; }
  .contact__form { margin-top: 32px; }
}
@media (max-width: 560px) {
  .form { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px 48px; font-size: 0.875rem; color: var(--ink-2); }
.site-footer .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .brand__word { width: 120px; height: 54px; color: var(--ink); }
.footer__meta { display: flex; gap: 8px 28px; flex-wrap: wrap; }
.footer__meta a { text-underline-offset: 3px; }

/* Onthullen bij scrollen */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); transition-delay: var(--d, 0ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
