/* osvaldo — sito di presentazione. HTML/CSS/JS vanilla, nessuna libreria. */

:root {
  --bg: #f4f5fa;
  --bg-2: #ffffff;
  --text: #15171c;
  --muted: #62667a;
  --border: rgba(15, 17, 23, 0.1);
  --surface: rgba(255, 255, 255, 0.7);
  --accent: #6a5cff;
  --accent-2: #3a2fbe;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  --sans: -apple-system, "SF Pro Text", Inter, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", -apple-system, "SF Pro Text", Inter, sans-serif;
  --playful: #ffd166;
}

:root[data-theme="dark"] {
  --bg: #0b0c10;
  --bg-2: #101116;
  --text: #eef0f5;
  --muted: #9296a6;
  --border: rgba(255, 255, 255, 0.1);
  --surface: rgba(255, 255, 255, 0.05);
  --accent: #8b7fff;
  --accent-2: #6a5cff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c10;
    --bg-2: #101116;
    --text: #eef0f5;
    --muted: #9296a6;
    --border: rgba(255, 255, 255, 0.1);
    --surface: rgba(255, 255, 255, 0.05);
    --accent: #8b7fff;
    --accent-2: #6a5cff;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }

/* --- topbar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 15px;
}
.brand-mark { border-radius: 8px; }
.topnav { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.topnav a:hover { color: var(--text); }
.topbar-controls { display: flex; gap: 8px; }
.pill-btn {
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.pill-btn:hover { transform: translateY(-1px); }

/* --- hero: palcoscenico 3D --- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 64px;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  perspective: 1400px;
}
.hero-blobs { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
}
.blob-a {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  top: -140px; right: -100px;
  animation: float-a 14s ease-in-out infinite;
}
.blob-b {
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--playful), transparent 70%);
  bottom: -100px; left: -80px;
  animation: float-b 18s ease-in-out infinite;
}
@keyframes float-a {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 40px); }
}
@keyframes float-b {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

/* nuvola di cubi fluttuanti dietro la mascotte: parallax via JS su data-depth */
.stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transform-style: preserve-3d;
}
.cube {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 30px -12px rgba(58, 47, 190, 0.55);
  animation: bob 7s ease-in-out infinite;
  will-change: transform;
}
.cube svg { width: 22px; height: 22px; }
.cube[data-icon="clipboard"] { background: linear-gradient(135deg, #ff9f6a, #ff6a6a); box-shadow: 0 18px 30px -12px rgba(255, 106, 106, 0.5); }
.cube[data-icon="snippet"] { background: linear-gradient(135deg, var(--playful), #ff9f4a); box-shadow: 0 18px 30px -12px rgba(255, 159, 74, 0.5); }
.cube-1 { top: 12%; left: 6%; animation-duration: 7.5s; }
.cube-2 { top: 62%; left: 2%; animation-duration: 9s; animation-delay: -2s; }
.cube-3 { top: 8%; left: 92%; animation-duration: 8s; animation-delay: -4s; }
.cube-4 { top: 70%; left: 90%; animation-duration: 6.5s; animation-delay: -1s; }
.cube-5 { top: 40%; left: 96%; animation-duration: 10s; animation-delay: -6s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.hero-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease;
  display: inline-block;
}
.btn-primary:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 28px -8px var(--accent); }
.btn-ghost {
  border: 1px solid var(--border);
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover { background: var(--surface); transform: translateY(-2px); }

.hero-meta {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.hero-meta .dot { margin: 0 6px; opacity: 0.5; }

.hero-mascot-wrap { display: flex; justify-content: center; transform-style: preserve-3d; }
.hero-mascot { position: relative; transform-style: preserve-3d; animation: mascot-float 6s ease-in-out infinite; }
.hero-mascot svg { position: relative; z-index: 1; filter: drop-shadow(0 30px 40px rgba(58, 47, 190, 0.3)); }
.mascot-shadow {
  position: absolute;
  bottom: -18px;
  left: 50%;
  width: 160px;
  height: 26px;
  background: radial-gradient(ellipse, rgba(0,0,0,.28), transparent 70%);
  transform: translateX(-50%);
  animation: shadow-pulse 6s ease-in-out infinite;
}
@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-16px) rotate(2deg); }
}
@keyframes shadow-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
  50% { transform: translateX(-50%) scale(0.8); opacity: 0.35; }
}
.eye { transition: transform 0.08s linear; }

.scroll-hint {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 40px 0 0;
  animation: hint-bob 2s ease-in-out infinite;
}
@keyframes hint-bob {
  0%, 100% { transform: translateY(0); opacity: .6; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* --- reveal allo scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* --- modules --- */
.modules { padding: 64px 0; }
.modules h2, .principles h2, .docs h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  text-align: center;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 40px;
  font-size: 15px;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  perspective: 1200px;
  counter-reset: card;
}

/* Card moderne: nessuna icona/pittogramma. Solo un glow sfumato di colore,
   un indice numerico minimale e uno "spotlight" che segue il cursore
   (posizione via --mx/--my impostate da script.js). Stesso linguaggio
   visivo di Linear/Vercel/Raycast: colore + tipografia + luce, non icon-pack. */
.module-card {
  --mx: 50%;
  --my: 0%;
  --glow: var(--accent);
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 24px 24px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
  counter-increment: card;
}
.module-card::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, var(--glow), transparent 70%);
  opacity: 0.22;
  filter: blur(10px);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.module-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(255,255,255,0.10), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.module-card:hover::after { opacity: 1; }
.module-card:hover {
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.3);
  border-color: var(--glow);
}
.module-card:hover::before { opacity: 0.32; }

