/* Aavo Puukoda v2 (Minu Novu). v1's look kept: colours from their logo (pine #F6E5B2, mid #C59369, outline #682B1C),
   warm paper, one dark mahogany band (now Teenused), Vollkorn 600 headings + Cabin text.
   Pages: index.html (hero, five round gallery buttons, Teenused, Meist, Kontakt), galerii.html (the five galleries,
   four photos each), teenused.html (four groups, then the owner's paragraph in the dark Teenustööd band), meist.html
   and five gallery pages (whole photos in justified rows + lightbox). Every page: the "Galerii" panel in the navbar,
   a breadcrumb on the inner pages, the footer with link columns. The one signature is taken from Avo's logo (a horn
   plane with a curled pine shaving), drawn in code (tools/laast.py): a planed pine board's grain behind the home hero
   (HERO_BOARD; since 16.11 without the shaving, after Tislerikoda's hero), the same board lighter and still in the
   inner page heads, a planed board with shavings in the footer, and one still figure of a dark finished board in the
   Teenused band.
   Avo: "vähem on rohkem", so nothing beyond that. */

:root {
  --paper: #FBF8F2;
  --paper-2: #F3EBDC;
  --card: #FFFDF8;
  --pine: #F6E5B2;
  --pine-2: #EDCE8A;
  --pine-mid: #C59369;
  --brown: #682B1C;
  --brown-2: #7D3A26;
  --ink: #2B1810;
  --ink-2: #5A4034;
  --edge: #B07F57;   /* form field border, 3.3:1 on paper (WCAG 1.4.11) */
  --line: #E6D9C3;
  --mahogany: #3A1309;
  --mahogany-2: #4C1B0E;
  --on-dark: #F6E5B2;
  --on-dark-2: #E3CBA3;
  --serif: 'Vollkorn', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Cabin', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --wrap: 1200px;
  --gut: 16px;
  --shadow-1: 0 2px 4px rgba(28, 16, 10, .05), 0 8px 24px -6px rgba(28, 16, 10, .12);
  --shadow-2: 0 4px 10px rgba(28, 16, 10, .08), 0 26px 48px -20px rgba(28, 16, 10, .38);
}
@media (min-width: 768px) { :root { --gut: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  caret-color: var(--brown);
}
::selection { background: var(--pine-2); color: var(--ink); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--brown); margin: 0; text-wrap: balance; letter-spacing: -0.012em; }
p { margin: 0; text-wrap: pretty; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gut)); margin-inline: auto; padding-inline: var(--gut); }
.ic { width: 18px; height: 18px; fill: currentColor; flex: none; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--brown); color: var(--pine); padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Navbar: opaque paper pill, no backdrop-filter. From 768 px: links, Facebook, phone. Below: logo, phone
   and a menu button that opens the links under the pill (main.js); there the list starts with "Avaleht". ---------- */
.nav-wrap { position: fixed; inset: 12px 0 auto; z-index: 40; padding-inline: 12px; pointer-events: none; }
.nav {
  position: relative;
  pointer-events: auto; max-width: calc(var(--wrap) + 16px); margin-inline: auto; height: 68px;
  display: flex; align-items: center; gap: 24px; padding: 0 10px 0 18px;
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow-1);
}
.brand { display: block; flex: none; border-radius: 6px; }
.brand img { height: 46px; width: auto; }
.nav-links { list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: 1rem; color: var(--ink);
  transition: background-color .18s ease, color .18s ease;
}
.nav-links a[aria-current] { color: var(--brown); background: var(--pine); }
.nav-fb-row, .nav-home-row { display: none; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.nav-fb { display: none; width: 44px; height: 44px; flex: none; border-radius: 50%; color: var(--brown); transition: color .18s ease, transform .16s var(--ease-out); }
.nav-fb:active { transform: scale(.94); }
.ic-fb { display: block; width: 100%; height: 100%; fill: currentColor; }
.nav-call {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px;
  border-radius: 999px; background: var(--brown); color: var(--pine); text-decoration: none; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap;
  transition: background-color .18s ease, transform .16s var(--ease-out);
}
.nav-call:active { transform: scale(.97); }
.nav-menu {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--paper-2); color: var(--brown); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, transform .16s var(--ease-out);
}
.nav-menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; overflow: visible; }
.nav-menu path { transform-box: fill-box; transform-origin: center; transition: transform .18s var(--ease-out); }
.nav-menu[aria-expanded="true"] { background: var(--pine); }
.nav-menu[aria-expanded="true"] .l1 { transform: translateY(4px) rotate(45deg); }
.nav-menu[aria-expanded="true"] .l2 { transform: translateY(-4px) rotate(-45deg); }
.nav-menu:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { background: var(--paper-2); }
  .nav-links a[aria-current]:hover { background: var(--pine); }
  .nav-call:hover { background: var(--brown-2); }
  .nav-menu:hover { background: var(--pine); }
  .nav-fb:hover, .nav-fb-row a:hover { color: var(--brown-2); }
}
/* Phones: the menu is a panel under the pill, 180 ms fade and 6 px drop (reduced motion: fade only). While it is open
   the page behind is dimmed a little, so the panel does not read as part of the text under it. The dim layer is drawn
   behind the pill (z-index -1 inside .nav-wrap) and takes no taps: a tap outside still reaches the page and closes
   the menu (main.js). */
