/* Poutrel, direction A "Atelier" (ADR 0009).
   One section per part of the page, in page order. Design values are custom properties
   in "Design values"; a new part of the page adds its own section and styles only its own
   classes. Its rules for a screen width go into the shared @media blocks at the end
   (Very wide, Tablet, Phone), never into a breakpoint of its own. */

/* ---- Fonts: Montserrat, served from the site; only the weights used ---- */

@font-face { font-family: Montserrat; font-style: normal; font-weight: 300; font-display: swap; src: url("/fonts/montserrat-300.woff2") format("woff2"); }
@font-face { font-family: Montserrat; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/montserrat-400.woff2") format("woff2"); }
@font-face { font-family: Montserrat; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/montserrat-500.woff2") format("woff2"); }

/* ---- Design values ---- */

:root {
  /* Colours */
  --ink: #131211;
  --ink-deep: #0c0b0a;
  --tile: #1d1b19;
  --paper: #edeae6;
  --white: #fff;
  --mute: #aca69f;
  --rule: #2e2b28;
  --field-line: #6b665f;
  --shade: linear-gradient(180deg, rgb(12 11 10 / .72) 0%, rgb(12 11 10 / .38) 45%, rgb(12 11 10 / .82) 100%);

  /* Type. Font weights are written as numbers (300, 400, 500) where they are used, so
     the check can match them against the font files above. */
  --font: Montserrat, system-ui, sans-serif;
  --text-size: 17px;
  --small-size: 14px;
  --cap-size: 12px;
  --caption-size: 11px;
  --h2-size: 44px;
  --h3-size: 22px;

  /* Space */
  --page-width: 1200px;
  --gutter: 40px;
  --section: 130px;
  --grid-gap: 8px;
  --grid-row: 380px;
  /* The top photo fills the first screen (owner, 2026-11-26), never shorter than 480px; the
     official-site notice is in the footer only (owner, 2026-11-27). 100vh first: a browser
     without svh keeps the photo instead of collapsing it. */
  --hero-height: max(480px, 100vh);
  /* The footer's row with the official-site notice. */
  --notice-height: 72px;
  --intro-photo-height: 640px;

  /* Motion */
  --ease: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
}

/* The screen's height without a phone's address bar, where the browser knows it. */
@supports (height: 100svh) {
  :root { --hero-height: max(480px, 100svh); }
}

/* ---- Base ---- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--text-size);
  line-height: 1.65;
}

::selection { background: var(--paper); color: var(--ink); }
a { color: var(--paper); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color .3s; }
a:hover { color: var(--white); }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 300; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter); }
.cap { font-size: var(--cap-size); letter-spacing: .28em; text-transform: uppercase; font-weight: 500; }
.mute { color: var(--mute); }
.h2 { font-size: var(--h2-size); line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.text { max-width: 56ch; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 30;
  background: var(--paper); color: var(--ink); padding: 12px 18px;
  font-size: var(--cap-size); letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
}
.skip:focus { top: 16px; color: var(--ink); }

/* ---- Hero: the workshop photo, the logo and the navigation ---- */

.hero { position: relative; height: var(--hero-height); background: var(--ink-deep); overflow: hidden; }
.hero-photo, .hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: var(--shade); }
.hero-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px var(--gutter); }
.hero-mark { width: 44px; }
.hero-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 0 var(--gutter); text-align: center; }
.hero-logo { width: min(620px, 78vw); }
.hero-tagline { letter-spacing: .5em; margin-right: -.5em; }
.hero-foot { position: absolute; left: 0; right: 0; bottom: 44px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 0 var(--gutter); }

/* ---- Navigation ---- */

.nav { display: flex; gap: 36px; align-items: center; }
.nav a { text-decoration: none; font-size: var(--cap-size); letter-spacing: .24em; text-transform: uppercase; font-weight: 500; padding: 14px 0; }
.nav a:hover { text-decoration: underline; }

/* ---- Language switch, in the header and the footer ---- */

