/* Colori: tutta la palette («Nero») sta in queste variabili. */
:root {
  --bg: #000;
  --surface: #171717;
  --text: #fff;
  --muted: #bdbdbd;
  --accent: #bdbdbd;          /* parola in corsivo del titolo */
  --line: rgba(255, 255, 255, .2);
  --border: #444;
  --button-bg: #fff;
  --button-text: #000;
  /* sezione a contrasto (servizi) */
  --alt-bg: #fff;
  --alt-text: #000;
  --alt-muted: #555;
  --alt-line: #ccc;
  /* riga dei servizi al passaggio del mouse */
  --hover-bg: #000;
  --hover-text: #fff;
  --hover-muted: #bdbdbd;
  /* fascia a righe */
  --pole: repeating-linear-gradient(-45deg, #fff 0 9px, #000 9px 18px);
  --pole-period: 25.456px;    /* larghezza di un ciclo: somma delle righe / sin(45°) */
  /* etichette «DA INSERIRE» */
  --todo: #e6b422;
  --alt-todo: #8a6100;
  --hover-todo: #e6b422;
  --serif: 'Besley', Georgia, serif;
  --sans: 'Manrope', Arial, sans-serif;
  --gutter: 64px;
  --section-space: clamp(72px, 9vw, 128px);
  --header-height: 68px;
}

/* Base */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible,
button:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--text); color: var(--bg); }

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.025em;
}

h2 { font-size: clamp(34px, 5vw, 60px); }
p { color: var(--muted); }

