/* Traccia Abbonamenti — site styles
   Light, typographic, Apple-elegant. System fonts only.
   Automatic dark mode, mobile-first, motion-aware. */

:root {
  --accent: #007AFF;
  --accent-press: #0062cc;
  --accent-soft: rgba(0, 122, 255, 0.10);

  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-2: #ececef;
  --card: #ffffff;

  --ink: #1d1d1f;
  --ink-2: #4b4b4f;       /* secondary text, ~8:1 on white */
  --ink-3: #6e6e73;       /* tertiary, large text only */
  --line: #e3e3e6;
  --line-strong: #d2d2d7;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --shadow-lg: 0 30px 70px rgba(0,0,0,.16);

  --radius: 22px;
  --radius-sm: 14px;
  --maxw: 1080px;

  /* z-scale */
  --z-sticky: 100;

  --ease: cubic-bezier(0.16, 1, 0.3, 1); /* ease-out-expo-ish */
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #0A84FF;
    --accent-press: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.16);

    --bg: #000000;
    --surface: #101012;
    --surface-2: #1a1a1d;
    --card: #161618;

    --ink: #f5f5f7;
    --ink-2: #c4c4c8;
    --ink-3: #98989d;
    --line: #2a2a2d;
    --line-strong: #3a3a3e;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow: 0 10px 30px rgba(0,0,0,.5);
    --shadow-lg: 0 40px 90px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Language visibility */
html[data-lang="it"] .lang-en { display: none !important; }
html[data-lang="en"] .lang-it { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Typography scale ---- */
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
.display {
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 0.3em;
}
h2 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
}
h3 {
  font-size: 1.3rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.3em;
}
p { margin: 0 0 1em; color: var(--ink-2); text-wrap: pretty; }
.lead {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 38ch;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

.accent-text { color: var(--accent); }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 58px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--ink); font-size: 1.02rem; letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent);
  display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 600;
  box-shadow: 0 2px 8px var(--accent-soft);
}
.logo-img {
  width: 30px; height: 30px; border-radius: 8px; display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.footer-brand .logo-img { width: 26px; height: 26px; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  color: var(--ink-2); font-size: 0.95rem; padding: 7px 12px; border-radius: 9px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface); text-decoration: none; }
.nav-links a.active { color: var(--ink); font-weight: 500; }

