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

:root {
  --black:   #0a0a0a;
  --dark:    #1a1a1a;
  --mid:     #404040;
  --muted:   #808080;
  --light:   #c0c0c0;
  --pale:    #e8e8e8;
  --white:   #f5f5f5;
  --accent:  #ffffff;
  --font:    'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--pale);
  line-height: 1.6;
  font-size: 16px;
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  height: 64px;
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #222;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--light);
  text-decoration: none;
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

.nav-cta {
  background: var(--accent);
  color: var(--black) !important;
  padding: .45rem 1.2rem;
  border-radius: 2px;
  font-weight: 600;
  transition: background .2s, color .2s !important;
}

.nav-cta:hover { background: var(--light) !important; }

/* BURGER */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--light);
  transition: transform .3s, opacity .3s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5vw;
  padding-top: 64px;
  background: linear-gradient(160deg, var(--dark) 0%, var(--black) 60%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 70% 50%, #2a2a2a 0%, transparent 70%);
  pointer-events: none;
}

.hero-label {
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.08;
  color: var(--accent);
  max-width: 14ch;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--muted);
}

.hero p {
  font-size: 1.15rem;
  color: var(--light);
  max-width: 52ch;
  margin-bottom: 2.5rem;
}

.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: .8rem 2rem;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  border-radius: 2px;
  transition: background .2s, color .2s, border-color .2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--black);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--light);
  border-color: var(--light);
}

.btn-outline {
  background: transparent;
  color: var(--light);
  border-color: var(--mid);
}

.btn-outline:hover {
  border-color: var(--light);
  color: var(--accent);
}

/* SECTIONS */
section { padding: 7rem 5vw; }

.section-label {
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .8rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
  margin-bottom: 1.2rem;
  max-width: 22ch;
}

.section-sub {
  color: var(--light);
  max-width: 56ch;
  margin-bottom: 3.5rem;
  font-size: 1.05rem;
}

/* GRID */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5px;
  background: #222;
  border: 1px solid #222;
}

.card {
  background: var(--dark);
  padding: 2.5rem;
  transition: background .2s;
}

.card:hover { background: #222; }

.card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1.5rem;
  opacity: .7;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: .6rem;
}

.card p {
  font-size: .93rem;
  color: var(--muted);
  line-height: 1.65;
}

/* DIVIDER */
.divider {
  border: none;
  border-top: 1px solid #222;
  margin: 0;
}

/* STATS */
.stats {
  background: var(--dark);
  padding: 5rem 5vw;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 3rem;
  text-align: center;
}

.stat-num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: .85rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* PAGE HEADER */
.page-header {
  padding: 10rem 5vw 5rem;
  background: var(--dark);
  border-bottom: 1px solid #222;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 1rem;
}

.page-header p {
  color: var(--light);
  font-size: 1.1rem;
  max-width: 56ch;
}

/* SOLUTIONS PAGE */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: #222;
  border: 1px solid #222;
}

.solution-card {
  background: var(--dark);
  padding: 3rem;
  position: relative;
  overflow: hidden;
  transition: background .2s;
}

.solution-card:hover { background: #1e1e1e; }

.solution-num {
  position: absolute;
  top: 2rem; right: 2rem;
  font-size: .75rem;
  color: #333;
  font-weight: 700;
}

.solution-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .8rem;
}

.solution-card p {
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }

.tag {
  font-size: .75rem;
  padding: .3rem .75rem;
  background: #222;
  color: var(--muted);
  border-radius: 1px;
  letter-spacing: .04em;
}

/* ABOUT PAGE */
.about-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-body h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.about-body p {
  color: var(--light);
  line-height: 1.75;
  margin-bottom: 1rem;
  font-size: .98rem;
}

.value-list { list-style: none; margin-top: 1.5rem; }

.value-list li {
  padding: 1rem 0;
  border-bottom: 1px solid #222;
  color: var(--light);
  font-size: .95rem;
  display: flex;
  gap: .8rem;
}

.value-list li::before {
  content: '—';
  color: var(--muted);
  flex-shrink: 0;
}

/* CONTACT PAGE */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.contact-info h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--light);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-detail a {
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  transition: color .2s;
}

.contact-detail a:hover { color: var(--accent); }

/* FORM */
form { display: flex; flex-direction: column; gap: 1.2rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label {
  display: block;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

input, select, textarea {
  width: 100%;
  background: var(--dark);
  border: 1px solid #333;
  color: var(--pale);
  padding: .8rem 1rem;
  font-family: var(--font);
  font-size: .95rem;
  border-radius: 2px;
  outline: none;
  transition: border-color .2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--muted);
}

textarea { resize: vertical; min-height: 130px; }

select { appearance: none; cursor: pointer; }

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: .5rem;
}

.form-note { font-size: .8rem; color: var(--muted); }