.hero-bar .nav { margin-left: auto; }
.lang { display: flex; gap: 10px; font-size: var(--cap-size); letter-spacing: .2em; font-weight: 500; }
/* Each language is a target of at least 44 px to tap. */
.lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 14px 4px; text-decoration: none; }
.lang a:hover { text-decoration: underline; }
.lang a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
.footer .lang a { padding-top: 0; justify-content: flex-start; }

/* ---- Introduction ---- */

.intro { padding: var(--section) 0; }
.intro-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px; align-items: center; }
.intro-photo { grid-column: 1 / span 5; }
.intro-photo img { width: 100%; height: var(--intro-photo-height); object-fit: cover; }
.intro-text { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: 28px; }

/* The line between the introduction and the Werk title: it stood above the three kinds of
   work and stays while they are off the page (owner, 2026-11-27). A hairline: half a pixel,
   one screen pixel on a sharp screen. */
.section-rule { margin: 0 0 var(--section); border: 0; border-top: .5px solid var(--rule); }

/* ---- Photo grid ---- */

.work-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; padding-bottom: 60px; }
.work-head .text { max-width: 44ch; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: var(--grid-row); grid-auto-flow: dense; gap: var(--grid-gap); padding: 0 var(--grid-gap); }
.grid figure { margin: 0; position: relative; overflow: hidden; background: var(--tile); height: 100%; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.grid figure:hover img { transform: scale(1.03); }
/* The caption sits on a plate of the deep ink, so it reads on any photo. */
.grid figcaption { position: absolute; left: 16px; bottom: 14px; max-width: calc(100% - 32px); padding: 6px 10px 6px 12px; background: var(--ink-deep); font-size: var(--caption-size); letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--white); }
.tile-big { grid-column: span 2; grid-row: span 2; }
.tile-wide { grid-column: span 2; }

/* ---- Contact ---- */

.contact { margin-top: 122px; padding: var(--section) 0; border-top: 1px solid var(--rule); }
.contact-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px; }
.contact-info { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 28px; }
.contact-info .text { line-height: 1.4; }
/* Each link a visitor taps alone is at least 44 px high. */
.contact-info a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- Contact form (switched off: its fields shown, disabled, under a line saying where to write) ---- */

.contact-form { grid-column: 7 / span 6; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: var(--cap-size); letter-spacing: .2em; text-transform: uppercase; font-weight: 500; color: var(--mute); }
.form-field input, .form-field textarea { background: transparent; border: 0; border-bottom: 1px solid var(--field-line); border-radius: 0; color: var(--paper); font: inherit; padding: 10px 0; min-height: 48px; caret-color: var(--paper); }
.form-field textarea { min-height: 120px; resize: vertical; }
/* Focus and a refused field: a 2px white line, one pixel less padding so nothing moves. */
.form-field input:focus-visible, .form-field textarea:focus-visible, .form-field [aria-invalid="true"] { outline: 0; border-bottom: 2px solid var(--white); padding-bottom: 9px; }
/* The bot field: out of sight, out of the keyboard order (aria-hidden and tabindex in the markup). */
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Turnstile's "flexible" widget takes the form's width; never more. */
.cf-turnstile { max-width: 100%; overflow: hidden; }
.form-note { margin: 0; font-size: var(--small-size); }
.form-note a { display: inline-flex; align-items: center; min-height: 44px; }
.form-status { margin: 0; }
.form-status:empty { display: none; }
.form-send { align-self: flex-start; background: var(--paper); color: var(--ink); border: 0; font: inherit; font-weight: 500; font-size: var(--cap-size); letter-spacing: .24em; text-transform: uppercase; padding: 18px 34px; min-height: 52px; cursor: pointer; transition: background .3s; }
.form-send:hover { background: var(--white); }
.form-send:disabled { opacity: .6; cursor: progress; }
/* Switched off: the fields keep their place but read as not in use yet. */
.form-closed { margin: 0; }
.form-closed a { display: inline-flex; align-items: center; min-height: 44px; }
.form-field :disabled { border-bottom-color: var(--rule); cursor: not-allowed; }
.contact-form:has(.form-closed) .form-send:disabled { opacity: .5; cursor: not-allowed; }
/* The answer page the function shows when the form was posted without JavaScript. */
.answer { padding: var(--section) 0; }
.answer .wrap { display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }

