.home-view { max-width: 1440px; margin: 0 auto; padding: 0 64px; }
html[data-view="home"] body { min-width: 0; }
html[data-view="home"] .topbar [data-route="workspace"] { display: none; }
.home-body { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; min-height: calc(100svh - 160px); gap: 16px; }
.home-invitation { position: relative; z-index: 3; padding: 32px 0; }
.home-eyebrow { margin: 0 0 24px; color: var(--ink-soft); text-transform: uppercase; font-size: 11px; letter-spacing: .22em; font-weight: 600; }
.home-invitation h1 { margin: 0; color: var(--ink); font-size: clamp(42px, 4.7vw, 70px); line-height: 1.1; font-weight: 650; letter-spacing: -.05em; }
.home-invitation h1 em { color: var(--accent); font-style: normal; font-weight: inherit; }
.home-intro { margin: 26px 0 36px; color: var(--ink-soft); font-size: 17px; line-height: 1.65; }
.home-actions { display: grid; grid-template-columns: 1fr 1.5fr; align-items: end; gap: 12px; max-width: 550px; }
.home-picker { grid-column: 1 / -1; min-width: 0; position: relative; }
.home-picker-label { display: block; margin: 0 0 9px 4px; color: var(--ink-soft); font-size: 12px; }
.home-model-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-raised); color: var(--ink); text-align: left; cursor: pointer; font-size: 14px; box-shadow: 0 6px 18px rgb(30 65 110 / 4%); }
.home-model-toggle:hover, .home-model-toggle[aria-expanded="true"] { border-color: var(--accent); }
.home-model-toggle > svg { flex: none; margin-left: auto; transition: transform 180ms ease; }
.home-model-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.home-selected-icon { width: 26px; height: 26px; flex: none; color: var(--accent); }
.home-selected-icon svg { width: 100%; height: 100%; }
.home-simulate, .home-create { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 25px; border: 1px solid transparent; border-radius: 18px; background: var(--accent); color: var(--on-brand); font-size: 15px; font-weight: 650; cursor: pointer; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 20%, transparent); transition: transform 180ms cubic-bezier(.2,.8,.2,1), background 180ms ease, box-shadow 180ms ease; }
.home-create { background: color-mix(in srgb, var(--paper-raised) 65%, var(--accent-soft)); color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 35%, var(--paper-raised)); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 9%, transparent), inset 0 1px 0 color-mix(in srgb, var(--paper-raised) 80%, transparent); }
.home-create svg { flex: none; transition: transform 180ms cubic-bezier(.2,.8,.2,1); }
.home-create:hover { background: var(--accent-soft); box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 16%, transparent); }
.home-create:hover svg { transform: rotate(90deg); }
.home-simulate:focus-visible, .home-create:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.home-simulate:hover { background: var(--accent-strong); }
.home-simulate:active, .home-create:active { transform: translateY(0) scale(.98); }
.home-question { min-height: 46px; max-width: 48ch; margin: 18px 4px 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.home-model-menu.opens-above { top: auto; bottom: calc(100% + 9px); }
.home-all-models { display: flex; justify-content: space-between; margin-top: 8px; padding: 12px 10px 5px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; text-decoration: none; }
.home-all-models:hover { color: var(--accent); }
/* La scultura ha sempre le sue proporzioni: con solo un'altezza massima, su uno
   schermo largo (o rimpicciolendo la pagina) si allargava e le orbite si allungavano. */
.home-sculpture { position: relative; justify-self: center; width: min(100%, 530px); aspect-ratio: 1.08; color: var(--accent); pointer-events: none; }
.home-orbit { position: absolute; border: 1px solid color-mix(in srgb, var(--ink-soft) 14%, transparent); border-radius: 50%; }
.home-orbit-outer { inset: 7% 4%; transform: rotate(-22deg); animation: home-orbit-sway 18s ease-in-out -4s infinite alternate; }
.home-orbit-inner { inset: 19% 13%; transform: rotate(24deg); animation: home-orbit-sway 23s ease-in-out -9s infinite alternate-reverse; }
.home-connection { position: absolute; inset: 0; width: 100%; height: 100%; stroke: color-mix(in srgb, var(--accent) 24%, transparent); stroke-width: 1; }
.home-connection path + path { stroke-dasharray: 2 8; animation: home-connection-flow 12s linear infinite; }
.home-specimen { position: absolute; left: 30%; top: 27%; width: 41%; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper-raised); box-shadow: 0 28px 60px rgb(30 65 110 / 9%), inset 0 2px 1px rgb(255 255 255 / 45%); animation: home-float 9s ease-in-out infinite alternate; }
.home-art-icon { width: 40%; height: 40%; }
.home-art-icon svg { width: 100%; height: 100%; overflow: visible; animation: home-art-arrive 420ms cubic-bezier(.2,.8,.2,1) both; }
.home-art-icon .home-steam { animation: home-steam-rise 3.8s ease-in-out infinite; }
.home-art-icon .home-steam-late { animation-delay: -1.9s; }
.home-bubble { position: absolute; display: grid; place-items: center; width: 56px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-raised); box-shadow: 0 14px 35px rgb(30 65 110 / 6%); font: 300 28px ui-sans-serif, system-ui, sans-serif; animation: home-float 11s ease-in-out infinite alternate-reverse; }
.home-bubble-plus { top: 13%; left: 15%; color: var(--accent); transform: rotate(-8deg); animation: home-bubble-drift 8s ease-in-out -2s infinite alternate; }
.home-bubble-minus { right: 6%; bottom: 26%; color: var(--leva); transform: rotate(8deg); animation: home-bubble-drift 10s ease-in-out -5s infinite alternate-reverse; }
.home-art-caption { position: absolute; top: 76%; width: 100%; text-align: center; font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .22em; }
.home-point { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 7%, transparent); }
.home-point-one { right: 19%; top: 18%; animation: home-point-drift 7s ease-in-out -2s infinite alternate; }
.home-point-two { left: 16%; bottom: 19%; width: 4px; height: 4px; opacity: .5; animation: home-point-drift 11s ease-in-out -6s infinite alternate-reverse; }
.home-footer { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--ink-soft); border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); font-size: 12px; }
@keyframes home-float { from { translate: 0 -6px; } to { translate: 0 7px; } }
@keyframes home-orbit-sway { from { rotate: -5deg; scale: .985; } to { rotate: 5deg; scale: 1.015; } }
@keyframes home-bubble-drift { from { translate: -4px -7px; rotate: -3deg; } to { translate: 5px 8px; rotate: 3deg; } }
@keyframes home-point-drift { from { translate: -5px 5px; scale: .85; } to { translate: 5px -6px; scale: 1.15; } }
@keyframes home-connection-flow { to { stroke-dashoffset: -40; } }
@keyframes home-steam-rise { 0%, 100% { transform: translateY(2px); opacity: .25; } 45% { opacity: .9; } 80% { transform: translateY(-4px); opacity: .15; } }
@keyframes home-art-arrive { from { opacity: 0; transform: translateY(5px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes home-menu-in { from { opacity: 0; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
.home-view.hidden .home-sculpture *, .home-view.motion-paused .home-sculpture * { animation-play-state: paused; }
@media (max-width: 1100px) {
  .home-view { padding-inline: 40px; }
  .home-body { grid-template-columns: 1.3fr 1fr; }
  .home-actions { gap: 8px; }
  .home-simulate { padding-inline: 20px; }
  .home-invitation h1 { font-size: 50px; }
}
@media (max-width: 760px) {
  html[data-view="home"] .topbar { padding-inline: 24px; gap: 18px; }
  html[data-view="home"] .topbar nav a[data-route="workspace"], html[data-view="home"] .theme-toggle { display: none; }
  html[data-view="home"] .topbar nav { margin-left: auto; gap: 0; }
  html[data-view="home"] .topbar nav a { padding-inline: 8px; font-size: 12px; }
  .home-view { padding-inline: 28px; }
  .home-body { display: block; min-height: calc(100svh - 145px); }
  .home-invitation { padding-top: 74px; padding-bottom: 32px; }
  .home-invitation h1 { font-size: clamp(38px, 7vw, 54px); }
  .home-intro { font-size: 16px; }
  .home-sculpture { display: none; }
  .home-actions { max-width: none; }
  .home-model-toggle { font-size: 12px; padding-inline: 10px; gap: 7px; }
  .home-selected-icon { width: 22px; height: 22px; }
  .home-simulate, .home-create { padding-inline: 12px; font-size: 13px; gap: 8px; }
  .home-model-menu { width: min(365px, calc(100vw - 56px)); }
  .home-footer { min-height: 75px; align-items: start; padding-top: 18px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-view .home-sculpture *, .home-model-menu { animation: none; }
  .home-simulate, .home-create, .home-create svg { transition: none; }
  .home-simulate:hover, .home-create:hover, .home-create:hover svg, .home-simulate:active, .home-create:active { transform: none; }
}

/* Catalogo della home: menu in vetro con ricerca, ambiti, forme e voci con icona d'ambito. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home-model-menu { position: absolute; top: calc(100% + 9px); left: 0; width: min(640px, calc(100vw - 48px)); max-height: min(620px, 80svh); z-index: 20; display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-16); background: var(--glass-menu); border: 1px solid var(--glass-edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-float), var(--shadow-glint); backdrop-filter: blur(28px) saturate(1.3); -webkit-backdrop-filter: blur(28px) saturate(1.3); animation: home-menu-in 160ms ease both; }
.home-model-menu.opens-above { top: auto; bottom: calc(100% + 9px); }
.home-model-search, .home-model-domains, .home-model-shapes-row, .home-model-count { flex: none; }
.home-model-search { display: flex; align-items: center; gap: var(--space-12); min-height: var(--size-control); padding: 0 var(--space-16); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-rest); color: var(--accent); }
.home-model-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.home-model-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 450 15px/1.4 var(--font-sans); }
.home-model-search input::placeholder { color: var(--ink-faint); }
.home-model-search input::-webkit-search-cancel-button { cursor: pointer; }
/* Le categorie si distribuiscono su tutta la larghezza; se non ci stanno scorrono. */
.home-model-domains { display: flex; gap: var(--space-8); overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.home-domain { --tint: var(--accent); flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; padding: 0; border: 0; background: transparent; color: var(--ink-soft); font: 500 11.5px/1.2 var(--font-sans); cursor: pointer; }
.home-domain-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--glass-panel); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-rest); color: var(--tint); transition: transform var(--dur-tap, 140ms) ease, box-shadow var(--dur-tap, 140ms) ease, background-color var(--dur-tap, 140ms) ease; }
/* Nessun movimento al passaggio del mouse: lo dice il design system. */
.home-domain[aria-pressed="true"] { color: var(--ink); font-weight: 650; }
.home-domain[aria-pressed="true"] .home-domain-icon { background: linear-gradient(160deg, var(--accent-top), var(--accent)); border-color: var(--accent); color: var(--on-brand, #fff); box-shadow: var(--shadow-accent); }
.home-domain:focus-visible { outline: none; }
.home-domain:focus-visible .home-domain-icon { outline: 2px solid var(--focus); outline-offset: 2px; }
.home-model-shapes-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); padding-top: var(--space-8); border-top: 1px solid var(--line); color: var(--ink-faint); font: 500 12px/1.3 var(--font-sans); }
.home-model-shapes { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-sunken); border: 1px solid var(--glass-edge); }
.home-shape { width: 36px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.home-shape path { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-shape:hover { background: var(--surface-2); }
.home-shape[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow-rest); }
.home-shape:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.home-model-options { flex: 1 1 auto; min-height: 120px; -webkit-mask-image: linear-gradient(#000 calc(100% - 18px), transparent); mask-image: linear-gradient(#000 calc(100% - 18px), transparent); padding-bottom: 14px !important; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 2px; align-content: start; margin: 0 calc(-1 * var(--space-4)); padding: 0 var(--space-4); scrollbar-width: thin; }
.home-model-choice { --tint: var(--accent); display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: var(--space-12); align-items: center; width: 100%; padding: 9px 10px; text-align: left; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--ink); cursor: pointer; transition: background-color var(--dur-tap, 140ms) ease, box-shadow var(--dur-tap, 140ms) ease; }
.home-model-choice:hover, .home-model-choice:focus-visible { background: var(--surface-2); outline: none; }
.home-model-choice:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.home-model-choice[aria-pressed="true"] { background: var(--surface); border-color: var(--glass-edge); box-shadow: var(--shadow-panel), var(--shadow-glint); }
.home-choice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--glass-panel); border: 1px solid var(--glass-edge); color: var(--tint); }
.home-choice-icon svg { width: 26px; height: 26px; }
.home-choice-copy { min-width: 0; }
.home-choice-copy strong { display: block; font: 600 14.5px/1.3 var(--font-sans); }
.home-choice-copy small { display: block; margin-top: 2px; color: var(--ink-soft); font: 450 12.5px/1.35 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-choice-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.home-choice-meta svg path { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.home-choice-meta em { font: 500 12px/1.2 var(--font-sans); font-style: normal; color: var(--ink-faint); white-space: nowrap; }
.home-model-empty { margin: var(--space-16) var(--space-8); color: var(--ink-soft); font: 450 13px/1.5 var(--font-sans); }
.home-model-count { margin: 0 var(--space-4); color: var(--ink-faint); font: 500 12px/1.3 var(--font-sans); font-variant-numeric: tabular-nums; }
.home-selected-icon svg, .home-art-icon svg { stroke-width: 1.8; }
@media (max-width: 760px) {
  .home-model-menu, .home-model-menu.opens-above { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 76px) !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); left: 12px; right: 12px; width: auto; max-height: none !important; z-index: 60; }
  .home-choice-meta svg { display: none; }
  .home-model-shapes-row > span { display: none; }
  .home-model-shapes { flex: 1; justify-content: space-between; }
  .home-model-domains { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
}
@media (prefers-reduced-motion: reduce) { .home-domain-icon, .home-model-choice { transition: none; } }
