/* Font locali con licenze OFL incluse in assets/fonts. */
@font-face { font-family: Syne; src: url('../fonts/Syne.ttf') format('truetype'); font-style: normal; font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/JetBrainsMono.ttf') format('truetype'); font-style: normal; font-weight: 100 800; font-display: swap; }
:root { --red: #962118; --bg: #d9d9d9; --paper: #eeeae3; --white: #fff; --line: #96211844; --mono: 'JetBrains Mono', monospace; --display: Syne, Arial, sans-serif; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: var(--bg); color: var(--red); font: 12px/1.5 var(--mono); -webkit-font-smoothing: antialiased; }
body[data-mood="night"] { --bg: #272c30; --red: #f4edb5; --white: #272c30; --paper: #444a4c; --line: #f4edb544; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--red); outline-offset: 5px; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 60; padding: 10px; background: var(--red); color: var(--white); }
.skip-link:focus { top: 18px; }
#emci-shell { position: fixed; inset: 0; isolation: isolate; }
.brand-banner, .dialog-brand { position: absolute; top: max(22px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: 210px; height: 74px; border-radius: 6px; background: var(--red); color: var(--white); display: grid; place-items: center; z-index: 50; }
.brand-banner a, .dialog-brand a { width: 100%; height: 100%; display: grid; place-items: center; }
.brand-wordmark { font: 800 50px/.85 var(--display); letter-spacing: -.085em; padding-right: .085em; }
.brand-logo, .dialog-brand img { width: auto; height: auto; max-height: 58px; max-width: 184px; object-fit: contain; }
.corner { position: absolute; z-index: 20; }
.location { left: 28px; top: 29px; }
.location time { display: block; }
.mood-toggle { right: 28px; top: 29px; }
.mood-toggle span { margin-left: 12px; font-size: 17px; vertical-align: middle; }
.mood-toggle:hover, .view-toggle:hover { text-decoration: underline; text-underline-offset: 5px; }
#emci-main { position: absolute; inset: 0; }
#emci-canvas { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; mask-image: linear-gradient(to bottom, transparent, #000 115px, #000 calc(100% - 125px), transparent); }
#emci-canvas.is-dragging { cursor: grabbing; }
#emci-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.product-tile { position: absolute; width: 220px; display: block; text-align: left; cursor: inherit; }
.tile-image { width: 220px; height: 275px; object-fit: cover; background: var(--paper); transform: scale(var(--drag-scale, 1)); transition: filter .2s; }
.product-tile:hover .tile-image { filter: contrast(1.06); }
.tile-caption { display: flex; gap: 12px; justify-content: space-between; margin-top: 11px; font: 500 12px/1.4 var(--mono); text-transform: uppercase; }
.tile-caption > span:first-child { max-width: 175px; overflow-wrap: anywhere; }
.tile-caption .tile-number { opacity: .55; }
.canvas-hint { position: absolute; bottom: 104px; left: 50%; transform: translateX(-50%); pointer-events: none; text-align: center; font-size: 10px; letter-spacing: .02em; opacity: .75; margin: 0; }
.canvas-hint span { display: block; margin-top: 4px; }
.contact-banner { position: absolute; bottom: max(23px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 4px; padding: 5px; background: var(--red); color: var(--white); border-radius: 6px; }
.contact-banner a, .contact-banner button { padding: 12px 23px; border-radius: 3px; font-size: 13px; transition: background .15s, color .15s; }
.contact-banner a:hover, .contact-banner button:hover, .contact-banner a:focus-visible, .contact-banner button:focus-visible { background: var(--bg); color: var(--red); }
.zoom-controls { left: 22px; bottom: max(27px, env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; }
.zoom-controls button { font-size: 20px; width: 34px; height: 40px; }
.zoom-controls button:disabled { opacity: .3; cursor: default; }
.zoom-controls output { min-width: 40px; text-align: center; }
.view-toggle { bottom: max(37px, calc(env(safe-area-inset-bottom) + 10px)); right: 28px; }
.view-toggle span { opacity: .5; }
.view-toggle[aria-pressed="true"] span { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
#emci-list { position: absolute; inset: 120px 0 110px; padding: 10px 6vw 40px; overflow: auto; overscroll-behavior: contain; }
.list-row { width: 100%; border-top: 1px solid var(--line); padding: 16px 0; display: grid; grid-template-columns: 45px 64px 1fr auto; align-items: center; text-align: left; gap: 28px; }
.list-row:last-child { border-bottom: 1px solid var(--line); }
.list-row img { width: 64px; height: 80px; object-fit: cover; }
.list-title { font: 800 clamp(24px, 4vw, 62px)/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.list-row:hover .list-title { transform: translateX(8px); }
.list-title { transition: transform .2s; }
/* I dialog sono nel top layer del browser: il logo è replicato nello stesso punto. */
#emci-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: var(--red); background: var(--bg); overflow: hidden; }
#emci-dialog::backdrop { background: var(--bg); }
.dialog-brand { pointer-events: auto; }
.close-button { position: absolute; z-index: 60; right: 28px; top: 30px; padding: 8px 0 8px 12px; background: var(--bg); }
.close-button:hover { text-decoration: underline; text-underline-offset: 5px; }
.dialog-scroll { position: absolute; inset: 118px 0 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 4vw max(36px, env(safe-area-inset-bottom)); }
.product-panel { display: grid; grid-template-columns: 1.1fr 1fr; gap: 35px 5vw; align-items: start; }
.product-panel h2, .news-panel > h2 { font: 800 clamp(42px, 7.2vw, 118px)/.9 var(--display); text-transform: uppercase; letter-spacing: -.055em; margin: 0; overflow-wrap: anywhere; }
.product-panel h2 { grid-column: 1; grid-row: 1; position: relative; z-index: 1; }
.product-hero { grid-column: 2; grid-row: 1 / 3; width: 100%; height: min(65vh, 780px); object-fit: contain; background: var(--paper); }
.product-meta { grid-column: 1; grid-row: 2; align-self: end; margin: 25px 0 0; display: grid; gap: 22px; }
.product-meta dt { font-size: 11px; margin-bottom: 5px; }
.product-meta dd { margin: 0; font: 600 clamp(23px, 3vw, 46px)/1.08 var(--display); overflow-wrap: anywhere; }
.gallery-section { grid-column: 1 / -1; min-width: 0; margin-top: 15px; }
.gallery-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; text-transform: uppercase; font-size: 11px; }
#gallery-drag { border: 1px solid var(--red); border-radius: 30px; padding: 10px 22px; }
.product-gallery { display: flex; gap: 24px; overflow: auto; cursor: grab; touch-action: pan-x pan-y; scrollbar-width: thin; scrollbar-color: var(--red) transparent; overscroll-behavior-x: contain; padding-bottom: 15px; }
.product-gallery.is-dragging { cursor: grabbing; }
.product-gallery img { height: 330px; width: 264px; flex-shrink: 0; object-fit: cover; background: var(--paper); user-select: none; }
.news-panel { max-width: 1250px; margin: 0 auto; }
.news-panel > h2 { margin-bottom: 55px; }
.news-item { padding: 26px 0 40px; border-top: 1px solid var(--line); }
.news-item h3 { font: 800 clamp(28px, 4vw, 60px)/1.05 var(--display); text-transform: uppercase; margin: 15px 0 24px; overflow-wrap: anywhere; }
.news-copy { max-width: 780px; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.news-copy a { text-decoration: underline; }
.news-copy figure { margin: 20px 0; }
.news-copy img, .news-copy video { max-width: 100%; height: auto; }
.news-copy pre, .news-copy table { display: block; max-width: 100%; overflow: auto; }
.no-js { position: absolute; inset: 120px 20px 100px; overflow: auto; background: var(--bg); padding: 20px; }
@media (max-width: 700px) {
    .brand-banner, .dialog-brand { top: max(18px, env(safe-area-inset-top)); width: 130px; height: 54px; }
    .brand-wordmark { font-size: 31px; }
    .brand-logo, .dialog-brand img { max-width: 112px; max-height: 40px; }
    .location { left: 15px; top: 25px; font-size: 9px; max-width: 90px; }
    .mood-toggle { right: 15px; top: 29px; font-size: 9px; }
    .mood-toggle span { display: none; }
    .contact-banner { bottom: max(20px, env(safe-area-inset-bottom)); }
    .contact-banner a, .contact-banner button { padding: 10px 18px; font-size: 12px; }
    .zoom-controls { bottom: 82px; left: 9px; gap: 0; font-size: 10px; }
    .zoom-controls button { width: 36px; }
    .view-toggle { bottom: 95px; right: 16px; font-size: 10px; }
    .canvas-hint { bottom: 147px; font-size: 9px; width: 260px; }
    #emci-list { inset: 100px 0 135px; padding: 0 18px 24px; }
    .list-row { grid-template-columns: 22px 44px 1fr; gap: 14px; }
    .list-row img { width: 44px; height: 55px; }
    .list-row .list-year { display: none; }
    .list-title { font-size: clamp(21px, 6vw, 38px); }
    .close-button { right: 16px; top: 28px; font-size: 11px; }
    .dialog-scroll { inset: 94px 0 0; padding: 12px 18px 30px; }
    .product-panel { grid-template-columns: 1fr; gap: 27px; }
    .product-panel h2 { font-size: clamp(44px, 12vw, 80px); grid-column: 1; grid-row: 1; }
    .product-hero { grid-column: 1; grid-row: 2; height: auto; max-height: 60vh; }
    .product-meta { grid-column: 1; grid-row: 3; margin: 0; gap: 20px; }
    .product-meta dd { font-size: 28px; }
    .gallery-section { grid-row: 4; }
    .product-gallery { gap: 14px; }
    .product-gallery img { width: 200px; height: 250px; }
    .news-panel > h2 { font-size: 64px; margin-bottom: 30px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
/* The logo stays still; only the red backplate gently springs outward. */
.brand-banner, .dialog-brand { background: transparent; }
.brand-banner::before, .dialog-brand::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--red); transform: scale(1); transition: transform 480ms cubic-bezier(.34, 1.56, .64, 1); }
.brand-banner:focus-within::before, .dialog-brand:focus-within::before { transform: scale(1.07, 1.12); }
@media (hover: hover) { .brand-banner:hover::before, .dialog-brand:hover::before { transform: scale(1.07, 1.12); } }
.brand-banner:active::before, .dialog-brand:active::before { transform: scale(1.035, 1.06); }
/* One continuous red banner: the drawer always matches the contact bar width. */
.contact-banner { --drawer-height: 0px; --contact-base: max(23px, env(safe-area-inset-bottom)); bottom: calc(var(--contact-base) + var(--drawer-height) + var(--keyboard-inset, 0px)); transition: bottom 320ms cubic-bezier(.22, 1, .36, 1), border-radius 220ms; max-width: calc(100vw - 32px); }
.contact-banner.is-expanded { border-radius: 6px 6px 0 0; }
.contact-drawer { position: absolute; top: 100%; left: 0; width: 100%; padding: 14px 20px 20px; border-radius: 0 0 6px 6px; background: var(--red); color: var(--white); text-align: left; transform-origin: top; animation: contact-unfold 300ms cubic-bezier(.22, 1, .36, 1); max-height: max(80px, calc(var(--visible-height, 100dvh) - 120px)); overflow-y: auto; }
@keyframes contact-unfold { from { opacity: 0; transform: scaleY(.88); } to { opacity: 1; transform: scaleY(1); } }
.newsletter-form { margin: 0; }
.newsletter-form label { display: block; font-size: 13px; margin-bottom: 10px; }
.newsletter-entry { display: flex; border-bottom: 1px solid #ffffff80; align-items: center; }
.newsletter-entry input { min-width: 0; width: 100%; padding: 10px 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: 13px/1.5 var(--mono); }
.newsletter-entry input::placeholder { color: inherit; opacity: .65; }
.newsletter-entry input:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
.contact-banner .newsletter-entry button { padding: 8px 10px; font-size: 20px; }
.newsletter-entry button:disabled { cursor: default; }
.newsletter-note, .mail-note { font-size: 9px; line-height: 1.6; opacity: .75; margin: 12px 0 0; }
.contact-banner .newsletter-note a { display: inline; padding: 0; font-size: inherit; text-decoration: underline; }
#newsletter-status, #mail-status { margin: 12px 0 0; font-size: 11px; }
#newsletter-status:empty, #mail-status:empty { display: none; }
.newsletter-trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.is-subscribed .newsletter-entry { opacity: .75; }
.is-subscribed input { cursor: default; }
.mail-options > p:first-child { margin: 0 0 8px; font-size: 13px; }
.mail-providers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.contact-banner .mail-providers a, .contact-banner .mail-providers button { padding: 7px 8px; font-size: 10px; border: 1px solid #ffffff60; }
@media (max-width: 700px) { .contact-banner { --contact-base: max(20px, env(safe-area-inset-bottom)); } .contact-drawer { padding: 12px 16px 16px; } .newsletter-entry input { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .brand-banner::before, .dialog-brand::before, .contact-banner { transition: none; } .contact-drawer { animation: none; } }

/* Keep email text and caret visible on iOS; prevent input auto-zoom. */
.newsletter-entry input { font-size: 16px; -webkit-text-fill-color: var(--white); caret-color: var(--white); opacity: 1; }
.contact-banner.is-expanded { transition: border-radius 220ms; }
