/* Critical CSS — solo mobile (max-width: 768px), above-the-fold */
:root {
  --mm-50: #faf7f2;
  --mm-100: #f3ecdc;
  --mm-200: #e8dfc8;
  --mm-300: #decfae;
  --mm-400: #cfba8e;
  --mm-500: #e3a23c;
  --mm-600: #c1552c;
  --mm-700: #a84824;
  --mm-800: #28374d;
  --mm-900: #151f2e;
  /* Sezioni scure: base + alone (override da theme-boot) */
  --mm-ink-top: #1c2838;
  --mm-ink-mid: #28374d;
  --mm-ink-bot: #1a2433;
  --mm-ink-glow: transparent;
  --mm-ink-accent: #cfba8e;
  --mm-ink-kicker: #e8a07a;
  --font-brand: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(21, 31, 46, 0.08);
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--mm-900);
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--mm-500) 18%, transparent), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, color-mix(in srgb, var(--mm-600) 12%, transparent), transparent 50%),
    linear-gradient(180deg, var(--mm-50) 0%, var(--mm-100) 100%);
  min-height: 100vh;
  overflow-x: clip;
  transition: color 0.35s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--mm-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--mm-800);
}

.mm-brand {
  font-family: var(--font-brand);
  letter-spacing: -0.025em;
}

.wrap {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
}

/* —— Nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--mm-50) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--mm-200) 70%, transparent);
}

.site-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  position: relative;
}

.nav-logo img {
  height: 28px;
  width: auto;
}

.nav-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--mm-200);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--mm-800);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -5px;
}

.nav-toggle-bars::after {
  top: 5px;
}

.nav-toggle.is-open .nav-toggle-bars {
  background: transparent;
}

.nav-toggle.is-open .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-panel {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  right: 0;
  padding: 0.75rem 0 1rem;
  background: rgba(250, 247, 242, 0.98);
  border-bottom: 1px solid var(--mm-200);
  box-shadow: 0 16px 32px rgba(21, 31, 46, 0.1);
}

.nav-panel.is-open {
  display: block;
}

.nav-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  color: var(--mm-800);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.7rem 0.25rem;
}

.nav-links a:hover {
  color: var(--mm-700);
}

.nav-links a.btn,
.nav-links a.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.85rem 1.15rem;
  line-height: 1.2;
  min-height: 2.85rem;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  transform: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-links a.btn:hover,
.nav-links a.btn:focus-visible,
.nav-links a.btn:active,
.nav-links a.btn-primary:hover,
.nav-links a.btn-primary:focus-visible,
.nav-links a.btn-primary:active {
  color: #fff;
  transform: none;
  scale: none;
}

.nav-links li:last-child a.btn {
  width: 100%;
}

body.nav-open {
  overflow: hidden;
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

button.btn {
  appearance: none;
  -webkit-appearance: none;
}

.btn:active {
  transform: translateY(1px);
}

/* CTA «Entra in MailGram» — paper plane brand */
.btn-enter::before {
  content: "";
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  background-color: currentColor;
  opacity: 0.95;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round' d='M21.5 3.5 10.8 14.2M21.5 3.5 14.6 21l-2.7-7.4L4.5 11l17-7.5z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round' d='M21.5 3.5 10.8 14.2M21.5 3.5 14.6 21l-2.7-7.4L4.5 11l17-7.5z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.nav-links a.btn-enter::before {
  width: 0.9em;
  height: 0.9em;
}

/* CTA «Archivio su Drive» — logo Google Drive a colori */
.btn-drive::before {
  content: "";
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  background: url("/assets/icon-google-drive.svg") center / contain no-repeat;
}

a.btn-primary,
.btn-primary {
  background: var(--mm-700);
  color: #fff;
}

a.btn-primary:hover,
a.btn-primary:focus-visible,
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--mm-800);
  color: #fff;
}

a.btn-secondary,
.btn-secondary {
  background: transparent;
  color: var(--mm-800);
  border-color: var(--mm-200);
}

a.btn-secondary:hover,
a.btn-secondary:focus-visible,
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--mm-100);
  color: var(--mm-800);
}

.cta-panel a.btn-primary,
.cta-panel a.btn-primary:hover,
.cta-panel a.btn-primary:focus-visible {
  color: #fff;
}

.btn-nav {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.nav-links a.btn.is-logged-in,
.nav-links a.btn-primary.is-logged-in {
  background: var(--mm-800);
}

.nav-auth {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
}

.nav-auth-user {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
}

html.mg-logged-in .nav-cta-guest {
  display: none !important;
}

html.mg-logged-in .nav-auth-user {
  display: flex;
}

html:not(.mg-logged-in) .nav-auth-user {
  display: none !important;
}

.nav-logout {
  font-weight: 600;
}

[data-auth-cta] .cta-label-user {
  display: none;
}

html.mg-logged-in [data-auth-cta] .cta-label-guest {
  display: none;
}

html.mg-logged-in [data-auth-cta] .cta-label-user {
  display: inline;
}

@media (min-width: 768px) {
  .nav-auth,
  .nav-auth-user {
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 0.5rem;
  }

  .nav-auth .btn-nav {
    width: auto;
  }
}

/* —— Hero —— */
.hero {
  padding: 0.85rem 0 2.25rem;
  overflow: hidden;
  text-align: center;
}

.hero-inner {
  display: grid;
  gap: 1.75rem;
}

.hero-copy {
  max-width: 36rem;
  margin-inline: auto;
}

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0 auto 1rem;
  width: 100%;
  max-width: 36rem;
}

.hero-brand-icon {
  width: clamp(3.75rem, 18vw, 5.25rem);
  height: auto;
  flex-shrink: 0;
}

.hero-brand-wordmark {
  width: min(100%, 15.5rem);
  height: auto;
  display: block;
}

.hero-headline {
  margin: 0 0 0.85rem;
  font-family: var(--font-brand);
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--mm-900);
  text-align: center;
}

.hero-lead {
  margin: 0 auto 1.35rem;
  color: var(--mm-700);
  font-size: 1rem;
  max-width: 32rem;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.hero-cta .btn {
  width: 100%;
}

.hero-visual {
  margin: 0;
  position: relative;
}

/* Cornice finestra macOS intorno al mockup prodotto */
.mac-window {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #ece8e1;
  border: 1px solid rgba(40, 55, 77, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 4px 6px rgba(21, 31, 46, 0.04),
    0 28px 64px rgba(21, 31, 46, 0.16);
}

.mac-window-chrome {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: linear-gradient(180deg, #f7f3ec 0%, #ece6db 100%);
  border-bottom: 1px solid rgba(40, 55, 77, 0.12);
}

.mac-window-dots {
  display: flex;
  gap: 5px;
  justify-self: start;
}

.mac-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.18);
}

.mac-dot-close {
  background: #ff5f57;
}

.mac-dot-min {
  background: #febc2e;
}

.mac-dot-max {
  background: #28c840;
}

.mac-window-title {
  justify-self: center;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--mm-800);
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
  line-height: 1;
}

.mac-window-body {
  background: var(--mm-100);
  line-height: 0;
}

.hero-visual .hero-mockup-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: var(--mm-100);
}

.hero-visual img,
.hero-visual svg {
  width: 100%;
  border-radius: 0;
  box-shadow: none;
  border: 0;
}

/* —— Motion —— */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.hero-copy.reveal {
  transition-delay: 0.05s;
}

.hero-visual.reveal {
  transition-delay: 0.18s;
}
