/* Tipicooo landing — design tokens & shared chrome */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  /* Brand palette */
  --blue: #0071C2;
  --blue-dark: #23387E;
  --light-blue: #47A1DE;
  --yellow: #FEBB02;
  --yellow-soft: rgba(254, 187, 2, 0.16);

  /* Surfaces */
  --surface: #f4f7fb;
  --surface-elevated: #ffffff;
  --cream: #f7f4ec;
  --cream-dark: #efe9dc;

  /* Text */
  --text: #121a2e;
  --text-muted: #4a5568;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: rgba(255, 255, 255, 0.88);

  /* Lines & effects */
  --border: #d5deeb;
  --border-strong: #9db8d8;
  --white: #fff;
  --shadow: 0 10px 30px rgba(35, 56, 126, 0.1);
  --shadow-hover: 0 14px 36px rgba(0, 113, 194, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --focus-ring: 0 0 0 3px rgba(254, 187, 2, 0.55);

  /* Typography */
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  /* Aliases for story pages / page-specific CSS */
  --font-serif: var(--font-display);
  --font-sans: var(--font-body);
  --gold: var(--blue-dark);
  --gold-light: var(--blue);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 180ms;
  --duration: 320ms;
  --duration-slow: 700ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Sticky header (~64px) — ancore #come-funziona / #scarica restano leggibili */
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(0, 113, 194, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 30%, rgba(254, 187, 2, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 35% at 80% 80%, rgba(35, 56, 126, 0.06), transparent 55%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 22px,
      rgba(35, 56, 126, 0.02) 22px,
      rgba(35, 56, 126, 0.02) 23px
    );
  background-attachment: scroll;
}

@media (min-width: 768px) {
  body {
    background-attachment: fixed;
  }
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue);
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.container {
  width: min(100% - 2rem, 1080px);
  margin-inline: auto;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(35, 56, 126, 0.96);
  color: var(--text-on-dark);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(18, 26, 46, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 0.5rem;
  position: relative;
}

.header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-right: 0.15rem;
  border-radius: var(--radius-sm);
  color: var(--white);
  text-decoration: none;
  font-size: 1.45rem;
  line-height: 1;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.header-back:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--yellow);
}

.logo {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-right: auto;
  transition: color var(--duration-fast) var(--ease-out);
}

.logo:hover {
  color: var(--yellow);
}

.nav {
  display: none;
  gap: 1.35rem;
  align-items: center;
}

.nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-out);
}

.nav a:hover {
  color: var(--yellow);
}

.nav-cta {
  background: var(--yellow);
  color: var(--text) !important;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition:
    background var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.nav-cta:hover {
  background: #ffc933;
  color: var(--text) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(254, 187, 2, 0.35);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

.nav.open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--blue-dark);
  padding: 1rem 1.5rem 1.35rem;
  gap: 0.35rem;
  box-shadow: 0 16px 28px rgba(18, 26, 46, 0.28);
  animation: nav-in var(--duration) var(--ease-out);
}

.nav.open a {
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav.open .nav-cta {
  margin-top: 0.5rem;
  text-align: center;
  border-bottom: none;
}

@keyframes nav-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Hero (full-bleed) ── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(100svh, 780px);
  padding: 5rem 0 4rem;
  text-align: center;
  overflow: hidden;
  background: var(--blue-dark);
  color: var(--text-on-dark);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    rgba(18, 26, 46, 0.35) 0%,
    rgba(35, 56, 126, 0.2) 42%,
    rgba(0, 113, 194, 0.45) 100%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  animation: hero-enter var(--duration-slow) var(--ease-out) both;
}

.motto {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin: 0.75rem 0 1rem;
}

.hero-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(5.5rem, 18vw, 7.5rem);
}

.hero-pin {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -48%);
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
}

.hero-pin svg {
  display: block;
  width: clamp(120px, 34vw, 200px);
  height: auto;
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 4rem);
  color: var(--white);
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 18px rgba(18, 26, 46, 0.45);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.05rem, 3.2vw, 1.25rem);
  color: var(--text-on-dark-muted);
  margin: 0.65rem 0 0;
}

.ornament-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(160px, 100%);
  height: 28px;
  margin: 1.1rem auto;
  opacity: 0.85;
}

.ornament-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.ornament-diamond {
  display: block;
  width: 28px;
  height: 24px;
  margin: 0 8px;
  object-fit: contain;
  filter: brightness(1.15);
}

.hero-lead {
  max-width: 34em;
  margin: 0 auto;
  color: var(--text-on-dark-muted);
  font-size: 1.05rem;
}

.hero-lead--tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 0.35rem auto 0.85rem;
}

.hero-lead + .hero-lead {
  margin-top: 0;
}

/* Hero CTA group */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--yellow);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(254, 187, 2, 0.28);
}

.btn--primary:hover {
  background: #ffc933;
  box-shadow: 0 12px 28px rgba(254, 187, 2, 0.4);
}

.btn--secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--yellow);
  color: var(--yellow);
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Sections ── */
.section {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  position: relative;
}

.section-alt {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(244, 247, 251, 0.9) 100%
  );
  border-block: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: clamp(1.6rem, 4.5vw, 2.15rem);
  color: var(--blue-dark);
  text-align: center;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section-intro {
  text-align: center;
  color: var(--text-muted);
  margin: 0 auto 2rem;
  max-width: 36em;
}