/* ---- Footer ---- */

.footer { border-top: 1px solid var(--rule); padding: 64px 0 0; }
/* The footer's last row: the official-site notice across the page (owner, 2026-11-26), its
   only place since it left the band under the top photo (owner, 2026-11-27). */
.footer-notice { margin: 64px 0 0; min-height: var(--notice-height); display: flex; align-items: center; justify-content: center; border-top: 1px solid var(--rule); padding: 0 24px; text-align: center; font-size: var(--small-size); letter-spacing: .04em; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; font-size: var(--small-size); }
.footer-col { display: flex; flex-direction: column; }
.footer-col > span { padding: 3px 0; }
/* Each link a visitor taps alone is at least 44 px high. */
.footer-col a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-col.narrow { max-width: 30ch; }
.footer-logo { width: 180px; margin-bottom: 20px; }
/* The email address and the Instagram account, each after its hairline icon. */
.footer-col .icon-link { gap: 12px; }
.icon { flex: none; color: var(--mute); transition: color .3s; }
.icon-link:hover .icon, .icon-link:focus-visible .icon { color: var(--white); }

/* ---- Privacy page: a plain bar, then one column to read ---- */

.small { font-size: var(--small-size); }
.page-bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px var(--gutter); border-bottom: 1px solid var(--rule); }
.page-home { display: flex; align-items: center; min-width: 44px; min-height: 44px; position: relative; z-index: 2; }
.reading a { display: inline-flex; align-items: center; min-height: 44px; }
.privacy { padding: 96px 0 var(--section); }
/* A long word (a web address) breaks rather than widen the page on a phone. */
.reading { max-width: calc(64ch + 2 * var(--gutter)); display: flex; flex-direction: column; gap: 20px; overflow-wrap: break-word; }
.reading h1 { margin-bottom: 12px; }
.reading section { display: flex; flex-direction: column; gap: 16px; margin-top: 36px; }
.reading h2 { font-size: var(--h3-size); font-weight: 400; letter-spacing: .02em; text-wrap: balance; }
/* A list's points are marked with a steel-grey dash. It is a real list marker, not a drawn
   line: Safari's screen reader stops announcing a list whose markers are removed. */
.reading ul { display: flex; flex-direction: column; gap: 10px; padding-left: 28px; list-style: "—" outside; }
.reading li { padding-left: 12px; text-wrap: pretty; }
.reading li::marker { color: var(--mute); }
.privacy-updated { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); }

/* ---- Phone menu: the button, shown on a phone by src/menu.js (see Phone below) ---- */

.nav-toggle { display: none; position: relative; z-index: 2; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: none; color: var(--paper); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 7px; }
.nav-toggle span { display: block; width: 26px; height: 1px; background: currentColor; transition: transform .4s var(--ease); }
.menu-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
@keyframes menu-in { from { opacity: 0; } }

/* ---- Less motion, forced colours ---- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .grid figure:hover img { transform: none; }
}

@media (forced-colors: active) {
  .hero-shade { display: none; }
}

/* ---- Touch screens: no hover zoom that sticks after a tap ---- */

@media (hover: none) {
  .grid figure:hover img { transform: none; }
}

/* ---- Very wide (from 1600 px): a wider frame (owner, 2026-11-26); the header lines up with it; the grid stops growing ---- */

@media (min-width: 1600px) {
  :root { --page-width: 1440px; --grid-row: 440px; }
  .hero-bar, .hero-foot, .page-bar { padding-left: calc((100% - var(--page-width)) / 2 + var(--gutter)); padding-right: calc((100% - var(--page-width)) / 2 + var(--gutter)); }
  .grid { max-width: 1920px; margin: 0 auto; }
}

/* ---- Tablet (up to 1023 px): the same page, tighter; the photo grid in two columns ---- */

