/* ============ Fonts (self-hosted, no third-party requests) ============ */
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/oswald-600-latin.woff2") format("woff2");
}

/* ============ Custom properties ============ */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #0b0d1c;
  --color-bg-raised: #12152c;
  --color-border: #131E61;
  --color-text: #14161f;
  --color-text-muted: #131E61;
  --color-accent: #131e61;
  --color-accent-light: #131E61;
  --color-accent-lighter: #1b36e5;
  --color-accent-text: #131e61;
  --color-on-accent-muted: #9f9f9f;

  /* For content sitting on dark surfaces (hero photo, homepage tiles) —
     kept separate from --color-text so the light-page palette above can
     change without breaking contrast on those dark areas. */
  --color-on-dark: #ffffff;
  --color-on-dark-muted: #c7cdf5;

  /* Footer has its own bg/text pair, independent of the page and dark-surface colors. */
  --color-footer-bg: #131e61;
  --color-footer-text: #ffffff;
  --color-footer-text-muted: #c7cdf5;

  --nav-height: 100px;
  --container-width: 1600px;
  --radius: 4px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --font-base: Bahnschrift, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Oswald", Haettenschweiler, "Arial Narrow", sans-serif;
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-weight: 350;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0 0 var(--space-2); }
button { font: inherit; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.eyebrow {
  display: block;
  color: var(--color-accent-text);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
}

.section-intro {
  color: var(--color-text-muted);
  max-width: 640px;
  margin-bottom: var(--space-5);
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  background: var(--color-accent);
  color: #fff;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--color-accent-light); border-color: var(--color-accent-light); }
.btn-outline {
  background: transparent;
  border-color: var(--color-border);
}
.btn-outline:hover { border-color: var(--color-accent-light); background: rgba(84, 104, 230, 0.15); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-accent-lighter);
  outline-offset: 2px;
}

/* ============ Nav ============ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: var(--color-accent);
  z-index: 100;
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.site-logo img { height: 50px; width: auto; }

.nav-links {
  display: flex;
  gap: var(--space-4);
}
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-on-accent-muted);
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

body { padding-top: var(--nav-height); }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--color-bg-raised);
}
.hero-bg-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--color-bg-raised);
  z-index: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  transition: transform 1.4s ease;
}
.hero-slide.is-shown {
  transform: translateX(0);
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroKenBurns 18s ease-in-out infinite alternate;
}
@keyframes heroKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide img { animation: none; }
  .hero-slide { transition: none; }
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,7,15,0.15) 0%, rgba(6,7,15,0.92) 100%);
  z-index: 1;
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding: var(--space-5) 0;
  max-width: 720px;
}
.hero h1 {
  color: var(--color-on-dark);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.1;
  /* Optical alignment: the rounded "U" glyph in Oswald carries more built-in
     left-side whitespace than the paragraph's font, so the title's ink
     starts visibly right of the subtitle's even though both boxes line up
     exactly. Nudge left to compensate. */
  margin-left: -0.035em;
}
.hero p {
  color: var(--color-on-dark-muted);
  font-size: 1.05rem;
  max-width: 520px;
}

/* ============ Tiles ============ */
.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}
.tile {
  position: relative;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.tile:hover img { transform: scale(1.05); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,7,15,0) 40%, rgba(6,7,15,0.92) 100%);
}
.tile-icon { background: var(--color-accent); }
.tile-icon img {
  width: 38%;
  height: 38%;
  margin: auto;
  object-fit: contain;
}
.tile-icon::after { content: none; }
.tile-label {
  position: relative;
  z-index: 1;
  padding: var(--space-3);
  color: var(--color-on-dark);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 1.15rem;
}
.tile-label span {
  display: block;
  font-family: var(--font-base);
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-on-dark-muted);
  margin-top: 0.3rem;
}

/* ============ Services grid (hover-expand cards) ============ */
/* Flexbox + wrap + justify-content:center centers a leftover last row
   (e.g. 2 cards under a row of 3) automatically, regardless of item count. */
.services-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}
.service-card {
  position: relative;
  flex: 1 1 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg-raised);
}
.service-card-media { position: absolute; inset: 0; }
.service-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.service-card-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto 0fr;
  background: var(--color-accent);
  padding: var(--space-3);
  transition: grid-template-rows 0.3s ease;
}
.service-card-title {
  color: var(--color-on-dark);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 1.05rem;
  margin: 0;
}
.service-card-desc {
  overflow: hidden;
  min-height: 0;
  color: var(--color-on-dark-muted);
  font-size: 0.85rem;
  margin: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Hover-expand only on devices with real hover (mouse/trackpad).
   Touch devices get the description shown by default instead, since
   there's no reliable hover state to reveal it with. */
@media (hover: hover) and (pointer: fine) {
  .service-card:hover .service-card-media img { transform: scale(1.05); }
  .service-card:hover .service-card-bar { grid-template-rows: auto 1fr; }
  .service-card:hover .service-card-desc { opacity: 1; padding-top: 0.5rem; }
}
@media (hover: none) {
  .service-card-bar { grid-template-rows: auto auto; }
  .service-card-desc { opacity: 1; padding-top: 0.5rem; }
}

/* Single-column view shows the description statically (no hover to reveal
   it with), so the card needs more headroom than the 4:3 desktop shape
   gives — otherwise the longest description gets clipped by the card's
   own overflow:hidden. */
@media (max-width: 639px) {
  .service-card { aspect-ratio: 4 / 5; }
}

/* 2-per-row from tablet width up, 3-per-row (the "max") only on wider
   desktop viewports. */
@media (min-width: 640px) {
  .service-card {
    flex: 1 1 calc(50% - var(--space-3) / 2);
    max-width: calc(50% - var(--space-3) / 2);
  }
}

/* 1200px rather than the usual 1024px breakpoint — measured empirically:
   below ~1150px the 3-column cards get too narrow for the longest
   description ("Fabricage & Constructie") to fit without clipping. */
@media (min-width: 1200px) {
  .service-card {
    flex: 1 1 calc(33.333% - var(--space-3) * 2 / 3);
    max-width: calc(33.333% - var(--space-3) * 2 / 3);
  }
}

/* ============ Project grid ============ */
/* Same flexbox + wrap + justify-content:center approach as .services-grid,
   so an incomplete last row of project cards centers itself the same way
   the services cards do, instead of hugging the left edge. */
.project-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}
.project-card {
  position: relative;
  flex: 1 1 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg-raised);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.project-card:focus-visible { outline: 2px solid var(--color-accent-lighter); outline-offset: 2px; }
