/* Fiamia — the same dark room, amber light and system type as the app (WarmTheme.swift). */

:root {
  --background: #17191C;   /* WarmBackground */
  --surface: #24262A;      /* WarmSurface */
  --surface-raised: #2C2E33;
  --accent: #E8B179;       /* AccentColor */
  --accent-soft: rgba(232, 177, 121, 0.14);
  --on-accent: #1E1710;
  --text: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-tertiary: rgba(255, 255, 255, 0.45);
  --outline: rgba(255, 255, 255, 0.07);
  --radius-group: 22px;
  --radius-screen: 34px;
  --gutter: 16px;
  --width: 1080px;
  color-scheme: dark;
}

/* The app is always dark, whatever iOS is set to: so is the site. */
:root[data-theme="light"], :root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  background-image: radial-gradient(ellipse 900px 520px at 50% -120px, rgba(232, 177, 121, 0.10), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  /* San Francisco on Apple devices, as in the app; the system font elsewhere. */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap {
  width: 100%;
  max-width: calc(var(--width) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Top bar ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }

/* iOS segmented control, like Impostazioni → Lingua */
.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.24);
}
.segmented a {
  min-width: 76px;
  padding: 5px 12px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
.segmented a:hover { text-decoration: none; }
.segmented a[aria-current="true"] {
  background: #636366;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
}

/* ---------- Buttons: borderedProminent and bordered with the app's tint ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: filter 0.15s ease;
}
.button:hover { text-decoration: none; filter: brightness(1.06); }
.button:active { filter: brightness(0.92); }
.button.prominent { background: var(--accent); color: var(--on-accent); }
.button.bordered { background: var(--accent-soft); color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------- Hero: a candle to light, with the wax and flame you choose ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "title" "cta" "stage" "mix";
  gap: 0;
  padding-top: 24px;
  padding-bottom: 40px;
  text-align: center;
}
.hero-title { grid-area: title; }
.hero-cta { grid-area: cta; }
.hero-stage { grid-area: stage; }
.mix { grid-area: mix; }

.hero-title h1 {
  margin: 0;
  font-size: clamp(54px, 13vw, 92px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.hero-title .tagline {
  margin: 14px 0 0;
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.015em;
}
.hero-title .intro {
  margin: 22px auto 0;
  max-width: 30em;
  color: var(--text-secondary);
}
.hero-cta .actions { justify-content: center; margin-top: 28px; }
.requirements { margin: 14px 0 0; font-size: 13px; color: var(--text-tertiary); }

/* The candle, drawn by the app's own engine, in its dark room fading into the page. */
.hero-stage { margin: 8px calc(var(--gutter) * -1) 0; }
.hero-room {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, transparent 100%);
}
.mix-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.mix-img.is-shown { opacity: 1; }
.mix-caption {
  min-height: 1.4em;
  text-align: center;
  margin: -18px 0 0;
  position: relative;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Like the Room and flame panel: round wax colours, flames in dark circles. */
.mix {
  display: none;
  margin-top: 20px;
  padding: 18px 18px 20px;
  border-radius: 26px;
  background: var(--surface);
  text-align: left;
}
.mix-ready .mix { display: block; }
.mix-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mix-head h2 { font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.button.small { min-height: 32px; padding: 0 14px; font-size: 15px; }
.mix-label {
  margin: 16px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.swatch:active { transform: scale(0.94); }
.swatch.wax { background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10); }
.swatch.flame { display: grid; place-items: center; background: #1B1D20; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.swatch.flame svg { width: 20px; height: 20px; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.swatch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }

/* ---------- Sections ---------- */

section { padding: 72px 0; }

h2 {
  margin: 0;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.lead {
  margin: 16px 0 0;
  max-width: 32em;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

/* A screen of the app, as it is: no phone around it. */
.screen {
  width: min(100%, 340px);
  margin: 0 auto;
  border-radius: var(--radius-screen);
  box-shadow: 0 0 0 1px var(--outline), 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

/* WarmGroup: rows on a dark grey surface */
.group {
  margin-top: 28px;
  padding: 6px 20px;
  border-radius: var(--radius-group);
  background: var(--surface);
}
.row { padding: 15px 0; }
.row h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.row p { margin: 3px 0 0; font-size: 15px; line-height: 1.45; color: var(--text-secondary); }

/* Candle scenes */
.scenes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 40px;
}
.scenes figure { margin: 0; }
.scenes img {
  width: 100%;
  aspect-ratio: 1080 / 790;
  object-fit: cover;
  border-radius: 18px;
  background: var(--surface);
}
.scenes figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-tertiary);
}
.scenes figcaption strong { display: block; color: var(--text); font-size: 15px; font-weight: 600; }

.names {
  margin: 22px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.names strong { color: var(--text); font-weight: 600; }

/* Archive: one WarmGroup per idea */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 40px;
}
.card {
  padding: 20px 22px 22px;
  border-radius: var(--radius-group);
  background: var(--surface);
}
.card h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--text-secondary); }

/* Privacy in short */
.promise { text-align: center; }
.promise .lead { margin-left: auto; margin-right: auto; }
.promise .actions { justify-content: center; margin-top: 28px; }

/* Closing */
.closing { text-align: center; padding-bottom: 96px; }
.closing img { width: 96px; height: 96px; margin: 0 auto 26px; border-radius: 22px; }
.closing .actions { justify-content: center; margin-top: 28px; }

/* ---------- Footer ---------- */

footer {
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--text-tertiary);
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
footer nav { display: flex; gap: 20px; }
footer nav a { color: var(--text-secondary); }
footer p { margin: 0; max-width: 34em; }

/* ---------- Privacy policy ---------- */

.policy { max-width: 680px; padding-top: 32px; padding-bottom: 72px; }
.policy h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.policy .updated { margin: 12px 0 0; font-size: 13px; color: var(--text-tertiary); }
.policy .summary {
  margin-top: 32px;
  padding: 20px 22px;
  border-radius: var(--radius-group);
  background: var(--surface);
  font-size: 17px;
  color: var(--text);
}
.policy .summary p { margin: 0; }
.policy h2 {
  margin-top: 44px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.policy p, .policy li { color: var(--text-secondary); font-size: 16px; line-height: 1.6; }
.policy p { margin: 10px 0 0; }
.policy ul { margin: 10px 0 0; padding: 0; list-style: none; }
.policy li { margin-top: 10px; }
.policy li strong, .policy p strong { color: var(--text); font-weight: 600; }
.policy .back { display: inline-block; margin-bottom: 26px; font-size: 15px; }

/* ---------- Wider screens ---------- */

@media (min-width: 760px) {
  :root { --gutter: 28px; }
  section { padding: 110px 0; }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-areas: "title stage" "cta stage" "mix stage";
    grid-template-rows: auto auto 1fr;
    column-gap: 40px;
    align-items: start;
    padding-top: 48px;
    text-align: left;
  }
  .hero-title .intro { margin-left: 0; }
  .hero-cta .actions { justify-content: flex-start; }
  .hero-stage { margin: 0; align-self: center; }
  .mix { margin-top: 36px; max-width: 480px; }

  .split { grid-template-columns: 1fr 1fr; gap: 64px; }
  .split.reverse > :first-child { order: 2; }
  .screen { width: min(100%, 360px); }

  .scenes { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (min-width: 1040px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .mix-img, .swatch, .button { transition: none; }
}

.mix-note { margin: 16px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-tertiary); }
