/* ============================================================
   DIGIREALE — Stile elegante (ispirato a Montblanc)
   con accento Matrix. Palette: nero, avorio, oro, verde codice.
   ============================================================ */

:root {
  --nero: #0a0a0a;
  --nero-soft: #141414;
  --avorio: #f5f3ee;
  --avorio-soft: #ece8df;
  --grigio: #8a8578;
  --grigio-scuro: #4a463d;
  --oro: #c9a961;
  --oro-chiaro: #e3cd97;
  --matrix: #00ff5f;
  --matrix-soft: rgba(0, 255, 95, 0.55);

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Space Mono', 'Courier New', monospace;

  --max: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--avorio);
  color: var(--nero);
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--oro);
  font-weight: 400;
}

.mono { font-family: var(--mono); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 40px; }

/* ---------- HEADER ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 40px;
  transition: background .5s var(--ease), padding .5s var(--ease), box-shadow .5s var(--ease);
}
.site-header.scrolled {
  background: rgba(245, 243, 238, 0.92);
  backdrop-filter: blur(14px);
  padding: 16px 40px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.site-header.on-dark { color: var(--avorio); }
.site-header.on-dark.scrolled { color: var(--nero); }

.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  padding-left: 0.28em;
}
.brand span { color: var(--oro); }

.nav { display: flex; gap: 38px; align-items: center; }
.nav a {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--oro); transition: width .4s var(--ease);
}
.nav a:hover::after, .nav a.active::after { width: 100%; }

.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: 0; }
.burger span { width: 26px; height: 1.5px; background: currentColor; transition: .3s; }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  background: var(--nero); color: var(--avorio);
  overflow: hidden;
}
#matrix-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.28; z-index: 1;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 2;
  background: radial-gradient(ellipse at 30% 40%, rgba(10,10,10,0.2), rgba(10,10,10,0.9) 80%);
}
.hero .container { position: relative; z-index: 3; }
.hero-inner { max-width: 820px; }
.hero .eyebrow { margin-bottom: 28px; }
.hero h1 {
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 1.02;
  margin-bottom: 30px;
  font-weight: 500;
}
.hero h1 em { font-style: italic; color: var(--oro-chiaro); }
.hero p {
  font-size: 1.15rem; max-width: 540px; color: rgba(245,243,238,0.8);
  font-weight: 300; margin-bottom: 44px;
}
.hero .mono-tag {
  font-family: var(--mono); font-size: 0.75rem; color: var(--matrix);
  letter-spacing: 0.1em; margin-bottom: 20px; display: inline-block;
  opacity: 0.85;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.2em;
  text-transform: uppercase; padding: 16px 34px;
  border: 1px solid var(--oro); color: var(--oro);
  transition: all .4s var(--ease); cursor: pointer; background: transparent;
}
.btn:hover { background: var(--oro); color: var(--nero); }
.btn-solid { background: var(--nero); color: var(--avorio); border-color: var(--nero); }
.btn-solid:hover { background: var(--oro); border-color: var(--oro); color: var(--nero); }
.btn .arrow { transition: transform .4s var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }

/* ---------- SECTION BASICS ---------- */
section { position: relative; }
.section-pad { padding: 130px 0; }
.section-head { max-width: 720px; margin-bottom: 70px; }
.section-head .eyebrow { display: block; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 24px; }
.section-head p { color: var(--grigio-scuro); font-size: 1.05rem; max-width: 560px; }

.dark { background: var(--nero); color: var(--avorio); }
.dark .section-head p { color: rgba(245,243,238,0.7); }

