/* Hallmark · genre: editorial · macrostructure: Photographic (home) / Long Document (content) / Catalogue (lavori)
 * theme: custom (vibe: "walnut, warm stone, brass, workshop light")
 * stone oklch(95% 0.012 75) · walnut oklch(21% 0.024 45) · brass oklch(76% 0.115 75) · Cabinet Grotesk + Switzer
 * axes: dark-light alternating / geometric-sans / warm · enrichment: photography · nav: N9 edge-aligned + sheet · footer: Ft1
 * design-system: design.md · designed-as-app
 * Hallmark · pre-emit critique: P4 H5 E4 S4 R4 V5
 */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--space-md); }
body {
  margin: 0;
  background: var(--color-stone);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
  text-wrap: balance;
}
h1 { font-size: var(--text-display); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-md); letter-spacing: -0.01em; line-height: 1.2; }
p, ul, ol, dl, table, figure { margin: 0; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: var(--rule-hair); text-underline-offset: 0.22em; transition: color var(--dur-short) var(--ease-out), text-decoration-color var(--dur-short) var(--ease-out); }
a:hover { color: var(--color-brass-deep); }
:focus-visible { outline: var(--rule-thick) solid var(--color-focus-light); outline-offset: 3px; }
strong { font-weight: 600; }
.tabular, .hours { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: var(--space-sm); top: -4rem; background: var(--color-cream); color: var(--color-ink); padding: var(--space-2xs) var(--space-sm); z-index: var(--z-overlay); border-radius: var(--radius-card); }
.skip:focus { top: var(--space-sm); }
.wrap { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-gutter); }
.lede { font-size: var(--text-md); line-height: 1.5; max-width: 42ch; }
.small { font-size: var(--text-sm); }
.muted { color: var(--color-ink-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* pending facts — visible on purpose until the owner confirms them */
.todo { background: var(--color-todo); color: var(--color-ink); outline: var(--rule-hair) dashed var(--color-todo-rule); padding: 0 0.25em; font-size: 0.92em; }

/* dark surfaces flip link + focus colours */
:is(.head, .band, .contact, .foot, .bleed, .sheet, .closing) a:hover { color: var(--color-brass); }
:is(.head, .band, .contact, .foot, .bleed, .sheet, .closing) :focus-visible { outline-color: var(--color-focus); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); align-items: center; margin-top: var(--space-lg); }
.btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: 0.005em;
  text-decoration: none;
  padding: 0.85em 1.4em;
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-cream);
  border: 0;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.btn:hover { background: var(--color-brass-deep); color: var(--color-cream); }
.btn:active { transform: translateY(1px); }
.btn--brass { background: var(--color-brass); color: var(--color-walnut); }
.btn--brass:hover, :is(.head, .band, .contact, .foot, .bleed, .sheet) .btn--brass:hover { background: var(--color-cream); color: var(--color-walnut); }
.link-arrow { font-family: var(--font-display); font-weight: 700; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--color-brass-deep); text-decoration-thickness: var(--rule-thick); text-underline-offset: 0.3em; }
.link-arrow--light { color: var(--color-cream); text-decoration-color: var(--color-brass); }