.wrap {
  width: min(100% - 2 * var(--gutter), 1320px);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  background: var(--button-bg);
  color: var(--button-text);
  padding: 12px 20px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* Dati mancanti: volutamente fuori palette, per non dimenticarli prima di pubblicare.
   Cerca class="todo" in index.html per trovarli tutti. */
.todo {
  display: inline-block;
  padding: 3px 8px;
  border: 1px dashed currentColor;
  color: var(--todo);
  font: 500 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0;
  vertical-align: middle;
}
.todo::before { content: 'DA INSERIRE · '; }
.light-section .todo { color: var(--alt-todo); }

/* Pulsanti e link */
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 32px;
  background: var(--button-bg);
  color: var(--button-text);
  border: 1px solid var(--button-bg);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: background .2s, color .2s;
}
.button:hover { background: transparent; color: var(--text); border-color: var(--text); }
.button-small { min-height: 44px; padding: 0 24px; font-size: 14px; }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
  transition: text-decoration-color .2s;
}
.text-link:hover { text-decoration-color: currentColor; }
.text-link[hidden] { display: none; }
button.text-link { padding: 0; border: 0; background: none; color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
.link-row { display: flex; flex-wrap: wrap; gap: 0 28px; margin-top: 16px; }

/* Avviso breve in basso (link copiato) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  transform: translateX(-50%);
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.toast[hidden] { display: none; }

/* Testata */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.sprite { position: absolute; }

.brand { flex-shrink: 0; transition: opacity .3s, visibility .3s; }
.site-header.is-over-signature .brand { opacity: 0; visibility: hidden; }
.logo { display: block; height: 50px; aspect-ratio: 808 / 564; fill: currentColor; }

/* Firma: il tratto «Costi» compare da sinistra a destra, poi sale «BARBER». */
.signature { position: relative; display: block; aspect-ratio: 808 / 564; fill: currentColor; }
.signature svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.signature-firma {
  -webkit-mask: linear-gradient(90deg, #000 46%, transparent 54%) 0 0 / 220% 100% no-repeat;
  mask: linear-gradient(90deg, #000 46%, transparent 54%) 0 0 / 220% 100% no-repeat;
  animation: write 1.9s cubic-bezier(.65, 0, .35, 1) .35s both;
}
.signature-barber { animation: rise .7s ease-out 1.95s both; }

@keyframes write {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

/* Sorpresa: un clic sulle forbici del logo e tagliano due volte (js/main.js aggiunge .is-snipping).
   I due bracci ruotano attorno al perno, in coordinate del disegno. */
.scissors-arm-a,
.scissors-arm-b { transform-origin: 67.2px 471px; transition: transform .2s; }
.scissors-hit { cursor: pointer; }
@media (hover: hover) {
  .scissors:hover .scissors-arm-a { transform: rotate(-4deg); }
  .scissors:hover .scissors-arm-b { transform: rotate(4deg); }
}
.scissors.is-snipping .scissors-arm-a { animation: snip-a .6s ease-in-out; }
.scissors.is-snipping .scissors-arm-b { animation: snip-b .6s ease-in-out; }
@keyframes snip-a {
  0%, 50%, 100% { transform: rotate(0); }
  25%, 75% { transform: rotate(10deg); }
}
@keyframes snip-b {
  0%, 50%, 100% { transform: rotate(0); }
  25%, 75% { transform: rotate(-10deg); }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 14px;
}
.main-nav > a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.main-nav > a:not(.button):hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

/* Apertura */
.hero { padding-block: clamp(64px, 11vw, 150px) var(--section-space); }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.hero-signature { width: 100%; max-width: 520px; justify-self: end; }

.hero h1 { font-size: clamp(52px, 5.6vw, 88px); }
/* Con la spaziatura stretta il browser spegne la legatura «fi» e le due lettere si toccano:
   sul corsivo la spaziatura torna normale, così la legatura del font si riattiva. */
.hero h1 em { font-weight: 400; color: var(--accent); letter-spacing: 0; }

.hero-lead {
  max-width: 30em;
  margin-top: 32px;
  font-size: 18px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 36px;
}

/* Titolo di Ivan Costigliola, sopra il titolo principale */
.hero-award { margin-bottom: 24px; font-size: 14px; line-height: 1.5; }
.hero-award strong { display: block; color: var(--text); font-weight: 600; letter-spacing: .02em; }

.hero-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  object-fit: cover;
  margin-top: var(--section-space);
}
.hero:has(.hero-photo) { padding-bottom: 0; }

/* Richiamo al palo da barbiere: unico elemento decorativo della pagina */
.barber-pole { height: 12px; overflow: hidden; background: var(--bg); }
.barber-pole::before {
  content: '';
  display: block;
  width: calc(100% + var(--pole-period) + 1px);
  height: 100%;
  background: var(--pole);
  animation: pole 2.6s linear infinite;
}
@keyframes pole {
  to { transform: translateX(calc(-1 * var(--pole-period))); }
}

/* Servizi */
.light-section { background: var(--alt-bg); color: var(--alt-text); }
.light-section p { color: var(--alt-muted); }

.services { padding-block: var(--section-space); }

.service-intro { max-width: 30em; margin-top: 20px; }

/* Listino: due colonne su schermi larghi, nell'ordine del prezzario di Costi */
.service-list { margin-top: 40px; columns: 2; column-gap: clamp(40px, 6vw, 96px); }

.service-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 24px;
  margin-inline: -14px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--alt-line);
  break-inside: avoid;
  transition: background .25s, color .25s;
}

.service-row h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.25;
  letter-spacing: -.01em;
}
.service-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.service-row p { grid-column: 1 / -1; font-size: 14px; line-height: 1.5; transition: color .25s; }

.service-link { color: inherit; }
.service-link::after { content: ''; position: absolute; inset: 0; } /* tutta la riga porta alla prenotazione */
.service-link:focus-visible { outline: none; }

/* La riga si inverte al passaggio del mouse o con il fuoco da tastiera, non dopo un clic. */
.service-row:has(:focus-visible) { background: var(--hover-bg); color: var(--hover-text); outline: 2px solid var(--alt-text); outline-offset: 2px; }
.service-row:has(:focus-visible) p { color: var(--hover-muted); }
@media (hover: hover) {
  .service-row:hover { background: var(--hover-bg); color: var(--hover-text); }
  .service-row:hover p { color: var(--hover-muted); }
}

/* Prenotazione */
.booking { background: var(--surface); padding-block: var(--section-space); }

.booking-inner,
.location-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px clamp(40px, 7vw, 100px);
  align-items: center;
}

.booking-copy p,
.location-copy p { max-width: 26em; margin-top: 24px; }

.app-card { padding: 32px; border: 1px solid var(--border); }

.app-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}
.app-identity img { width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--border); }
.app-identity h3 { font-size: 18px; font-weight: 500; line-height: 1.3; }
.app-identity p { font-size: 14px; }

