/* Layout: a living room seen through its TV. A drawn TV set frames the product,
   phone frames hold the app screens, everything else stays quiet and very legible. */
:root {
  --bg: #f3f6f2;          /* pale sage paper */
  --surface: #ffffff;
  --ink: #142019;         /* deep green-black, same family as the TV screen */
  --muted: #4b5c52;
  --line: #d5ddd6;
  --accent: #23784a;      /* the "call" green of the product */
  --accent-ink: #ffffff;
  --accent-soft: #dcefe2;
  --signal: #c2453b;      /* the red "camera on" dot */
  --highlight: #e9a826;
  --highlight-soft: rgba(233, 168, 38, 0.28);
  --bezel: #1b1f1d;
  --screen: #17221d;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.95rem;
  --step-0: 1.125rem;
  --step-1: 1.4rem;
  --step-2: 1.9rem;
  --step-3: clamp(2.3rem, 5vw + 1rem, 3.6rem);

  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101713; --surface: #18221c; --ink: #e9f0eb; --muted: #a7b6ac;
    --line: #2a3830; --accent: #5fc58b; --accent-ink: #0d1a12; --accent-soft: #1d3326;
    --signal: #e0675d; --bezel: #050706; --screen: #17221d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101713; --surface: #18221c; --ink: #e9f0eb; --muted: #a7b6ac;
  --line: #2a3830; --accent: #5fc58b; --accent-ink: #0d1a12; --accent-soft: #1d3326;
  --signal: #e0675d; --bezel: #050706; --screen: #17221d;
  color-scheme: dark;
}

/* Language switch: Italian by default, English when <html data-lang="en">. */
body [lang="en"] { display: none; }
:root[data-lang="en"] body [lang="en"] { display: revert; }
:root[data-lang="en"] body [lang="it"] { display: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; }

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Top bar */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 0.55rem; }
.brand-dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.top-right { display: flex; align-items: center; gap: 1rem; font-size: var(--step--1); }
.top-right a { color: var(--muted); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang button {
  font: inherit; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em;
  border: 0; background: transparent; color: var(--muted); padding: 0.3rem 0.75rem; border-radius: 999px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3rem; align-items: center; padding-block: 3.5rem 4rem; }
.hero-text { display: grid; gap: 1.25rem; min-width: 0; }
.eyebrow { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.lead { font-size: var(--step-1); line-height: 1.45; color: var(--muted); max-width: 32ch; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: 0.85rem 1.4rem; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:hover { filter: brightness(1.05); }

/* The drawn TV */
.tv { min-width: 0; }
.tv-set { background: var(--bezel); border-radius: 28px; padding: 14px 14px 20px; box-shadow: 0 30px 60px -30px rgba(10, 30, 20, 0.55); }
.tv-set img { border-radius: 16px; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--screen); }
.tv-led { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 8px auto 0; opacity: 0.8; }
.tv-stand { width: 34%; height: 14px; margin: 0 auto; background: var(--bezel); clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%); }
.tv-caption { margin-top: 0.9rem; font-size: var(--step--1); color: var(--muted); text-align: center; }

/* Sections */
section { border-top: 1px solid var(--line); }
section > .wrap { padding-block: 3.5rem; display: grid; gap: 2rem; }
.section-head { display: grid; gap: 0.75rem; }
.section-head p { color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 0.5rem; align-content: start; padding-top: 1rem; border-top: 3px solid var(--accent); }
.steps h3::before { content: counter(step) ". "; color: var(--accent); }
.steps p { color: var(--muted); }

/* The three living-room mockups */
.story { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; counter-reset: scene; }
@media (min-width: 1300px) { .story { margin-inline: -5rem; } }
.story li { counter-increment: scene; display: grid; gap: 0.6rem; align-content: start; min-width: 0; }
.story .scene { width: 100%; height: auto; display: block; border-radius: 22px; border: 1px solid var(--line); }
.story h3::before { content: counter(scene) ". "; color: var(--accent); }
.story p { color: var(--muted); }
body svg [lang="en"] { display: none; }
:root[data-lang="en"] body svg [lang="en"] { display: inline; }

/* Feature rows with a phone or TV picture */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.feature.flip .feature-media { order: -1; }
.feature-text { display: grid; gap: 1rem; min-width: 0; }
.feature-text p { color: var(--muted); max-width: 34rem; }
.feature-media { display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; min-width: 0; }
.phone { width: min(15rem, 100%); background: var(--bezel); border-radius: 30px; padding: 9px; box-shadow: 0 24px 50px -28px rgba(10, 30, 20, 0.6); }
.phone img { border-radius: 22px; width: 100%; aspect-ratio: 1 / 2; object-fit: cover; object-position: top; }
.tv-small { width: 100%; }

.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.points li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: start; }
.points li::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--accent); margin-top: 0.6rem; }
.points.red li::before { background: var(--signal); }