.module-card > .card-index {
  position: relative;
  z-index: 1;
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  opacity: 0.6;
  margin-bottom: 22px;
}
.module-card > .card-index::before {
  content: "0" counter(card);
}

/* L'icona, se proprio ci deve essere, solo come filigrana enorme e sfumata
   sul fondo della card — mai come badge in primo piano. */
.card-bg-icon {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 130px;
  height: 130px;
  color: var(--glow);
  opacity: 0.1;
  transform: rotate(-8deg);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.25s ease, transform 0.4s ease;
}
.card-bg-icon svg { width: 100%; height: 100%; }
.module-card:hover .card-bg-icon { opacity: 0.16; transform: rotate(-4deg) scale(1.06); }

.module-card h3,
.module-card p,
.module-card .kbd { position: relative; z-index: 1; }

.module-card[data-icon="clipboard"], .module-card[data-icon="task"] { --glow: #ff6a6a; }
.module-card[data-icon="snippet"], .module-card[data-icon="emoji"] { --glow: var(--playful); }
.module-card[data-icon="shelf"], .module-card[data-icon="scratchpad"] { --glow: #2fa88f; }

.module-card h3 { font-family: var(--display); font-weight: 700; font-size: 15.5px; margin: 0 0 6px; }
.module-card p { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 0 0 14px; }
.kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--muted);
}

/* --- principles --- */
.principles { padding: 64px 0; background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.principle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin-top: 40px;
}
.principle h3 { font-size: 15px; margin: 0 0 8px; color: var(--accent); }
.principle p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0; }

/* --- docs --- */
.docs { padding: 64px 0 80px; }
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.steps li { counter-increment: step; position: relative; padding-left: 40px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps h3 { font-size: 14.5px; margin: 0 0 6px; }
.steps p { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 0; }
.docs-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 48px;
  font-style: italic;
}

/* --- footer --- */
.footer { padding: 28px 0; border-top: 1px solid var(--border); }
.footer-inner {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-dot { opacity: 0.5; }

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-mascot-wrap { order: -1; }
  .hero-mascot svg { width: 150px; height: 150px; }
  .stage { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .blob, .cube, .module-card, .hero-mascot, .hero-mascot svg, .eye, .scroll-hint, .mascot-shadow {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* --- download & autorizzazione --- */
.download { padding: 64px 0; }
.download h2 { text-align: center; }
.btn-small { padding: 8px 16px; font-size: 13px; margin-top: 12px; }

.download-steps {
  list-style: none;
  counter-reset: dl;
  padding: 0;
  margin: 40px 0 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.download-steps > li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.download-steps h3 { font-family: var(--display); font-weight: 700; font-size: 16px; margin: 0 0 6px; }
.download-steps p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 8px; }
.download-sub { font-size: 13px; }
.code-block {
  background: #16171c;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0;
  overflow-x: auto;
}
.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  color: #a5f3c4;
  white-space: pre;
}

/* --- mockup HTML/CSS della UI reale (non screenshot) --- */
.mockup-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin: 48px 0 24px;
}
.mockup { margin: 0; }
.mockup-chrome {
  background: #17181c;
  border-radius: 10px 10px 0 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mockup-chrome-plain { justify-content: center; }
.mockup-chrome .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.mockup-title {
  color: #9a9ba3;
  font-size: 11.5px;
  font-family: var(--mono);
  margin-left: 8px;
}
.mockup-chrome-plain .mockup-title { margin-left: 0; }
.mockup-body {
  background: linear-gradient(160deg, #1c1d24, #121319);
  border-radius: 0 0 10px 10px;
  padding: 16px;
  min-height: 150px;
}
.mockup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  color: #e5e6ea;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.mockup-row:last-child { border-bottom: none; }
.mockup-toggle { width: 26px; height: 14px; border-radius: 8px; background: rgba(255,255,255,.15); position: relative; }
.mockup-toggle.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.mockup-toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.mockup-toggle.on::after { transform: translateX(12px); }

.mockup-search {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: #e5e6ea;
  font-size: 13px;
  margin-bottom: 10px;
}
.mockup-caret { display: inline-block; width: 1.5px; height: 13px; background: var(--accent); margin-left: 2px; vertical-align: middle; animation: caret-blink 1s step-end infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.mockup-result {
  padding: 8px 10px;
  border-radius: 7px;
  color: #e5e6ea;
  font-size: 12.5px;
  margin-bottom: 3px;
}
.mockup-result.active { background: rgba(106, 92, 255, 0.28); }
.mockup-result.muted { color: #82838d; }

/* --- disinstallazione / aggiornamento --- */
.uninstall { padding: 64px 0 80px; background: var(--bg-2); border-top: 1px solid var(--border); }
.uninstall h2 { text-align: center; margin-bottom: 40px; }
.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.manage-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.manage-card h3 { font-family: var(--display); font-weight: 700; font-size: 16px; margin: 0 0 10px; color: var(--accent); }
.manage-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0 0 8px; }
