/* Event Horizon Beyond v0.2 */
:root {
  --void: #070814;
  --void-2: #0d0f22;
  --disk: #ffb45a;
  --disk-deep: #e8772a;
  --photon: #fff3e2;
  --blue: #8ea2ff;
  --text: #e8e6f0;
  --muted: #aeadc6;
  --line: rgba(232, 230, 240, .14);
  --glass: rgba(9, 10, 26, .62);
  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--disk); outline-offset: 3px; border-radius: 4px; }

#space { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; background: var(--void); }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .nav, .foot { position: relative; z-index: 2; }
.req-intro .sec-lead { color: var(--text); }
.services, .process, .products, .req-intro { text-shadow: 0 1px 14px rgba(7, 8, 20, .9); }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  transition: background .3s, backdrop-filter .3s;
}
.nav.is-solid { background: rgba(7, 8, 20, .72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1rem/1 var(--f-display); letter-spacing: -.01em; }
.ver { font: 500 .7rem/1 var(--f-body); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 3px 7px; }
.nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; align-items: center; }
.nav ul a { text-decoration: none; font-size: .95rem; color: var(--muted); transition: color .2s; }
.nav ul a:hover { color: var(--text); }
.nav ul .nav-cta { color: var(--void); background: var(--disk); padding: 9px 16px; border-radius: 99px; font-weight: 600; }
.nav ul .nav-cta:hover { color: var(--void); background: var(--photon); }
.menu-btn { display: none; }

/* ---------- COMMON ---------- */
section { padding: clamp(80px, 12vw, 160px) var(--gutter); max-width: var(--max); margin: 0 auto; }
.sec-title {
  font: 700 clamp(2.2rem, 5.5vw, 4.2rem)/1 var(--f-display);
  font-variation-settings: "wdth" 85;
  letter-spacing: -.035em; margin: 0 0 .5em;
}
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 40px; margin-bottom: 40px; }
.sec-head .sec-title { margin: 0; }
.sec-lead { color: var(--muted); max-width: 46ch; margin: 0; font-size: 1.1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1 var(--f-body); text-decoration: none; cursor: pointer;
  padding: 16px 26px; border-radius: 99px; border: 1px solid transparent;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--disk); color: var(--void); }
.btn-primary:hover { background: var(--photon); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(7, 8, 20, .35); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--text); }
.btn[disabled] { opacity: .55; cursor: wait; }
.link { color: var(--blue); text-underline-offset: 4px; font-weight: 500; }

/* ---------- HERO ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 120px; position: relative; }
.hero-title { margin: 0 0 28px; font-family: var(--f-display); font-weight: 800; line-height: .82; letter-spacing: -.055em; }
.hero-title span { display: block; }
.hero-title .l1 { font-size: clamp(3.2rem, 11vw, 9.5rem); font-variation-settings: "wdth" 75; }
.hero-title .l2 { font-size: clamp(3.2rem, 11vw, 9.5rem); font-variation-settings: "wdth" 100; padding-left: .35em; }
.hero-title .l3 {
  font-size: clamp(3.2rem, 11vw, 9.5rem); font-weight: 300; font-variation-settings: "wdth" 75;
  color: rgba(255, 243, 226, .16); -webkit-text-stroke: 1.5px var(--photon); padding-left: .9em;
}
.hero-sub { max-width: 38ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--text); margin: 0 0 36px; text-shadow: 0 1px 20px rgba(7,8,20,.8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.scroll-hint { position: absolute; bottom: 28px; left: var(--gutter); margin: 0; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.scroll-hint::before { content: ""; width: 1px; height: 36px; background: linear-gradient(var(--disk), transparent); animation: drip 2.4s ease-in-out infinite; }
@keyframes drip { 0%,100% { transform: scaleY(.3); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

/* hero load sequence: the one orchestrated moment */
.hero-title span, .hero-sub, .hero-actions { opacity: 0; transform: translateY(24px); animation: rise 1s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-title .l1 { animation-delay: .25s; }
.hero-title .l2 { animation-delay: .4s; }
.hero-title .l3 { animation-delay: .55s; }
.hero-sub { animation-delay: .85s; }
.hero-actions { animation-delay: 1s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- SERVIZI ---------- */
.svc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.svc { padding: 36px 36px 40px 0; }
.svc + .svc { padding-left: 36px; border-left: 1px solid var(--line); }
.svc h3 { font: 700 clamp(1.8rem, 3.4vw, 2.6rem)/1 var(--f-display); letter-spacing: -.03em; margin: 0 0 16px; }
.svc p { margin: 0 0 20px; max-width: 48ch; color: var(--text); }
.svc-side { grid-column: 1 / -1; border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 24px; align-items: baseline; }
.svc-side h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); color: var(--muted); margin: 0; }
.svc-side p { margin: 0; color: var(--muted); }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .85rem; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }

