/* Inter self-hosted (niente richieste a fonts.googleapis.com/fonts.gstatic.com):
   font variabile, un'unica @font-face per sottoinsieme copre i pesi 400-700. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --bg: #f8f8f6;
  --panel: #ffffff;
  --text: #111827;
  --text-soft: #5f6773;
  --border: rgba(34, 39, 46, 0.14);
  --primary: #e0b020;
  --primary-text: #33260a;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --max-width: 1100px;
  color-scheme: light;
}

/* Tema scuro: segue il sistema di default, oppure il toggle in header (che
   forza [data-theme]) memorizzato in localStorage — stessa logica di
   assets/js/theme.js nell'app principale. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e1f23;
    --panel: #24262c;
    --text: #f4f4f6;
    --text-soft: #a2a7b3;
    --border: rgba(255, 255, 255, 0.14);
    --primary: #e6bb35;
    --primary-text: #221a03;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1e1f23;
  --panel: #24262c;
  --text: #f4f4f6;
  --text-soft: #a2a7b3;
  --border: rgba(255, 255, 255, 0.14);
  --primary: #e6bb35;
  --primary-text: #221a03;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 900px 500px at 15% 0%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.55;
}

a {
  color: inherit;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  display: block;
}

.brand span {
  color: var(--primary-text);
  background: var(--primary);
  padding: 0 6px;
  border-radius: 6px;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.3s ease;
}

.theme-switch-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}

.theme-switch-btn svg {
  width: 18px;
  height: 18px;
}

.theme-switch-btn.is-rotating {
  transform: rotate(180deg);
}

.theme-icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-moon {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-icon-sun {
    display: block;
  }
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

/* Hero */

.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-text);
  background: color-mix(in srgb, var(--primary) 30%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 16px;
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Hero slideshow */

.hero-slideshow {
  position: relative;
  max-width: 900px;
  margin: 48px auto 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.hero-slideshow-track {
  display: flex;
  transition: transform 0.5s ease;
}

.hero-slide {
  flex: 0 0 100%;
  min-width: 0;
  cursor: pointer;
}

.hero-slideshow-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.hero-slideshow-dots button {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--border);
  cursor: pointer;
}

.hero-slideshow-dots button.active {
  background: var(--primary);
}

/* Browser-style frame for app screenshots */

.browser-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.browser-frame-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.browser-frame-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.browser-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* YouTube facade: niente iframe (niente contatto con Google) finché non si
   clicca play; vedi includes/youtube_embed.php */

.yt-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.yt-embed-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-embed-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.yt-embed-play svg {
  width: 26px;
  height: 26px;
}

.yt-embed-play:hover {
  transform: scale(1.08);
}

.yt-embed.is-loaded .yt-embed-thumb,
.yt-embed.is-loaded .yt-embed-play {
  display: none;
}

.yt-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .yt-embed-play {
    transition: none;
  }
}

/* Phone frame */

.phone-frame {
  position: relative;
  width: 240px;
  aspect-ratio: 390 / 844;
  margin: 0 auto;
  background: #111827;
  border: 10px solid #111827;
  border-radius: 36px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.phone-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 42%;
  height: 16px;
  background: #111827;
  border-radius: 0 0 10px 10px;
  z-index: 2;
}

.phone-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 1s ease;
}

.phone-frame img.active {
  opacity: 1;
}

/* Phone showcase (phone + text side by side) */

.phone-showcase {
  display: flex;
  align-items: center;
  gap: 56px;
}

