/* Reiboku Bonsai — fogli di stile. Token dal design system "Reiboku Bonsai" (tavole di brand di Luca). */

@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/playfair-display-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/playfair-display-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/playfair-display-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  --sumi: #0F1010;
  --washi: #F7F4EB;
  --legno: #A4A7A6;
  --cinabro: #9E2F2A;
  --testo-muto: #5E605F;
  --filetto-washi: #DAD6CC;
  --filetto-sumi: rgba(247, 244, 235, 0.16);

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-text: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 120px;

  --container: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--washi);
  color: var(--sumi);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--washi); color: var(--sumi); padding: var(--space-1) var(--space-2); z-index: 100; }
.skip:focus { left: var(--space-2); top: var(--space-2); }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header (tavola 06 · Header sito) ---------- */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--header-h);
  color: var(--washi);
}
.site-header--solid { position: relative; background: var(--sumi); border-bottom: 1px solid var(--filetto-sumi); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.brand { display: block; line-height: 0; }
.brand img { width: 118px; height: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  font-size: 13px; font-weight: 400; letter-spacing: 0.04em; text-decoration: none;
  color: var(--washi); opacity: 0.86; padding: 10px 0;
}
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.menu-btn {
  appearance: none; background: none; border: 0; color: var(--washi); cursor: pointer;
  width: 44px; height: 44px; margin-right: -12px; display: inline-flex; align-items: center; justify-content: center;
}
.menu-btn svg { width: 18px; height: 14px; }

.menu {
  position: fixed; inset: 0; z-index: 50; background: var(--sumi); color: var(--washi);
  display: none; flex-direction: column;
}
.menu[data-open="true"] { display: flex; }
.menu__top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.menu__list { list-style: none; margin: 0; padding: var(--space-5) 0 0; display: flex; flex-direction: column; gap: var(--space-3); }
.menu__list a { font-family: var(--font-display); font-size: clamp(32px, 6vw, 48px); line-height: 1.1; text-decoration: none; }
.menu__list a:hover { color: var(--legno); }
.menu__foot { margin-top: auto; padding-bottom: var(--space-4); font-size: 13px; color: var(--legno); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.menu__foot a { text-decoration: none; }

/* ---------- Hero (tavola 06 · Header sito) ---------- */
.hero {
  position: relative; min-height: min(86vh, 820px); background: var(--sumi); color: var(--washi);
  display: flex; align-items: center; overflow: hidden;
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15,16,16,0.92) 0%, rgba(15,16,16,0.72) 38%, rgba(15,16,16,0.18) 72%, rgba(15,16,16,0.05) 100%);
}
.hero::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 180px; z-index: 1;
  background: linear-gradient(180deg, rgba(15,16,16,0.75) 0%, rgba(15,16,16,0) 100%);
}
.hero .container { position: relative; z-index: 2; padding-top: var(--header-h); }
.hero__title {
  margin: 0; max-width: 11ch;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(44px, 6.4vw, 88px); line-height: 1.08; letter-spacing: -0.005em;
}
.hero .btn { margin-top: clamp(28px, 4vw, 48px); }

/* ---------- Bottone (contorno sottile, angoli vivi) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 18px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid currentColor; background: transparent; color: inherit;
  font-family: var(--font-text); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.btn svg { width: 22px; height: 8px; flex: none; }
.on-dark .btn:hover, .btn--light:hover { background: var(--washi); color: var(--sumi); }
.on-light .btn:hover, .btn--dark:hover { background: var(--sumi); color: var(--washi); }

/* ---------- Sezioni ---------- */
.section { padding: clamp(72px, 10vw, var(--space-6)) 0; }
.on-dark { background: var(--sumi); color: var(--washi); }
.on-light { background: var(--washi); color: var(--sumi); }
.label {
  margin: 0 0 var(--space-4);
  font-family: var(--font-text); font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cinabro);
}
.on-dark .label { color: var(--legno); }
.h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 5.2vw, 72px); line-height: 1.06; }
.h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.1; }
.h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.2; }
.lead { margin: 0; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.6; max-width: 56ch; }
.muted { color: var(--testo-muto); }
.on-dark .muted { color: var(--legno); }
.rule { height: 0; border: 0; border-top: 1px solid var(--filetto-washi); margin: 0; }
.on-dark .rule { border-top-color: var(--filetto-sumi); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }

/* Significato / payoff */
.meaning { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.payoff { margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(40px, 5.6vw, 80px); line-height: 1.05; }
.meaning__card { display: flex; gap: var(--space-4); align-items: center; padding-left: var(--space-4); border-left: 1px solid var(--filetto-washi); }
.meaning__seal { width: 72px; flex: none; }
.meaning__title { margin: 0 0 var(--space-1); font-family: var(--font-display); font-size: 28px; line-height: 1.2; }
.meaning__lines { margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.7; color: var(--testo-muto); }

/* ---------- Schede esemplari (tavola 06 · Scheda dell'esemplare) ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); }
.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.card__media { position: relative; aspect-ratio: 5 / 4; overflow: hidden; background: #1A1B1B; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card__media img { transform: scale(1.03); }
.card__media .card__seal { position: absolute; top: 16px; left: 16px; width: 22px; height: auto; object-fit: contain; transform: none; }
.card__body { padding-top: var(--space-3); }
.card__num { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--testo-muto); }
.card__title { margin: 6px 0 var(--space-2); font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 24px; line-height: 1.25; }

.specs { margin: 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--filetto-washi); }
.specs dt, .specs dd { margin: 0; padding: 10px 0; min-height: 41px; border-bottom: 1px solid var(--filetto-washi); font-size: 13px; display: flex; align-items: center; }
.specs dt { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; padding-right: var(--space-3); color: var(--testo-muto); }
.specs dd { justify-content: flex-end; text-align: right; }

.empty { padding: var(--space-5) 0; border-top: 1px solid var(--filetto-washi); color: var(--testo-muto); }

/* Pagina esemplare */
.specimen { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.specimen__media { position: relative; background: #1A1B1B; }
.specimen__media img { width: 100%; height: auto; }
.specimen__info { position: sticky; top: var(--space-4); }
.specimen__title { margin: var(--space-1) 0 var(--space-4); font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(36px, 4.2vw, 56px); line-height: 1.08; }
.specimen__text { margin: var(--space-4) 0; font-size: 16px; line-height: 1.7; }
.back { display: inline-block; margin-bottom: var(--space-4); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--testo-muto); }
.back:hover { color: var(--sumi); }

/* ---------- Servizi ---------- */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--filetto-sumi); }
.on-light .services { border-top-color: var(--filetto-washi); }
.service { padding: var(--space-4) var(--space-4) var(--space-4) 0; border-right: 1px solid var(--filetto-sumi); }
.on-light .service { border-right-color: var(--filetto-washi); }
.service + .service { padding-left: var(--space-4); }
.service:last-child { border-right: 0; padding-right: 0; }
.service__num { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; color: var(--cinabro); }
.on-dark .service__num { color: var(--legno); }
.service__title { margin: var(--space-2) 0 var(--space-2); }
.service__text { margin: 0; font-size: 15px; line-height: 1.65; }
.service__list { list-style: none; margin: var(--space-3) 0 0; padding: 0; font-size: 13px; line-height: 1.5; }
.service__list li { padding: 9px 0; border-top: 1px solid var(--filetto-washi); }
.on-dark .service__list li { border-top-color: var(--filetto-sumi); }

/* ---------- Contatti ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-5); align-items: end; }
.contact__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--filetto-washi); }
.on-dark .contact__list { border-top-color: var(--filetto-sumi); }
.contact__list li { display: flex; justify-content: space-between; gap: var(--space-3); padding: 14px 0; border-bottom: 1px solid var(--filetto-washi); font-size: 15px; }
.on-dark .contact__list li { border-bottom-color: var(--filetto-sumi); }
.contact__list span { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--testo-muto); align-self: center; }
.on-dark .contact__list span { color: var(--legno); }
.contact__list a { text-decoration: none; }
.contact__list a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Page head (pagine interne) ---------- */
.page-head { padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); }
.page-head .lead { margin-top: var(--space-3); }