/* FOOTER */
footer {
  background: var(--dark);
  border-top: 1px solid #222;
  padding: 4rem 5vw 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--muted);
  font-size: .9rem;
  margin-top: .8rem;
  max-width: 34ch;
  line-height: 1.7;
}

.footer-col h4 {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .6rem; }

.footer-col a {
  color: var(--light);
  text-decoration: none;
  font-size: .9rem;
  transition: color .2s;
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid #222;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .82rem;
  color: var(--muted);
}

/* SINGLE POST */
.post-header {
  padding: 9rem 5vw 4rem;
  background: var(--dark);
  border-bottom: 1px solid #222;
}

.post-header__inner { max-width: 72ch; }

.post-header__cats {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.post-header__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1.12;
  margin-bottom: 1.5rem;
}

.post-header__meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .04em;
  flex-wrap: wrap;
}

.post-header__sep { opacity: .4; }

.post-thumbnail {
  width: 100%;
  max-height: 520px;
  overflow: hidden;
  border-bottom: 1px solid #222;
}

.post-thumbnail img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
}

.post-body-wrap {
  padding: 5rem 5vw;
  display: flex;
  justify-content: center;
}

.post-body {
  width: 100%;
  max-width: 72ch;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--accent);
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  line-height: 1.2;
}

.entry-content h2 { font-size: 1.6rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content h4 { font-size: 1.05rem; }

.entry-content p {
  color: var(--light);
  line-height: 1.8;
  margin-bottom: 1.4rem;
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}

.entry-content a:hover { color: var(--light); }

.entry-content blockquote {
  border-left: 2px solid var(--mid);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  color: var(--muted);
  font-style: italic;
}

.entry-content pre {
  background: var(--dark);
  border: 1px solid #333;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: .88rem;
  border-radius: 2px;
  margin: 1.5rem 0;
  line-height: 1.6;
}

.entry-content code {
  background: var(--dark);
  border: 1px solid #333;
  padding: .15em .4em;
  font-size: .87em;
  border-radius: 2px;
  color: var(--pale);
}

.entry-content pre code { background: none; border: none; padding: 0; }

.entry-content ul,
.entry-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1.4rem;
  color: var(--light);
  line-height: 1.8;
}

.entry-content li { margin-bottom: .4rem; }

.entry-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border: 1px solid #222;
}

.entry-content hr {
  border: none;
  border-top: 1px solid #222;
  margin: 3rem 0;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #222;
}

.post-nav-wrap {
  border-top: 1px solid #222;
  padding: 0 5vw;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 2.5rem 0;
  text-decoration: none;
  transition: opacity .2s;
}

.post-nav__item:hover { opacity: .7; }

.post-nav__item--prev { padding-right: 3rem; border-bottom: 1px solid #222; }

.post-nav__item--next {
  text-align: right;
  padding-left: 3rem;
  border-left: 1px solid #222;
  border-bottom: 1px solid #222;
}

.post-nav__label {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-nav__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
}

/* ARCHIVE */
.archive-body { padding: 5rem 5vw; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1px;
  background: #222;
  border: 1px solid #222;
  margin-bottom: 4rem;
}

.post-card {
  background: var(--dark);
  transition: background .2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover { background: #1e1e1e; }

.post-card__thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}

.post-card:hover .post-card__thumb img { transform: scale(1.03); }

.post-card__body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card__cat {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .75rem;
  display: block;
}

.post-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .75rem;
}

.post-card__title a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}

.post-card__title a:hover { color: var(--light); }

.post-card__excerpt {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex: 1;
}

.post-card__excerpt p { margin: 0; }

.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid #2a2a2a;
}

.post-card__date {
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .04em;
}

.post-card__link {
  font-size: .82rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: .06em;
  transition: color .2s;
}

.post-card__link:hover { color: var(--light); }

.archive-pagination .nav-links {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  border-top: 1px solid #222;
}

.archive-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #333;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  transition: border-color .2s, color .2s;
}

.archive-pagination .page-numbers:hover,
.archive-pagination .page-numbers.current {
  border-color: var(--accent);
  color: var(--accent);
}

.archive-empty {
  color: var(--muted);
  padding: 5rem 0;
  text-align: center;
}

/* WORDPRESS ADMIN BAR
   Quando si è loggati, WP aggiunge #wpadminbar prima del <header>.
   Il reset globale (margin:0) distrugge il suo layout: compensiamo qui. */
body.admin-bar { padding-top: 32px; }
body.admin-bar nav { top: 32px; }

@media screen and (max-width: 782px) {
  body.admin-bar { padding-top: 46px; }
  body.admin-bar nav { top: 46px; }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--dark); padding: 1.5rem 5vw; border-bottom: 1px solid #222; }
  .nav-links.open { display: flex; }
  .burger { display: flex; }
  .about-body, .contact-layout { grid-template-columns: 1fr; gap: 3rem; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { border-left: none; border-top: 1px solid #222; padding-left: 0; text-align: left; }
  .post-grid { grid-template-columns: 1fr; }
}
