/* =========================================================
   CASA HoN — stili comuni a tutte le stanze
   Ogni stanza aggiunge i suoi in css/stanze/<nome>.css
   ========================================================= */

/* ---------- font serviti in casa (solo caratteri latini, licenza OFL) ---------- */
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(/assets/fonts/rubik.woff2) format("woff2"); }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/kalam-400.woff2) format("woff2"); }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/kalam-700.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/jetbrains-mono.woff2) format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 900; font-display: swap; src: url(/assets/fonts/playfair-900.woff2) format("woff2"); }
@font-face { font-family: "Archivo Black"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/archivo-black.woff2) format("woff2"); }

:root {
  /* le due luci di casa */
  --dani: #1f8bff;
  --ome: #9b3cff;
  --both: linear-gradient(100deg, #06b6ff, #424dff 50%, #b625ff);
  --lamp: #ffc477;
  --discord: #5865f2;
  --night: #0b0912;
  --text: #f1ecf8;
  --dim: #aaa2bf;
  --paper: #fff6d8;
  --accent: var(--lamp); /* ogni stanza può cambiarlo */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--night); color: var(--text);
  font: 17px/1.6 Rubik, system-ui, sans-serif;
}
img, svg { max-width: 100%; }
img { display: block; height: auto; }
a { color: inherit; }
button { font: inherit; }
.wrap { width: min(100% - 32px, 1140px); margin-inline: auto; }

a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px;
}

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--discord); color: #fff; border-radius: 8px; }
.skip:focus { top: 12px; }

/* sprite di disegni condivisi (es. le locandine): invisibile, si usa con <use> */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- biglietto scritto a mano (post-it) ---------- */
.note {
  font-family: Kalam, cursive; color: #2b2233; background: var(--paper);
  padding: 12px 16px 10px; line-height: 1.35; font-size: 1.05rem;
  box-shadow: 0 10px 24px rgb(0 0 0 / .45); position: relative; max-width: 300px;
}
.note::before { content: ""; position: absolute; top: -10px; left: 50%; width: 70px; height: 20px; transform: translateX(-50%) rotate(-3deg); background: rgb(255 255 255 / .45); }
.note b { font-weight: 700; }
.note .sig { display: block; text-align: right; font-weight: 700; margin-top: 4px; color: #6a5cff; }

/* ---------- barra in alto ---------- */
.nav { position: sticky; top: 0; z-index: 30; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; background: rgb(11 9 18 / .55); backdrop-filter: blur(10px); }
.nav.is-scrolled { background: rgb(11 9 18 / .88); border-bottom-color: rgb(255 255 255 / .06); }
.nav__inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; margin-right: auto; }
.nav__brand img { width: 50px; height: auto; }
.bell { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--discord); color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 6px 22px rgb(88 101 242 / .45); white-space: nowrap; }
.bell:hover { filter: brightness(1.1); }

.rooms-menu { position: relative; }
.rooms-menu summary { list-style: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .12); font-weight: 600; font-size: .95rem; color: var(--text); user-select: none; }
.rooms-menu summary::-webkit-details-marker { display: none; }
.rooms-menu[open] summary { background: rgb(255 255 255 / .08); }
.rooms-menu ul {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; margin: 0; padding: 8px; list-style: none;
  background: #17131f; border: 1px solid rgb(255 255 255 / .1); border-radius: 14px; box-shadow: 0 24px 50px rgb(0 0 0 / .55);
}
.rooms-menu a { display: block; padding: 9px 12px; border-radius: 9px; text-decoration: none; color: var(--dim); font-weight: 600; }
.rooms-menu a:hover { background: rgb(255 255 255 / .06); color: var(--text); }
.rooms-menu a[aria-current="page"] { color: var(--text); background: rgb(255 255 255 / .08); }
.rooms-menu a[aria-current="page"]::after { content: " · sei qui"; font: .7rem "JetBrains Mono", monospace; color: var(--accent); }

@media (max-width: 600px) {
  .nav__brand span, .bell span { display: none; }
  .rooms-menu { position: static; }
  .rooms-menu ul { left: 12px; right: 12px; min-width: 0; }
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid rgb(255 255 255 / .06); background: rgb(0 0 0 / .25); padding: 46px 0 40px; }
.foot__inner { display: grid; justify-items: center; text-align: center; gap: 14px; color: var(--dim); font-size: .95rem; }
.foot__logo img { width: 110px; height: auto; }
.foot__rooms { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.foot__rooms a { text-decoration: none; color: var(--dim); }
.foot__rooms a:hover { color: var(--text); }
.foot__sites { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.foot__sites a { text-decoration: none; font: .78rem "JetBrains Mono", monospace; color: var(--dim); padding: 3px 10px; border: 1px solid rgb(255 255 255 / .1); border-radius: 999px; }
.foot__sites a:hover { color: var(--text); border-color: rgb(255 255 255 / .25); }
.foot__note { margin: 0; }
.foot__motion { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font: .78rem "JetBrains Mono", monospace; }
.foot__motion button { background: none; border: 1px solid rgb(255 255 255 / .14); color: var(--dim); border-radius: 999px; padding: 3px 10px; cursor: pointer; font: inherit; }
.foot__motion button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }
.foot__small { margin: 0; font: .75rem "JetBrains Mono", monospace; color: #6f6887; }

/* ---------- comparse allo scroll ---------- */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.js-reveal [data-reveal].in { opacity: 1; transform: none; }

/* ---------- animazioni spente (dal sistema o dall'interruttore) ---------- */
.calm *, .calm *::before, .calm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- i siti di casa (link diretti ai servizi) ---------- */
.sites { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.sites a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%;
  padding: 26px 18px 18px; border-radius: 16px; text-decoration: none; text-align: center; overflow: hidden; isolation: isolate;
  background: linear-gradient(#17131f, #120f19); border: 1px solid #2a2338;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
/* la lampadina sopra ogni sito, nel suo colore */
.sites a::before { content: ""; position: absolute; top: 0; left: 50%; width: 46px; height: 6px; transform: translateX(-50%); border-radius: 0 0 14px 14px; background: var(--c); box-shadow: 0 0 18px 3px var(--c); }
.sites a::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 55% at 50% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 75%); opacity: .55; transition: opacity .3s; }
.sites a:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--c) 55%, #2a2338); box-shadow: 0 18px 40px rgb(0 0 0 / .45); }
.sites a:hover::after { opacity: 1; }
.sites__art svg { width: 120px; height: 92px; filter: drop-shadow(0 10px 8px rgb(0 0 0 / .5)); transition: transform .35s; }
.sites a:hover .sites__art svg { transform: translateY(-6px) rotate(-3deg); }
.sites__tag {
  position: relative; font: 700 1.08rem Kalam, cursive; color: #2b2233; background: var(--paper);
  padding: 2px 14px 2px 20px; border-radius: 3px; transform: rotate(-2deg); box-shadow: 0 4px 10px rgb(0 0 0 / .4); white-space: nowrap;
}
.sites__tag::before { content: ""; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #2b2233; transform: translateY(-50%); }
.sites li:nth-child(even) .sites__tag { transform: rotate(2deg); }
.sites__line { color: var(--dim); font-size: .93rem; line-height: 1.4; }
.sites__go { margin-top: auto; display: grid; gap: 2px; justify-items: center; }
.sites__go small { font: .7rem "JetBrains Mono", monospace; color: #6f6887; }
.sites__go b { font: 700 .82rem "JetBrains Mono", monospace; color: var(--c); }
@media (max-width: 860px) { .sites { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .sites { grid-template-columns: 1fr; } .sites__art svg { width: 100px; height: 76px; } }