@media (max-width: 767px) {
  .nav::before {
    content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(43, 24, 16, .3); pointer-events: none;
    opacity: 0; visibility: hidden; transition: opacity .18s var(--ease-out), visibility 0s .18s;
  }
  .nav.menu-in::before { opacity: 1; visibility: visible; transition-delay: 0s; }
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: none; gap: 2px; padding: 8px;
    background: var(--card); border-radius: 20px; box-shadow: var(--shadow-2);
    max-height: calc(100vh - 104px); max-height: calc(100dvh - 104px); overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; transform: translateY(-6px); transition: opacity .18s var(--ease-out), transform .18s var(--ease-out);
  }
  .nav.menu-on .nav-links { display: grid; }
  .nav.menu-in .nav-links { opacity: 1; transform: none; }
  .nav-links a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: 12px; font-size: 1.125rem; }
  .nav-home-row { display: block; }
  .nav-fb-row { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
  .nav-fb-row a { color: var(--brown); }
  .nav-fb-row .ic-fb { width: 24px; height: 24px; flex: none; }
}
/* "Galerii": a disclosure button with a panel of the five galleries under the pill (click, keyboard; hover on a mouse;
   main.js). Each row is the gallery's round photo and name (the same photo and name as the home buttons). Below 768 px
   it is part of the phone menu: a plain "Galerii" link with the five galleries under it. Without JavaScript the button
   is a plain link to galerii.html. */
.nav-sub { position: relative; }
.sub-link { display: none !important; }
.sub-btn {
  display: flex; align-items: center; gap: 3px; padding: 8px 10px 8px 14px; border: 0; border-radius: 10px; background: none;
  font: 500 1rem/1.55 var(--sans); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, color .18s ease;
}
.sub-btn .chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s var(--ease-out); }
.nav-sub.open .chev { transform: rotate(180deg); }
.sub-btn.is-cur { color: var(--brown); background: var(--pine); }
.sub {
  position: absolute; z-index: 2; top: calc(100% + 16px); left: 50%; width: 300px; margin-left: -150px; padding: 8px;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow-2);
  display: none; opacity: 0; transform: translateY(-6px); transition: opacity .18s var(--ease-out), transform .18s var(--ease-out);
}
.nav-sub.on .sub { display: block; }
.nav-sub.open .sub { opacity: 1; transform: none; }
.sub::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px; }   /* the mouse crosses the gap */
.sub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-links .sub a { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-radius: 12px; font-weight: 500; }
.sub-ph { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--paper-2); box-shadow: 0 0 0 1.5px var(--pine-2); }
.sub-ph img { width: 100%; height: 100%; object-fit: cover; }
.nav-links .sub a[aria-current] { color: var(--brown); background: var(--pine); }   /* the tinted row marks it; no side stripe */
.nav-links .sub-all { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.nav-links .sub-all a { justify-content: space-between; min-height: 44px; padding-left: 14px; font-weight: 600; color: var(--brown); }
.sub-all svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html:not(.js) .sub-link { display: block !important; }
html:not(.js) .sub-btn, html:not(.js) .sub { display: none; }
.sub-link.is-cur { color: var(--brown); background: var(--pine); }
@media (hover: hover) and (pointer: fine) {
  .sub-btn:hover, .nav-sub.open .sub-btn { background: var(--paper-2); }
  .sub-btn.is-cur:hover, .nav-sub.open .sub-btn.is-cur { background: var(--pine); }
  .nav-links .sub a:hover { background: var(--paper-2); }
  .nav-links .sub a[aria-current]:hover { background: var(--pine); }
}
@media (max-width: 767px) {
  .sub-link { display: flex !important; }
  .sub-btn { display: none; }
  .sub { position: static; display: block; width: auto; margin: 0; padding: 0 0 4px 16px; background: none; box-shadow: none; opacity: 1; transform: none; transition: none; }
  .sub::before, .sub-ph, .nav-links .sub-all { display: none; }
  .nav-links .sub a { min-height: 44px; padding: 8px 14px; font-size: 1rem; color: var(--ink-2); }
  .nav-links .sub a[aria-current] { color: var(--brown); }
  .sub-link.is-cur:not([aria-current]) { background: none; color: var(--brown); }   /* the gallery's own row is the tinted one */
}
@media (min-width: 768px) {
  .nav-links { display: flex; margin: 0 auto; gap: 4px; }
  .nav-end { margin-left: 0; }
  .nav-fb { display: block; }
  .nav-menu { display: none; }
}
@media (min-width: 768px) and (max-width: 1023px) { .nav { gap: 12px; } .nav-links a { padding-inline: 10px; } }
@media (min-width: 1024px) { .nav { height: 76px; padding-left: 20px; } .brand img { height: 58px; } }
@media (max-width: 429px) { .nav { padding-left: 14px; gap: 12px; } .nav-call { padding: 0 14px; } }   /* up to 429 px the wide gaps would push the menu button out of the pill */
@media (max-width: 393px) { .nav { gap: 9px; } }   /* 390 to 392 px: the row was up to 2 px wider than the pill's inside, the menu button sat in the right padding */
/* Small phones: logo, number and menu button in one row (the logo never under 36 px tall) */
@media (max-width: 389px) { .nav { padding: 0 8px 0 12px; gap: 8px; } .brand img { height: 38px; } .nav-end { gap: 6px; } .nav-call { padding: 0 12px; } }
@media (max-width: 359px) { .nav-wrap { padding-inline: 8px; } .nav { padding: 0 6px 0 10px; } .brand img { height: 36px; } .nav-end { gap: 4px; } .nav-call { gap: 6px; padding: 0 10px; } .nav-call .ic { width: 16px; height: 16px; } }
@media (max-width: 329px) { .nav-wrap { padding-inline: 6px; } }   /* 320 to 322 px: the same, 3 px */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 52px; padding: 0 22px;
  border-radius: 12px; font: 600 1.0625rem/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; border: 0;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .16s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brown); color: var(--pine); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 14px -6px rgba(28, 16, 10, .5); }
