/* La Cisternetta web: palette and type mirror ios_app DesignSystem.swift.
   Z: skip 200, nav 100, modal 20, toast 30. */

:root {
  --bg: #F7EDE4;
  --bg-2: #FFFAF5;
  --bg-3: #EDE3DA;
  --primary: #D98315;
  --primary-2: #C76A28;
  --primary-3: #E08A1B;
  --secondary: #8C5329;
  --beer-gold: #F2BB13;
  --beer-amber: #D47119;
  --beer-foam: #F2EBDA;
  --text: #2E2925;
  --muted: #6B6560;
  --foam: #1C1A18;
  --error: #D12A2A;
  --success: #2E995B;
  --card: rgba(46, 41, 37, 0.04);
  --card-border: rgba(46, 41, 37, 0.10);
  --separator: #D9D2CC;
  --ring: rgba(217, 131, 21, 0.38);
  --on-primary: #FFFAF5;
  --shadow-elev: 0 2px 8px rgba(46, 41, 37, 0.06);
  --shadow-deep: 0 24px 60px rgba(46, 41, 37, 0.16);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-med: 280ms;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-system: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --nav-h: 64px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1A18;
    --bg-2: #2B2826;
    --bg-3: #363230;
    --primary: #E69A39;
    --primary-2: #CC7E47;
    --primary-3: #D9953D;
    --secondary: #A6704B;
    --beer-gold: #EDBA1F;
    --beer-amber: #E6842E;
    --beer-foam: #D4CFC3;
    --text: #EDE7E1;
    --muted: #9E9995;
    --foam: #F7EDE4;
    --error: #D94C4C;
    --success: #46B073;
    --card: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.10);
    --separator: #404040;
    --ring: rgba(230, 154, 57, 0.45);
    --on-primary: #1C1A18;
    --shadow-deep: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}
body {
  font-family: var(--font-system);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  -webkit-tap-highlight-color: color-mix(in srgb, var(--primary) 18%, transparent);
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4, .font-rounded {
  font-family: var(--font-rounded);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1, h2 { line-height: 1.12; }
p { text-wrap: pretty; }
.nums { font-variant-numeric: tabular-nums; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-3); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-family: var(--font-rounded);
  font-weight: 700;
}
.skip-link:focus, .skip-link:focus-visible {
  transform: none;
  color: var(--on-primary);
  outline-offset: 2px;
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 max(20px, var(--safe-right)) 0 max(20px, var(--safe-left));
  padding-top: var(--safe-top);
  height: calc(var(--nav-h) + var(--safe-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--separator);
}
.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-rounded);
  font-weight: 800;
  flex-shrink: 0;
}
.site-nav .brand:hover { color: var(--text); }
.site-nav .logo { width: 32px; height: 32px; border-radius: 8px; }
.site-nav .links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 8px;
}
.site-nav .links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.site-nav .links a:hover { color: var(--text); }
.site-nav .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
}
.lang-switch button {
  background: transparent;
  border: 0;
  color: var(--muted);
  min-width: 40px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-rounded);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.lang-switch button.active,
.lang-switch button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}
body > .lang-switch {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: calc(12px + var(--safe-right));
  z-index: 100;
}

/* Topbar (sub-pages) */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 24px 16px;
}
.topbar a.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.topbar a.brand:hover { color: var(--text); }
.topbar img.logo { width: 36px; height: 36px; border-radius: var(--r-sm); }
.topbar .brand-name { font-family: var(--font-rounded); font-weight: 800; }

.page { max-width: 760px; margin: 0 auto; padding: 32px 24px 80px; }
.page h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 800;
  margin-bottom: 8px;
}
.page .updated { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.page h2 { font-size: 24px; font-weight: 700; margin: 36px 0 12px; color: var(--foam); }
.page h3 { font-size: 18px; font-weight: 600; margin: 20px 0 8px; color: var(--foam); }
.page p, .page li { color: var(--muted); margin-bottom: 12px; font-size: 16px; }
.page ul, .page ol { padding-left: 22px; margin-bottom: 16px; }
.page li { margin-bottom: 6px; }
.page strong { color: var(--text); font-weight: 600; }
.page code {
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--shadow-elev);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--on-primary) !important;
  padding: 0 20px;
  min-height: 48px;
  height: 48px;
  border-radius: var(--r-md);
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn:hover {
  background: var(--primary-3);
  transform: translateY(-1px);
  color: var(--on-primary) !important;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.secondary {
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  color: var(--text) !important;
  box-shadow: none;
}
.btn.secondary:hover { background: var(--bg-2); color: var(--text) !important; }
.btn.btn-sm { height: 40px; min-height: 40px; padding: 0 14px; font-size: 14px; }

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row label { font-size: 14px; font-weight: 600; color: var(--text); font-family: var(--font-rounded); }
.form-row input, .form-row textarea, .form-row select {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  min-height: 48px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--muted); }
.form-row input:focus-visible, .form-row textarea:focus-visible, .form-row select:focus-visible {
  border-color: var(--primary);
  background: var(--bg-2);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}