.lang-switch {
  display: inline-flex; background: var(--surface);
  border: 1px solid var(--line); border-radius: 980px; padding: 2px;
}
.lang-switch button {
  border: 0; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 5px 12px; border-radius: 980px; cursor: pointer;
  transition: all .18s var(--ease);
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 1.05rem;
  padding: 14px 26px; border-radius: 980px; border: 0; cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .15s;
  box-shadow: 0 6px 20px var(--accent-soft);
}
.btn:hover { background: var(--accent-press); text-decoration: none; transform: translateY(-2px); box-shadow: 0 12px 28px var(--accent-soft); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--accent);
  box-shadow: none; padding: 14px 22px;
}
.btn-ghost:hover { background: var(--accent-soft); transform: translateY(-2px); box-shadow: none; }
.btn-light { background: #fff; color: #000; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.btn-light:hover { background: #f0f0f2; }

/* ---- Sections ---- */
section { padding: clamp(64px, 11vw, 130px) 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.9rem; font-weight: 500; color: var(--accent);
  background: var(--accent-soft); padding: 6px 14px; border-radius: 980px;
  margin-bottom: 22px; letter-spacing: 0;
}

/* ---- Hero ---- */
.hero { padding: clamp(48px, 7vw, 80px) 0 clamp(40px, 6vw, 64px); text-align: center; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero .lead { margin: 0 auto; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.hero-note { font-size: 0.88rem; color: var(--ink-3); margin-top: 16px; }

/* Hero stat row */
.stat-row {
  display: inline-flex; gap: clamp(20px, 5vw, 48px); margin-top: 38px;
  align-items: stretch;
}
.stat {
  text-align: center;
}
.stat .num {
  font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; letter-spacing: -0.04em;
  color: var(--ink); line-height: 1; display: block;
}
.stat .lbl { font-size: 0.88rem; color: var(--ink-3); margin-top: 8px; display: block; }
.stat-sep { width: 1px; background: var(--line); align-self: stretch; }
.stat-caption { font-size: 0.78rem; color: var(--ink-3); margin-top: 14px; }

/* ---- Phone frames ---- */
/* Corner radius is a percentage of the phone's own width, so it scales with
   the phone. The slash syntax (horizontal / vertical) compensates for the
   ~2.17 screenshot aspect ratio and keeps the corners circular at any size. */
.phone {
  position: relative; border-radius: 13% / 6%; padding: 0; background: var(--ink);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-strong);
}
.phone img {
  display: block; width: 100%; height: auto; border-radius: 12.5% / 5.8%;
}

/* Hero phone composition (left · front · right) */
.hero-visual {
  margin: clamp(48px, 8vw, 90px) auto 0;
  max-width: 760px; position: relative;
  display: flex; justify-content: center; align-items: flex-end;
}
.hero-visual .phone { width: min(44%, 280px); transition: transform .4s var(--ease); }
.hero-visual .phone.side {   /* left, behind */
  transform: translateY(26px) rotate(-6deg) scale(0.9);
  margin-right: -6%; z-index: 1;
}
.hero-visual .phone.front {  /* center, on top */ z-index: 2; }
.hero-visual .phone.back {   /* right, behind */
  transform: translateY(26px) rotate(6deg) scale(0.9);
  margin-left: -6%; z-index: 1;
}
@media (hover: hover) {
  .hero-visual:hover .phone.side  { transform: translateY(20px) rotate(-8deg) scale(0.9); }
  .hero-visual:hover .phone.back  { transform: translateY(20px) rotate(8deg) scale(0.9); }
  .hero-visual:hover .phone.front { transform: translateY(-6px); }
}

/* ---- Feature rows (alternating) ---- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.feature + .feature { margin-top: clamp(80px, 12vw, 150px); }
.feature .feature-text { max-width: 30ch; }
.feature .feature-text h2 { margin-bottom: 0.4em; }
.feature .feature-text p { font-size: 1.12rem; line-height: 1.5; }
.feature .feature-media { display: flex; justify-content: center; }
.feature .phone { width: min(78%, 300px); }
.feature .tag {
  display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--accent);
  margin-bottom: 14px; letter-spacing: 0;
}
/* reverse alternate */
.feature.reverse .feature-text { order: 2; }
.feature.reverse .feature-media { order: 1; }

/* ---- Quick points strip ---- */
.points {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(28px, 4vw, 48px);
}
.point { }
.point .ic { font-size: 1.9rem; display: block; margin-bottom: 12px; }
.point h3 { margin-bottom: 6px; }
.point p { margin: 0; font-size: 1rem; color: var(--ink-2); }

/* ---- Privacy dark section (art-directed) ---- */
.privacy-dark {
  background: #0a0a0c; color: #f5f5f7; position: relative; overflow: hidden;
}
.privacy-dark::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(70% 60% at 80% 10%, rgba(10,132,255,.22), transparent 60%);
}
.privacy-dark .container { position: relative; z-index: 1; }
.privacy-dark h2 { color: #fff; }
.privacy-dark .lead { color: #c4c4c8; }
.privacy-dark .eyebrow { background: rgba(10,132,255,.18); color: #5fb0ff; }
.privacy-list {
  list-style: none; padding: 0; margin: 36px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px; background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.10); border-radius: var(--radius); overflow: hidden;
}
.privacy-list li {
  background: #0d0d10; padding: 26px 24px;
}
.privacy-list .k {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 1.08rem; color: #fff; margin-bottom: 8px;
}
.privacy-list .k .dot {
  width: 22px; height: 22px; border-radius: 50%; background: rgba(10,132,255,.2);
  color: #5fb0ff; display: grid; place-items: center; font-size: 13px; flex-shrink: 0;
}
.privacy-list p { color: #a6a6ad; margin: 0; font-size: 0.97rem; line-height: 1.5; }
.privacy-dark .more { margin-top: 32px; }
.privacy-dark .more a { color: #5fb0ff; font-weight: 500; }

/* ---- Gallery ---- */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: clamp(20px, 3vw, 32px); margin-top: 48px;
}
.gallery figure { margin: 0; text-align: center; }
.gallery .phone { width: 100%; }
.gallery figcaption { margin-top: 14px; color: var(--ink-3); font-size: 0.9rem; }

/* ---- FAQ ---- */
.faq { display: grid; gap: 10px; max-width: 760px; }
details.faq-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 2px 22px; transition: border-color .2s, box-shadow .2s;
}
details.faq-item[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
details.faq-item summary {
  cursor: pointer; list-style: none; font-weight: 600; font-size: 1.08rem;
  padding: 18px 0; display: flex; justify-content: space-between; align-items: center;
  gap: 14px; color: var(--ink); letter-spacing: -0.01em;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+"; font-size: 1.6rem; color: var(--ink-3); font-weight: 300;
  transition: transform .25s var(--ease); flex-shrink: 0;
}
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item .answer { padding: 0 0 20px; }
details.faq-item .answer p:last-child { margin-bottom: 0; }
details.faq-item .answer ol, details.faq-item .answer ul {
  color: var(--ink-2); margin: 0 0 .5em; padding-left: 1.3em;
}
details.faq-item .answer li { margin-bottom: .35em; }

/* ---- Contact box ---- */
.contact-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 44px); text-align: center; margin-bottom: 48px;
}
.contact-box .email-btn { margin-top: 10px; }

/* ---- Legal ---- */
.legal { max-width: 720px; }
.legal h2 {
  font-size: 1.5rem; margin-top: 2em; scroll-margin-top: 80px;
  display: flex; gap: 12px; align-items: baseline;
}
.legal h2:first-of-type { margin-top: 0.5em; }
.legal h2 .n {
  font-size: 0.95rem; font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums; min-width: 1.4em;
}
.legal p, .legal li { color: var(--ink-2); }
.legal li { margin-bottom: .4em; }
.legal strong { color: var(--ink); font-weight: 600; }
.updated {
  display: inline-block; font-size: 0.85rem; color: var(--ink-2);
  background: var(--surface); padding: 7px 16px; border-radius: 980px;
  border: 1px solid var(--line);
}
.steps {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 22px 18px 42px; margin: 0 0 1em;
}
.steps li { color: var(--ink); }

/* ---- Page hero (support / privacy) ---- */
.page-hero { padding: clamp(56px, 9vw, 96px) 0 clamp(28px, 4vw, 44px); }
.page-hero .display { font-size: clamp(2.4rem, 6vw, 3.6rem); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0; background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; align-items: flex-start; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.footer-brand .logo {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-size: 15px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--ink-2); font-size: 0.95rem; }
.footer-links a:hover { color: var(--ink); }
.footer-meta { color: var(--ink-3); font-size: 0.86rem; text-align: right; line-height: 1.7; }

/* ---- Focus ---- */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px;
}

/* ---- Motion / reveal ---- */
@media (prefers-reduced-motion: no-preference) {
  html.js-anim .reveal { opacity: 0; transform: translateY(26px); }
  html.js-anim .reveal.in {
    opacity: 1; transform: none;
    transition: opacity .7s var(--ease), transform .7s var(--ease);
  }
  html.js-anim .reveal.stagger > * { opacity: 0; transform: translateY(20px); }
  html.js-anim .reveal.stagger.in > * {
    opacity: 1; transform: none;
    transition: opacity .6s var(--ease), transform .6s var(--ease);
  }
  html.js-anim .reveal.stagger.in > *:nth-child(2) { transition-delay: .08s; }
  html.js-anim .reveal.stagger.in > *:nth-child(3) { transition-delay: .16s; }
  html.js-anim .reveal.stagger.in > *:nth-child(4) { transition-delay: .24s; }
  html.js-anim .reveal.stagger.in > *:nth-child(5) { transition-delay: .32s; }
  html.js-anim .reveal.stagger.in > *:nth-child(6) { transition-delay: .40s; }
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .feature .feature-text { max-width: 36ch; margin: 0 auto; }
  .feature.reverse .feature-text { order: 1; }
  .feature.reverse .feature-media { order: 2; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .hero-visual { gap: 0; }
  .hero-visual .phone { width: 46%; }
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
  .stat-row { gap: 18px; }
}