.btn-ghost { background: var(--card); color: var(--brown); box-shadow: inset 0 0 0 1.5px var(--pine-mid); }
.btn-pine { background: var(--pine); color: var(--brown); }   /* on the dark band: 8.6:1, hover 7.1:1; no shadow, no arrow */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--brown-2); }
  .btn-ghost:hover { background: var(--pine); box-shadow: inset 0 0 0 1.5px var(--brown); }
  .btn-pine:hover { background: var(--pine-2); }
}
.more {
  display: inline-flex; align-items: center; gap: 6px; padding: 11px 0; white-space: nowrap; font-weight: 600; color: var(--brown);
  text-decoration: underline; text-decoration-color: var(--pine-mid); text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  transition: text-decoration-color .18s ease;
}
.links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .more:hover { text-decoration-color: currentColor; }
  .more:hover svg { transform: translateX(3px); }
}

/* ---------- Hero: headline, text and three photos (stair, door, window), nothing else (Avo: "rohkem polegi vaja").
   Phones and tablets: the photos first, smaller, all three in view.
   Each photo is shown at most 225 css px wide (the stair crop is 450 px), so a 2x screen never upscales. ---------- */
.hero { padding: 92px 0 24px; }
.hero-grid { display: grid; gap: 20px; }
.hero-photos {
  order: -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start;
  max-width: calc(3 * 210px + 2 * 14px); margin: 0;
}
.hp { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow-2); background: var(--paper-2); }
.hp-1, .hp-3 { margin-top: 16px; }
.hero h1 { font-size: clamp(2.15rem, 1.25rem + 3.1vw, 3.6rem); line-height: 1.06; }
.lede { margin-top: 14px; font-size: clamp(1.0625rem, .95rem + .3vw, 1.1875rem); line-height: 1.55; color: var(--ink-2); max-width: 36em; }
@media (max-height: 700px) and (max-width: 767px) { .lede { font-size: 1rem; } .hero h1 { font-size: 2rem; } }
@media (min-width: 768px) {
  .hero { padding: 116px 0 40px; }
  .hero-photos { gap: 14px; }
  .hp { border-radius: 12px; }
  .hp-1, .hp-3 { margin-top: 32px; }
  .hero-photos { margin-inline: auto; }   /* tablets: the row sits in the middle, not against the left edge */
}
@media (min-width: 1024px) {
  .hero { padding: 132px 0 48px; }
  .hero-grid { --hp: clamp(150px, calc(15vw + 8px), 210px); grid-template-columns: minmax(0, 1fr) calc(3 * var(--hp) + 32px); column-gap: clamp(40px, 5vw, 72px); align-items: center; }
  .hero-photos { order: 0; grid-template-columns: repeat(3, var(--hp)); gap: 16px; max-width: none; margin-inline: 0; }
  .hp-1, .hp-3 { margin-top: 44px; }
}

/* ---------- The five galleries: big round photo buttons ---------- */
.galleries { padding: 8px 0 48px; }
.gal-list {
  list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center;
  --d: min(128px, calc((100vw - 2 * var(--gut) - 2 * 12px) / 3)); gap: 22px 12px;
}
.gal-list > li { width: var(--d); min-width: 0; }   /* the ring is --d; a long name (Täispuituksed) may run a little wider, centred */
.gal { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--brown); border-radius: 12px; }
.gal:focus-visible { outline: none; }
.gal-ph {
  display: block; flex: none; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--paper-2);
  box-shadow: 0 0 0 3px var(--card), 0 0 0 4.5px var(--pine-2), var(--shadow-2);
  transition: box-shadow .2s ease;
}
.gal-ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease-out); }
.gal:focus-visible .gal-ph { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--brown), var(--shadow-2); }
.gal:focus-visible .gal-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.gal-name { font-family: var(--serif); font-weight: 600; font-size: 1rem; line-height: 1.2; text-align: center; text-wrap: balance; }
@media (max-width: 359px) { .gal-name { font-size: .9375rem; } }   /* 320 px: "Täispuituksed" stays clear of its neighbours */
@media (hover: hover) and (pointer: fine) {
  .gal:hover .gal-ph img { transform: scale(1.04); }
  .gal:hover .gal-ph { box-shadow: 0 0 0 3px var(--card), 0 0 0 4.5px var(--pine-mid), var(--shadow-2); }
}
.gal:active .gal-ph { transform: scale(.98); }
@media (min-width: 768px) {
  .galleries { padding: 0 0 64px; }
  .gal-list { flex-wrap: nowrap; justify-content: space-between; --d: min(200px, calc((100% - 4 * clamp(16px, 2.2vw, 40px)) / 5)); gap: 16px clamp(16px, 2.2vw, 40px); max-width: 1120px; }
  .gal-name { font-size: 1.1875rem; }
}
@media (min-width: 1024px) { .galleries { padding-bottom: 88px; } .gal-name { font-size: 1.3125rem; } }

/* ---------- Teenused: the one dark band (on teenused.html the same band is "Teenustööd", with the button only). One
   block on the left: the heading, Avo's paragraph a step softer (so the heading and the button carry the brightest
   pine), then the pine button and the link. From 1024 px the quiet right part holds one still figure of a dark
   finished board (tools/laast.py dark_board(), a file of its own: both pages share one cached copy, the editor gets
   no new element): three arch tips and a knot, a little lighter than the mahogany, gone before the text. Phones and
   tablets keep plain mahogany and never load the file. ---------- */
