/* FamilAI website — tokens mirror FamilAI/Resources/Brand.json */

:root {
  --carta: #F7FCFF;
  --pergamena: #EAF7FE;
  --tiglio: #DDF5FF;
  --inchiostro: #0B2B40;
  --ossidiana: #28556E;
  --cenere: #3F6D84;
  --granato: #00689F;
  --oliva: #4F9C88;
  --ocra: #0A75B3;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 56px;
  --s-xxxl: 88px;

  --serif: "Tiempos Headline", "Tiempos Text", "New York", Georgia, "Times New Roman", serif;
  --sans: "Söhne", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Brand-blue shadows used as the "memory glass" container chrome */
  --shadow-frame:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 0 0 1px rgba(40, 85, 110, 0.08),
    0 18px 38px -22px rgba(11, 43, 64, 0.35),
    0 2px 8px -2px rgba(11, 43, 64, 0.10);
  --shadow-card:
    0 0 0 1px rgba(40, 85, 110, 0.06),
    0 12px 28px -20px rgba(11, 43, 64, 0.25);
  --shadow-card-hover:
    0 0 0 1px rgba(0, 104, 159, 0.18),
    0 22px 42px -22px rgba(11, 43, 64, 0.35);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

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

a {
  color: var(--granato);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(0, 104, 159, 0.35);
  transition: color 200ms var(--ease), text-decoration-color 200ms var(--ease);
}

a:hover {
  color: var(--ocra);
  text-decoration-color: var(--ocra);
}

/* Layout */

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--s-lg);
}

.container--narrow {
  max-width: 760px;
}

/* Site header */

.site-header {
  padding: var(--s-md) 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(247, 252, 255, 0.78);
  border-bottom: 1px solid rgba(11, 43, 64, 0.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--inchiostro);
}

.brand__logo {
  display: block;
  height: 44px;
  width: auto;
  transition: transform 320ms var(--ease);
  will-change: transform;
}

.brand:hover .brand__logo,
.brand:focus-visible .brand__logo {
  animation: logo-pulse 1.6s ease-in-out;
  transform-origin: center;
}

@keyframes logo-pulse {
  0%, 100% { transform: scale(1) rotate(0); }
  35%      { transform: scale(1.06) rotate(-3deg); }
  65%      { transform: scale(1.03) rotate(2deg); }
}

@media (max-width: 640px) {
  .brand__logo { height: 38px; }
}

.nav {
  display: flex;
  gap: var(--s-lg);
  font-size: 15px;
}

.nav a {
  color: var(--ossidiana);
  text-decoration: none;
  padding: 6px 2px;
}

.nav a:hover { color: var(--inchiostro); }
.nav a[aria-current="page"] {
  color: var(--inchiostro);
  font-weight: 500;
}

/* Eyebrow / small-caps label */

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--granato);
  margin-bottom: var(--s-md);
}

.eyebrow--muted { color: var(--cenere); }

.eyebrow__logo {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -4px;
  margin-right: 8px;
  object-fit: contain;
}

/* Hero — dramatic, full-height, image-centric */

.hero {
  position: relative;
  padding: var(--s-xxxl) 0 var(--s-xxl);
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.hero::before {
  background:
    radial-gradient(55% 70% at 85% 18%, rgba(10, 117, 179, 0.28), transparent 70%),
    radial-gradient(65% 80% at 10% 100%, rgba(221, 245, 255, 0.95), transparent 70%),
    radial-gradient(45% 55% at 50% 50%, rgba(0, 104, 159, 0.06), transparent 75%);
}

.hero::after {
  background: linear-gradient(180deg, transparent 70%, rgba(234, 247, 254, 0.60) 100%);
}

/* Ambient floating orbs — bigger, more saturated, more visible */

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
  will-change: transform;
}

.hero__orb--1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(10, 117, 179, 0.55), rgba(10, 117, 179, 0.0) 70%);
  top: -120px;
  right: -120px;
  animation: orb-drift-1 22s ease-in-out infinite;
}

.hero__orb--2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 104, 159, 0.40), rgba(0, 104, 159, 0.0) 70%);
  bottom: -80px;
  left: -60px;
  animation: orb-drift-2 28s ease-in-out infinite;
}

.hero__orb--3 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(221, 245, 255, 1), rgba(221, 245, 255, 0) 70%);
  top: 30%;
  left: 38%;
  animation: orb-drift-3 32s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-60px, 60px) scale(1.08); }
}