.form-row textarea { min-height: 140px; resize: vertical; }
.form-row select option { background: var(--bg-2); color: var(--text); }
.field-error,
.page .field-error {
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
  min-height: 1.2em;
}
.form-row input[aria-invalid="true"],
.form-row textarea[aria-invalid="true"] {
  border-color: var(--error);
}

footer {
  border-top: 1px solid var(--separator);
  padding: 40px 24px calc(32px + var(--safe-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
footer img.logo { width: 48px; height: 48px; border-radius: var(--r-md); margin: 0 auto 12px; }
footer .links { margin-top: 14px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
footer .links a { color: var(--muted); }
footer .links a:hover { color: var(--text); }

[data-i18n-it], [data-i18n-en] { display: none; }
html[lang="en"] [data-i18n-en] { display: initial; }
html[lang="it"] [data-i18n-it] { display: initial; }
html[lang="en"] span[data-i18n-en],
html[lang="it"] span[data-i18n-it] { display: inline; }

/* Landing */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px max(24px, var(--safe-left)) 48px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  min-height: calc(100dvh - var(--nav-h) - var(--safe-top));
}
.hero-copy { max-width: 36rem; }
.hero-kicker {
  display: inline-block;
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 13px;
  color: var(--secondary);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.hero h1 em {
  font-style: italic;
  color: var(--primary);
  display: block;
  padding-bottom: 4px;
}
.lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 36ch;
  margin-bottom: 28px;
  line-height: 1.5;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.tank-wrap { position: relative; aspect-ratio: 4 / 5; max-width: 380px; width: 100%; margin: 0 auto; }
.tank {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.01));
  border: 2px solid color-mix(in srgb, var(--primary) 28%, var(--card-border));
  box-shadow: inset 0 4px 30px rgba(255,255,255,.06), var(--shadow-deep);
  overflow: hidden;
}
.liquid {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 8%;
  background: linear-gradient(180deg, var(--beer-gold), var(--beer-amber));
}
.wave {
  position: absolute;
  left: -50%; right: -50%;
  top: -28px;
  height: 60px;
  background: var(--beer-gold);
  border-radius: 45% 47% 43% 49% / 60% 60% 40% 40%;
  animation: wave1 7s ease-in-out infinite;
  opacity: .92;
}
.wave.wave-2 {
  top: -22px;
  opacity: .55;
  background: var(--beer-foam);
  animation: wave2 9s ease-in-out infinite;
}
@keyframes wave1 {
  0%, 100% { transform: translateX(-2%) rotate(-1.5deg); }
  50% { transform: translateX(2%) rotate(1.5deg); }
}
@keyframes wave2 {
  0%, 100% { transform: translateX(3%) rotate(2deg); }
  50% { transform: translateX(-3%) rotate(-2deg); }
}
.tank-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  pointer-events: none;
}
.tank-overlay .pct {
  font-family: var(--font-rounded);
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
  font-variant-numeric: tabular-nums;
}
.tank-overlay .lit {
  font-size: 18px;
  color: #fff;
  margin-top: 4px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
  font-variant-numeric: tabular-nums;
}
.tank-overlay .lbl {
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
  margin-top: 14px;
}
.tank-shine {
  position: absolute;
  top: 8%; left: 12%;
  width: 18%; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.30), transparent);
  border-radius: 100px;
  filter: blur(2px);
  pointer-events: none;
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px max(24px, var(--safe-left));
}
.section h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  margin-bottom: 12px;
  max-width: 18ch;
}
.section .sub {
  color: var(--muted);
  max-width: 48ch;
  margin-bottom: 36px;
  font-size: 16px;
}