/* ---------- nav (edge-aligned, over the dark head) ---------- */
.nav { position: absolute; inset: 0 0 auto 0; z-index: var(--z-nav); color: var(--color-cream); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding-block: var(--space-md); }
.brand { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); letter-spacing: -0.01em; line-height: 1.1; text-decoration: none; white-space: nowrap; }
.brand span { display: block; font-family: var(--font-body); font-weight: 400; font-size: var(--text-xs); letter-spacing: 0.04em; color: var(--color-cream-soft); }
.brand:hover { color: var(--color-cream); }
.nav-right { display: flex; align-items: center; gap: var(--space-sm); }
.nav-lang { font-size: var(--text-sm); text-decoration: none; white-space: nowrap; }
.nav-lang:hover { text-decoration: underline; }
.nav-call { padding: 0.6em 1.1em; font-size: var(--text-sm); }
.nav-menu {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: inherit;
  background: none;
  border: var(--rule-hair) solid currentColor;
  border-radius: var(--radius-pill);
  padding: 0.55em 1.1em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.nav-menu:hover { background: var(--color-cream); color: var(--color-walnut); }
.nav-menu:active { transform: translateY(1px); }

.sheet { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 0; background: var(--color-walnut); color: var(--color-cream); }
.sheet::backdrop { background: var(--color-scrim); }
.sheet-inner { display: grid; align-content: start; min-height: 100%; padding-block: var(--space-md) var(--space-xl); }
.sheet-close { justify-self: end; }
.sheet ul { list-style: none; padding: 0; margin-top: var(--space-xl); }
.sheet li + li { border-top: var(--rule-hair) solid var(--color-line-dark); }
.sheet li a { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 4vw + 0.5rem, 3rem); letter-spacing: -0.02em; line-height: 1.1; padding-block: var(--space-sm); text-decoration: none; }
.sheet li a[aria-current="page"] { color: var(--color-brass); }
.sheet-contact { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-lg); margin-top: var(--space-xl); color: var(--color-cream-soft); }
.sheet-contact a { white-space: nowrap; }

/* ---------- full-bleed head ---------- */
.head { position: relative; display: grid; min-height: min(72svh, 46rem); background: var(--color-walnut); color: var(--color-cream); isolation: isolate; }
.head--home { min-height: min(92svh, 60rem); }
.head--plain { min-height: 0; }
.head > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.head:not(.head--plain)::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--color-scrim) 0%, var(--color-scrim-0) 75%); }
.head-inner { align-self: end; width: 100%; padding-top: calc(var(--space-4xl) + var(--space-md)); padding-bottom: var(--space-2xl); }
.head--plain .head-inner { padding-top: var(--space-4xl); padding-bottom: var(--space-xl); }
.head h1 { max-width: 16ch; }
.head--home h1 { max-width: 13ch; }
.head .lede { margin-top: var(--space-md); color: var(--color-cream); }
.head-credit { position: absolute; right: var(--page-gutter); bottom: var(--space-sm); margin: 0; }
.crumbs { font-size: var(--text-sm); color: var(--color-cream-soft); margin-bottom: var(--space-md); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.crumbs li + li::before { content: "/"; margin-right: var(--space-2xs); opacity: 0.6; }
.crumbs a { white-space: nowrap; }

.credit { font-size: var(--text-xs); color: var(--color-ink-soft); }
.credit a { white-space: nowrap; }
:is(.head, .bleed) .credit { color: var(--color-cream-soft); }

/* ---------- hover swap (e.g. folding door closed → open) ---------- */
.swap { display: grid; }
.swap > img { grid-area: 1 / 1; }
.swap > img + img { opacity: 0; transition: opacity var(--dur-med) var(--ease-out); }
:is(a, figure):hover .swap > img + img, a:focus-visible .swap > img + img { opacity: 1; }
.plates a:hover .swap img { opacity: 1; } /* no dimming: the swap is the hover signal */

/* ---------- home: intro ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--space-2xl); padding-block: var(--space-3xl); align-items: start; }
.intro-lede { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); line-height: 1.3; letter-spacing: -0.012em; max-width: 34ch; }
.facts { display: grid; gap: var(--space-md); }
.facts dt { font-size: var(--text-xs); letter-spacing: 0.06em; color: var(--color-ink-soft); }
.facts dd { margin: var(--space-3xs) 0 0; font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); line-height: 1.25; }

/* ---------- home: services ---------- */
.services { display: grid; gap: var(--space-3xl); padding-bottom: var(--space-3xl); }
.service { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: var(--space-xl) var(--space-2xl); align-items: center; }
.service:nth-child(even) > figure { order: 2; }
.service figure img { width: 100%; aspect-ratio: 4 / 5; max-height: 44rem; object-fit: cover; border-radius: var(--radius-img); }
.service h2 { font-size: var(--text-xl); max-width: 18ch; }
.service p { margin-top: var(--space-sm); max-width: 46ch; color: var(--color-ink-soft); }
.service .link-arrow { display: inline-block; margin-top: var(--space-md); }

.plate-cap { margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--color-ink-soft); display: flex; flex-wrap: wrap; gap: 0 var(--space-2xs); }
.plate-cap b { white-space: nowrap; font-weight: 600; color: var(--color-ink); }