@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(80px, -40px) scale(0.92); }
}

@keyframes orb-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(50px, 70px) scale(1.12); }
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-xxl);
  align-items: center;
}

@media (min-width: 920px) {
  .hero__inner {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: var(--s-xxxl);
  }
}

.hero__title {
  font-family: var(--serif);
  font-size: clamp(48px, 7.6vw, 92px);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--inchiostro);
  margin: 0 0 var(--s-lg);
  max-width: 14ch;
}

.hero__lede {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--ossidiana);
  max-width: 52ch;
  margin: 0 0 var(--s-xl);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  align-items: center;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--inchiostro);
  color: var(--carta);
  text-decoration: none;
  padding: 15px 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.005em;
  transition: transform 180ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
  box-shadow: 0 8px 22px -10px rgba(11, 43, 64, 0.55);
}

.cta:hover {
  background: var(--granato);
  color: var(--carta);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -10px rgba(0, 104, 159, 0.55);
}

.cta--ghost {
  background: transparent;
  color: var(--inchiostro);
  border: 1px solid rgba(40, 85, 110, 0.22);
  box-shadow: none;
}

.cta--ghost:hover {
  background: var(--pergamena);
  color: var(--inchiostro);
  border-color: rgba(40, 85, 110, 0.35);
  box-shadow: none;
}

.hero__note {
  font-size: 14px;
  color: var(--cenere);
  margin: var(--s-md) 0 0;
}

.hero__note a {
  color: var(--ossidiana);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(40, 85, 110, 0.3);
}

.hero__note a:hover {
  color: var(--granato);
  text-decoration-color: var(--granato);
}

/* App Store download badge — mirrors Apple's badge in brand-coherent black */

.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--inchiostro);
  color: var(--carta);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-family: var(--sans);
  line-height: 1.1;
  min-height: 56px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 12px 28px -16px rgba(11, 43, 64, 0.55);
  transition: transform 180ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}

.appstore-badge:hover {
  background: #000;
  color: var(--carta);
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.10) inset,
    0 16px 32px -16px rgba(11, 43, 64, 0.70);
}

.appstore-badge:focus-visible {
  outline: 3px solid rgba(0, 104, 159, 0.55);
  outline-offset: 3px;
}

.appstore-badge__apple {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.appstore-badge__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
}

.appstore-badge__sup {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  opacity: 0.85;
  text-transform: none;
}

.appstore-badge__main {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* On the dark CTA band — invert to white badge */

.appstore-badge--on-dark {
  background: var(--carta);
  color: var(--inchiostro);
  margin: 0 auto;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 14px 32px -14px rgba(0, 0, 0, 0.55);
}

.appstore-badge--on-dark:hover {
  background: var(--tiglio);
  color: var(--inchiostro);
}

/* Hero media — photo-print treatment with tilt + iPhone mockup overlay */

.hero__media {
  position: relative;
  border-radius: var(--r-xl);
  background: var(--carta);
  aspect-ratio: 5 / 4;
  padding: 12px 12px 38px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 0 0 1px rgba(40, 85, 110, 0.12),
    0 38px 80px -28px rgba(11, 43, 64, 0.50),
    0 8px 24px -6px rgba(11, 43, 64, 0.18);
  transform: rotate(1.5deg) translateZ(0);
  transition: transform 600ms var(--ease);
}

.hero__media:hover {
  transform: rotate(0.5deg) translateY(-4px);
}

.hero__media picture {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.hero__media picture::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 55%, rgba(11, 43, 64, 0.25) 100%),
    linear-gradient(135deg, rgba(0, 104, 159, 0.08), transparent 35%);
  pointer-events: none;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
}

@media (max-width: 919px) {
  .hero__inner { grid-template-areas: "media" "text"; }
  .hero__text  { grid-area: text; }
  .hero__media {
    grid-area: media;
    aspect-ratio: 4 / 3;
    transform: rotate(1deg);
    padding: 10px 10px 30px;
  }
  .hero__title { max-width: 100%; }
}

/* iPhone mockup — sits on top of the hero image, tilted the other way */

