/*
Theme Name: FM Studio
Theme URI: https://www.fmstudio3d.it
Author: FM Studio
Description: Tema su misura per FM Studio — modellazione 3D di parti industriali. Scena 3D animata, portfolio "Lavori" e modulo contatti con allegati. Testi modificabili da Aspetto → Personalizza.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: fmstudio
*/

:root {
  --bg: #0E100C;
  --bg-2: #161912;
  --fg: #f2f0ea;
  --muted: #8E9287;
  --line: rgba(255,255,255,.09);
  --accent: #C8FF2E;
  --accent-2: #EFFFBF;
  --radius: 18px;
  --pad: clamp(20px, 5vw, 72px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, .display { font-family: "Space Grotesk", sans-serif; font-weight: 500; line-height: 1.02; letter-spacing: -.02em; }
img { max-width: 100%; height: auto; }

/* Scena 3D fissa dietro ai contenuti */
#scene {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
  transition: opacity .2s linear;
}
.glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 60vw; height: 60vw; right: -15vw; top: -15vw;
  background: radial-gradient(circle, rgba(200,255,46,.10), transparent 60%);
  filter: blur(20px);
}
main, .site-header, .site-footer { position: relative; z-index: 1; }

/* Navigazione */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad);
  transition: background .3s, backdrop-filter .3s, padding .3s;
}
.site-header.scrolled { background: rgba(10,10,12,.6); backdrop-filter: blur(14px); padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.logo img { height: 22px; width: auto; display: block; }
.site-nav { display: flex; gap: 34px; font-size: .92rem; }
.site-nav a { color: var(--muted); transition: color .2s; }
.site-nav a:hover { color: var(--fg); }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 100px;
  background: var(--fg); color: var(--bg);
  font-weight: 500; font-size: .92rem;
  transition: transform .25s, background .25s;
}
.btn:hover { background: var(--accent); color: var(--bg); transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); background: transparent; color: var(--fg); }
.btn .arrow { transition: transform .25s; }
.btn:hover .arrow { transform: translateX(4px); }