.project-card-media { position: absolute; inset: 0; }
.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.project-card-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto 0fr;
  background: var(--color-accent);
  padding: var(--space-3);
  transition: grid-template-rows 0.3s ease;
}
.project-card-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.project-card-title {
  color: var(--color-on-dark);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 1.05rem;
  margin: 0;
}
.project-card-desc {
  overflow: hidden;
  min-height: 0;
  color: var(--color-on-dark-muted);
  font-size: 0.85rem;
  margin: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.project-card-tag {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--color-on-dark-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(6, 7, 15, 0.28);
    border-color: var(--color-accent-light);
  }
  .project-card:hover .project-card-media img { transform: scale(1.05); }
  .project-card:hover .project-card-bar { grid-template-rows: auto 1fr; }
  .project-card:hover .project-card-desc { opacity: 1; padding-top: 0.5rem; }
}
@media (hover: none) {
  .project-card-bar { grid-template-rows: auto auto; }
  .project-card-desc { opacity: 1; padding-top: 0.5rem; }
}
@media (max-width: 639px) {
  .project-card { aspect-ratio: 4 / 5; }
}

.placeholder-note {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ============ Contact form ============ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
.form-field { margin-bottom: var(--space-3); }
.form-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font: inherit;
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-honeypot { position: absolute; left: -9999px; }

.contact-meta {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.contact-meta a { color: var(--color-accent-text); }

/* ============ Page header (non-home pages) ============ */
.page-header {
  padding-top: var(--space-5);
  padding-bottom: var(--space-4);
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-footer-bg);
  margin-top: var(--space-6);
  padding: var(--space-5) 0 var(--space-3);
  color: var(--color-footer-text-muted);
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
}
.footer-grid h4 {
  color: var(--color-footer-text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}
.footer-grid p { margin: 0 0 0.3rem; }
.footer-grid a { display: block; margin-bottom: 0.3rem; }
.footer-grid a:hover { color: var(--color-footer-text); }
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
  font-size: 0.8rem;
}

/* ============ Simple content pages (privacy/legal) ============ */
.prose { max-width: 720px; padding: var(--space-5) 0; }
.prose h2 {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 1.4rem;
}
.prose p { color: var(--color-text-muted); }

/* ============ Project lightbox ============ */
body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 15, 0.92);
  padding: var(--space-3);
}
.lightbox[hidden] { display: none; }
.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
}
.lightbox-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.lightbox-image { width: 100%; height: 100%; object-fit: contain; background: var(--color-bg-raised); }
.lightbox-zone { position: absolute; top: 0; bottom: 0; width: 50%; cursor: pointer; }
.lightbox-zone.prev { left: 0; }
.lightbox-zone.next { right: 0; }
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(6, 7, 15, 0.6);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-nav-btn.prev { left: var(--space-2); }
.lightbox-nav-btn.next { right: var(--space-2); }
.lightbox-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(6, 7, 15, 0.6);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-caption { padding-top: var(--space-2); text-align: center; }
.lightbox-title {
  color: var(--color-on-dark);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 1.2rem;
  margin: 0 0 0.3rem;
}
.lightbox-description { color: var(--color-on-dark-muted); font-size: 0.9rem; max-width: 600px; margin: 0 auto 0.4rem; }
.lightbox-counter { color: var(--color-on-dark-muted); font-size: 0.8rem; }

.lightbox-thumbs {
  display: flex;
  justify-content: flex-start;
  justify-content: safe center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: var(--space-2) 0.2rem 0.2rem;
  scrollbar-width: thin;
}
.lightbox-thumb {
  flex: 0 0 auto;
  width: 64px;
  aspect-ratio: 4 / 3;
  padding: 0;
  border-radius: calc(var(--radius) - 2px);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.lightbox-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox-thumb:hover { opacity: 0.85; }
.lightbox-thumb.is-active { opacity: 1; border-color: var(--color-accent-lighter); }

/* ============ Breakpoints ============ */
@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .project-card {
    flex: 1 1 calc(50% - var(--space-3) / 2);
    max-width: calc(50% - var(--space-3) / 2);
  }
}

@media (min-width: 860px) {
  .contact-layout { grid-template-columns: 1.2fr 0.8fr; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Same 1200px threshold as .service-card, for the same reason and for
   visual consistency between the two grids. */
@media (min-width: 1200px) {
  .project-card {
    flex: 1 1 calc(33.333% - var(--space-3) * 2 / 3);
    max-width: calc(33.333% - var(--space-3) * 2 / 3);
  }
}

@media (max-width: 767px) {
  .hero { min-height: 0; aspect-ratio: 4 / 5; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-accent);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.is-open { max-height: 320px; }
  .nav-links a {
    display: block;
    padding: 1.25rem var(--space-3);
  }
  .nav-links li:last-child a {
    padding-bottom: var(--space-4);
  }
}
