/* ==========================================================
   Laboo — Directory
   Stessa grafica del sito (nuovo/assets/css/laboo.css): carta e inchiostro,
   Manrope e JetBrains Mono, un solo colore d'accento (--c) per la bolla.
   ========================================================== */

:root {
  --paper: #F6F5F1;
  --ink: #141414;
  --text: #3E3C38;
  --muted: #6B6862;
  --line: #D9D6CE;
  --box: #ECEAE3;
  --c: #7D8C2E;
  --cd: #5A6620; /* accento scuro per testo su carta: contrasto 5.7:1 */
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad-x: clamp(20px, 6vw, 112px);
  --head-x: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; height: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -80px; z-index: 50;
  padding: 12px 18px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font-weight: 500; font-size: 14px;
}
.skip:focus { top: 16px; }

.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; font-weight: 400; color: var(--muted); }
.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--pad-x); }

/* ---------- Intestazione ---------- */
.site-header {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 28px var(--head-x);
}
.wordmark {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  padding: 8px 0;
}
.wordmark__logo { flex: none; width: auto; height: 26px; fill: currentColor; }
.wordmark__text span { opacity: .72; }
.head-link {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  min-height: 44px; display: inline-flex; align-items: center; gap: 10px;
  padding: 0 18px; border: 1px solid var(--ink); border-radius: 999px;
  transition: background .3s, color .3s;
}
.head-link::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.head-link:hover, .head-link[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- Briciole ---------- */
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.crumbs li + li::before { content: "/"; padding: 0 10px; }
.crumbs a { display: inline-block; padding: 8px 0; text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--line); }
.crumbs a:hover { color: var(--ink); text-decoration-color: currentColor; }
.crumbs a[aria-current="page"] { text-decoration: none; color: var(--ink); }

/* ---------- Testata con la bolla ---------- */
.fill-c { fill: var(--c); }
.stroke-c { fill: none; stroke: var(--c); }
.hero { position: relative; padding-top: clamp(32px, 6vw, 96px); padding-bottom: clamp(48px, 6vw, 96px); }
.hero__bubble { position: absolute; right: clamp(-60px, 2vw, 40px); top: clamp(-20px, 2vw, 40px); width: clamp(140px, 22vw, 320px); height: auto; overflow: visible; pointer-events: none; }
.hero__text { position: relative; display: flex; flex-direction: column; gap: 24px; max-width: 880px; animation: rise 1s var(--ease) both; }
.h-display { font-size: clamp(42px, 6.5vw, 96px); font-weight: 300; letter-spacing: -.04em; line-height: .98; overflow-wrap: break-word; hyphens: auto; }
.lead { font-size: clamp(19px, 1.9vw, 26px); font-weight: 300; line-height: 1.45; max-width: 640px; }
@media (max-width: 700px) {
  /* su telefono la bolla sta sopra il titolo, non dietro */
  .hero__bubble { position: relative; display: block; right: auto; top: auto; width: 120px; margin: 0 0 24px auto; }
}

/* icona disegnata dentro la bolla */
.lb-b1, .lb-b2, .lb-grow, .lb-rise { transform-box: fill-box; transform-origin: center; }
.lb-grow { animation: grow 1.4s cubic-bezier(.3, .7, .3, 1) .2s both; }
.lb-icon { fill: none; stroke: var(--paper); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.lb-icon > * { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s cubic-bezier(.6, 0, .2, 1) forwards; }
.lb-icon > :nth-child(1) { animation-delay: 1.4s; }
.lb-icon > :nth-child(2) { animation-delay: 1.65s; }
.lb-icon > :nth-child(3) { animation-delay: 1.9s; }
.lb-icon > :nth-child(4) { animation-delay: 2.1s; }
.lb-b1 { animation: float-a 6s ease-in-out infinite; }
.lb-b2 { animation: float-b 4.8s ease-in-out infinite .6s; }
.lb-rise { opacity: 0; animation: bubble-rise 5.5s ease-out infinite; }
.lb-r1 { animation-duration: 5.5s; animation-delay: 1.8s; }
.lb-r2 { animation-duration: 4.2s; animation-delay: .6s; }

/* ---------- Sezioni ---------- */
.section { display: flex; flex-direction: column; gap: 32px; padding-bottom: clamp(64px, 8vw, 128px); }

/* in primo piano */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 40px 40px; }
.card { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--ink); }
.card h3 { font-size: clamp(20px, 1.8vw, 24px); font-weight: 400; letter-spacing: -.02em; line-height: 1.25; }
.card h3 a { display: inline; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .4s var(--ease); }
.card h3 a:hover, .card h3 a:focus-visible { background-size: 100% 1px; }
.card__arrow { color: var(--cd); }
.card p { color: var(--text); font-size: 15px; }