/* Reveal on scroll-ready sections (CSS-only entrance) */
.section > .container,
.section-cta > .container {
  animation: section-reveal var(--duration-slow) var(--ease-out) both;
  animation-timeline: view();
  animation-range: entry 0% cover 28%;
}

@supports not (animation-timeline: view()) {
  .section > .container,
  .section-cta > .container {
    animation: section-reveal var(--duration-slow) var(--ease-out) both;
  }
}

@keyframes section-reveal {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Steps (interactive cards only) ── */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
  position: relative;
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.step-card:not(.step-card--link) {
  padding: 1.5rem;
}

.step-card--link {
  overflow: hidden;
}

.step-card--link:hover,
.step-card--link:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.step-card-link {
  display: block;
  padding: 1.5rem;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.step-card-link:focus-visible {
  box-shadow: inset var(--focus-ring);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--yellow);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 50%;
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.step-card h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  color: var(--blue-dark);
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.step-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.step-map-cta {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
  transition: color var(--duration-fast) var(--ease-out);
}

.step-card--link:hover .step-map-cta,
.step-card--link:focus-within .step-map-cta {
  color: var(--blue-dark);
}

/* ── Ecosystem / audience (no card chrome) ── */
.cards-grid {
  display: grid;
  gap: 1.75rem 2rem;
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.info-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  text-align: left;
  border-top: 3px solid var(--yellow);
  padding-top: 1.1rem;
}

.card-icon {
  display: none;
}

.info-card h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  color: var(--blue-dark);
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.info-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

@media (min-width: 768px) {
  #per-chi .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.partner-block {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 3px solid var(--blue);
  text-align: left;
}

.partner-block h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--blue-dark);
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  letter-spacing: -0.01em;
}

.partner-lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  max-width: 40rem;
  font-size: 1.02rem;
}

.partner-subtitle {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--blue-dark);
  margin: 0 0 0.5rem;
}

.partner-steps {
  margin: 0 0 1.35rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
  max-width: 36rem;
}

.partner-steps li + li {
  margin-top: 0.4rem;
}

.partner-register {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.partner-cta {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
  transition: color var(--duration-fast) var(--ease-out);
}

.partner-cta:hover {
  color: var(--blue-dark);
}

/* ── Dual panel (cashback / tipicoins) ── */
.dual-panel {
  display: grid;
  gap: 1.75rem 2.5rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .dual-panel {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 0 1.15rem;
  border-left: 3px solid var(--blue);
}

.panel-accent {
  background: transparent;
  border-left-color: var(--yellow);
}

/* Interactive panels (es. guadagna) — card solo dove c’è tap */
.panel--link {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.panel h3,
.panel h2 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  color: var(--blue-dark);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.panel p {
  margin: 0;
  color: var(--text-muted);
}

.note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: normal;
}

/* ── Contatti ── */
.contatti-inner {
  text-align: center;
}

.contact-email {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 0.15rem;
  transition:
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.contact-email:hover {
  color: var(--blue-dark);
  border-bottom-color: var(--blue);
}

/* ── CTA / Scarica ── */
.section-cta {
  background:
    radial-gradient(ellipse 70% 80% at 10% 20%, rgba(254, 187, 2, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 70% at 90% 80%, rgba(71, 161, 222, 0.22), transparent 55%),
    linear-gradient(145deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  text-align: center;
}

.section-cta h2 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4.5vw, 2.15rem);
  letter-spacing: -0.02em;
}

.section-cta p {
  margin: 0 0 1.25rem;
  opacity: 0.92;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.store-badge {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

.store-badge--soon {
  background: rgba(255, 255, 255, 0.1);
  border: 1px dashed rgba(255, 255, 255, 0.45);
  color: var(--white);
}

.cta-small {
  font-size: 0.85rem !important;
  opacity: 0.75 !important;
}

/* ── Footer ── */
.site-footer {
  background: #121a2e;
  color: rgba(255, 255, 255, 0.82);
  padding: 2.75rem 0;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0;
  color: var(--white);
  letter-spacing: -0.02em;
}

.footer-tag {
  font-size: 0.9rem;
  margin: 0.35rem 0 1.1rem;
  opacity: 0.75;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.footer-nav a {
  color: var(--yellow);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-nav a:hover {
  color: #ffc933;
}

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.55;
  margin: 0;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body {
    background-attachment: scroll !important;
  }

  .hero-inner,
  .section > .container,
  .section-cta > .container,
  .nav.open {
    animation: none !important;
    animation-timeline: auto !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .btn:hover,
  .btn:active,
  .nav-cta:hover,
  .step-card--link:hover,
  .step-card--link:focus-within {
    transform: none;
  }
}

/* ── Responsive tweaks ── */
@media (max-width: 479px) {
  .hero {
    min-height: min(100svh, 680px);
    padding: 4rem 0 3rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .store-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .store-badge {
    text-align: center;
  }
}

@media (min-width: 1024px) {
  .hero {
    min-height: min(100svh, 820px);
  }

  .hero-inner {
    max-width: 44rem;
  }
}
