/* ==========================================================
   Le Terrazze — Modern luxury condominium site
   Design language: warm espresso + cream + gold, glassmorphism
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Palette */
  --bg: #faf7f2;
  --bg-soft: #f3ede2;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --ink: #1a1410;
  --ink-soft: #5a4d40;
  --ink-mute: #8a7d6f;
  --accent: #b08a5a;
  --accent-deep: #8b6a3f;
  --accent-soft: #d9c2a2;
  --accent-glow: rgba(176, 138, 90, 0.18);
  --espresso: #2c1810;
  --rule: #e6dccb;
  --rule-soft: #f0e8da;
  --gold-grad: linear-gradient(135deg, #d4a574 0%, #b08a5a 50%, #8b6a3f 100%);
  --espresso-grad: linear-gradient(180deg, #2c1810 0%, #3d2517 100%);

  /* Type */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --nav-h: 72px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 6px rgba(44, 24, 16, 0.05);
  --shadow-md: 0 8px 24px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 20px 60px rgba(44, 24, 16, 0.14);
  --shadow-glow: 0 8px 32px rgba(176, 138, 90, 0.25);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gold-grad);
  z-index: 1000;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   NAVBAR — Sticky glass
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--rule);
  transition: all 0.4s var(--ease);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.88);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.nav-brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gold-grad);
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
}

.nav-brand .name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.nav-brand .name span {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: block;
  margin-top: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s var(--ease);
  position: relative;
}

.nav-links a:hover {
  color: var(--accent-deep);
  background: var(--bg-soft);
}

.nav-links a.active {
  color: var(--accent-deep);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--gold-grad);
  border-radius: 2px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--espresso);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.25s var(--ease);
  border: 1px solid var(--espresso);
}

.nav-cta:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.nav-cta svg { width: 14px; height: 14px; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 60px) 28px 80px;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse at top, var(--bg-soft) 0%, var(--bg) 60%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, var(--accent-glow) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(176, 138, 90, 0.1) 0%, transparent 45%);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  opacity: 0.55;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 920px;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.hero .eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-grad);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7.5vw, 5.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
  color: var(--espresso);
}

.hero h1 .italic {
  font-weight: 700;
  color: var(--accent-deep);
  display: inline-block;
}

.hero .description {
  font-family: var(--font-body);
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 44px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s var(--ease);
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--espresso);
  color: white;
  border-color: var(--espresso);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn svg { width: 16px; height: 16px; }

.hero-meta {
  margin-top: 64px;
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-meta .stat {
  text-align: center;
}

.hero-meta .stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--espresso);
  line-height: 1;
}

.hero-meta .stat-num .plus {
  color: var(--accent);
}

.hero-meta .stat-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 6px;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: floatY 2.5s var(--ease) infinite;
}

.scroll-cue .line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, var(--ink-mute), transparent);
}

@keyframes floatY {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ============================================================
   SECTION GENERIC
   ============================================================ */
section.block {
  padding: 120px 28px;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 72px;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 18px;
  padding: 6px 14px;
  background: var(--accent-glow);
  border-radius: 999px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--espresso);
  margin-bottom: 18px;
}

.section-title em {
  font-style: normal;
  color: var(--accent-deep);
}

.section-sub {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ============================================================
   ABOUT / FEATURES
   ============================================================ */
#about {
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  position: relative;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  transition: all 0.4s var(--ease);
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-grad);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-soft);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  color: var(--accent-deep);
  margin-bottom: 24px;
  transition: all 0.4s var(--ease);
}

.feature-card:hover .feature-icon {
  background: var(--gold-grad);
  color: white;
  transform: rotate(-6deg) scale(1.05);
}

.feature-icon svg { width: 26px; height: 26px; }

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.feature-card p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.7;
}

/* ============================================================
   REGOLAMENTO SECTION
   ============================================================ */
#regolamento {
  background: var(--bg-soft);
  padding-top: 120px;
  padding-bottom: 0;
}

.reg-toolbar {
  max-width: 1200px;
  margin: 0 auto 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-wrap svg {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-mute);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  transition: all 0.25s var(--ease);
}

#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.reg-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--surface);
  color: var(--accent-deep);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s var(--ease);
}

.reg-download:hover {
  background: var(--accent-deep);
  color: white;
  border-color: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.reg-download svg { width: 16px; height: 16px; }

/* Layout: TOC + content */
.reg-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
  padding-bottom: 120px;
}

/* ===== TOC ===== */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-soft) transparent;
}

.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: var(--accent-soft); border-radius: 3px; }

.toc-group {
  margin-bottom: 28px;
}

.toc-group h4 {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-group h4::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--accent);
}

.toc ul {
  list-style: none;
}

.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 1px 0;
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: all 0.2s var(--ease);
}

.toc a:hover {
  background: var(--surface);
  color: var(--accent-deep);
  border-left-color: var(--accent-soft);
}