/* ---------- PORTFOLIO ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 .92rem/1 var(--f-body); color: var(--muted); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 10px 16px;
  transition: color .2s, background .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.is-on { background: var(--text); color: var(--void); border-color: var(--text); }

.pf-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.pf { grid-column: span 2; position: relative; border-radius: 6px; overflow: hidden; background: var(--void-2); border: 1px solid var(--line); text-decoration: none; display: flex; flex-direction: column; isolation: isolate; }
.pf.is-feat { grid-column: span 4; grid-row: span 2; }
.pf.is-wide { grid-column: span 3; }
.pf[hidden] { display: none; }
.pf-art { aspect-ratio: 4 / 3; position: relative; overflow: hidden; flex: 1; min-height: 180px; }
.pf-art canvas, .pf-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pf-art img { object-fit: cover; }
.pf-info { padding: 18px 20px 20px; background: rgba(7, 8, 20, .85); border-top: 1px solid var(--line); }
.pf-kind { font-size: .82rem; color: var(--disk); margin: 0 0 4px; }
.pf h3 { font: 700 1.35rem/1.1 var(--f-display); letter-spacing: -.02em; margin: 0 0 6px; }
.pf.is-feat h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.pf p { margin: 0; color: var(--muted); font-size: .95rem; }
.pf-meta { margin-top: 10px !important; font-size: .82rem !important; }
.pf-empty { grid-column: 1 / -1; color: var(--muted); }

/* ---------- PROCESSO ---------- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.steps li { counter-increment: s; padding: 0 28px 0 0; position: relative; }
.steps li::before {
  content: counter(s); display: block; font: 300 4.5rem/1 var(--f-display); font-variation-settings: "wdth" 75;
  color: transparent; -webkit-text-stroke: 1px var(--disk); margin-bottom: 18px;
}
.steps li::after { content: ""; position: absolute; top: 2.3rem; left: 3.4rem; right: 12px; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.steps li:last-child::after { display: none; }
.steps h3 { font: 600 1.2rem/1.2 var(--f-display); margin: 0 0 8px; }
.steps p { margin: 0; color: var(--muted); font-size: .97rem; }

/* ---------- PRODOTTI ---------- */
.shelf { display: flex; gap: 22px; overflow-x: auto; padding: 8px 4px 28px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.book { flex: 0 0 auto; width: 240px; scroll-snap-align: start; text-decoration: none; }
.cover {
  aspect-ratio: 3 / 4.2; border-radius: 3px 8px 8px 3px; position: relative; overflow: hidden; padding: 20px 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset 6px 0 0 rgba(0,0,0,.25), 0 24px 50px -20px rgba(0,0,0,.8);
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.book:hover .cover, .book:focus-visible .cover { transform: translateY(-8px) rotate(-1.5deg); }
.cover .c-type { font-size: .78rem; opacity: .8; margin: 0; }
.cover .c-title { font: 800 1.55rem/1 var(--f-display); letter-spacing: -.03em; font-variation-settings: "wdth" 80; margin: 0; }
.cover .c-ring { position: absolute; width: 170%; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid currentColor; opacity: .3; left: -35%; top: 40%; transform: rotateX(72deg); }
.book-info { padding-top: 14px; }
.book-info h3 { font: 600 1.05rem/1.25 var(--f-body); margin: 0 0 4px; }
.book-info p { margin: 0; font-size: .9rem; color: var(--muted); }
.book-info .price { color: var(--disk); font-weight: 600; }

/* ---------- RICHIESTA ---------- */
.request { padding-bottom: 120px; }
.req-intro { margin-bottom: 40px; }
.req-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.wizard, .summary { background: var(--glass); backdrop-filter: blur(18px) saturate(1.2); border: 1px solid var(--line); border-radius: 18px; }
.wizard { padding: clamp(22px, 3.5vw, 40px); }
.summary { padding: 26px; position: sticky; top: 90px; }

.w-progress { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 32px; counter-reset: w; }
.w-progress li { flex: 1; font-size: .78rem; color: var(--muted); padding-top: 10px; border-top: 2px solid var(--line); transition: color .3s, border-color .3s; }
.w-progress li.is-on { color: var(--text); border-color: var(--disk); }
.w-progress li.is-done { border-color: rgba(255, 180, 90, .45); }

.w-step { border: 0; padding: 0; margin: 0; display: none; }
.w-step.is-on { display: block; animation: stepIn .45s cubic-bezier(.2,.7,.2,1); }
@keyframes stepIn { from { opacity: 0; transform: translateX(18px); } }
legend { font: 700 clamp(1.5rem, 2.6vw, 2rem)/1.1 var(--f-display); letter-spacing: -.02em; margin-bottom: 18px; padding: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: -8px 0 16px; }
.meter .hint { margin: 10px 0 0; }

.opts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.opts-big { display: grid; grid-template-columns: 1fr 1fr; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt > span {
  display: block; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02);
  transition: border-color .2s, background .2s, color .2s;
}
.opts-big .opt > span { padding: 18px 20px; height: 100%; }
.opt b { display: block; font: 600 1.1rem/1.2 var(--f-display); }
.opt small { color: var(--muted); font-size: .88rem; }
.opt:hover > span { border-color: rgba(232,230,240,.4); }
.opt input:checked + span { border-color: var(--disk); background: rgba(255, 180, 90, .1); }
.opt input:focus-visible + span { outline: 2px solid var(--disk); outline-offset: 2px; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--text); background: rgba(7, 8, 20, .6);
  border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px;
  transition: border-color .2s;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23aeadc6' stroke-width='1.6'/%3E%3C/svg%3E"); background-position: calc(100% - 16px) 50%; background-repeat: no-repeat; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--disk); }
.field textarea { resize: vertical; min-height: 110px; }
.field.is-bad input { border-color: #ff7a7a; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .93rem; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--disk); width: 18px; height: 18px; margin-top: 3px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.w-error { color: #ff9a8a; min-height: 1.4em; margin: 6px 0 0; font-size: .93rem; }
.w-nav { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }
.w-nav [hidden] { display: none; }
.w-done { text-align: left; padding: 10px 0; animation: stepIn .5s; }
.w-done h3 { font: 700 2rem/1 var(--f-display); margin: 0 0 12px; color: var(--disk); }
.w-done p { margin: 0 0 8px; }
.w-done:focus { outline: none; }

.summary h3 { font: 600 1.1rem/1 var(--f-display); margin: 0 0 18px; }
.summary dl { margin: 0 0 22px; }
.summary dl div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }
.summary dd.is-empty { color: var(--muted); opacity: .7; }
.meter-top { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 10px; }
.meter-top b { color: var(--disk); }
.meter-bar { height: 6px; border-radius: 99px; background: rgba(232,230,240,.1); overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 8%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--disk), var(--photon)); transition: width .5s cubic-bezier(.2,.7,.2,1); }