.iphone {
  --iphone-w: 220px;
  --iphone-bezel: 7px;
  position: absolute;
  bottom: -42px;
  left: -48px;
  width: var(--iphone-w);
  aspect-ratio: 9 / 19.5;
  background:
    linear-gradient(135deg, #1a3850 0%, #0B2B40 45%, #0B2B40 55%, #1a3850 100%);
  border-radius: 36px;
  padding: var(--iphone-bezel);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 0 0 1px rgba(247, 252, 255, 0.04),
    0 34px 68px -22px rgba(0, 0, 0, 0.75),
    0 12px 28px -8px rgba(0, 0, 0, 0.55);
  transform: rotate(-8deg);
  z-index: 3;
  animation: iphone-float 6s ease-in-out infinite;
  isolation: isolate;
}

.iphone__bezel-light {
  position: absolute;
  inset: 0;
  border-radius: 36px;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, transparent 30%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.10) 0%, transparent 30%);
  z-index: 1;
}

.iphone__notch {
  position: absolute;
  top: calc(var(--iphone-bezel) + 6px);
  left: 50%;
  width: 30%;
  height: 22px;
  background: #000;
  border-radius: 999px;
  z-index: 4;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.iphone__statusbar {
  position: absolute;
  top: calc(var(--iphone-bezel) + 11px);
  color: var(--carta);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  z-index: 4;
  line-height: 1;
}

.iphone__statusbar--left  { left: calc(var(--iphone-bezel) + 14px); }
.iphone__statusbar--right {
  right: calc(var(--iphone-bezel) + 12px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.iphone__statusbar--right svg {
  width: 12px;
  height: 9px;
  color: var(--carta);
}

.iphone__statusbar--right svg:nth-child(2) {
  width: 18px;
}

.iphone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(95% 60% at 50% 0%, rgba(10, 117, 179, 0.45), transparent 70%),
    radial-gradient(75% 50% at 50% 100%, rgba(0, 104, 159, 0.30), transparent 75%),
    linear-gradient(180deg, #0B2B40 0%, #1a4a68 100%);
  border-radius: 29px;
  padding: 38px 16px 14px;
  color: var(--carta);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  z-index: 2;
}

.iphone__logo {
  width: 56px;
  height: 56px;
  margin: 4px 0 8px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.iphone__label {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 252, 255, 0.55);
  margin: 0 0 6px;
}

.iphone__title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--carta);
  margin: 0 0 14px;
  white-space: nowrap;
}

.iphone__wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 32px;
  margin: 2px 0 14px;
  width: 100%;
}

.iphone__wave span {
  width: 3px;
  background: linear-gradient(180deg, var(--carta), rgba(247, 252, 255, 0.7));
  border-radius: 999px;
  animation: wave-bar 1.2s ease-in-out infinite;
  transform-origin: center;
}

.iphone__wave span:nth-child(1)  { height: 6px;  animation-delay: 0.00s; }
.iphone__wave span:nth-child(2)  { height: 10px; animation-delay: 0.07s; }
.iphone__wave span:nth-child(3)  { height: 16px; animation-delay: 0.14s; }
.iphone__wave span:nth-child(4)  { height: 20px; animation-delay: 0.21s; }
.iphone__wave span:nth-child(5)  { height: 24px; animation-delay: 0.28s; }
.iphone__wave span:nth-child(6)  { height: 28px; animation-delay: 0.35s; }
.iphone__wave span:nth-child(7)  { height: 24px; animation-delay: 0.42s; }
.iphone__wave span:nth-child(8)  { height: 20px; animation-delay: 0.49s; }
.iphone__wave span:nth-child(9)  { height: 24px; animation-delay: 0.56s; }
.iphone__wave span:nth-child(10) { height: 16px; animation-delay: 0.63s; }
.iphone__wave span:nth-child(11) { height: 20px; animation-delay: 0.70s; }
.iphone__wave span:nth-child(12) { height: 10px; animation-delay: 0.77s; }
.iphone__wave span:nth-child(13) { height: 6px;  animation-delay: 0.84s; }
.iphone__wave span:nth-child(14) { height: 8px;  animation-delay: 0.91s; }
.iphone__wave span:nth-child(15) { height: 4px;  animation-delay: 0.98s; }

.iphone__player {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.iphone__progress-track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(247, 252, 255, 0.18);
  border-radius: 999px;
}

.iphone__progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 38%;
  background: var(--carta);
  border-radius: 999px;
}

.iphone__progress-dot {
  position: absolute;
  top: 50%;
  left: 38%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--carta);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(247, 252, 255, 0.25);
}

