/* Layout concept: a builder's plan sheet — clean white sheet, photos as the drawings,
   contact set as the title block (cartouche) found in the corner of every construction plan. */
:root {
  --paper: #fafaf8;
  --sheet: #ffffff;
  --ink: #17181a;
  --slate: #3f4145;      /* the grey square of the logo */
  --muted: #66686c;
  --line: #dedbd5;       /* stone-grey rule */
  --wood: #9c6236;       /* stair-tread accent */
  --band: #1b1c1e;       /* contact band */
  --band-ink: #f1f0ed;
  --band-muted: #a9a8a4;
  --band-line: #3a3b3e;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Public Sans", "Segoe UI", Arial, sans-serif;
  --f-label: "IBM Plex Mono", Consolas, "Courier New", monospace;

  --wrap: 1180px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 108px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--wood); outline-offset: 3px; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

.label {
  font: 500 0.72rem/1.3 var(--f-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Header ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--sheet);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--sheet);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 14px;
}
.brand { flex-shrink: 0; }
.brand img { height: 69px; width: auto; max-width: none; }
.nav { display: flex; gap: clamp(14px, 3vw, 34px); }
.nav a {
  font: 600 0.82rem/1 var(--f-display);
  font-stretch: 112%;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; color: var(--slate);
  padding-block: 8px; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--wood); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--band); color: var(--band-ink); overflow: hidden; }
.hero-slides { position: absolute; inset: 0; }
.hero-slides img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.6s ease;
}
.hero-slides img.is-on { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,21,23,0) 35%, rgba(20,21,23,.78) 100%);
}
.hero .wrap {
  position: relative; z-index: 1;
  min-height: clamp(420px, 68vh, 680px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-block: 48px;
}
.hero .label { color: #e4e2dd; }
.hero h1 {
  font: 800 clamp(2.2rem, 6vw, 4.4rem)/1.02 var(--f-display);
  font-stretch: 118%;
  letter-spacing: -0.01em;
  margin: 14px 0 16px; max-width: 14ch; text-wrap: balance;
}
.hero p { margin: 0; max-width: 46ch; font-size: 1.08rem; color: #e9e7e2; }
.hero-dots { display: flex; gap: 8px; margin-top: 28px; }
.hero-dots button {
  width: 30px; height: 4px; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.35);
}
.hero-dots button[aria-current="true"] { background: var(--band-ink); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 9vw, 104px); }
.section-head {
  display: grid; gap: 10px; margin-bottom: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--ink); padding-top: 18px;
}
.section-head h2 {
  font: 800 clamp(1.8rem, 4vw, 2.7rem)/1.05 var(--f-display);
  font-stretch: 115%; margin: 0; text-wrap: balance;
}
.section-head p { margin: 0; max-width: 60ch; color: var(--muted); }

/* Services */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 32px); }
.service { background: var(--sheet); border: 1px solid var(--line); display: flex; flex-direction: column; }
.service img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.service-body { padding: 22px 24px 26px; display: grid; gap: 8px; }
.service h3 {
  font: 700 1.35rem/1.15 var(--f-display); font-stretch: 112%; margin: 0;
}
.service p { margin: 0; color: var(--muted); }