.services { position: relative; isolation: isolate; overflow: hidden; background: var(--mahogany); color: var(--on-dark-2); padding: 56px 0; }
.services h2 { color: var(--on-dark); }
.services :focus-visible { outline-color: var(--pine); }
.svc-body { margin-top: 14px; }
.svc-text { max-width: 30em; font-size: clamp(1.125rem, 1rem + .45vw, 1.375rem); line-height: 1.6; color: var(--on-dark-2); }
.services .links { margin-top: 24px; align-items: center; gap: 12px 28px; }
.services .more { color: var(--pine); text-decoration-color: var(--pine-mid); }
@media (min-width: 1024px) {
  .services { padding: 88px 0; }
  .svc-body { margin-top: 16px; }
  .services .links { margin-top: 28px; }
  /* the file spans 360 px left and 240 px right of the content's right edge (its x 0), its middle on the band's */
  .services::before {
    content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; right: calc(max(var(--gut), 50% - 600px) - 240px); width: 600px;
    background: url(assets/puit/tume-laud.svg) no-repeat 0 50%; pointer-events: none;
  }
}
/* up to 1119 px the paragraph runs to about 360 px from the content's edge: the figure moves 40 px out of its way */
@media (min-width: 1024px) and (max-width: 1119px) { .services::before { right: calc(var(--gut) - 280px); } }

/* ---------- Sections ---------- */
.about, .contact { padding: 48px 0; }
@media (min-width: 1024px) { .about, .contact { padding: 96px 0; } }
.services h2, .about h2, .contact h2, .g-more h2 { font-size: clamp(1.85rem, 1.35rem + 1.7vw, 2.6rem); line-height: 1.1; }

/* ---------- Meist ---------- */
.about-grid { display: grid; gap: 20px; align-items: center; }
.about-photo { max-width: 470px; }
.about-photo img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow-2); background: var(--paper-2); }
@media (max-width: 767px) { .about-photo { display: none; } }   /* phones never load it (data: source in <picture>) */
.about-text p { margin-top: 12px; color: var(--ink-2); max-width: 36em; }
.about-text .links { margin-top: 8px; }
.three { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; margin-top: 14px !important; white-space: nowrap; }
.three span { font-family: var(--serif); font-weight: 600; font-size: clamp(1.125rem, .6rem + 2.2vw, 2rem); color: var(--brown); line-height: 1.2; }
.three span + span::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 10px 0 0; background: var(--pine-mid); transform: translateY(-.2em) rotate(45deg);
}
@media (max-width: 359px) { .three { gap: 8px; } .three span { font-size: 1rem; } .three span + span::before { margin-right: 8px; } }   /* 320 px: the three words stay on one line */
@media (min-width: 768px) { .three { gap: 18px; } .three span + span::before { width: 9px; height: 9px; margin-right: 18px; } }
@media (min-width: 1024px) {
  .about-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
  .three span { font-size: clamp(1.5rem, .5rem + 1.6vw, 2rem); }
}

/* ---------- Contact ---------- */
.contact { background: var(--paper-2); }
.contact-grid { display: grid; gap: 28px; }
.contact-info > p { margin-top: 10px; color: var(--ink-2); max-width: 30em; }
.phone {
  display: inline-flex; align-items: baseline; gap: 8px; margin-top: 18px; text-decoration: none;
  font-family: var(--serif); font-weight: 600; color: var(--brown); font-size: clamp(2.25rem, 1.5rem + 2.4vw, 3.25rem); line-height: 1;
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em;
}
.phone small { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
@media (hover: hover) and (pointer: fine) { .phone:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--pine-mid); } }
.facts { margin: 22px 0 0; display: grid; gap: 14px; }
.facts dt { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-size: 1.0625rem; }
.facts a { color: var(--brown); text-decoration-color: var(--pine-mid); text-underline-offset: 3px; }
.form { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-1); padding: 20px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; align-content: start; }
.form h3, .form .field:nth-of-type(n+3), .form .btn, .form .form-note { grid-column: 1 / -1; }
.form h3 { font-size: 1.5rem; }
.field { display: grid; gap: 5px; }
.field label { font-size: .9375rem; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; font: 400 1.0625rem/1.4 var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--edge); border-radius: 10px; padding: 11px 13px; min-height: 48px;
  transition: border-color .18s ease, background-color .18s ease;
}
.field textarea { resize: vertical; min-height: 88px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23682B1C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.field ::placeholder { color: #7C6458; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--brown); outline-offset: 1px; border-color: var(--brown); background: var(--card); }
.form .btn { justify-self: start; }
.form-note { font-size: .9375rem; color: var(--ink); background: var(--pine); border-radius: 10px; padding: 10px 14px; }
.form-note[hidden] { display: none; }
/* the real form only (FORM_LIVE in build.mjs): the spam field off screen, a wrong field and the note when it failed,
   the button while it sends */
.f-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field [aria-invalid="true"] { border-color: var(--brown); box-shadow: inset 0 0 0 1px var(--brown); }
.form-note.is-bad { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--brown); }
.form.is-busy .btn { opacity: .6; cursor: progress; }
@media (min-width: 1024px) {
  .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: start; }
  .form { padding: 30px 30px 32px; column-gap: 16px; }
}

/* ---------- Footer: logo and company, three link columns (the galleries, the pages, the workshop), the preview note,
   the Novu mark in the footer's own colours; behind it the planed board (.board, drawn by tools/laast.py) ---------- */