/* ---------- dark band: process ---------- */
.band { background: var(--color-walnut); color: var(--color-cream); padding-block: var(--space-3xl); }
.band h2 { max-width: 20ch; }
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--space-xl); margin-top: var(--space-2xl); }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-brass); margin-bottom: var(--space-sm); }
.steps h3 { font-size: var(--text-md); }
.steps p { margin-top: var(--space-2xs); color: var(--color-cream-soft); }

/* ---------- full-bleed statement photo ---------- */
.bleed { position: relative; display: grid; min-height: min(80svh, 44rem); color: var(--color-cream); isolation: isolate; background: var(--color-walnut); }
.bleed > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.bleed::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--color-scrim) 0%, var(--color-scrim-0) 70%); }
.bleed-text { align-self: end; width: 100%; padding-bottom: var(--space-2xl); }
.bleed-text p { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); line-height: 1.08; letter-spacing: -0.02em; max-width: 22ch; }

/* ---------- archive rail ---------- */
.archive { padding-block: var(--space-3xl) var(--space-2xl); }
.archive-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-sm) var(--space-lg); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(14rem, 22%); gap: var(--space-sm); overflow-x: auto; scroll-snap-type: x mandatory; margin-top: var(--space-xl); padding-bottom: var(--space-sm); scrollbar-width: thin; }
.rail a { scroll-snap-align: start; }
.rail img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-img); transition: opacity var(--dur-short) var(--ease-out); }
.rail a:hover img { opacity: 0.85; }

/* ---------- FAQ ---------- */
.faq-block { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--space-xl) var(--space-2xl); padding-block: var(--space-2xl) var(--space-3xl); align-items: start; }
.faq { max-width: var(--measure); }
.prose .faq { margin-top: var(--space-md); }
.faq details { border-bottom: var(--rule-hair) solid var(--color-line); }
.faq details:first-child { border-top: var(--rule-hair) solid var(--color-line); }
.faq summary { cursor: pointer; list-style: none; padding-block: var(--space-md); font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); line-height: 1.3; display: flex; justify-content: space-between; gap: var(--space-md); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--color-brass-deep); flex: none; transition: transform var(--dur-short) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--color-brass-deep); }
.faq .answer { padding-bottom: var(--space-md); color: var(--color-ink-soft); }
.faq .answer > * + * { margin-top: var(--space-xs); }

/* ---------- contact band ---------- */
.contact { background: var(--color-walnut-2); color: var(--color-cream); }
.contact-inner { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--space-2xl); padding-block: var(--space-3xl); }
.contact .lede { margin-top: var(--space-md); color: var(--color-cream-soft); }
.contact-phone { margin-block: var(--space-xl) var(--space-md); }
.contact-phone a { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.nap { font-style: normal; display: grid; gap: var(--space-md); align-content: start; }
.nap dt { font-size: var(--text-xs); letter-spacing: 0.06em; color: var(--color-ink-soft); }
.contact .nap dt { color: var(--color-cream-soft); }
.nap dd { margin: var(--space-3xs) 0 0; font-size: var(--text-md); }
.nap a { white-space: nowrap; }

/* ---------- content pages ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: var(--space-2xl) var(--space-3xl); padding-block: var(--space-2xl) var(--space-3xl); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--space-sm); }
.prose > h2 { margin-top: var(--space-2xl); font-size: var(--text-xl); }
.prose > h3 { margin-top: var(--space-xl); }
.prose > h2 + *, .prose > h3 + * { margin-top: var(--space-sm); }
.prose > figure:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: var(--space-2xs); }
.prose li::marker { color: var(--color-brass-deep); }
.prose figure { margin-block: var(--space-xl); }
.prose figure img { width: auto; max-width: 100%; max-height: 34rem; border-radius: var(--radius-img); }
.prose figcaption { margin-top: var(--space-2xs); }
.doc aside { position: sticky; top: var(--space-md); align-self: start; background: var(--color-stone-2); border-radius: var(--radius-card); padding: var(--space-lg); font-size: var(--text-sm); }
.doc aside > * + * { margin-top: var(--space-sm); }
.doc aside ul { list-style: none; padding: 0; }
.doc aside li + li { margin-top: var(--space-2xs); }
.updated { font-size: var(--text-sm); color: var(--color-ink-soft); margin-top: var(--space-xl); }

.table-wrap { overflow-x: auto; margin-block: var(--space-lg); }
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); min-width: 34rem; }
caption { text-align: left; font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); padding-bottom: var(--space-xs); }
th, td { text-align: left; vertical-align: top; padding: var(--space-xs) var(--space-sm) var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-line); }
thead th { border-bottom: var(--rule-thick) solid var(--color-ink); font-weight: 600; }
tbody th { font-weight: 600; }

.closing { background: var(--color-walnut); color: var(--color-cream); border-radius: var(--radius-card); padding: var(--space-xl); margin-top: var(--space-2xl); }
.closing p { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); line-height: 1.25; max-width: 28ch; }

/* ---------- lavori · catalogue ---------- */
.plates { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: var(--space-xl) var(--space-md); padding-block: var(--space-2xl) var(--space-3xl); }
.plates a { display: block; text-decoration: none; }
.plates img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--color-stone-2); border-radius: var(--radius-img); transition: opacity var(--dur-short) var(--ease-out); }
.plates a:hover img { opacity: 0.85; }
.plates a:hover .plate-cap span { color: var(--color-brass-deep); }