.app-qr { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
  .app-qr { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
  .app-qr img { flex-shrink: 0; width: 120px; height: 120px; }
  .app-qr p { font-size: 14px; max-width: 16em; }
}

.app-buttons { display: grid; gap: 12px; }
.app-button { width: 100%; }
/* Il negozio del proprio telefono va per primo e pieno; js/main.js aggiunge .platform-android */
.app-button[data-store='android'],
.platform-android .app-button[data-store='ios'] { background: transparent; color: var(--text); border-color: var(--text); }
.platform-android .app-button[data-store='android'] { order: -1; background: var(--button-bg); color: var(--button-text); border-color: var(--button-bg); }
.app-button[data-store]:hover { background: transparent; color: var(--text); border-color: var(--text); }
.app-alt { margin-top: 18px; font-size: 14px; text-align: center; }
.app-alt a { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

/* Dove siamo */
.location { padding-block: var(--section-space); }
.location-inner { align-items: start; }

.info-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.info-row:last-child { border-bottom: 1px solid var(--line); }
.info-row dt { font-size: 14px; color: var(--muted); padding-top: 2px; }
.info-row dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.info-row dd.info-stack { flex-direction: column; align-items: flex-start; gap: 12px; }

.hours { border-collapse: collapse; color: var(--muted); font-size: 15px; line-height: 1.5; }
.hours th { padding: 3px 28px 3px 0; font-weight: 400; text-align: left; }
.hours td { padding: 3px 0; font-variant-numeric: tabular-nums; }
.hours-note { max-width: 26em; }
.hours .is-today th,
.hours .is-today td { color: var(--text); font-weight: 600; }

.info-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
}
.info-link:hover { text-decoration-color: currentColor; }
.info-note { font-size: 14px; color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Piè di pagina */
.site-footer { border-top: 1px solid var(--line); }

.footer-signature {
  width: min(100%, 520px);
  margin: clamp(56px, 8vw, 104px) auto clamp(40px, 6vw, 72px);
}

.footer-inner {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 32px;
  padding-block: 28px;
}
.footer-inner p { font-size: 14px; }
.credit a { color: var(--text); font-weight: 600; }
.credit a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.back-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
}

.mobile-actions { display: none; }

/* Comparsa allo scorrimento: attiva solo se js/main.js aggiunge .reveal-on */
.reveal-on [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal-on [data-reveal].is-visible { opacity: 1; transform: none; }
.reveal-on [data-reveal='write'] { opacity: 1; transform: none; }
.reveal-on [data-reveal] .signature-firma,
.reveal-on [data-reveal] .signature-barber { animation-play-state: paused; }
.reveal-on [data-reveal].is-visible .signature-firma,
.reveal-on [data-reveal].is-visible .signature-barber { animation-play-state: running; }

@media (max-width: 960px) {
  .service-list { columns: 1; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-signature { display: none; }
  .hero h1 { font-size: clamp(35px, 11.2vw, 88px); }
}

/* Tablet */
@media (max-width: 1100px) {
  :root { --gutter: 32px; }
}

/* Mobile */
@media (max-width: 760px) {
  :root { --header-height: 0px; }

  /* La testata scorre via: a schermo resta solo la barra in basso. */
  .site-header { position: static; }
  .header-inner { height: 76px; }
  .logo { height: 54px; }
  .main-nav { gap: 22px; }
  .main-nav .button { display: none; }

  .hero-lead { font-size: 17px; margin-top: 24px; }
  .hero-actions { margin-top: 28px; }
  .hero-photo { aspect-ratio: 4 / 5; }

  .service-list { margin-top: 28px; }
  .service-row { margin-inline: -12px; padding-inline: 12px; }

  .booking-inner,
  .location-inner { grid-template-columns: 1fr; }

  .app-card { padding: 24px; }
  .info-row { grid-template-columns: 100px 1fr; }

  .footer-inner { padding-bottom: calc(28px + 72px + env(safe-area-inset-bottom)); }
  .hours th { padding-right: 20px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 12px;
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
    transition: transform .25s, visibility .25s;
  }
  .mobile-actions.is-hidden { transform: translateY(100%); visibility: hidden; }

  .mobile-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid var(--border);
    font-size: 15px;
  }
  .mobile-actions a:last-child {
    background: var(--button-bg);
    color: var(--button-text);
    border-color: var(--button-bg);
    font-weight: 600;
  }
}

@media (max-width: 480px) {
  :root { --gutter: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