.footer { position: relative; isolation: isolate; overflow: hidden; background: var(--paper); color: var(--ink-2); font-size: .9375rem; line-height: 1.5; }
.footer-grid { display: grid; gap: 22px; padding-block: 36px 26px; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.footer-logo { height: 40px; width: auto; }
.footer-co { font-weight: 600; color: var(--ink); }
.footer-co span { font-weight: 400; color: var(--ink-2); }
.footer-co span::before { content: "·"; margin: 0 8px; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; }
.foot-links > div:last-child { grid-column: 1 / -1; }
.foot-h { font: 600 1.0625rem/1.3 var(--serif); color: var(--brown); margin-bottom: 4px; }
.foot-links ul { list-style: none; margin: 0; padding: 0; display: grid; }
.foot-links li { padding: 3px 0; }
.footer a { color: var(--brown); text-decoration-color: var(--pine-mid); text-underline-offset: 3px; }
.foot-links a { text-decoration: none; }
.foot-h a { color: var(--brown); }
@media (hover: hover) and (pointer: fine) { .foot-links a:hover { text-decoration: underline; } }
.demo-note { max-width: 46em; margin-top: 48px; }   /* the links above keep clear of the board's top edge (the note is one line) */
@media (min-width: 768px) {
  .foot-links { grid-template-columns: repeat(3, auto); justify-content: start; gap: 22px clamp(32px, 6vw, 80px); }
  .foot-links > div:last-child { grid-column: auto; }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 28px 48px; align-items: start; padding-block: 44px 28px; }
  .footer-brand { flex-direction: column; align-items: flex-start; }
  .footer-co span { display: block; }
  .footer-co span::before { content: none; }
  .demo-note { grid-column: 1 / -1; }
}
.footer a.novu {
  display: block; padding: 14px 0 18px; text-align: center;
  color: var(--ink-2); font-size: .875rem; text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .footer a.novu:hover { text-decoration: underline; text-underline-offset: 3px; } }
/* Below 1024 px the board's top edge runs between the links and the note. The note is one short line (the photo credit),
   so its margin keeps the links clear of the edge and of the shavings. While the floating preview notice is on screen the row under the note gets
   room for it; the note then sits above the board, with room over the shavings. */
@media (max-width: 1023px) {
  .demo-note { margin-top: 68px; }
  .footer .board { bottom: 30px; }
  html:not(.nv-frame) body:has(#nvPre:not([hidden])) .footer a.novu { padding-top: 40px; padding-bottom: 112px; }
  html:not(.nv-frame) body:has(#nvPre:not([hidden])) .footer .board { bottom: 14px; }
  html:not(.nv-frame) body:has(#nvPre:not([hidden])) .demo-note { margin-top: 16px; }
}

/* ---------- Gallery pages ---------- */
.g-head { padding: 104px 0 22px; }
.g-head h1 { font-size: clamp(2.15rem, 1.25rem + 3.1vw, 3.4rem); line-height: 1.06; }
.g-intro, .p-lede { margin-top: 14px; max-width: 40em; font-size: clamp(1.0625rem, .95rem + .3vw, 1.1875rem); line-height: 1.55; color: var(--ink-2); }
/* Text the owner still has to write: a dashed box while it is the placeholder (data-novu-tbd; build.mjs and main.js
   drop the attribute once his own words are in); an optional text he empties takes no space (.opt). */
.opt:empty { display: none; }
[data-novu-tbd] { padding: 12px 16px; border: 1.5px dashed var(--pine-mid); border-radius: 12px; font-size: 1rem; width: fit-content; }
/* The same texts sit in a block the client can take off the page (.tog, data-novu-toggle). In the Minu Novu editor the
   block gets room at the top for the editor's "Eemalda lehelt" switch, which would otherwise lie on the text. */
.novu-edit .tog { padding-top: 56px; }
@media (min-width: 768px) { .g-head { padding: 132px 0 32px; } }

/* Breadcrumb: Avaleht > Galerii > the gallery (the names follow the owner's names) */
.crumbs ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; font-size: .9375rem; color: var(--ink-2); }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--pine-mid); }
.crumbs a { display: inline-block; padding: 4px 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.crumbs [aria-current] { display: inline-block; padding: 4px 0; color: var(--brown); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .crumbs a:hover { color: var(--brown); text-decoration-color: var(--pine-mid); } }

/* Whole photos in justified rows: every photo keeps its own shape (--r = w/h), each row fills the width and all photos
   in a row are equally tall; the order reads left to right (the lightbox follows it). A photo's basis is its share of
   a row of --k photos of the gallery's mean shape (--m), so phones show two or three a row, tablets three, computers
   four or five; the last row is not stretched (the ::after takes the rest). The grow factors are --r times 100, so
   the factors on a line always add up to more than 1 and a tall photo alone in a row still fills it. */
.jr { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; --k: 2.5; --g: 8px; gap: var(--g); }
.jr > li { flex: calc(var(--r) * 100) 1 calc((100% - (var(--k) - 1) * var(--g)) * var(--r) / (var(--k) * var(--m)) * .96); min-width: 0; }
.jr::after { content: ""; flex: 1e9 1 0px; }
.jr a, .gs-row a { display: block; border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.jr a:focus-visible, .gs-row a:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; }
.jr img, .gs-row img { width: 100%; height: auto; aspect-ratio: var(--r); object-fit: cover; transition: opacity .2s ease; }
@media (min-width: 768px) { .jr { --k: 3.2; --g: 12px; } }
@media (min-width: 1024px) { .jr { --k: 4.4; --g: 16px; } }
@media (hover: hover) and (pointer: fine) { .jr a:hover img, .gs-row a:hover img { opacity: .88; } }

.g-more { padding: 56px 0 48px; text-align: center; }
.g-more h2 { margin-bottom: 24px; }
.gal-list.is-small {
  display: grid; grid-template-columns: repeat(2, var(--d)); justify-content: center; gap: 24px 32px;
  --d: min(120px, calc((100vw - 2 * var(--gut) - 32px) / 2));
}
.gal-list.is-small .gal-name { font-size: .9375rem; }
@media (min-width: 768px) {
  .g-more { padding: 88px 0 72px; }
  .gal-list.is-small { display: flex; flex-wrap: nowrap; justify-content: center; gap: 32px; max-width: none; --d: min(160px, calc((100vw - 2 * var(--gut) - 3 * 32px) / 4)); }
  .gal-list.is-small .gal-name { font-size: 1.0625rem; }
}

/* ---------- Galerii page: each gallery's name, count and first four photos (links to the gallery page) ---------- */
.gs-list { display: grid; gap: 44px; padding-bottom: 56px; }
.gs { display: grid; grid-template-areas: "head" "grid" "more"; gap: 12px; }
.gs-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.gs-title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.15; }
.gs-count { color: var(--ink-2); font-size: .9375rem; font-variant-numeric: tabular-nums; }
/* the first four photos of a gallery in one justified row (two by two on phones): --p2 and --p4 are each photo's
   share of its row, worked out by the generator from the photos' shapes (and again by build.mjs and main.js when a
   photo is changed in Minu Novu, so the new photo is whole here too) */