@media (max-width: 1023px) {
  :root {
    --gutter: 32px;
    --section: 96px;
    --h2-size: 38px;
    --grid-row: 300px;
    --intro-photo-height: 560px;
  }
  .intro-photo { grid-column: 1 / span 6; }
  .intro-text { grid-column: 7 / span 6; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact { margin-top: 96px; }
  .contact-info { grid-column: 1 / span 8; }
  .contact-form { grid-column: 1 / -1; }
}

/* ---- Phone (up to 767 px): one column, the photo first; the menu behind a button ---- */

@media (max-width: 767px) {
  :root {
    --gutter: 20px;
    --section: 72px;
    --h2-size: 32px;
    --h3-size: 20px;
    --grid-row: 200px;
    --notice-height: 84px;
    --intro-photo-height: 440px;
  }
  .hero-bar { padding-top: 20px; padding-bottom: 20px; }
  .hero-mark { position: relative; z-index: 2; }

  /* Without the script, the links stay in the bar: on a line under the mark, the language
     switch on a line of its own, so nothing runs off a narrow screen (WCAG 1.4.10, from 320 px). */
  :root:not(.has-menu) :is(.hero-bar, .page-bar) { flex-wrap: wrap; row-gap: 0; }
  :root:not(.has-menu) .nav { flex-basis: 100%; flex-wrap: wrap; margin-left: 0; gap: 0 20px; }
  :root:not(.has-menu) .nav .lang { flex-basis: 100%; }
  :root:not(.has-menu) .nav .lang a { justify-content: flex-start; padding-left: 0; }

  /* With the script, the links move into a full-screen panel behind the button. */
  .has-menu .nav-toggle { display: inline-flex; }
  .has-menu .nav {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 0;
    padding: 96px var(--gutter) 64px; background: var(--ink-deep);
    visibility: hidden;
  }
  .menu-open .nav { visibility: visible; animation: menu-in .4s var(--ease); }
  .has-menu .nav > a { padding: 18px 0; border-bottom: 1px solid var(--rule); font-size: var(--h2-size); font-weight: 300; line-height: 1.15; letter-spacing: -.01em; text-transform: none; }
  .has-menu .nav > a:first-child { border-top: 1px solid var(--rule); }
  .has-menu .nav .lang { margin-top: 28px; gap: 16px; }
  .has-menu .nav .lang a { justify-content: flex-start; padding-left: 0; }
  .menu-open, .menu-open body { overflow: hidden; }
  .hero-mid { gap: 24px; }
  .hero-logo { width: 84vw; }
  .hero-tagline { letter-spacing: .36em; margin-right: -.36em; }
  .hero-foot { bottom: 28px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .intro-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .intro-grid { gap: 36px; }
  .intro-photo, .intro-text { grid-column: 1 / -1; }
  .intro-text { gap: 22px; }
  .work-head { padding-bottom: 36px; }
  .grid { gap: 6px; padding: 0 6px; }
  .grid figcaption { left: 12px; bottom: 10px; max-width: calc(100% - 24px); letter-spacing: .14em; }
  .tile-wide { grid-row: span 1; }
  .contact { margin-top: 72px; }
  .contact-info { grid-column: 1 / -1; gap: 22px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .footer { padding: 48px 0 0; }
  .footer-notice { margin-top: 48px; padding: 18px var(--gutter); }
  .footer-grid { flex-direction: column; gap: 28px; }
}

/* ---- Focus points of the photos, added by the build from content/photos.yaml ---- */
.focus-welding-helmet { object-position: 50% 50%; }
.focus-welder-at-work { object-position: 50% 50%; }
.focus-kitchen-island { object-position: 50% 50%; }
.focus-steel-drawers { object-position: 50% 50%; }
.focus-spiral-stair { object-position: 50% 50%; }
.focus-panel-handle { object-position: 50% 50%; }
.focus-stair-wood { object-position: 50% 50%; }
.focus-wall-cabinet { object-position: 50% 50%; }
.focus-kitchen-steel-fronts { object-position: 50% 50%; }
.focus-bookcase { object-position: 50% 50%; }