.iphone__timestamps {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: rgba(247, 252, 255, 0.55);
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.iphone__play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--carta);
  border: none;
  color: var(--inchiostro);
  cursor: default;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 8px 20px -6px rgba(0, 0, 0, 0.55);
}

.iphone__play svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

@keyframes iphone-float {
  0%, 100% { transform: rotate(-8deg) translate(0, 0); }
  50%      { transform: rotate(-7deg) translate(0, -8px); }
}

@keyframes wave-bar {
  0%, 100% { transform: scaleY(0.45); opacity: 0.55; }
  50%      { transform: scaleY(1);    opacity: 1; }
}

/* Mobile: keep iPhone visible but smaller, on the right side */

@media (max-width: 919px) {
  .iphone {
    --iphone-w: 170px;
    --iphone-bezel: 6px;
    bottom: -32px;
    left: auto;
    right: -22px;
    transform: rotate(6deg);
    animation: iphone-float-mobile 6s ease-in-out infinite;
  }
  .iphone__logo { width: 44px; height: 44px; margin: 4px 0 6px; }
  .iphone__title { font-size: 13.5px; margin-bottom: 10px; }
  .iphone__label { font-size: 8px; }
  .iphone__screen { padding: 32px 12px 10px; }
  .iphone__wave { height: 24px; margin-bottom: 10px; }
  .iphone__wave span:nth-child(1)  { height: 4px; }
  .iphone__wave span:nth-child(2)  { height: 8px; }
  .iphone__wave span:nth-child(3)  { height: 12px; }
  .iphone__wave span:nth-child(4)  { height: 16px; }
  .iphone__wave span:nth-child(5)  { height: 18px; }
  .iphone__wave span:nth-child(6)  { height: 22px; }
  .iphone__wave span:nth-child(7)  { height: 18px; }
  .iphone__wave span:nth-child(8)  { height: 16px; }
  .iphone__wave span:nth-child(9)  { height: 18px; }
  .iphone__wave span:nth-child(10) { height: 12px; }
  .iphone__wave span:nth-child(11) { height: 16px; }
  .iphone__wave span:nth-child(12) { height: 8px; }
  .iphone__wave span:nth-child(13) { height: 4px; }
  .iphone__wave span:nth-child(14) { height: 6px; }
  .iphone__wave span:nth-child(15) { height: 3px; }
  .iphone__play { width: 32px; height: 32px; margin-top: 4px; }
  .iphone__play svg { width: 14px; height: 14px; }
  .iphone__timestamps { font-size: 7.5px; }
  .iphone__notch { height: 18px; top: calc(var(--iphone-bezel) + 4px); }
  .iphone__statusbar { font-size: 8.5px; top: calc(var(--iphone-bezel) + 8px); }
  .iphone__statusbar--left { left: calc(var(--iphone-bezel) + 10px); }
  .iphone__statusbar--right { right: calc(var(--iphone-bezel) + 9px); gap: 3px; }
  .iphone__statusbar--right svg { width: 10px; height: 7px; }
  .iphone__statusbar--right svg:nth-child(2) { width: 14px; }

  @keyframes iphone-float-mobile {
    0%, 100% { transform: rotate(6deg) translate(0, 0); }
    50%      { transform: rotate(5deg) translate(0, -6px); }
  }
}

@media (max-width: 480px) {
  .iphone {
    --iphone-w: 144px;
    bottom: -24px;
    right: -12px;
  }
  .iphone__logo { width: 38px; height: 38px; }
  .iphone__title { font-size: 12px; margin-bottom: 8px; }
  .iphone__label { font-size: 7px; letter-spacing: 0.18em; }
  .iphone__screen { padding: 28px 10px 8px; }
  .iphone__wave { height: 20px; margin-bottom: 8px; }
}

/* Hero scroll indicator */

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: var(--s-lg);
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--cenere);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  z-index: 4;
  opacity: 0.75;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

.hero__scroll:hover {
  opacity: 1;
  color: var(--inchiostro);
  transform: translateX(-50%) translateY(2px);
}

.hero__scroll-label {
  display: block;
}

.hero__scroll-icon {
  width: 18px;
  height: 18px;
  animation: scroll-bob 1.8s ease-in-out infinite;
}

@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(6px); opacity: 1; }
}

@media (max-width: 760px) {
  .hero__scroll { display: none; }
}

/* Trust strip — quiet rhythm break under hero */