.gs-row { grid-area: grid; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; --g: 8px; gap: var(--g); }
.gs-row > li { flex: calc(var(--r) * 100) 1 calc((100% - var(--g)) * var(--p2) * .99); min-width: 0; }
.gs-more { grid-area: more; justify-self: start; }
@media (min-width: 768px) {
  .gs-list { gap: 64px; padding-bottom: 88px; }
  .gs { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head more" "grid grid"; align-items: end; gap: 14px 24px; }
  .gs-row { --g: 12px; }
  .gs-row > li { flex-basis: calc((100% - 3 * var(--g)) * var(--p4) * .99); }
}
@media (min-width: 1024px) { .gs-list { padding-bottom: 104px; } .gs-row { --g: 16px; } }

/* ---------- Teenused page: four groups (square photo, name, text, gallery links), then the dark Teenustööd band
   (.services, as on the index). Below 600 px the photo is a small square beside the name and the text runs under
   both, so four groups fit in about one and a half screens. ---------- */
.sv { padding: 10px 0 56px; }
.sv-list { list-style: none; margin: 0 auto; display: grid; gap: 36px; }
.sv-item { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px 16px; align-items: center; }
.sv-ph { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--paper-2); box-shadow: var(--shadow-1); }
.sv-body { display: contents; }
.sv-body h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.15; }
.sv-text { grid-column: 1 / -1; color: var(--ink-2); max-width: 36em; }
.sv-body .links { grid-column: 1 / -1; margin-top: -8px; }
@media (min-width: 600px) {
  .sv-list { gap: 40px; }
  .sv-item { grid-template-columns: min(300px, 40%) minmax(0, 1fr); gap: 24px; align-items: start; }
  .sv-body { display: block; }
  .sv-text { margin-top: 8px; }
  .sv-body .links { margin-top: 4px; }
}
@media (min-width: 1024px) {
  .sv { padding: 16px 0 96px; }
  .sv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 32px; }
  .sv-item { grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); }
}

/* ---------- Meist page: text and the company card, three workshop photos ---------- */
.m-page { padding-bottom: 56px; }
.m-grid { display: grid; gap: 32px; grid-template-areas: "text" "photos" "facts"; }
.m-text { grid-area: text; }
.m-text .three { margin-top: 16px !important; }
.m-p { margin-top: 14px; color: var(--ink-2); max-width: 40em; }
.m-ph { grid-area: photos; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.m-ph li:first-child { grid-column: 1 / -1; }
.m-ph img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; background: var(--paper-2); }
.m-facts { grid-area: facts; background: var(--card); border-radius: 16px; box-shadow: var(--shadow-1); padding: 20px 18px 22px; }
.m-facts h2 { font-size: 1.375rem; line-height: 1.2; }
.m-facts .facts { margin-top: 14px; }
.m-facts .map { display: inline-block; padding: 6px 0; }
@media (min-width: 768px) {
  .m-ph { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .m-ph li:first-child { grid-column: auto; }
  .m-facts { padding: 24px 26px 26px; }
}
@media (min-width: 768px) and (max-width: 1023px) { .m-facts .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 32px; } }   /* the full-width card: the three facts side by side */
@media (min-width: 1024px) {
  .m-page { padding-bottom: 96px; }
  .m-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "text facts" "photos photos"; gap: 56px 64px; align-items: start; }
  .m-facts { margin-top: 8px; padding: 28px 30px 30px; }
}