dialog.viewer { border: 0; padding: 0; background: none; overflow: visible; max-width: min(92vw, 60rem); max-height: 92dvh; color: var(--color-cream); }
dialog.viewer::backdrop { background: var(--color-scrim); }
dialog.viewer img { max-height: 74dvh; width: auto; margin-inline: auto; border-radius: var(--radius-img); }
dialog.viewer p { margin-top: var(--space-xs); text-align: center; }
dialog.viewer .viewer-media.swap:hover img + img, dialog.viewer .viewer-media.is-open img + img { opacity: 1; }
dialog.viewer .viewer-toggle { display: block; margin: var(--space-sm) auto 0; }
dialog.viewer .viewer-toggle[hidden] { display: none; }
dialog.viewer form { position: fixed; top: var(--space-sm); right: var(--space-sm); }
dialog.viewer button { font: inherit; font-family: var(--font-display); font-weight: 700; background: var(--color-cream); color: var(--color-walnut); border: 0; border-radius: var(--radius-pill); padding: var(--space-2xs) var(--space-md); cursor: pointer; white-space: nowrap; }
dialog.viewer button:hover { background: var(--color-brass); }

/* ---------- footer ---------- */
.foot { background: var(--color-walnut); color: var(--color-cream); padding-block: var(--space-2xl) var(--space-xl); }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-md); padding-bottom: var(--space-xl); border-bottom: var(--rule-hair) solid var(--color-line-dark); }
.foot-brand { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); letter-spacing: -0.02em; line-height: 1; }
.foot-brand span { display: block; margin-top: var(--space-xs); font-family: var(--font-body); font-weight: 400; font-size: var(--text-sm); letter-spacing: 0; color: var(--color-cream-soft); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--space-xl); padding-top: var(--space-xl); }
.foot-links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: var(--space-2xs) var(--space-xl); }
.foot-links a { white-space: nowrap; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-dense { font-size: var(--text-sm); line-height: 1.75; color: var(--color-cream-soft); max-width: 70ch; }
.foot-dense a { color: var(--color-cream); white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 56rem) {
  .intro, .service, .faq-block, .contact-inner, .doc, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .service:nth-child(even) > figure { order: 0; }
  .intro { gap: var(--space-xl); padding-block: var(--space-2xl); }
  .services { gap: var(--space-2xl); }
  .doc aside { position: static; }
  .rail { grid-auto-columns: minmax(0, 62%); }
  .head-credit { position: static; padding: 0 var(--page-gutter) var(--space-sm); }
}
@media (max-width: 30rem) {
  .nav-lang { display: none; }
  .brand span { display: none; }
  .nav-right { gap: var(--space-2xs); }
  .brand { font-size: var(--text-base); }
  .nav-call, .nav-menu { padding: 0.5em 0.8em; font-size: var(--text-xs); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