/* Projects */
.realisations { background: var(--sheet); border-block: 1px solid var(--line); }
.project { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.project + .project { margin-top: clamp(48px, 7vw, 80px); }
.project:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); }
.project:nth-of-type(even) .viewer { order: 2; }
.project.project--photos { grid-template-columns: minmax(0, 1fr); }
.project--photos .viewer-main { aspect-ratio: 16 / 9; }
.project--photos .thumbs { grid-template-columns: repeat(8, minmax(0, 1fr)); }
@media (max-width: 640px) { .project--photos .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.viewer { display: grid; gap: 10px; min-width: 0; }
.viewer-main {
  position: relative; aspect-ratio: 3 / 2; max-width: 100%; background: var(--paper);
  border: 0; padding: 0; cursor: zoom-in; overflow: hidden;
}
.viewer-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.thumbs button {
  border: 0; padding: 0; cursor: pointer; aspect-ratio: 1; overflow: hidden;
  background: var(--paper); opacity: .62; transition: opacity .2s;
  outline: 2px solid transparent; outline-offset: 2px;
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button:hover { opacity: 1; }
.thumbs button[aria-pressed="true"] { opacity: 1; outline-color: var(--wood); }
.project-info { display: grid; gap: 14px; min-width: 0; padding-top: 4px; }
.project-info .num {
  font: 800 clamp(3rem, 7vw, 5rem)/0.9 var(--f-display); font-stretch: 120%;
  color: var(--ink); letter-spacing: -0.02em;
}
.project-info h3 { font: 600 1.1rem/1.3 var(--f-body); margin: 0; }
.project-info p { margin: 0; color: var(--muted); }
.caption { font: 500 0.78rem/1.4 var(--f-label); letter-spacing: 0.04em; color: var(--muted); min-height: 1.4em; }

/* Gallery */
.gallery-head { margin-top: clamp(64px, 9vw, 104px); }
.gallery {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense; gap: 10px;
  margin-top: clamp(48px, 7vw, 80px);
}
.gallery button {
  border: 0; padding: 0; cursor: zoom-in; overflow: hidden; background: var(--paper);
  aspect-ratio: 3 / 2; max-width: 100%;
}
.gallery button.wide { grid-column: span 2; grid-row: span 2; }
.gallery button.tall { grid-row: span 2; aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery button:hover img { transform: scale(1.03); }
.gallery-more { display: flex; justify-content: center; margin-top: 28px; }
.more-btn {
  font: 600 0.85rem/1 var(--f-display); font-stretch: 112%;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1.5px solid var(--ink);
  padding: 14px 22px; cursor: pointer;
}
.more-btn:hover { background: var(--ink); color: var(--sheet); }
@media (prefers-reduced-motion: reduce) {
  .gallery img, .hero-slides img { transition: none; }
}

/* Contact / title block */
.contact { background: var(--band); color: var(--band-ink); }
.contact .section-head { border-top-color: var(--band-ink); }
.contact .section-head p { color: var(--band-muted); }
.cartouche {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--band-line); border: 1px solid var(--band-line);
}
.cartouche > div { padding: 20px 22px; background: var(--band); min-width: 0; display: grid; gap: 8px; align-content: start; }
.cartouche .label { color: var(--band-muted); }
.cartouche .value { font: 600 1.15rem/1.3 var(--f-display); font-stretch: 108%; overflow-wrap: anywhere; }
.cartouche .value a { text-decoration: none; border-bottom: 1px solid var(--wood); }
.cartouche .value a:hover { color: #fff; border-bottom-color: #fff; }
.section-logo { display: flex; justify-content: center; margin-top: clamp(48px, 7vw, 80px); }
.section-logo img { width: min(360px, 80%); height: auto; }
.brand img { width: auto; }
.copy-btn {
  justify-self: start; font: 500 0.7rem/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase;
  color: var(--band-muted); background: transparent; border: 1px solid var(--band-line); padding: 7px 10px; cursor: pointer;
}
.copy-btn:hover { color: var(--band-ink); border-color: var(--band-muted); }

.site-footer { background: var(--band); color: var(--band-muted); border-top: 1px solid var(--band-line); }
.site-footer .wrap { padding-block: 20px; font: 400 0.8rem/1.5 var(--f-label); letter-spacing: .03em; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0;
}
.lightbox::backdrop { background: rgba(14,14,15,.94); }
.lightbox-inner {
  height: 100%; display: grid; grid-template-rows: 1fr auto; gap: 12px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter-r) calc(16px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
}
.lightbox img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; min-height: 0; }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #e9e7e2; font: 500 0.8rem/1.4 var(--f-label); }
.lightbox-bar .btns { display: flex; gap: 8px; }
.lightbox button {
  font: 600 0.8rem/1 var(--f-display); letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25);
  padding: 10px 14px; cursor: pointer;
}
.lightbox button:hover { background: rgba(255,255,255,.18); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .project, .project:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); }
  .project:nth-of-type(even) .viewer { order: 0; }
  .project-info { order: -1; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cartouche { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .services { grid-template-columns: minmax(0, 1fr); }
  .brand img { height: 32px; }
  .nav { gap: 10px; }
  .nav a { font-size: 0.66rem; letter-spacing: .03em; font-stretch: 100%; }
  .nav .nav-home { display: none; }
  .cartouche { grid-template-columns: minmax(0, 1fr); }
  .gallery button.wide { grid-column: span 2; grid-row: auto; }
}

/* Compact contact band */
.section.contact { padding-block: clamp(28px, 4vw, 44px); }
.contact .section-head { margin-bottom: 16px; padding-top: 12px; gap: 4px; }
.contact .section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cartouche > div { padding: 12px 16px; gap: 4px; }
.cartouche .value { font-size: 1.05rem; }
.copy-btn { padding: 5px 8px; margin-top: 2px; }
.site-footer .wrap { padding-block: 14px; }

/* Tighter space around the logo */
.section-logo { margin-top: 28px; }
.section.realisations { padding-bottom: 32px; }