/* categorie */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 48px 40px; }
.cat { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 24px; }
.cat__nome { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); font-size: clamp(22px, 2.2vw, 28px); font-weight: 300; letter-spacing: -.02em; line-height: 1.2; }
.cat__n { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.cat:target .cat__nome { border-bottom-color: var(--c); border-bottom-width: 3px; }

/* elenco delle voci (categorie e "altre voci") */
.voci { list-style: none; margin: 0; padding: 0; }
.voci a { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 6px 0; font-size: 17px; border-bottom: 1px solid var(--line); transition: padding .3s var(--ease); }
.voci__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); transition: transform .35s var(--ease); }
.voci__dot--ink { background: var(--ink); }
.voci a:hover, .voci a:focus-visible { padding-left: 6px; }
.voci a:hover .voci__dot, .voci a:focus-visible .voci__dot { transform: scale(1.6); }
.altre .voci { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); column-gap: 40px; }

/* scheda di un sito */
.sito { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 28px; border-top: 1px solid var(--ink); }
.sito + .sito { margin-top: 24px; }
@media (min-width: 900px) {
  .sito--img { grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); align-items: start; gap: 64px; }
}
.sito__testo { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.sito__nome { font-size: clamp(26px, 3.4vw, 44px); font-weight: 300; letter-spacing: -.03em; line-height: 1.1; }
.sito__nome a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; text-decoration-color: var(--line); transition: text-decoration-color .3s; }
.sito__nome a:hover, .sito__nome a:focus-visible { text-decoration-color: currentColor; }
.sito__img { display: block; width: 100%; max-width: 320px; border-radius: 20px; background: var(--box); }
.prose { display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: 1.65; color: var(--text); }
.prose ul { margin: 0; padding-left: 1.2em; }
.prose li { padding: 2px 0; }
.prose li::marker { color: var(--cd); }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.prose h4 { margin-top: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; font-weight: 400; color: var(--muted); text-transform: lowercase; }
@media (min-width: 700px) { .prose .cols { columns: 2; column-gap: 40px; } .prose .cols li { break-inside: avoid; } }
.btn-link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 22px;
  border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 500; font-size: 15px;
  transition: transform .3s var(--ease);
}
.btn-link:hover { transform: translateY(-2px); }
.btn-link:focus-visible { outline-color: var(--ink); }

/* ---------- Invito e piè di pagina ---------- */
.cta { border-top: 1px solid var(--line); }
.cta__inner { padding-block: clamp(56px, 7vw, 112px) clamp(40px, 5vw, 64px); display: flex; flex-direction: column; gap: 18px; }
.cta__text { max-width: 640px; color: var(--text); }
.cta__text a { text-decoration: underline; text-underline-offset: .2em; }
.cta__mail { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .2em; font-size: clamp(36px, 6vw, 88px); font-weight: 300; letter-spacing: -.04em; line-height: 1.05; overflow-wrap: anywhere; }
.cta__mail span { color: var(--cd); }

.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  padding: 24px var(--head-x); /* allineato all'intestazione: scritta "laboo/" a sinistra, menu a destra */
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted);
}
.links { display: flex; flex-wrap: wrap; gap: 0 20px; list-style: none; margin: 0; padding: 0; }
.links li { display: flex; }
.site-footer a { display: inline-block; padding: 6px 0; text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--line); }
.site-footer a:hover { color: var(--ink); }

/* ---------- Animazioni ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float-a { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes float-b { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes bubble-rise { 0% { transform: translateY(0) scale(.4); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-230px) scale(1); opacity: 0; } }
@keyframes grow { 0% { transform: translateY(160px) scale(.06); } 55% { transform: translateY(0) scale(1.06); } 78% { transform: scale(.97); } 100% { transform: none; } }

/* Torna su (come nel sito, assets/css/laboo.css) */
.to-top {
  /* --lift (da directory.js): quando si vede il footer il pulsante sale sopra di esso */
  position: fixed; right: var(--head-x); bottom: max(28px, var(--lift, 0px)); z-index: 25;
  width: 48px; height: 48px; border: 0; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper); cursor: pointer;
  box-shadow: 0 6px 20px rgba(20, 20, 20, .18);
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.6);
  transition: opacity .35s, visibility .35s, transform .45s cubic-bezier(.3, .7, .3, 1);
}
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.is-far .to-top { opacity: 1; visibility: visible; transform: none; }
.is-far .to-top:hover { transform: translateY(-3px); }
.to-top:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important;
    animation-iteration-count: 1 !important; transition-duration: .01ms !important;
  }
}

@media print {
  .hero__bubble, .skip, .head-link, .cta, .to-top { display: none; }
  body { background: #fff; }
}
