/* =============================================================
   PERRI STUDIO — Editoriale Brutalist
   Palette: carta #F2EFE8 · inchiostro #141414 · lime #D8F34E
   ============================================================= */

/* =============================================================
   1. VARIABILI
   ============================================================= */
:root {
  --paper: #f2efe8;
  --paper-2: #e9e4d8;
  --ink: #141414;
  --ink-2: #2a2a2a;
  --gray: #6b6b6b;
  --line: #cfc9ba;
  --lime: #d8f34e;
  --lime-dark: #b7d62e;
  --white: #ffffff;

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Archivo', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --container: 1320px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.65, 0, 0.35, 1);
}

/* =============================================================
   2. RESET & BASE
   ============================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Texture grana */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--lime); color: var(--ink); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 10px; }

/* =============================================================
   3. PRELOADER
   ============================================================= */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.preloader-inner {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.preloader-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 6vw, 56px);
  letter-spacing: -0.02em;
}

.preloader-dot { color: var(--lime); }

.preloader-count {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--lime);
}

.preloader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.preloader-bar i {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--lime);
}

/* =============================================================
   4. CURSOR
   ============================================================= */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.2s var(--ease), background 0.3s, width 0.3s, height 0.3s;
}

.cursor.hovering {
  width: 56px; height: 56px;
  background: var(--lime);
  mix-blend-mode: normal;
}

.cursor-label {
  position: fixed;
  top: 0; left: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.cursor.view-label .cursor-label { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-label { display: none; }
}

/* =============================================================
   5. NAVBAR
   ============================================================= */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: height 0.4s var(--ease);
}

.navbar.scrolled { height: 62px; }

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.nav-logo-reg { color: var(--lime-dark); font-size: 0.6em; vertical-align: super; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  padding: 6px 0;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--lime); /* fallback */
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-num { color: var(--lime-dark); margin-right: 4px; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper) !important;
  border-radius: 40px;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease);
}

.nav-cta:hover { background: var(--lime); color: var(--ink) !important; }
.nav-cta:hover::after { display: none; }
.nav-cta-arrow { font-size: 14px; }

/* AREA STRUMENTI */
.nav-tool {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 9px 14px;
  border: 1px solid var(--ink);
  border-radius: 30px;
  transition: background 0.3s, color 0.3s;
}

.nav-tool:hover {
  background: var(--lime);
  color: var(--ink);
}

.nav-tool span {
  color: var(--lime-dark);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lime-dark);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.nav-burger { display: none; flex-direction: column; gap: 6px; z-index: 7500; }
.nav-burger span { display: block; width: 26px; height: 2px; background: var(--ink); transition: transform 0.4s var(--ease), opacity 0.3s; }
.nav-burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { transform: translateY(-8px) rotate(-45deg); }

/* =============================================================
   6. MENU MOBILE
   ============================================================= */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 7200;
  background: var(--lime);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 8vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.mobile-menu.open { opacity: 1; visibility: visible; }

.mobile-menu-links { display: flex; flex-direction: column; gap: 8px; }

.mobile-menu-links a {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 10vw, 72px);
  color: var(--ink);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.mobile-menu.open .mobile-menu-links a { opacity: 1; transform: translateY(0); }

.m-num {
  font-family: var(--font-mono);
  font-size: 14px;
  vertical-align: super;
  margin-right: 6px;
}

.mobile-menu-foot {
  position: absolute;
  bottom: 36px;
  left: 8vw;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}

/* =============================================================
   7. HERO
   ============================================================= */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  position: relative;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  border-bottom: 1px solid var(--line);
  padding-block: 14px;
  margin-bottom: 40px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 9vw, 128px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.hero-line {
  display: block;
  overflow: hidden;
}

.hero-line-accent { color: var(--lime-dark); }

.hero-rotator {
  display: inline-block;
  position: relative;
}

.hero-sticker {
  position: absolute;
  top: 22%;
  right: clamp(20px, 6vw, 90px);
  width: 130px; height: 130px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  transform: rotate(8deg);
  animation: float 6s ease-in-out infinite;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.sticker-star { color: var(--ink); }

@keyframes float {
  0%, 100% { transform: rotate(8deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-12px); }
}

.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-top: 60px;
  flex-wrap: wrap;
}

.hero-intro {
  max-width: 460px;
  font-size: 18px;
  color: var(--ink-2);
}

.hero-scroll-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--ink);
  padding: 14px 22px;
  border-radius: 40px;
  transition: background 0.3s, color 0.3s;
}

.hero-scroll-link:hover { background: var(--ink); color: var(--paper); }

.hero-arrow { font-size: 18px; }

/* =============================================================
   8. MARQUEE
   ============================================================= */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--ink);
  background: var(--lime);
  padding: 14px 0;
  transform: rotate(-1deg);
  margin: 20px 0;
}

.marquee-track {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  width: max-content;
  animation: marquee 22s linear infinite;
}

.marquee-track span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.marquee-star { color: var(--ink); }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* =============================================================
   9. SEZIONI
   ============================================================= */