/* ---------- INTRO SPLIT ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.split .media { aspect-ratio: 4/5; overflow: hidden; background: var(--nero-soft); }
.split .media img, .split .media svg { width: 100%; height: 100%; object-fit: cover; }
.split h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 26px; }
.split p { color: var(--grigio-scuro); margin-bottom: 20px; }
.dark .split p { color: rgba(245,243,238,0.72); }

/* ---------- SERVICE / CARD GRID ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--avorio-soft); }
.dark .grid-3 { background: rgba(255,255,255,0.08); }
.card {
  background: var(--avorio); padding: 54px 40px; min-height: 320px;
  display: flex; flex-direction: column; transition: background .5s var(--ease), color .5s var(--ease);
}
.dark .card { background: var(--nero); }
.card .num { font-family: var(--mono); font-size: 0.8rem; color: var(--oro); margin-bottom: 40px; }
.card h3 { font-size: 1.7rem; margin-bottom: 18px; }
.card p { color: var(--grigio-scuro); font-size: 0.96rem; flex-grow: 1; }
.dark .card p { color: rgba(245,243,238,0.66); }
.card .link { margin-top: 28px; font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--nero); }
.dark .card .link { color: var(--avorio); }
.card:hover { background: var(--nero); color: var(--avorio); }
.card:hover p { color: rgba(245,243,238,0.72); }
.card:hover .link { color: var(--oro-chiaro); }
.card:hover h3 { color: var(--avorio); }

/* ---------- APPO BAND (home) ---------- */
.appo-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: rgba(255,255,255,0.08); }
.appo-cell { background: var(--nero); padding: 44px 30px; display: flex; flex-direction: column; transition: background .5s var(--ease); }
.appo-cell:hover { background: #161616; }
.appo-cell .l { font-family: var(--serif); font-size: 3rem; color: var(--oro); line-height: 1; }
.appo-cell .t { font-family: var(--serif); font-size: 1.5rem; margin: 12px 0 8px; color: var(--avorio); }
.appo-cell .d { font-size: 0.9rem; color: rgba(245,243,238,0.6); }
@media (max-width: 900px){ .appo-band { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .appo-band { grid-template-columns: 1fr; } }

/* ---------- FEATURE BANNER ---------- */
.banner {
  position: relative; padding: 150px 0; text-align: center; overflow: hidden;
  background: var(--nero); color: var(--avorio);
}
.banner .mini-matrix { position: absolute; inset: 0; opacity: 0.16; }
.banner .container { position: relative; z-index: 2; }
.banner h2 { font-size: clamp(2.4rem, 6vw, 4.4rem); max-width: 900px; margin: 0 auto 34px; }
.banner h2 em { font-style: italic; color: var(--oro-chiaro); }

/* ---------- BLOG LIST ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 46px; }
.post {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--avorio-soft); padding-top: 26px;
}
.post .thumb { aspect-ratio: 3/2; overflow: hidden; margin-bottom: 26px; background: var(--nero-soft); }
.post .thumb svg, .post .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.post:hover .thumb svg, .post:hover .thumb img { transform: scale(1.05); }
.post .meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--oro); margin-bottom: 14px; text-transform: uppercase; }
.post h3 { font-size: 1.55rem; margin-bottom: 14px; line-height: 1.2; }
.post p { color: var(--grigio-scuro); font-size: 0.92rem; margin-bottom: 20px; flex-grow: 1; }
.post .link { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }
.post .link .arrow { color: var(--oro); }

/* ---------- ARTICLE ---------- */
.article-hero {
  background: var(--nero); color: var(--avorio); padding: 200px 0 90px;
  position: relative; overflow: hidden;
}
.article-hero .mini-matrix { position: absolute; inset: 0; opacity: 0.14; }
.article-hero .container { position: relative; z-index: 2; max-width: 860px; }
.article-hero .meta { font-family: var(--mono); font-size: 0.75rem; color: var(--matrix); letter-spacing: 0.1em; margin-bottom: 24px; }
.article-hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); margin-bottom: 24px; }
.article-hero .lead { font-size: 1.2rem; color: rgba(245,243,238,0.8); max-width: 640px; }

.article-body { max-width: 720px; margin: 0 auto; padding: 90px 40px 120px; }
.article-body p { font-size: 1.12rem; color: #2a2820; margin-bottom: 28px; line-height: 1.85; }
.article-body h2 { font-size: 2rem; margin: 54px 0 22px; }
.article-body h3 { font-size: 1.45rem; margin: 40px 0 16px; }
.article-body blockquote {
  border-left: 2px solid var(--oro); padding: 8px 0 8px 34px; margin: 40px 0;
  font-family: var(--serif); font-size: 1.5rem; font-style: italic; color: var(--grigio-scuro);
}
.article-body ul { margin: 0 0 28px 22px; }
.article-body li { margin-bottom: 12px; font-size: 1.08rem; color: #2a2820; }
.article-body .callout {
  background: var(--nero); color: var(--avorio); padding: 40px; margin: 44px 0;
  font-family: var(--mono); font-size: 0.95rem; line-height: 1.7;
  border-left: 3px solid var(--matrix);
}
.article-body .callout .label { color: var(--matrix); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; display: block; margin-bottom: 14px; }

/* ---------- FORM ---------- */
.form-wrap { max-width: 640px; }
.field { margin-bottom: 30px; }
.field label { display: block; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grigio); margin-bottom: 12px; }
.field input, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--grigio-scuro);
  padding: 12px 0; font-family: var(--sans); font-size: 1.05rem; color: var(--nero); font-weight: 300;
}
.dark .field input, .dark .field textarea { color: var(--avorio); border-color: rgba(255,255,255,0.3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--oro); }
.field textarea { resize: vertical; min-height: 120px; }

.contact-split { display: grid; grid-template-columns: 1fr 1fr; gap: 90px; }
.contact-info li { list-style: none; margin-bottom: 34px; }
.contact-info .k { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--oro); margin-bottom: 8px; }
.contact-info .v { font-family: var(--serif); font-size: 1.5rem; }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--nero); color: var(--avorio); padding: 90px 0 40px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; padding-bottom: 60px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-brand .brand { font-size: 2rem; margin-bottom: 20px; display: inline-block; }
.footer-brand p { color: rgba(245,243,238,0.6); max-width: 320px; font-size: 0.95rem; }
.footer-col h4 { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--oro); margin-bottom: 22px; }
.footer-col a { display: block; color: rgba(245,243,238,0.75); font-size: 0.92rem; margin-bottom: 14px; transition: color .3s; }
.footer-col a:hover { color: var(--oro-chiaro); }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 30px; font-size: 0.78rem; color: rgba(245,243,238,0.45); }
.footer-bottom .mono { color: var(--matrix-soft); }

/* ---------- REVEAL ANIM ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .split, .contact-split { grid-template-columns: 1fr; gap: 40px; }
  .grid-3, .post-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 720px) {
  .container, .site-header { padding-left: 22px; padding-right: 22px; }
  .nav { position: fixed; inset: 0; background: var(--nero); color: var(--avorio);
    flex-direction: column; justify-content: center; gap: 30px; transform: translateX(100%);
    transition: transform .5s var(--ease); z-index: 99; }
  .nav.open { transform: none; }
  .nav a { font-size: 1.1rem; }
  .burger { display: flex; z-index: 100; }
  .section-pad { padding: 80px 0; }
}
