/* =========================================================================
   Tabaccheria Aurora — sistema visivo
   3 atmosfere (data-theme): bottega · notte · insegna
   2 stili titolo (data-titles): serif · sans
   ========================================================================= */

/* ---- font ---- */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,500;1,6..72,600&family=Hanken+Grotesk:wght@400;500;600;700;800&family=Spline+Sans+Mono:wght@400;500;600&family=Bodoni+Moda:opsz,wght@6..96,700;6..96,900&display=swap');

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===========================================================
   PALETTE
   =========================================================== */
:root {
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono:  "Spline Sans Mono", ui-monospace, monospace;

  /* default title family — swapped by [data-titles] */
  --title-font: var(--sans);
  --title-spacing: -0.025em;
  --title-weight: 800;

  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20,15,8,.05), 0 12px 30px -16px rgba(20,15,8,.22);
  --shadow-soft: 0 1px 2px rgba(20,15,8,.04), 0 18px 40px -28px rgba(20,15,8,.30);
}

/* BOTTEGA — caldo, classico (default) */
[data-theme="bottega"] {
  --bg:        oklch(0.962 0.013 84);
  --bg-2:      oklch(0.945 0.018 80);
  --surface:   oklch(0.992 0.006 86);
  --ink:       oklch(0.265 0.018 64);
  --ink-soft:  oklch(0.47 0.020 64);
  --ink-faint: oklch(0.63 0.018 66);
  --line:      oklch(0.885 0.018 78);
  --line-soft: oklch(0.92 0.014 80);
  --accent:    oklch(0.46 0.108 252);   /* insegna blue */
  --accent-ink:oklch(0.38 0.11 252);
  --gold:      oklch(0.63 0.105 74);    /* ocra */
  --gold-ink:  oklch(0.52 0.10 70);
  --on-accent: oklch(0.98 0.01 86);
  --tint:      oklch(0.93 0.03 252 / .5);
  --placeholder-a: oklch(0.90 0.02 80);
  --placeholder-b: oklch(0.86 0.03 78);
  color-scheme: light;
}

/* NOTTE — premium, scuro */
[data-theme="notte"] {
  --bg:        oklch(0.205 0.012 62);
  --bg-2:      oklch(0.238 0.014 60);
  --surface:   oklch(0.258 0.015 60);
  --ink:       oklch(0.935 0.012 84);
  --ink-soft:  oklch(0.78 0.014 82);
  --ink-faint: oklch(0.62 0.016 78);
  --line:      oklch(0.34 0.016 62);
  --line-soft: oklch(0.30 0.014 62);
  --accent:    oklch(0.72 0.085 252);
  --accent-ink:oklch(0.80 0.08 252);
  --gold:      oklch(0.76 0.10 80);
  --gold-ink:  oklch(0.82 0.09 82);
  --on-accent: oklch(0.18 0.01 60);
  --tint:      oklch(0.30 0.02 252 / .6);
  --placeholder-a: oklch(0.30 0.015 62);
  --placeholder-b: oklch(0.34 0.02 60);
  color-scheme: dark;
}

/* INSEGNA — istituzionale, blu */
[data-theme="insegna"] {
  --bg:        oklch(0.968 0.008 248);
  --bg-2:      oklch(0.945 0.014 250);
  --surface:   oklch(0.995 0.004 250);
  --ink:       oklch(0.285 0.045 252);
  --ink-soft:  oklch(0.46 0.045 252);
  --ink-faint: oklch(0.62 0.04 252);
  --line:      oklch(0.885 0.02 250);
  --line-soft: oklch(0.92 0.014 250);
  --accent:    oklch(0.43 0.135 256);
  --accent-ink:oklch(0.37 0.14 256);
  --gold:      oklch(0.64 0.11 72);
  --gold-ink:  oklch(0.54 0.105 70);
  --on-accent: oklch(0.985 0.01 250);
  --tint:      oklch(0.92 0.035 252 / .55);
  --placeholder-a: oklch(0.90 0.02 250);
  --placeholder-b: oklch(0.85 0.035 252);
  color-scheme: light;
}

/* title family swap */
[data-titles="serif"] {
  --title-font: var(--serif);
  --title-spacing: -0.01em;
  --title-weight: 600;
}
[data-titles="sans"] {
  --title-font: var(--sans);
  --title-spacing: -0.025em;
  --title-weight: 800;
}

/* ===========================================================
   BASE
   =========================================================== */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }

h1, h2, h3, h4 {
  font-family: var(--title-font);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-spacing);
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.section { padding: clamp(56px, 8vw, 110px) 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--gold-ink);
  opacity: .7;
}

.lead { color: var(--ink-soft); font-size: 1.12rem; line-height: 1.62; max-width: 60ch; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }

/* ===========================================================
   BRAND MARK — monogramma "T"
   =========================================================== */