/* How it works: steps beside the family app */
.how { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 3rem; align-items: center; }
.steps.vertical { grid-template-columns: minmax(0, 1fr); }
#funzionalita > .wrap { gap: 3.5rem; }

/* Look at the room: highlighted button and the camera view */
.phone svg.screen-mock { width: 100%; height: auto; display: block; border-radius: 22px; }
.pair { align-items: flex-start; gap: 1rem; flex-wrap: nowrap; }
.pair .arrow { align-self: center; margin-bottom: 2rem; }
.phone-fig { margin: 0; display: grid; gap: 0.6rem; justify-items: center; min-width: 0; flex: 1 1 0; max-width: 15rem; }
.phone-fig .phone { width: 100%; }
.phone-fig figcaption { font-size: var(--step--1); color: var(--muted); text-align: center; }
.shot { position: relative; }
.ring {
  /* the button sits at x 148-352, y 717-771 of the 500 x 1000 screenshot; 9px is the phone frame */
  position: absolute; left: calc(9px + (100% - 18px) * 0.27); top: calc(9px + (100% - 18px) * 0.709);
  width: calc((100% - 18px) * 0.46); height: calc((100% - 18px) * 0.07);
  border: 3px solid var(--highlight); border-radius: 14px; box-shadow: 0 0 0 3px var(--highlight-soft);
}
.arrow { font-size: 2rem; color: var(--accent); flex: none; }

/* Privacy: a short note */
#privacy > .wrap { padding-block: 2.5rem; }
.disclaimer { color: var(--muted); }
.disclaimer strong { color: var(--ink); }

/* Next */
.next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.next div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; display: grid; gap: 0.4rem; align-content: start; }
.next p { color: var(--muted); font-size: var(--step--1); }
.tag { justify-self: start; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem; }

/* Call to action band */
.cta { background: var(--accent-soft); border-top: 0; }
.cta .wrap { justify-items: start; }
.cta p { max-width: 40rem; }

footer { border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--muted); }
footer .wrap { padding-block: 1.75rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Survey page */
.form-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
/* An embedded Google Form cannot tell its height: fixed, taller than the longest page
   (page 4, about 1650px on a computer), so the form never scrolls inside the page.
   Phones wrap more text, so they get more height. */
.form-box iframe { width: 100%; height: 1850px; border: 0; display: block; background: var(--surface); }
@media (max-width: 700px) { .form-box iframe { height: 2200px; } }
.form-empty { padding: 2rem 1.5rem; display: grid; gap: 0.75rem; }
.form-empty p { color: var(--muted); }
.form-link { font-size: var(--step--1); color: var(--muted); }

.contact { display: grid; gap: 1rem; max-width: 38rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 700; }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem; width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.note { font-size: var(--step--1); color: var(--muted); }
.form-status { min-height: 1.6em; font-weight: 700; }
.form-status.ok { color: var(--accent); }
.form-status.error { color: var(--signal); }

@media (max-width: 860px) {
  .hero .wrap, .feature { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .feature.flip .feature-media { order: 0; }
  .steps, .next, .story, .how { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { padding-block: 2rem 3rem; }
  section > .wrap { padding-block: 2.75rem; }
}
@media (max-width: 480px) {
  .phone { width: min(12.5rem, 100%); }
  .feature-media .phone + .phone { display: none; }
  .arrow { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .tv-led { animation: blink 1.6s ease-in-out infinite; }
  .ring { animation: ring 1.8s ease-in-out infinite; }
  @keyframes ring { 50% { box-shadow: 0 0 0 7px var(--highlight-soft); } }
  @keyframes blink { 50% { opacity: 0.25; } }
}