.phone-showcase .phone-frame {
  flex: none;
  width: 220px;
  margin: 0;
  transform: rotate(-8deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
}

.phone-showcase-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.phone-showcase-text h2 {
  text-align: left;
}

.phone-showcase-text p.section-lead {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 720px) {
  .phone-showcase {
    flex-direction: column;
    gap: 32px;
    text-align: center;
  }

  .phone-showcase .phone-frame {
    transform: none;
  }

  .phone-showcase-text,
  .phone-showcase-text h2,
  .phone-showcase-text p.section-lead {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Flow diagram: server -> wifi -> telefono -> wifi/bluetooth -> stampante */

.flow-diagram {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.flow-node span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}

.flow-link {
  position: relative;
  flex: 1;
  min-width: 32px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-dash {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background-image: repeating-linear-gradient(to right, var(--primary) 0 6px, transparent 6px 14px);
  background-size: 28px 100%;
  opacity: 0.55;
  animation: flow-dash-move 1s linear infinite;
}

@keyframes flow-dash-move {
  to {
    background-position: -28px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-dash {
    animation: none;
  }
}

.flow-link-icons {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  padding: 0 4px;
}

.flow-wifi {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.flow-wifi path {
  animation: flow-pulse 1.8s ease-in-out infinite;
  opacity: 0.25;
}

.flow-wifi path:nth-of-type(1) {
  animation-delay: 0s;
}

.flow-wifi path:nth-of-type(2) {
  animation-delay: 0.2s;
}

.flow-wifi path:nth-of-type(3) {
  animation-delay: 0.4s;
}

.flow-bt {
  width: 15px;
  height: 15px;
  color: var(--text-soft);
}

@keyframes flow-pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-wifi path {
    animation: none;
    opacity: 1;
  }
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
}

/* Sections */

section {
  padding: 48px 0;
}

section h2 {
  font-size: 1.8rem;
  margin: 0 0 8px;
  text-align: center;
}

section p.section-lead {
  text-align: center;
  color: var(--text-soft);
  max-width: 620px;
  margin: 0 auto 36px;
}

/* Feature grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--text-soft);
}

.card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
}

.card li {
  margin-bottom: 6px;
}

.card li:last-child {
  margin-bottom: 0;
}

/* Icon badge */

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--primary-text);
  margin-bottom: 14px;
}

.icon-badge svg {
  width: 22px;
  height: 22px;
}

.icon-badge--lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin-bottom: 0;
}

.icon-badge--lg svg {
  width: 28px;
  height: 28px;
}

/* Steps */

.steps {
  counter-reset: step;
  display: grid;
  gap: 20px;
}

.step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.step-number {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h3 {
  margin: 0 0 4px;
}

.step p {
  margin: 0;
  color: var(--text-soft);
}

/* CTA band */

.cta-band {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}

.cta-band h2 {
  margin-bottom: 12px;
}

/* Feature highlight (funzionalità esclusiva) */

.feature-highlight {
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 40px;
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
  text-align: center;
}

.feature-highlight .hero-kicker {
  margin-bottom: 12px;
}

.bridge-usb-label {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font);
  fill: var(--text-soft);
}

code {
  background: var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.9em;
}

/* Network diagram */

.network-diagram {
  max-width: 460px;
  margin: 36px auto 0;
}

.network-diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

.net-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 6 8;
  opacity: 0.6;
  animation: net-flow 1.6s linear infinite;
}

@keyframes net-flow {
  to {
    stroke-dashoffset: -28;
  }
}

.net-node circle {
  fill: var(--panel);
  stroke: var(--border);
  stroke-width: 1.5;
}

.net-node text {
  font-size: 12px;
  font-family: var(--font);
  fill: var(--text-soft);
  text-anchor: middle;
}

.net-node-center circle {
  fill: var(--panel);
  stroke: var(--primary);
  stroke-width: 2;
  animation: net-pulse 2.2s ease-out infinite;
}

.net-node-center text {
  fill: var(--primary-text);
  font-weight: 700;
}

@keyframes net-pulse {
  0% {
    filter: drop-shadow(0 0 0 color-mix(in srgb, var(--primary) 55%, transparent));
  }
  70% {
    filter: drop-shadow(0 0 12px transparent);
  }
  100% {
    filter: drop-shadow(0 0 0 transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .net-line,
  .net-node-center circle {
    animation: none;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 24px 20px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.site-footer-inner nav {
  display: flex;
  gap: 16px;
}

.site-footer-inner a {
  text-decoration: none;
  color: inherit;
}

.site-footer-inner a:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .site-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .site-header-right {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 6px 14px;
  }

  .site-nav a {
    font-size: 0.9rem;
  }
}