.section {
  position: relative;
  padding: clamp(80px, 12vh, 140px) clamp(20px, 5vw, 56px);
  max-width: var(--container);
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 20px;
  margin-bottom: clamp(40px, 6vh, 70px);
}

.section-num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--lime-dark);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* =============================================================
   10. CHI SONO
   ============================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

.about-lead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.15;
  margin-bottom: 24px;
}

.about-lead em {
  font-style: normal;
  color: var(--lime-dark);
}

.about-body {
  font-size: 18px;
  color: var(--gray);
  max-width: 560px;
  line-height: 1.7;
}

.about-stats {
  display: flex;
  gap: clamp(24px, 4vw, 48px);
  margin-top: 44px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1;
}

.stat-num::after { content: "+"; color: var(--lime-dark); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
}

.about-monogram {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.monogram-box {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  background: var(--lime);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: rotate(2deg);
  box-shadow: 10px 10px 0 var(--ink);
}

.monogram-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(80px, 12vw, 140px);
  line-height: 1;
  color: var(--ink);
}

.monogram-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 6px 12px;
  border-radius: 20px;
}

/* =============================================================
   11. COSA FACCIO
   ============================================================= */
.section-services { background: var(--paper-2); max-width: 100%; }

.section-services .section-head { max-width: var(--container); margin-left: auto; margin-right: auto; }

.services-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.service-card {
  position: relative;
  padding: 34px 28px;
  border: 1px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
  transition: background 0.4s var(--ease), color 0.4s, transform 0.3s var(--ease);
  transform-style: preserve-3d;
}

.service-card:hover {
  background: var(--lime);
  transform: rotate(-1deg);
}

.service-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gray);
  display: block;
  margin-bottom: 40px;
}

.service-card h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.service-card p { font-size: 15px; color: var(--ink-2); max-width: 260px; }

.service-arrow {
  position: absolute;
  bottom: 24px;
  right: 26px;
  font-size: 30px;
  transition: transform 0.4s var(--ease);
}

.service-card:hover .service-arrow { transform: translate(6px, -6px); }

/* =============================================================
   12. CONSULENZA
   ============================================================= */
.consult-head { max-width: 900px; }

.consult-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 8vw, 100px);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.consult-title em { font-style: normal; color: var(--lime-dark); }

.consult-sub {
  font-size: 18px;
  color: var(--gray);
  max-width: 560px;
  line-height: 1.7;
}

.consult-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: clamp(40px, 6vw, 80px);
  margin-top: 60px;
  align-items: start;
}

/* Form */
.consult-form { border: 2px solid var(--ink); background: var(--paper); padding: 32px; }

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

.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.form-field label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
}

.form-field input,
.form-field select,
.form-field textarea {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.3s, background 0.3s;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--white);
}

.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  padding: 18px 32px;
  border-radius: 40px;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease);
}

.form-submit:hover { background: var(--lime); color: var(--ink); }

.form-submit-arrow { font-size: 22px; }

.form-note {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lime-dark);
  opacity: 0;
  transition: opacity 0.4s;
}

.form-note.show { opacity: 1; }

/* Contatti */
.consult-contact {
  display: flex;
  flex-direction: column;
  gap: 28px;
  border: 2px solid var(--ink);
  padding: 32px;
  background: var(--lime);
}

.contact-item { display: flex; flex-direction: column; gap: 6px; }

.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-2);
}

.contact-item a,
.contact-item > span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  transition: transform 0.3s var(--ease);
}

.contact-item a:hover { transform: translateX(4px); }

.contact-socials { display: flex; flex-direction: column; gap: 6px; }

.contact-socials a { font-family: var(--font-mono); font-size: 14px; }

/* =============================================================
   13. FOOTER
   ============================================================= */
.footer {
  border-top: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: clamp(50px, 8vh, 80px) clamp(20px, 5vw, 56px) 30px;
}

.footer-top {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}

.footer-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 8vw, 90px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.footer-reg { color: var(--lime); }

.footer-brand p { margin-top: 16px; color: var(--gray); max-width: 360px; font-size: 15px; }

.footer-nav { display: flex; flex-direction: column; gap: 12px; }

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--paper);
  transition: color 0.3s, transform 0.3s var(--ease);
}

.footer-nav a:hover { color: var(--lime); transform: translateX(4px); }

.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray);
}

/* =============================================================
   14. REVEAL
   ============================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* Split chars per hero */
.split-char {
  display: inline-block;
  will-change: transform, opacity;
}

/* =============================================================
   15. RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; }
  .consult-grid { grid-template-columns: 1fr; }
  .nav-status { display: none; }
}

@media (max-width: 768px) {
  .nav-links, .nav-status { display: none; }
  .nav-burger { display: flex; }
  .hero-sticker { width: 110px; height: 110px; font-size: 10px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .section { padding-left: 18px; padding-right: 18px; }
  .consult-form { padding: 22px; }
  .consult-contact { padding: 22px; }
}

/* =============================================================
   16. RIDUZIONE MOVIMENTO
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