.trust-strip {
  padding: var(--s-md) 0 var(--s-xl);
  border-bottom: 1px solid rgba(11, 43, 64, 0.06);
}

.trust-strip__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md) var(--s-xl);
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--cenere);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.trust-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ossidiana);
}

.trust-strip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--granato);
  box-shadow: 0 0 0 4px rgba(0, 104, 159, 0.15);
  flex-shrink: 0;
}

/* Sections */

section { padding: var(--s-xxxl) 0; }

.section-header {
  max-width: 720px;
  margin-bottom: var(--s-xl);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.022em;
  margin: 0 0 var(--s-md);
  color: var(--inchiostro);
}

.section-lede {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--ossidiana);
  max-width: 56ch;
  margin: 0;
  line-height: 1.55;
}

/* Cinematic letterbox image — used between sections for rhythm */

.section-media {
  margin: 0 0 var(--s-xl);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--pergamena);
  aspect-ratio: 21 / 9;
  position: relative;
  box-shadow: var(--shadow-frame);
}

.section-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 65%, rgba(11, 43, 64, 0.18) 100%),
    linear-gradient(135deg, rgba(0, 104, 159, 0.08), transparent 30%);
  pointer-events: none;
}

.section-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
}

@media (max-width: 760px) {
  .section-media { aspect-ratio: 4 / 3; }
}

/* Mode-choice section: 2 cards, side-by-side at desktop */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s-lg);
}

.mode-card {
  position: relative;
  background: var(--pergamena);
  border-radius: var(--r-xl);
  padding: var(--s-xxl) var(--s-xl) var(--s-xl);
  box-shadow: var(--shadow-card);
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease);
  overflow: hidden;
}

.mode-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--granato), var(--ocra));
  opacity: 0;
  transition: opacity 220ms var(--ease);
}

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

.mode-card:active {
  transform: scale(0.99);
  transition-duration: 80ms;
}

.mode-card:hover::before { opacity: 1; }

.mode-card--accent {
  background: linear-gradient(180deg, var(--tiglio) 0%, var(--pergamena) 100%);
}

.mode-card--accent::before { opacity: 1; }

.mode-card__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--granato);
  margin: 0 0 var(--s-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mode-card__kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--granato);
  display: inline-block;
}

.mode-card__title {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-md);
  color: var(--inchiostro);
}

.mode-card__body {
  color: var(--ossidiana);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

.mode-card__price {
  margin: var(--s-lg) 0 0;
  padding-top: var(--s-md);
  border-top: 1px solid rgba(40, 85, 110, 0.12);
  font-size: 14px;
  color: var(--cenere);
}

.mode-card__price strong {
  color: var(--inchiostro);
  font-weight: 500;
}

/* Privacy section — image-led drama */

.privacy {
  background: linear-gradient(180deg, var(--carta) 0%, var(--pergamena) 100%);
}

.privacy__media {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin: 0 0 var(--s-xl);
  box-shadow: var(--shadow-frame);
}

.privacy__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(11, 43, 64, 0.22) 100%);
  pointer-events: none;
}

.privacy__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

@media (max-width: 760px) {
  .privacy__media { aspect-ratio: 4 / 3; }
}

.privacy-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.privacy-rules li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--s-md);
  padding: var(--s-md) var(--s-md) var(--s-md) 0;
  align-items: start;
  color: var(--ossidiana);
  font-size: 15px;
  line-height: 1.55;
}

.privacy-rules .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--inchiostro);
  color: var(--carta);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
  margin-top: 2px;
}

.privacy-rules strong {
  display: block;
  color: var(--inchiostro);
  font-weight: 500;
  margin-bottom: 2px;
  font-size: 16px;
}

/* What you can do — 4-card grid with numbered hierarchy */

.capabilities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-md);
}

.cap {
  position: relative;
  background: var(--carta);
  border: 1px solid rgba(40, 85, 110, 0.10);
  border-radius: var(--r-lg);
  padding: var(--s-xl);
  transition: border-color 220ms var(--ease), transform 220ms var(--ease), background 220ms var(--ease);
}

.cap:hover {
  border-color: rgba(0, 104, 159, 0.28);
  background: var(--pergamena);
  transform: translateY(-1px);
}

.cap:active {
  transform: scale(0.98);
  transition-duration: 80ms;
}

.cap__num {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--granato);
  display: block;
  margin-bottom: var(--s-md);
  letter-spacing: 0.02em;
}