.toc a.active {
  background: var(--surface);
  color: var(--accent-deep);
  border-left-color: var(--accent);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.toc a .num {
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-soft);
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0;
}

.toc a.active .num {
  background: var(--gold-grad);
  color: white;
}

/* ===== Articles ===== */
.reg-content {
  min-width: 0;
}

.parte {
  margin: 56px 0 32px;
  position: relative;
  text-align: center;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

.parte:first-child { margin-top: 0; }

.parte h2 {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--espresso);
}

.parte .parte-num {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.articolo {
  position: relative;
  margin: 24px 0;
  padding: 36px 40px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule);
  scroll-margin-top: calc(var(--nav-h) + 20px);
  transition: all 0.4s var(--ease);
  opacity: 0;
  transform: translateY(30px);
}

.articolo.in-view {
  opacity: 1;
  transform: translateY(0);
}

.articolo:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-md);
}

.articolo::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--gold-grad);
  border-radius: 0 3px 3px 0;
  transition: height 0.5s var(--ease-out);
}

.articolo:hover::before,
.articolo.target::before {
  height: calc(100% - 72px);
}

.articolo.target {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.art-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
}

.articolo h3 {
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: white;
  background: var(--gold-grad);
  padding: 6px 14px;
  border-radius: 8px;
  align-self: center;
  text-align: center;
}

.articolo h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--espresso);
  line-height: 1.3;
  flex: 1;
}

.articolo p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.8;
  text-align: justify;
  hyphens: auto;
}

.articolo p.indent {
  text-indent: 1.4em;
}

.articolo p strong {
  color: var(--espresso);
  font-weight: 600;
}

.articolo ul.divieti {
  list-style: none;
  margin: 16px 0;
  padding: 18px 22px;
  background: linear-gradient(180deg, var(--bg-soft) 0%, transparent 100%);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-soft);
}

.articolo ul.divieti li {
  position: relative;
  padding-left: 28px;
  margin: 0 0 12px;
  text-align: justify;
  line-height: 1.75;
  font-size: 0.96rem;
  color: var(--ink);
}

.articolo ul.divieti li:last-child { margin-bottom: 0; }

.articolo ul.divieti li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.articolo ul.elenco {
  list-style: none;
  margin: 14px 0 14px 8px;
}

.articolo ul.elenco li {
  position: relative;
  padding-left: 22px;
  margin: 8px 0;
  line-height: 1.7;
}

.articolo ul.elenco li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.articolo.hidden {
  display: none;
}

.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-mute);
  font-family: var(--font-body);
  font-size: 1rem;
  display: none;
}

.no-results.show { display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--espresso);
  color: rgba(255, 255, 255, 0.85);
  padding: 80px 28px 36px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 56px;
}

.footer-brand .nav-brand {
  color: white;
  margin-bottom: 18px;
}

.footer-brand .name { color: white; }

.footer-brand .name span { color: var(--accent-soft); }

.footer-brand p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.6);
  max-width: 380px;
}

.footer-col h5 {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 18px;
}

.footer-col ul { list-style: none; }

.footer-col li { margin: 8px 0; }

.footer-col a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s var(--ease);
}

.footer-col a:hover { color: white; }

.footer-bot {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ============================================================
   FLOATING BACK-TO-TOP
   ============================================================ */
.to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  background: var(--espresso);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.85);
  transition: all 0.3s var(--ease-spring);
  z-index: 80;
  border: 1px solid var(--accent-deep);
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.to-top:hover {
  background: var(--accent-deep);
  transform: translateY(-3px) scale(1.05);
}

.to-top svg { width: 18px; height: 18px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .reg-layout {
    grid-template-columns: 240px 1fr;
    gap: 36px;
  }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-cta { padding: 8px 14px; font-size: 0.82rem; }

  section.block { padding: 80px 20px; }

  .reg-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .toc {
    position: relative;
    top: 0;
    max-height: none;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
  }

  .toc.collapsed .toc-body { display: none; }

  .toc-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-deep);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
  }

  .articolo { padding: 28px 22px; }
  .articolo h4 { font-size: 1.3rem; }
  .art-head { flex-direction: column; align-items: flex-start; gap: 10px; }

  .feature-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }
  .footer-bot { flex-direction: column; text-align: center; }

  .hero-meta { gap: 28px; }
  .hero-meta .stat-num { font-size: 1.9rem; }

  .nav-inner { padding: 0 18px; gap: 12px; }
  .nav-brand .name { font-size: 1.1rem; }

  .reg-toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: none; }
}

.toc-mobile-toggle { display: none; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .navbar, .progress-bar, .to-top, .hero, #about,
  .toc, .reg-toolbar, footer, .scroll-cue { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .reg-layout { display: block; }
  .articolo {
    border: none;
    box-shadow: none;
    page-break-inside: avoid;
    padding: 0;
    margin: 24px 0;
    opacity: 1 !important;
    transform: none !important;
  }
  .parte h2::before, .parte h2::after { background: black; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .articolo { opacity: 1; transform: none; }
}