/* ---------- Lightbox (native <dialog>, built by main.js) ---------- */
.lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #1C0D07; color: var(--on-dark); overflow: hidden; opacity: 0; transition: opacity .2s ease-out;
}
.lb::backdrop { background: transparent; }
.lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }   /* a photo already in the cache must not widen the stage before fit() */
.lb.is-in { opacity: 1; }
.lb :focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 6px 18px; }
.lb-count { font-size: .9375rem; color: var(--on-dark-2); font-variant-numeric: tabular-nums; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; padding: 0 12px; touch-action: pan-y pinch-zoom; }
.lb-fig { display: grid; justify-items: center; gap: 10px; transform: scale(.97); transition: transform .2s var(--ease-out); }
.lb.is-in .lb-fig { transform: none; }
.lb-img { display: block; max-width: none; object-fit: contain; border-radius: 6px; background: var(--mahogany-2); user-select: none; -webkit-user-drag: none; }
.lb-cap { max-width: 40em; padding-inline: 8px; font-size: .9375rem; line-height: 1.4; text-align: center; color: var(--on-dark); }
.lb-cap:empty { display: none; }
.lb-bar { display: flex; justify-content: space-between; padding: 8px 12px 14px; }
.lb-btn {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(246, 229, 178, .12); color: var(--on-dark); transition: background-color .18s ease, transform .16s var(--ease-out);
}
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .lb-btn:hover { background: rgba(246, 229, 178, .24); } }
@media (min-width: 768px) {
  .lb-top { padding: 14px 16px 8px 24px; }
  .lb-stage { padding: 0 84px 20px; }
  .lb-bar { position: absolute; inset: 50% 16px auto; transform: translateY(-50%); padding: 0; pointer-events: none; }
  .lb-bar .lb-btn { pointer-events: auto; width: 56px; height: 56px; }
  .lb[open] { grid-template-rows: auto minmax(0, 1fr); }
}
html.lb-lock { overflow: hidden; }
html.lb-lock body { padding-right: var(--sbw, 0px); }