.cap__title {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-sm);
  color: var(--inchiostro);
}

.cap__body {
  color: var(--ossidiana);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* Book feature — asymmetric split with the book image taking lead */

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-xl);
  align-items: center;
}

@media (min-width: 920px) {
  .feature {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--s-xxxl);
    align-items: center;
  }
}

.feature__media {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--pergamena);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-frame);
}

.feature__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 65%, rgba(11, 43, 64, 0.18) 100%),
    linear-gradient(135deg, rgba(0, 104, 159, 0.06), transparent 35%);
  pointer-events: none;
}

.feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.feature__title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-md);
}

.feature__body {
  font-size: 17px;
  color: var(--ossidiana);
  line-height: 1.6;
  margin: 0 0 var(--s-md);
  max-width: 50ch;
}

.feature__note {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--granato);
  background: rgba(0, 104, 159, 0.08);
  padding: 6px 12px;
  border-radius: 999px;
  margin: var(--s-md) 0 0;
}

/* Final CTA band */

.cta-band {
  background: var(--inchiostro);
  color: var(--carta);
  padding: var(--s-xxxl) 0;
  text-align: center;
  border-radius: 0;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 70% at 50% 0%, rgba(0, 104, 159, 0.35), transparent 70%),
    radial-gradient(60% 80% at 50% 100%, rgba(40, 85, 110, 0.30), transparent 70%);
  pointer-events: none;
}

.cta-band__title {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-md);
  color: var(--carta);
  position: relative;
}

.cta-band__lede {
  font-size: clamp(16px, 1.4vw, 18px);
  color: rgba(247, 252, 255, 0.78);
  max-width: 48ch;
  margin: 0 auto var(--s-xl);
  line-height: 1.55;
  position: relative;
}

.cta-band .cta {
  background: var(--carta);
  color: var(--inchiostro);
  box-shadow: 0 14px 32px -14px rgba(0, 0, 0, 0.45);
  position: relative;
}

.cta-band .cta:hover {
  background: var(--tiglio);
  color: var(--inchiostro);
}

.cta-band__note {
  position: relative;
  font-size: 13px;
  color: rgba(247, 252, 255, 0.6);
  margin: var(--s-md) 0 0;
  letter-spacing: 0.01em;
}

/* Document pages (privacy / terms / support) */

.doc { padding: var(--s-xxl) 0 var(--s-xxxl); }

.doc h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.022em;
  margin: 0 0 var(--s-md);
}

.doc__meta {
  color: var(--cenere);
  font-size: 14px;
  margin: 0 0 var(--s-xl);
  padding-bottom: var(--s-lg);
  border-bottom: 1px solid rgba(11, 43, 64, 0.08);
}

.doc__meta span {
  display: inline-block;
  margin-right: var(--s-md);
}

.doc h2 {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 500;
  margin: var(--s-xl) 0 var(--s-md);
  color: var(--inchiostro);
  letter-spacing: -0.01em;
}

.doc h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  margin: var(--s-lg) 0 var(--s-sm);
  color: var(--inchiostro);
}

.doc p,
.doc li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ossidiana);
}

.doc p strong,
.doc li strong {
  color: var(--inchiostro);
  font-weight: 500;
}

.doc ul { padding-left: var(--s-lg); }

.doc ul li { margin-bottom: var(--s-xs); }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-md) 0 var(--s-lg);
  font-size: 15px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid rgba(40, 85, 110, 0.10);
}

.doc th,
.doc td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(11, 43, 64, 0.08);
  vertical-align: top;
  color: var(--ossidiana);
}

.doc tr:last-child td { border-bottom: none; }

.doc th {
  color: var(--inchiostro);
  font-weight: 500;
  background: var(--pergamena);
  font-size: 14px;
}

.doc__callout {
  background: var(--pergamena);
  border-left: 3px solid var(--granato);
  padding: var(--s-md) var(--s-lg);
  border-radius: var(--r-md);
  margin: var(--s-md) 0;
  font-size: 15px;
  color: var(--ossidiana);
}

.doc__callout strong {
  color: var(--inchiostro);
  font-weight: 500;
}

/* FAQ accordion */

.faq details {
  border-bottom: 1px solid rgba(11, 43, 64, 0.08);
  padding: var(--s-md) 0;
}

.faq details:first-of-type {
  border-top: 1px solid rgba(11, 43, 64, 0.08);
}