/* ---------- Footer ---------- */
.site-footer { background: var(--sumi); color: var(--washi); padding: var(--space-5) 0 var(--space-4); }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--filetto-sumi); }
.footer__logo { width: 230px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-1) 28px; font-size: 13px; }
.footer__nav a { text-decoration: none; color: var(--washi); opacity: .86; }
.footer__nav a:hover { opacity: 1; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-3); font-size: 12px; color: var(--legno); }
.footer__bottom a { color: var(--legno); text-decoration: none; }
.footer__bottom a:hover { color: var(--washi); }

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: flex; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services { grid-template-columns: minmax(0, 1fr); }
  .service, .service + .service { padding: var(--space-4) 0; border-right: 0; border-bottom: 1px solid var(--filetto-sumi); }
  .on-light .service, .on-light .service + .service { border-bottom-color: var(--filetto-washi); }
  .service:last-child { border-bottom: 0; }
  .meaning, .contact, .specimen { grid-template-columns: minmax(0, 1fr); }
  .specimen__info { position: static; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .hero { min-height: 88vh; align-items: flex-end; padding-bottom: var(--space-5); }
  .hero__img { object-position: 62% 50%; }
  .hero::after { background: linear-gradient(0deg, rgba(15,16,16,0.94) 0%, rgba(15,16,16,0.7) 45%, rgba(15,16,16,0.2) 100%); }
  .meaning__card { padding-left: 0; border-left: 0; padding-top: var(--space-4); border-top: 1px solid var(--filetto-washi); }
}
@media (max-width: 560px) {
  .grid-cards { grid-template-columns: minmax(0, 1fr); }
  .brand img { width: 104px; }
  .footer__logo { width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card__media img { transition: none; }
}

/* Dettagli dell'esemplare */
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }
.details__item { margin: 0; aspect-ratio: 1 / 1; overflow: hidden; background: #1A1B1B; }
.details__item img { width: 100%; height: 100%; object-fit: cover; }
.card__media { background: #121313; }

/* Foto a schermo intero */
.zoom { display: block; cursor: zoom-in; }
.zoom:focus-visible { outline: 1px solid var(--sumi); outline-offset: 4px; }
.lb { position: fixed; inset: 0; z-index: 100; background: var(--sumi); display: flex; align-items: center; justify-content: center; color: var(--washi); }
.lb[hidden] { display: none; }
.lb__fig { margin: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 64px 72px 24px; box-sizing: border-box; }
.lb__img { max-width: 100%; max-height: calc(100% - 40px); width: auto; height: auto; object-fit: contain; }
.lb__cap { font-size: 12px; letter-spacing: 0.06em; color: var(--legno); text-align: center; }
.lb__btn { position: absolute; z-index: 1; appearance: none; background: none; border: 0; color: var(--washi); cursor: pointer; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; opacity: .85; }
.lb__btn:hover, .lb__btn:focus-visible { opacity: 1; }
.lb__btn:focus-visible { outline: 1px solid var(--washi); outline-offset: 2px; }
.lb__btn svg { width: 22px; height: 22px; }
.lb__close { top: 12px; right: 12px; }
.lb__close svg { width: 18px; height: 18px; }
.lb__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb__next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 760px) {
  .lb__fig { padding: 60px 8px 20px; }
  .lb__prev, .lb__next { top: auto; bottom: 8px; transform: none; }
}
.details__title { margin: var(--space-4) 0 var(--space-2); }
.details__fig { margin: 0; }
.details__cap { margin-top: 8px; font-size: 12px; line-height: 1.4; color: var(--testo-muto); }
.details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .details { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Schede: foto intera su passe-partout, senza tagli, qualunque sia l'orientamento */
.card__media { aspect-ratio: 4 / 5; background: #ECE8DE; }
.card__media img { object-fit: contain; }
.specimen__info .specs + .btn { margin-top: var(--space-4); }