/* ---------- Motion: hero from the first frame (CSS only); reveals once (opacity + transform) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: inset(0 0 12% 0 round 12px); opacity: .001; } to { clip-path: inset(0 0 0 0 round 12px); opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .hero h1 { animation: rise .6s var(--ease-out) .04s both; }
  .lede { animation: rise .6s var(--ease-out) .12s both; }
  .hp-1 { animation: unveil .9s var(--ease-out) .06s both; }
  .hp-2 { animation: unveil .9s var(--ease-out) .14s both; }
  .hp-3 { animation: unveil .9s var(--ease-out) .22s both; }
  .galleries .gal-list { animation: rise .6s var(--ease-out) .3s both; }
  .pre { opacity: 0; transform: translateY(18px); }
  [data-reveal] { transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
  /* the hero board draws in once, as Tislerikoda's hero does: each line from its arch tip outward, the inner rings
     first (every path carries its --d delay and --t time), then stays; the head script sets .anim, so without
     JavaScript it is simply there */
  .anim .hero-board path { stroke-dasharray: 1 2; animation: draw var(--t, 1.2s) var(--d, 0s) cubic-bezier(.3, .55, .3, 1) both; }
  /* the footer board draws once when the footer first comes into view (main.js: .wait, then .go) */
  .board.wait .dr, .board.wait .rv { stroke-dasharray: 1 2; stroke-dashoffset: 1.01; }
  .board.go .dr { animation: draw var(--t, 1.4s) var(--d, 0s) cubic-bezier(.25, .7, .3, 1) both; }
  .board.go .rv { animation: draw 1.1s var(--d, 0s) cubic-bezier(.16, 1, .3, 1) both; }
  /* the knot's heart is a fill, not a line: hidden with the rest, it fades in once its rings have drawn */
  .board.wait .bh { opacity: 0; transition: opacity .4s ease .9s; }
  .board.go .bh { opacity: 1; }
}
@keyframes draw { from { stroke-dashoffset: 1.01; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .lb-fig, .lb.is-in .lb-fig { transform: none; transition: none; }
  .nav-call:active, .nav-fb:active, .nav-menu:active, .btn:active, .lb-btn:active, .gal:active .gal-ph,
  .gal:hover .gal-ph img, .more:hover svg { transform: none; }
  .nav-links { transform: none !important; transition: opacity .18s ease !important; }
  .nav-menu path { transition: none; }
}

/* Minu Novu editor: the preview notice is not shown inside the editor frame; the navbar panel, the breadcrumb and the
   footer columns repeat names the page already shows, so they stay out of the way there (they still change with them) */
.nv-frame #nvPre { display: none !important; }
.nv-frame .sub, .nv-frame .crumbs, .nv-frame .foot-links { display: none !important; }

/* ---------- The wood (tools/laast.py): 1 unit = 1 css px, never scaled. Every colour is solid and already mixed with
   the paper, so lines that cross do not get lighter and text over them keeps its contrast. Nothing here takes a tap
   (pointer-events) or widens the page (the hero and the heads clip sideways, the footer and the Teenused band hide
   overflow). The Teenused band's dark board is with the band (Teenused, above). ---------- */
.hero { position: relative; isolation: isolate; overflow-x: hidden; overflow-x: clip; }
.board { display: block; max-width: none; overflow: visible; }
.board .rv { fill: none; }
/* home, HERO_BOARD in tools/build_pages.py: the hero's only wood (16.11: the shaving went, Ats took Tislerikoda's
   hero as the model), a planed pine board's long grain behind the whole hero, the floating navbar too, in the footer
   board's hand. The svg's x 0 is the page centre and its y 0 the hero's top. From 1024 px a mask keeps it at about a
   third behind the text, full round the photos (one arch tip sits in the gap between the text and them), and lets it
   fade out before the round gallery buttons; from about 2100 px it fades out at its own ends. */
.hero-board { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.hero-board svg {
  position: absolute; top: 0; left: 50%; margin-left: -1200px; max-width: none;
  fill: none; stroke-width: 1.3px; stroke-linecap: round; stroke-linejoin: round;
}
.hb-f { stroke: #DDC9A9; }   /* late wood: the firm line of a growth ring, 1.52:1 on the paper as Tislerikoda's grain */
.hb-c { stroke: #ECE0CE; stroke-width: 1.1px; }   /* the lighter line beside it, near the arch tips only */
/* As the photos grow to 210 px (by 1347 px) the gap between the text and them moves left. --s moves the board with it,
   30 px from 1247 to 1347 px: the inner tip stays in the gap, at least 22 px from the text's column and the stair
   photo, and the next two tips stay well behind the stair and window photos instead of meeting a photo's edge. --t is
   where the text's column ends (88 px left of the centre up to 1264 px, 130 px from 1348 px): left of it the board
   is the faint third, from there it rises to full strength 24 px right of the tip, before the photos. */
@media (min-width: 1024px) {
  .hero-board {
    --s: clamp(0px, (100% - 1247px) * .3, 30px);
    --t: clamp(0px, (100% - 1264px) * .5, 42px);
    -webkit-mask-image: linear-gradient(to right, transparent calc(50% - 1200px - var(--s)), rgb(0 0 0 / .32) calc(50% - 1100px - var(--s)), rgb(0 0 0 / .32) calc(50% - 88px - var(--t)), #000 calc(50% - 36px - var(--s)), #000 calc(50% + 1100px - var(--s)), transparent calc(50% + 1200px - var(--s))), linear-gradient(#000 calc(100% - 64px), transparent);
    mask-image: linear-gradient(to right, transparent calc(50% - 1200px - var(--s)), rgb(0 0 0 / .32) calc(50% - 1100px - var(--s)), rgb(0 0 0 / .32) calc(50% - 88px - var(--t)), #000 calc(50% - 36px - var(--s)), #000 calc(50% + 1100px - var(--s)), transparent calc(50% + 1200px - var(--s))), linear-gradient(#000 calc(100% - 64px), transparent);
    -webkit-mask-composite: source-in; mask-composite: intersect;
  }
  .hero-board svg { margin-left: calc(-1200px - var(--s)); }
}
/* narrower the photos come first: the board moves so its arches run through the photo row (--row: the row's bottom
   edge), full there, then faint behind the text, gone before the section ends. The numbers follow the Hero rules
   above: min(100vw, 690px) - 52px is the three photos' widths (the row, the screen less two 16 px gutters and at most
   658 px, less its two 10 px gaps); a photo is 4/3 as tall as wide, so .4444 (4/9) of that is its height; 108 = the
   hero's top padding 92 + .hp-1's margin 16. The svg's top puts the arch tip (y 254) halfway down the row: 100
   (halfway between the photos' tops, 92 and 108) + half a photo's height (.2222) - 254. From 768 px the photos are
   210 px wide: the row ends at 116 + 32 + 280 = 428 px, and its middle (272) less 254 is 18. */
@media (max-width: 1023px) {
  .hero-board {
    --row: calc(108px + (min(100vw, 690px) - 52px) * .4444);
    -webkit-mask-image: linear-gradient(#000 var(--row), rgb(0 0 0 / .32) calc(var(--row) + 20px), rgb(0 0 0 / .32) calc(100% - 120px), transparent calc(100% - 32px));
    mask-image: linear-gradient(#000 var(--row), rgb(0 0 0 / .32) calc(var(--row) + 20px), rgb(0 0 0 / .32) calc(100% - 120px), transparent calc(100% - 32px));
  }
  .hero-board svg { top: calc((min(100vw, 690px) - 52px) * .2222 - 154px); }   /* the arches' axis in the middle of the row */
}
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-board { --row: 428px; }
  .hero-board svg { top: 18px; }
}
/* inner page heads: the hero's board lighter and still, as Tislerikoda's inner page tops (16.11; the short shaving that
   stood here read as a hook). A background from its own file (laast.head_board(), assets/puit/hele-laud.svg), one cached
   copy for the eight pages and no element in the Minu Novu editor; its x 0 is the page centre. Faint behind the text on
   the left, full at the right, gone before the head ends. */
.g-head { position: relative; isolation: isolate; overflow-x: hidden; overflow-x: clip; }
.g-head::before {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: url(assets/puit/hele-laud.svg) no-repeat 50% 0;
  -webkit-mask-image: linear-gradient(to right, rgb(0 0 0 / .35) 0, rgb(0 0 0 / .35) 38%, #000 62%), linear-gradient(#000 45%, transparent);
  mask-image: linear-gradient(to right, rgb(0 0 0 / .35) 0, rgb(0 0 0 / .35) 38%, #000 62%), linear-gradient(#000 45%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
/* one column: the text runs the full width, so the board stays faint and grows towards the right edge */
@media (max-width: 899px) {
  .g-head::before {
    -webkit-mask-image: linear-gradient(to left, #000 0, rgb(0 0 0 / .4) 60%), linear-gradient(#000 35%, transparent);
    mask-image: linear-gradient(to left, #000 0, rgb(0 0 0 / .4) 60%), linear-gradient(#000 35%, transparent);
  }
}
/* footer: the board's right end (with the shavings) at the right edge of the content */
.board-wrap { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.board { position: absolute; bottom: 14px; right: calc(max(var(--gut), 50% - 600px) - 30px); }
.board .dr { fill: none; stroke-width: 1.3px; stroke-linejoin: round; }
.board .se, .board .sg { fill: none; stroke-width: 1.2px; stroke-linejoin: round; }
.board .sg { stroke-width: .9px; }
.board .be { stroke: #E0CDAE; }   /* the board's edges and end cuts */
.board .bl { stroke: #E6D7BE; }   /* late wood */
.board .bm { stroke: #EEE4D3; }   /* the lighter line of a growth ring */
.board .bk { stroke: #D7BF9A; }   /* the knot */
.board .bh { fill: #E6D3B3; }
/* on phones the note can run several lines over the board, where the knot would sit behind the words: the grain
   only bends there */
@media (max-width: 767px) { .board .kn { display: none; } }
