/* danieleponzoni.it - foglio di stile
   Tema scuro unico. Un solo accento (verde fosforo desaturato).
   Font: Outfit (variabile, self-hosted) + JetBrains Mono. Raggio unico 6px. */

@font-face {
  font-family: "Outfit";
  src: url("../fonts/Outfit-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jbmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jbmono-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0c0e10;
  --bg-alt: #101316;
  --surface: #14181c;
  --surface-2: #1a1f24;
  --line: rgba(236, 235, 230, 0.09);
  --line-strong: rgba(236, 235, 230, 0.18);
  --text: #ecebe6;
  --muted: #a3a6a1;
  --dim: #6e716d;
  --accent: #7fcf93;
  --accent-ink: #0c0e10;
  --accent-soft: rgba(127, 207, 147, 0.12);
  --sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 6px;
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.motion-ok { scroll-padding-top: 88px; }

body {
  font-family: var(--sans);
  font-weight: 350;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
em { font-style: italic; }
strong { font-weight: 600; color: var(--text); }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  padding: 10px 14px; background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius); font-weight: 600;
}
.skip:focus { top: 16px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: 72px;
  background: rgba(12, 14, 16, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; letter-spacing: 0.01em; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  font-family: var(--mono); font-weight: 700; font-size: 0.95rem;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(127, 207, 147, 0.25);
}
.menu { display: flex; align-items: center; gap: 28px; }
.menu > a:not(.btn) {
  font-size: 0.95rem; color: var(--muted); white-space: nowrap;
  position: relative; padding: 6px 0;
  transition: color 0.25s var(--ease);
}
.menu > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.menu > a:not(.btn):hover { color: var(--text); }
.menu > a:not(.btn):hover::after { transform: scaleX(1); }

.lang { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--dim); }
.lang a { color: var(--dim); padding: 4px 2px; transition: color 0.25s var(--ease); }
.lang a:hover { color: var(--accent); }
.lang-on { color: var(--text); }
.lang a + .lang-on::before, .lang-on + a::before { content: "/"; color: var(--dim); margin-right: 6px; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); transition: transform 0.3s var(--ease), opacity 0.3s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 1rem; letter-spacing: 0.005em; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { background: #93dba5; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); border-color: rgba(236, 235, 230, 0.32); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 0.92rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-center { justify-content: center; }

/* ---------- Tipografia ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
h1 {
  font-size: clamp(2rem, 3.9vw, 2.95rem);
  font-weight: 600; line-height: 1.08; letter-spacing: -0.025em;
  text-wrap: balance;
}
.h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-weight: 600; line-height: 1.12; letter-spacing: -0.02em;
  text-wrap: balance; max-width: 30ch;
}
.h2-big { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.06; letter-spacing: -0.025em; }
.h2 em { color: var(--accent); font-style: italic; padding-bottom: 0.08em; display: inline-block; }
.h3-label {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 400; color: var(--dim); margin-bottom: 28px;
}
.lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--muted); max-width: 46ch; margin: 24px 0 34px; }
.intro { font-size: 1.12rem; color: var(--muted); max-width: 58ch; margin-top: 22px; }
.intro-center { margin-inline: auto; text-align: center; }

/* ---------- Sezioni ---------- */
.section { padding: clamp(80px, 11vw, 150px) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-tight { padding: clamp(56px, 7vw, 96px) 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100dvh - 72px);
  display: flex; align-items: center;
  padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 7vw, 96px);
  overflow: hidden;
}
.hero::before {
  /* griglia puntinata, ferma: dà profondità senza pesare sulla GPU */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(236, 235, 230, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 20%, transparent 75%);
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.prompt {
  font-family: var(--mono); font-size: 0.9rem; color: var(--dim);
  display: flex; flex-wrap: wrap; gap: 0 10px; margin-bottom: 8px;
}
.prompt-user { color: var(--dim); }
.prompt-cmd { color: var(--text); }
.prompt-out { display: inline-block; font-family: var(--mono); font-weight: 400; font-size: 1.05rem; letter-spacing: 0; color: var(--accent); margin-bottom: 10px; }
.prompt-out.typing::after {
  content: "▍"; color: var(--accent); margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-photo {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 5; background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.04); }
.hero-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(236, 235, 230, 0.08);
  border-radius: inherit;
}

/* ---------- Cosa faccio ---------- */
.pillars {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px;
  margin-top: clamp(40px, 5vw, 64px);
}
.pillar {
  position: relative; padding: clamp(28px, 3.4vw, 44px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.pillar-infra {
  background-color: var(--surface);
  background-image:
    linear-gradient(rgba(127, 207, 147, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 207, 147, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}
.pillar-brand { background: linear-gradient(160deg, var(--surface-2), var(--surface) 60%); }
.pillar h3 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 14px; }
.pillar p { color: var(--muted); }
.list { margin-top: 24px; display: grid; gap: 10px; }
.list li {
  position: relative; padding-left: 22px; color: var(--text); font-weight: 400;
}
.list li::before {
  content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 1px; background: var(--accent);
}

/* ---------- Studio (Direzione Digitale) ---------- */
.studio {
  display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center;
  margin-top: clamp(32px, 4vw, 48px);
  padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.studio-logo { width: 200px; height: auto; }
.studio-text { color: var(--muted); max-width: 62ch; display: block; }
.studio-text strong { color: var(--text); }
.studio-link { display: block; margin-top: 10px; font-family: var(--mono); font-size: 0.85rem; color: var(--accent); }
.studio:hover .studio-link { text-decoration: underline; }

/* ---------- Da dove vengo: teschio e glider ---------- */
.storia-marks { display: flex; align-items: center; gap: 28px; margin-bottom: 28px; }
.mark-skull { height: 96px; width: auto; color: var(--text); }
.mark-glider { height: 96px; width: 96px; color: var(--accent); }

/* ---------- Timeline ---------- */
.timeline {
  margin-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.timeline li {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.timeline .when { font-family: var(--mono); font-size: 0.9rem; color: var(--accent); padding-top: 3px; }
.timeline .what { color: var(--muted); max-width: 60ch; }
.timeline .what a { color: var(--text); border-bottom: 1px solid var(--line-strong); transition: border-color 0.25s; }
.timeline .what a:hover { border-color: var(--accent); }

/* ---------- Sovranità ---------- */
.sov-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 7vw, 120px); align-items: start; }
.sov-copy .h2 { max-width: 16ch; }
.facts { display: grid; }
.fact { padding: 26px 0; border-top: 1px solid var(--line); }
.fact:last-child { border-bottom: 1px solid var(--line); }
.fact dt { font-family: var(--mono); font-size: 0.9rem; color: var(--text); margin-bottom: 8px; }
.fact dd { color: var(--muted); }

/* ---------- Chitarra ---------- */
.chit-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.chit-photo {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.chit-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.04); }
.umanesimo { font-style: normal; font-weight: 600; color: var(--accent); white-space: nowrap; }
.plain { margin-top: 28px; display: grid; gap: 16px; color: var(--muted); max-width: 58ch; }
.plain strong { color: var(--text); }

/* ---------- Partner ---------- */
.partners { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.partner {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 28px;
  padding: 34px 32px 34px 0; border-bottom: 1px solid var(--line);
}
.partner + .partner { padding-left: 32px; border-left: 1px solid var(--line); }
.partner-logo { height: 44px; width: auto; opacity: 0.82; transition: opacity 0.25s var(--ease); }
.partner-logo-tall { height: 64px; }
.partner:hover .partner-logo { opacity: 1; }
.partner-desc { color: var(--muted); font-size: 0.98rem; max-width: 34ch; }

/* ---------- Contatti ---------- */
.contact { text-align: center; background: var(--bg-alt); border-top: 1px solid var(--line); }
.contact .h2 { margin-inline: auto; }
.contact .cta-row { margin: 34px 0 48px; }
.contacts {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: center; gap: 16px 48px;
  text-align: left;
}
.contacts li { display: grid; gap: 4px; justify-items: start; }
.contacts .k { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.contacts a { border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: border-color 0.25s, color 0.25s; }
.contacts a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: 32px 0 40px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; font-size: 0.9rem; color: var(--dim); }
.footer-logo { margin-left: auto; }
.footer-logo img { width: 120px; height: auto; opacity: 0.85; }
.footer a { color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.footer a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Motion ----------
   Le animazioni partono solo se html ha la classe motion-ok,
   che il JS assegna quando il sistema non chiede movimento ridotto
   (o con ?motion=1 nell'indirizzo). Senza JS: tutto visibile, fermo. */
html.motion-ok .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
html.motion-ok .reveal.in { opacity: 1; transform: none; }
html.motion-ok .timeline li.reveal:nth-child(2) { transition-delay: 0.06s; }
html.motion-ok .timeline li.reveal:nth-child(3) { transition-delay: 0.12s; }
html.motion-ok .timeline li.reveal:nth-child(4) { transition-delay: 0.18s; }
html.motion-ok .timeline li.reveal:nth-child(5) { transition-delay: 0.24s; }
html.motion-ok .timeline li.reveal:nth-child(6) { transition-delay: 0.30s; }
html.motion-ok .timeline li.reveal:nth-child(7) { transition-delay: 0.36s; }
html.motion-ok .fact:nth-child(2) { transition-delay: 0.08s; }
html.motion-ok .fact:nth-child(3) { transition-delay: 0.16s; }
html.motion-ok .pillar-brand { transition-delay: 0.1s; }

html.motion-ok .hero-copy > * { animation: rise 0.9s var(--ease) both; }
html.motion-ok .hero-copy > :nth-child(1) { animation-delay: 0.05s; }
html.motion-ok .hero-copy > :nth-child(2) { animation-delay: 0.18s; }
html.motion-ok .hero-copy > :nth-child(3) { animation-delay: 0.3s; }
html.motion-ok .hero-copy > :nth-child(4) { animation-delay: 0.42s; }
html.motion-ok .hero-photo { animation: photo-in 1.2s var(--ease) 0.2s both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes photo-in { from { opacity: 0; transform: scale(0.97) translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .menu { gap: 18px; }
  .menu > a:not(.btn) { font-size: 0.88rem; white-space: nowrap; }
  .brand-name { font-size: 0.95rem; }
}

@media (max-width: 1023px) {
  .partners { grid-template-columns: 1fr; }
  .partner + .partner { padding-left: 0; border-left: 0; }
  .partner { padding-right: 0; }
  .partner { grid-template-columns: 1fr; gap: 14px; }
  .contacts { grid-template-columns: repeat(2, auto); }
}

@media (max-width: 767px) {
  .nav { height: 64px; }
  .brand-name { font-size: 0.95rem; }
  .lang { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--dim); }
.lang a { color: var(--dim); padding: 4px 2px; transition: color 0.25s var(--ease); }
.lang a:hover { color: var(--accent); }
.lang-on { color: var(--text); }
.lang a + .lang-on::before, .lang-on + a::before { content: "/"; color: var(--dim); margin-right: 6px; }

.nav-toggle { display: inline-flex; }
  .menu {
    position: fixed; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px;
    background: rgba(12, 14, 16, 0.97);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .menu.open { display: flex; }
  .menu > a:not(.btn) { padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .menu > a:not(.btn)::after { display: none; }
  .menu .btn { margin-top: 16px; }
  .lang { padding: 14px 0 4px; font-size: 0.9rem; }

  .hero { min-height: 0; padding-top: 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { order: -1; max-width: 420px; aspect-ratio: 5 / 4; }
  .hero-photo img { object-position: 50% 22%; }
  h1 br:not(.keep), .h2 br { display: none; }
  .prompt-out { display: block; }
  .hero::before { mask-image: none; -webkit-mask-image: none; opacity: 0.6; }

  .pillars { grid-template-columns: 1fr; }
  .mark-skull { height: 72px; }
  .mark-glider { height: 72px; width: 72px; }
  .studio { grid-template-columns: 1fr; gap: 18px; }
  .studio-logo { width: 160px; }
  .footer-logo { margin-left: 0; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .sov-grid, .chit-grid { grid-template-columns: 1fr; }
  .chit-photo { max-width: 420px; }
  .contacts { grid-template-columns: 1fr; justify-content: start; }
  .contact { text-align: left; }
  .contact .h2 { margin-inline: 0; }
  .intro-center { margin-inline: 0; text-align: left; }
  .cta-center { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