.faq summary {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--inchiostro);
  cursor: pointer;
  list-style: none;
  padding-right: var(--s-lg);
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  color: var(--cenere);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}

.faq details[open] summary::after { content: "−"; }

.faq details > *:not(summary) {
  margin-top: var(--s-sm);
  color: var(--ossidiana);
  font-size: 16px;
  line-height: 1.65;
}

/* Site footer */

.site-footer {
  border-top: 1px solid rgba(11, 43, 64, 0.08);
  padding: var(--s-xl) 0;
  margin-top: var(--s-xxl);
  font-size: 14px;
  color: var(--cenere);
  background: var(--carta);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md) var(--s-xl);
  align-items: center;
  justify-content: space-between;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md) var(--s-lg);
}

.site-footer a {
  color: var(--ossidiana);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--inchiostro);
  text-decoration: underline;
}

/* Mobile tweaks */

@media (max-width: 640px) {
  .container { padding: 0 var(--s-md); }
  section { padding: var(--s-xxl) 0; }
  .hero { padding: var(--s-xl) 0 var(--s-xl); }
  .mode-card { padding: var(--s-xl); }
  .feature__title { font-size: clamp(26px, 6vw, 32px); }
  .nav { gap: 18px; font-size: 14px; }
  .doc table { font-size: 14px; }
  .doc th, .doc td { padding: 10px 10px; }
}

/* Scroll-reveal — sections fade up as they enter the viewport */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger inner items within a revealed section */

.reveal .mode-card,
.reveal .cap,
.reveal .privacy-rules li,
.reveal .trust-strip__item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
  transition-delay: 60ms;
}

.reveal.is-visible .mode-card:nth-child(1),
.reveal.is-visible .cap:nth-child(1),
.reveal.is-visible .privacy-rules li:nth-child(1) { transition-delay: 100ms; }
.reveal.is-visible .mode-card:nth-child(2),
.reveal.is-visible .cap:nth-child(2),
.reveal.is-visible .privacy-rules li:nth-child(2) { transition-delay: 200ms; }
.reveal.is-visible .cap:nth-child(3),
.reveal.is-visible .privacy-rules li:nth-child(3) { transition-delay: 300ms; }
.reveal.is-visible .cap:nth-child(4) { transition-delay: 400ms; }

.reveal.is-visible .mode-card,
.reveal.is-visible .cap,
.reveal.is-visible .privacy-rules li,
.reveal.is-visible .trust-strip__item {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile sticky bottom download CTA — appears after the user scrolls past the hero */

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  justify-content: center;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(247, 252, 255, 0.94) 60%);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 280ms var(--ease), transform 280ms var(--ease);
}

.sticky-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-cta .appstore-badge {
  pointer-events: auto;
  width: 100%;
  max-width: 360px;
  justify-content: center;
}

/* Show sticky CTA only on small screens */
@media (max-width: 760px) {
  .sticky-cta { display: flex; }

  /* Avoid the sticky CTA covering the final CTA's content */
  .cta-band { padding-bottom: calc(var(--s-xxxl) + 80px); }
}

/* Mobile: more iOS-app feel for media — fuller, more dominant images */

@media (max-width: 760px) {
  .hero__media {
    aspect-ratio: 4 / 3;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.85) inset,
      0 0 0 1px rgba(40, 85, 110, 0.10),
      0 22px 44px -22px rgba(11, 43, 64, 0.45),
      0 2px 8px -2px rgba(11, 43, 64, 0.12);
  }
  .section-media,
  .privacy__media,
  .feature__media {
    border-radius: var(--r-lg);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.85) inset,
      0 0 0 1px rgba(40, 85, 110, 0.10),
      0 18px 38px -22px rgba(11, 43, 64, 0.40);
  }
  .cap:active,
  .mode-card:active {
    /* Slightly more pronounced on touch */
    transform: scale(0.97);
  }
}

/* Reduce motion — disable all of the above */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .reveal .mode-card,
  .reveal .cap,
  .reveal .privacy-rules li,
  .reveal .trust-strip__item {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero__orb { display: none; }
}

/* Sticky CTA compact badge */

.appstore-badge--compact {
  padding: 8px 16px;
  min-height: 48px;
  border-radius: 14px;
}

.appstore-badge--compact .appstore-badge__apple {
  width: 24px;
  height: 24px;
}

.appstore-badge--compact .appstore-badge__main {
  font-size: 18px;
}