.tmark {
  --s: 38px;
  width: var(--s); height: var(--s);
  flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: calc(var(--s) * 0.66);
  line-height: 1;
  letter-spacing: 0;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.tmark span { transform: translateY(0.02em); }

/* ===========================================================
   HEADER / NAV
   =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; gap: 18px; height: 74px; }
.brand { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.18rem; letter-spacing: 0; line-height: 1.1; white-space: nowrap; }
.brand-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 1rem; font-weight: 500;
  padding: 8px 11px; border-radius: 99px;
  color: var(--ink-soft);
  transition: color .18s, background .18s;
  cursor: pointer;
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 6%, transparent); }
.nav-link.active { color: var(--ink); background: var(--tint); }
.nav-cta {
  font-size: .98rem; font-weight: 600;
  padding: 9px 15px; border-radius: 99px;
  background: var(--ink); color: var(--bg);
  cursor: pointer; transition: transform .15s, opacity .2s;
}
.nav-cta:hover { transform: translateY(-1px); opacity: .92; }

/* theme switch — sole / mare / notte */
.theme-switch {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
}
.theme-btn {
  display: grid; place-items: center;
  width: 31px; height: 31px; border-radius: 99px;
  border: 0; background: transparent; color: var(--ink-faint);
  cursor: pointer; transition: color .15s, background .15s, transform .15s;
}
.theme-btn:hover { color: var(--ink); }
.theme-btn:active { transform: scale(.92); }
.theme-btn.active { background: var(--tint); color: var(--accent-ink); }

.nav .nav-toggle { display: none; }
.only-wide { display: inline-flex; }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 12px 20px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}
.mobile-menu .nav-link { padding: 12px 14px; font-size: 1rem; }
/* riga in fondo al menu (stato + selettore tema): non deve mai uscire dallo
   schermo — la pill può andare a capo e restringersi, lo switch resta intero */
.mobile-menu .status { white-space: normal; min-width: 0; flex: 0 1 auto; line-height: 1.35; }
.mobile-menu .theme-switch { flex: 0 0 auto; }

/* status pill */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}
.status .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ink-faint); }
.status.open .dot { background: oklch(0.62 0.16 150); box-shadow: 0 0 0 4px oklch(0.62 0.16 150 / .18); }
.status.closed .dot { background: oklch(0.6 0.17 28); box-shadow: 0 0 0 4px oklch(0.6 0.17 28 / .15); }

/* ===========================================================
   BUTTONS
   =========================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 1rem;
  padding: 13px 22px; border-radius: 99px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: var(--surface); border-color: color-mix(in oklab, var(--ink) 20%, var(--line)); color: var(--ink); box-shadow: 0 1px 2px rgba(20,15,8,.05); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--ink-faint); }
.btn-arrow::after { content: "→"; font-family: var(--mono); transition: transform .2s; }
.btn:hover .btn-arrow::after, .btn-arrow:hover::after { transform: translateX(3px); }

/* ===========================================================
   PLACEHOLDER (immagini da inserire)
   =========================================================== */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      var(--placeholder-a) 0, var(--placeholder-a) 11px,
      var(--placeholder-b) 11px, var(--placeholder-b) 22px);
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--ink-faint);
}
.ph::after {
  content: attr(data-label);
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  background: color-mix(in oklab, var(--surface) 86%, transparent);
  padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--line);
}

/* ===========================================================
   CARDS / GRID utilities
   =========================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.divider { height: 1px; background: var(--line-soft); border: 0; }

/* ===========================================================
   FOOTER
   =========================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 64px 0 40px;
}
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.foot-col h4 { font-family: var(--mono); font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; margin-bottom: 16px; }
.foot-col li { margin-bottom: 9px; }
.foot-col a { color: var(--ink-soft); font-size: 1rem; transition: color .15s; }
.foot-col a:hover { color: var(--ink); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.foot-bottom small { font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); letter-spacing: .03em; }

/* ===========================================================
   PAGE TRANSITION
   =========================================================== */
.page { animation: pageIn .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } * { scroll-behavior: auto !important; } }

/* reveal on the home stagger */
.reveal { animation: reveal .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 920px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 1040px) {
  .only-wide { display: none; }
  .nav-cta { display: none; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav .nav-toggle { display: inline-flex; }
  .mobile-menu { display: flex; }
  .wrap { padding: 0 20px; }
  body { font-size: 16px; }
}

/* ---- telefoni: header compatto, footer in colonna ---- */
@media (max-width: 480px) {
  html, body { overflow-x: hidden; }

  /* header: brand + mini selettore tema + menu (opzione B) */
  .nav { gap: 10px; height: 64px; }
  .brand { gap: 9px; }
  .brand-name { font-size: 0.98rem; white-space: normal; line-height: 1.06; }
  /* selettore tema compatto, sempre visibile nell'header */
  .nav .theme-switch { gap: 1px; padding: 2px; }
  .nav .theme-btn { width: 28px; height: 28px; }
  .nav .theme-btn svg { width: 15px; height: 15px; }
  .nav-toggle.btn { padding: 8px 12px; }

  /* footer in colonna unica: niente più testo schiacciato */
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 36px; }
  .site-footer { padding: 48px 0 36px; }
}