/* Hero */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 120px var(--pad) 60px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 28px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.hero h1 { font-size: clamp(3rem, 9vw, 8.4rem); max-width: 11ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { max-width: 460px; margin-top: 30px; color: var(--muted); font-size: 1.08rem; }
.hero .actions { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; }
.scroll-hint { position: absolute; bottom: 34px; left: var(--pad); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.scroll-hint::after { content: ""; width: 60px; height: 1px; background: var(--muted); animation: hint 2s ease-in-out infinite; transform-origin: left; }
@keyframes hint { 0%,100% { transform: scaleX(.2); } 50% { transform: scaleX(1); } }

/* Parole scorrevoli */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 26px 0; background: rgba(10,10,12,.5); backdrop-filter: blur(6px); }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 32s linear infinite; }
.marquee span { font-family: "Space Grotesk"; font-size: clamp(1.6rem, 4vw, 3rem); white-space: nowrap; color: transparent; -webkit-text-stroke: 1px rgba(242,240,234,.35); }
.marquee span:nth-child(odd) { color: var(--fg); -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sezioni della home */
.home-main > section { padding: clamp(90px, 14vw, 180px) var(--pad); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 64px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(2.2rem, 5.5vw, 4.4rem); max-width: 14ch; }
.section-head p { max-width: 380px; color: var(--muted); }
.label { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; display: block; }

/* Servizi */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.service { background: rgba(14,14,18,.82); backdrop-filter: blur(10px); padding: 40px 30px 46px; min-height: 340px; display: flex; flex-direction: column; transition: background .35s; position: relative; }
.service:hover { background: rgba(24,28,18,.92); }
.service .num { font-family: "Space Grotesk"; color: var(--muted); font-size: .9rem; }
.service h3 { font-size: 1.6rem; margin-top: auto; margin-bottom: 14px; }
.service p { color: var(--muted); font-size: .94rem; }
.service .icon { width: 44px; height: 44px; margin: 26px 0 40px; color: var(--accent); }
.service.cta { background: var(--accent); color: var(--bg); }
.service.cta:hover { background: #d6ff5c; }
.service.cta .num { color: var(--bg); font-size: 2rem; transition: transform .3s; }
.service.cta:hover .num { transform: translateX(8px); }
.service.cta p { color: rgba(14,16,12,.75); }

/* Lavori */
.work { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
.card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 380px; grid-column: span 4; transform-style: preserve-3d; transition: transform .15s ease-out; border: 1px solid var(--line); background: var(--bg-2); }
.card:nth-child(1) { grid-column: span 7; min-height: 520px; }
.card:nth-child(2) { grid-column: span 5; min-height: 520px; }
.card .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover .art { transform: scale(1.06); }
.card .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px; display: flex; justify-content: space-between; align-items: end; gap: 12px; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.card h3 { font-size: 1.4rem; }
.card small { color: rgba(255,255,255,.65); font-size: .82rem; }
.card .tag { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; padding: 7px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 100px; backdrop-filter: blur(6px); white-space: nowrap; }
.admin-note { margin-top: 22px; padding: 14px 18px; border: 1px dashed var(--accent); border-radius: 12px; color: var(--accent-2); font-size: .88rem; }
.admin-note a { text-decoration: underline; }

/* Segnaposto dei lavori (visibili solo all'amministratore finché non aggiungi i tuoi) */
.a1 { background: radial-gradient(circle at 30% 35%, #EFFFBF 0, #C8FF2E 16%, #2c3a0a 45%, #0b0d08 75%); }
.a1::after { content: ""; position: absolute; width: 46%; aspect-ratio: 1; left: 42%; top: 18%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0, #cfc7bb 12%, #5d5750 45%, #1b1917 75%); box-shadow: -40px 60px 80px rgba(0,0,0,.6); }
.a2 { background: linear-gradient(160deg, #1a2a3a, #0b1118 60%), #0b1118; }
.a2::after { content: ""; position: absolute; inset: 22% 18%; border: 1px solid rgba(140,200,255,.55); transform: perspective(600px) rotateX(55deg) rotateZ(35deg); background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(140,200,255,.25) 22px 23px), repeating-linear-gradient(90deg, transparent 0 22px, rgba(140,200,255,.25) 22px 23px); }
.a3 { background: conic-gradient(from 200deg at 60% 60%, #2b2b2b, #6b6b6b, #1a1a1a, #9a9a9a, #2b2b2b); }
.a4 { background: radial-gradient(ellipse at 50% 110%, #C8FF2E40, transparent 60%), linear-gradient(#141710, #0a0b08); }
.a4::after { content: ""; position: absolute; width: 38%; height: 55%; left: 31%; top: 18%; border-radius: 40% 40% 12px 12px; background: linear-gradient(90deg, #3a2f28, #b8a590 45%, #4a3c33); }
.a5 { background: linear-gradient(135deg, #10201a, #2f5d4a 50%, #0c1512); }
.a5::after { content: ""; position: absolute; inset: 25%; border-radius: 30%; background: linear-gradient(145deg, #d9ffe9, #5fae8a 40%, #163428); transform: rotate(18deg); box-shadow: 30px 40px 60px rgba(0,0,0,.5); }

/* Metodo */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.step { padding-top: 26px; border-top: 1px solid var(--line); position: relative; }
.step::before { content: ""; position: absolute; top: -1px; left: 0; height: 1px; width: 0; background: var(--accent); transition: width 1.2s cubic-bezier(.2,.7,.2,1) .2s; }
.step.in::before { width: 100%; }
.step .n { font-family: "Space Grotesk"; font-size: 3.4rem; color: var(--accent); line-height: 1; }
.step h3 { font-size: 1.3rem; margin: 18px 0 10px; }
.step p { color: var(--muted); font-size: .94rem; }

/* Numeri */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 90px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; background: rgba(14,14,18,.6); backdrop-filter: blur(8px); }
.stat .big { font-family: "Space Grotesk"; font-size: clamp(2.8rem, 6vw, 4.6rem); line-height: 1; }
.stat .big sup { font-size: .45em; color: var(--accent); }
.stat p { color: var(--muted); margin-top: 10px; }

/* Contatti */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 7vw, 110px); align-items: start; }
.contact h2 { font-size: clamp(2.6rem, 7vw, 6rem); }
.contact h2 em { font-style: normal; color: var(--accent); }
.contact-info { margin-top: 44px; display: grid; gap: 18px; }
.contact-info div { display: flex; flex-direction: column; }
.contact-info small { color: var(--muted); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.contact-info a { font-size: 1.15rem; transition: color .2s; }
.contact-info a:hover { color: var(--accent); }
.fm-form { position: relative; background: rgba(14,14,18,.75); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); display: grid; gap: 18px; }
.fm-form .field { display: grid; gap: 8px; }
.fm-form .field > label, .fm-form .field-title { font-size: .8rem; color: var(--muted); }
.fm-form input[type=text], .fm-form input[type=email], .fm-form textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--fg); font: inherit; padding: 10px 0; outline: none; transition: border-color .2s;
}
.fm-form input:focus, .fm-form textarea:focus { border-color: var(--accent); }
.fm-form textarea { resize: vertical; min-height: 110px; }
.fm-form input[type=file] { font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; }
.fm-form input[type=file]::file-selector-button { margin-right: 14px; padding: 8px 16px; border-radius: 100px; border: 1px solid var(--line); background: transparent; color: var(--fg); font: inherit; cursor: pointer; transition: border-color .2s; }
.fm-form input[type=file]::file-selector-button:hover { border-color: var(--accent); }
.fm-form .hint { font-size: .76rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { padding: 8px 16px; border: 1px solid var(--line); border-radius: 100px; font-size: .85rem; color: var(--fg); cursor: pointer; transition: all .2s; }
.chips input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.chips input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; color: var(--muted); }
.consent input { margin-top: 4px; accent-color: var(--accent); }
.consent a { color: var(--fg); text-decoration: underline; }
.fm-form .btn { justify-self: start; border: 0; cursor: pointer; margin-top: 8px; font-family: inherit; }
.form-msg { font-size: .9rem; padding: 12px 16px; border-radius: 12px; }
.form-msg.ok { background: rgba(200,255,46,.12); color: var(--accent-2); border: 1px solid rgba(200,255,46,.4); }
.form-msg.err { background: rgba(255,90,60,.1); color: #ffb4a3; border: 1px solid rgba(255,90,60,.35); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px var(--pad); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); background: var(--bg); }
.site-footer a:hover { color: var(--fg); }

/* Pagine interne (privacy, cookie, ecc.) */
.page-main { padding: 160px var(--pad) 100px; }
.page-content { max-width: 760px; margin: 0 auto; }
.page-content h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 40px; }
.page-content h2 { font-size: 1.8rem; margin: 48px 0 16px; }
.page-content h3 { font-size: 1.3rem; margin: 32px 0 12px; }
.page-content p, .page-content ul, .page-content ol { margin-bottom: 18px; color: #cfcdc6; }
.page-content ul, .page-content ol { padding-left: 1.4em; }
.page-content a { color: var(--accent); text-decoration: underline; }
.page-content strong { font-weight: 500; color: var(--fg); }

/* Animazioni di entrata (solo se JavaScript è attivo) */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; }
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .16em; margin-bottom: -.16em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }
.split.in .w > span { transform: none; }

@media (max-width: 980px) {
  .site-nav { display: none; }
  .services { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; gap: 40px 22px; }
  .card:nth-child(n) { grid-column: span 12; min-height: 340px; }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { justify-content: flex-end; padding-bottom: 100px; }
}
@media (max-width: 600px) {
  .services, .steps, .stats { grid-template-columns: 1fr; }
  .service { min-height: 260px; }
  .site-header .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .scroll-hint::after { animation: none; }
  .js .reveal, .split .w > span { transition: none; opacity: 1; transform: none; }
}