.bento {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  grid-template-areas:
    "tank groups board"
    "places feed push";
  gap: 14px;
}
.tile {
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 24px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  overflow: hidden;
  position: relative;
}
.tile-tank { grid-area: tank; min-height: 280px; background: #2A2118; color: #F7EDE4; border-color: transparent; }
.tile-groups { grid-area: groups; }
.tile-board { grid-area: board; }
.tile-places { grid-area: places; min-height: 220px; padding: 0; }
.tile-feed { grid-area: feed; }
.tile-push { grid-area: push; }
.tile h3 { font-size: 18px; font-weight: 750; color: inherit; }
.tile p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.tile-tank::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(transparent, rgba(20, 14, 8, 0.82));
  pointer-events: none;
}
.tile-tank h3, .tile-tank p, .tile-tank .tile-icon { position: relative; z-index: 1; }
.tile-tank p { color: rgba(247, 237, 228, 0.9); }
.tile-icon {
  width: 36px;
  height: 36px;
  color: var(--primary);
  margin-bottom: auto;
}
.tile-tank .tile-icon { color: var(--beer-gold); }
.tile-mini-tank {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tile-mini-tank .liquid { height: 62%; }
.tile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile-places .tile-copy {
  position: relative;
  z-index: 1;
  padding: 24px;
  background: linear-gradient(180deg, transparent 10%, rgba(28, 26, 24, 0.78) 100%);
  color: #F7EDE4;
  margin-top: auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.tile-places h3, .tile-places p { color: #F7EDE4; }
.tile-places p { color: rgba(247, 237, 228, 0.82); }

.band {
  background: var(--bg-3);
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}
.band-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 420px;
}
.band-copy { padding: 64px 48px; display: flex; flex-direction: column; justify-content: center; }
.band-copy h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; margin-bottom: 14px; max-width: 16ch; }
.band-copy p { color: var(--muted); margin-bottom: 22px; max-width: 42ch; }
.band-copy ul { list-style: none; display: grid; gap: 10px; }
.band-copy li { color: var(--text); font-size: 15px; font-weight: 600; }
.band-photo { min-height: 320px; }
.band-photo img { width: 100%; height: 100%; object-fit: cover; }

.stores {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px max(24px, var(--safe-left));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.stores h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 8px; max-width: 16ch; }
.stores p { color: var(--muted); }
.store-badges { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.store-badge {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  transition: transform var(--dur-fast) var(--ease-out);
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge img { height: 48px; width: auto; }
.store-badge.google img { height: 72px; margin: -12px 0; }
.store-badge .store-fallback {
  display: none;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  background: #1C1A18;
  color: #F7EDE4 !important;
  font-family: var(--font-rounded);
  font-weight: 700;
  align-items: center;
}
.store-badge.is-fallback img { display: none; }
.store-badge.is-fallback .store-fallback { display: inline-flex; }

.final-cta {
  text-align: left;
  padding: 80px max(24px, var(--safe-left)) 72px;
  max-width: 1120px;
  margin: 0 auto;
}
.final-cta h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 900; margin-bottom: 12px; max-width: 14ch; }
.final-cta p { color: var(--muted); margin-bottom: 24px; }

.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal:not(.is-in) {
    opacity: 0;
    transform: translateY(16px);
  }
  html.js .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  }
}

.nf {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.nf h1 {
  font-size: clamp(72px, 14vw, 120px);
  margin: 0 0 8px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--primary);
}
.nf p { color: var(--muted); margin: 0 0 24px; font-size: 18px; font-weight: 600; font-family: var(--font-rounded); }

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px 20px 40px;
    gap: 32px;
  }
  .lede { max-width: none; }
  .tank-wrap { max-width: 260px; }
  .tank-overlay .pct { font-size: 44px; }
  .bento {
    grid-template-columns: 1fr;
    grid-template-areas:
      "tank"
      "groups"
      "board"
      "places"
      "feed"
      "push";
  }
  .tile-tank, .tile-places { min-height: 220px; }
  .band-inner { grid-template-columns: 1fr; }
  .band-copy { padding: 40px 20px; }
  .band-photo { min-height: 240px; }
  .stores { grid-template-columns: 1fr; }
  .site-nav .links { display: none; }
  .final-cta { padding: 56px 20px; }
}

@media (max-width: 600px) {
  .topbar { padding: 20px 16px; }
  .page { padding: 24px 20px 60px; }
  .site-nav { padding-left: 14px; padding-right: 14px; gap: 8px; }
  .site-nav .brand-name { display: none; }
  .btn.btn-sm { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wave, .liquid, .reveal, .btn, .store-badge {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-nav {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