/* ---------- FOOTER ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding: 40px var(--gutter); border-top: 1px solid var(--line); background: rgba(7, 8, 20, .85); font-size: .95rem; }
.foot p { margin: 0 0 4px; }
.foot-brand { font: 700 1.1rem/1.2 var(--f-display); display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .req-wrap { grid-template-columns: 1fr; }
  .summary { position: static; }
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .pf, .pf.is-wide { grid-column: span 1; }
  .pf.is-feat { grid-column: span 2; grid-row: auto; }
  .steps { grid-template-columns: 1fr 1fr; gap: 36px 0; }
  .steps li:nth-child(2)::after { display: none; }
}
@media (max-width: 760px) {
  .menu-btn {
    display: block; font: 600 .95rem/1 var(--f-body); color: var(--text); background: rgba(7,8,20,.5);
    border: 1px solid var(--line); border-radius: 99px; padding: 10px 16px; cursor: pointer;
  }
  .nav ul {
    position: absolute; top: 100%; left: 16px; right: 16px; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(9, 10, 26, .96); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
    display: none;
  }
  .nav ul.is-open { display: flex; }
  .nav ul a { display: block; padding: 14px; color: var(--text); }
  .nav ul .nav-cta { text-align: center; margin-top: 6px; }
  .brand > span:first-of-type { font-size: .92rem; }
  .svc-list { grid-template-columns: 1fr; }
  .svc + .svc { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .svc { padding-right: 0; }
  .svc-side { grid-template-columns: 1fr; gap: 10px; }
  .pf-grid { grid-template-columns: 1fr; }
  .pf, .pf.is-wide, .pf.is-feat { grid-column: auto; }
  .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
  .opts-big, .grid2 { grid-template-columns: 1fr; }
  .hero { justify-content: flex-end; padding-bottom: 96px; }
  .hero-title .l2 { padding-left: .15em; }
  .hero-title .l3 { padding-left: .35em; }
  .w-progress li { font-size: 0; }
  .w-nav .btn { flex: 1; }
}

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