/* ==========================================================================
   DeMemos — shared styles
   Sharp, colourful, minimal futurism: a fine grid, hairline borders,
   chamfered corners, HUD marks and a bright teal → aqua → sky → pink spectrum.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --teal: #00bcc4;
  --blue: #2a7de1;
  --sky: #29b6f6;
  --pink: #ff5c9d;
  --amber: #ffb020;

  --teal-soft: #dcf8f9;
  --blue-soft: #e3ecff;
  --sky-soft: #e1f4fe;
  --pink-soft: #ffe3f0;

  /* Page colours: bright aqua with soft teal, sky and mint glows */
  --ink: #08323a;
  --ink-2: #24525a;
  --muted: #55787f;
  --line: rgba(8, 50, 58, 0.12);
  --line-strong: rgba(8, 50, 58, 0.22);
  --grid: rgba(0, 150, 160, 0.1);
  --link: #00808a;

  --bg: #c8eeee;
  --bg-2: #b0e2e7;
  --surface: rgba(255, 255, 255, 0.55);
  --night: #05434a;
  --night-2: #075a62;
  --bezel: #04161b;

  --grad: linear-gradient(100deg, #00a9b3 0%, #14c9c2 35%, var(--sky) 72%, var(--pink) 100%);
  --grad-text: linear-gradient(100deg, #008d96 0%, #00a59c 35%, #1a8ad8 72%, #e2508f 100%);

  --shadow: 0 24px 60px -30px rgba(0, 60, 70, 0.35);
  --shadow-lg: 0 50px 100px -40px rgba(0, 70, 80, 0.45);

  --cut: 12px;
  --radius: 3px;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(72px, 11vw, 140px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
  background: linear-gradient(180deg, #e2f8f6 0%, var(--bg) 45%, var(--bg-2) 100%) fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Fine blueprint grid, fading out towards the edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
}
/* Colour fields */
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(40% 35% at 8% 8%, rgba(0, 210, 215, 0.35), transparent 70%),
    radial-gradient(38% 32% at 92% 16%, rgba(41, 182, 246, 0.28), transparent 70%),
    radial-gradient(42% 36% at 85% 95%, rgba(255, 92, 157, 0.14), transparent 70%),
    radial-gradient(34% 32% at 12% 88%, rgba(47, 212, 180, 0.3), transparent 70%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.7rem, 6.6vw, 5.4rem); letter-spacing: -0.045em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.4rem); letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: #fff;
  color: #0b1020;
}
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section-y) 0; position: relative; }

.section-head {
  max-width: 740px;
  margin: 0 auto clamp(40px, 6vw, 72px);
  text-align: center;
}
.section-head p { font-size: 1.15rem; color: var(--muted); }

/* Monospace label: "// HOW IT WORKS" */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--link);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--grad);
}
.eyebrow--ai { color: #c73f80; }

/* ---------- Surfaces ---------- */
/* .panel: white, hairline, square, with HUD corner marks */
.panel,
.glass {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.panel::before,
.panel::after,
.glass::before,
.glass::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: width 0.5s var(--ease), height 0.5s var(--ease);
}
.panel::before,
.glass::before { top: -1px; left: -1px; border-top: 2px solid var(--teal); border-left: 2px solid var(--teal); }
.panel::after,
.glass::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--pink); border-right: 2px solid var(--pink); }
a.panel:hover::before,
a.panel:hover::after,
a.glass:hover::before,
a.glass:hover::after { width: 34px; height: 34px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  font: 600 0.98rem/1 var(--font-body);
  cursor: pointer;
  transition: transform 0.4s var(--ease), filter 0.3s, background-position 0.6s var(--ease);
}
.btn svg { width: 18px; height: 18px; transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 180% 100%;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.btn-primary:hover { background-position: 100% 0; transform: translateY(-2px); filter: saturate(1.15); }

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.8); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- AI badge ---------- */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(100deg, var(--sky), var(--pink));
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.ai-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #fff;
  animation: blink 1.6s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  view-transition-name: site-header;
  background: rgba(226, 248, 246, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, background 0.4s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(226, 248, 246, 0.92); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo b { font-weight: 600; }
.logo .tm {
  margin-left: 2px;
  font-family: var(--font-body);
  font-size: 0.42em;
  font-weight: 500;
  line-height: 1;
  vertical-align: top;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  position: relative;
  display: block;
  padding: 10px 14px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.3s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links .nav-ai { display: inline-flex; align-items: center; gap: 6px; }
.nav-links .nav-ai::before {
  content: "AI";
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(100deg, var(--sky), var(--pink));
}

.nav .btn { min-height: 44px; padding: 0 20px; font-size: 0.92rem; --cut: 9px; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  transition: transform 0.4s var(--ease), background 0.3s;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav .nav-cta { display: none; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px var(--gutter) 20px;
    background: #e8f9f8;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  }
  .nav-links a { padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-links a::after { left: 4px; right: auto; width: 40px; }
  .nav-open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
}

/* ---------- Cards and grids ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid--3 { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
}
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.card { padding: 30px 26px; }
.card h3 { margin: 22px 0 10px; }
.card p { margin: 0; color: var(--muted); }
.card-num {
  position: absolute;
  top: 18px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.card-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.card-icon svg { width: 24px; height: 24px; }
.card-icon.is-pink { background: linear-gradient(135deg, var(--pink), #ff8a5c); }
.card-icon.is-sky { background: linear-gradient(135deg, var(--sky), var(--pink)); }
.card-icon.is-blue { background: linear-gradient(135deg, var(--blue), var(--sky)); }

/* ---------- Feature rows: copy beside a device ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
}
.feature + .feature { margin-top: clamp(80px, 11vw, 150px); }
.feature--flip .feature-copy { order: 2; }
.feature-copy h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.feature-copy > p { font-size: 1.1rem; color: var(--muted); }
.feature-visual { position: relative; }
.feature-visual > .device--phone { max-width: 290px; margin: 0 auto; }

.checks { margin: 26px 0 0; padding: 0; list-style: none; }
.checks li {
  position: relative;
  margin-bottom: 14px;
  padding-left: 32px;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 14px;
  height: 14px;
  background: var(--grad);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.checks b { color: var(--ink); font-weight: 600; }
.checks .ai-badge { margin-right: 6px; vertical-align: 1px; }

@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature--flip .feature-copy { order: 0; }
  .feature-copy { text-align: center; }
  .checks { display: inline-block; text-align: left; }
}

/* ---------- Dark AI sections ---------- */
.section--night {
  color: #cdeff0;
  background: linear-gradient(135deg, #04434b 0%, #06555e 55%, #0a4f6a 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.section--night::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 240, 235, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 240, 235, 0.12) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}
.section--night::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40% 50% at 15% 20%, rgba(0, 230, 230, 0.3), transparent 70%),
    radial-gradient(40% 50% at 85% 80%, rgba(255, 92, 157, 0.18), transparent 70%),
    radial-gradient(30% 40% at 60% 10%, rgba(41, 182, 246, 0.3), transparent 70%);
  pointer-events: none;
}
.section--night > .container { position: relative; z-index: 1; }
.section--night h2,
.section--night h3 { color: #fff; }
.section--night .gradient-text { background-image: linear-gradient(100deg, #5ff3ee 0%, #7fd6ff 55%, #ff9ac6 100%); }
.section--night .section-head p,
.section--night .card p,
.section--night .feature-copy > p { color: #a7d8db; }
.section--night .eyebrow { color: #8fe9ee; }
.section--night .checks b { color: #fff; }
.section--night .panel,
.section--night .glass {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: none;
}

/* ---------- Devices ---------- */
.device {
  position: relative;
  background: var(--bezel);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 0 0 1.5px rgba(255, 255, 255, 0.06);
}
.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.device--tablet { aspect-ratio: 4 / 3; padding: 12px; border-radius: 18px; }
.device--tablet .device-screen { border-radius: 8px; container-type: inline-size; }

.device--phone { aspect-ratio: 9 / 19; padding: 9px; border-radius: 34px; }
.device--phone .device-screen { border-radius: 26px; }
.device--phone::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 50%;
  z-index: 3;
  width: 28%;
  height: 20px;
  border-radius: 999px;
  background: var(--bezel);
  transform: translateX(-50%);
}

.device--tv { aspect-ratio: 16 / 9; padding: 8px; border-radius: 4px; }
.device--tv .device-screen { border-radius: 1px; container-type: inline-size; }
.device--tv::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -24px;
  width: 30%;
  height: 24px;
  background: linear-gradient(#1d3a40, #0a1d22);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  transform: translateX(-50%);
}

.device--laptop {
  aspect-ratio: 16 / 10;
  padding: 10px 10px 12px;
  border-radius: 12px 12px 0 0;
}
.device--laptop .device-screen { border-radius: 2px; container-type: inline-size; }
.device--laptop::after {
  content: "";
  position: absolute;
  left: -9%;
  right: -9%;
  bottom: -14px;
  height: 14px;
  background: linear-gradient(#d6dbe7, #a9b1c4);
  clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
}

/* ---------- Slideshow (Patient side) ---------- */
.slideshow { position: absolute; inset: 0; background: var(--bezel); }
.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.slide.is-active { opacity: 1; z-index: 1; }
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.12) contrast(1.04);
}
.slide.is-active img { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1.04) translate(0, 0); }
  to { transform: scale(1.14) translate(-1.5%, -1%); }
}
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 10, 24, 0.82) 0%, rgba(6, 10, 24, 0.15) 45%, transparent 70%);
}
.slide-caption {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 9%;
  z-index: 2;
  color: #fff;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s 0.6s var(--ease), transform 1s 0.6s var(--ease);
}
.slide.is-active .slide-caption { opacity: 1; transform: none; }
.slide-caption strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 6cqw, 3rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.slide-caption span {
  display: block;
  margin-top: 6px;
  font-size: clamp(0.75rem, 2.4cqw, 1.2rem);
  opacity: 0.85;
}
.slide-dots {
  position: absolute;
  right: 6%;
  bottom: 10%;
  z-index: 3;
  display: flex;
  gap: 4px;
}
.slide-dots i {
  width: 14px;
  height: 3px;
  background: rgba(255, 255, 255, 0.4);
  transition: width 0.6s var(--ease), background 0.6s;
}
.slide-dots i.is-active { width: 28px; background: #fff; }

/* ---------- AI overlays on screens ---------- */
/* Tracking frame with corner brackets, drawn over a photo */
.track {
  position: absolute;
  z-index: 4;
  border: 1px solid rgba(143, 233, 238, 0.35);
  animation: track-drift 7s ease-in-out infinite;
  pointer-events: none;
}
.track::before,
.track::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
}
.track::before { top: -2px; left: -2px; border-top: 2px solid #8fe9ee; border-left: 2px solid #8fe9ee; }
.track::after { bottom: -2px; right: -2px; border-bottom: 2px solid #ff8cc6; border-right: 2px solid #ff8cc6; }
.track span {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 4px);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: clamp(7px, 1.5cqw, 11px);
  white-space: nowrap;
  color: var(--ink);
  background: #8fe9ee;
}
@keyframes track-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(3%, -2%); }
}

/* Floating dark HUD chip */
.hud-chip {
  position: absolute;
  z-index: 5;
  min-width: 170px;
  padding: 12px 14px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #dff7f7;
  background: rgba(3, 48, 54, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  animation: float 7s ease-in-out infinite;
}
.hud-chip .ai-badge { margin-bottom: 8px; }
.hud-chip b { display: block; color: #fff; font-weight: 600; }
.hud-chip small { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 0.68rem; color: #8cc6c9; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Attention meter */
.meter { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 8px; }
.meter i {
  flex: 1;
  height: 30%;
  background: linear-gradient(to top, var(--teal), var(--sky));
  animation: meter 2.4s ease-in-out infinite;
}
.meter i:nth-child(2) { animation-delay: -0.3s; }
.meter i:nth-child(3) { animation-delay: -0.6s; }
.meter i:nth-child(4) { animation-delay: -0.9s; }
.meter i:nth-child(5) { animation-delay: -1.2s; }
.meter i:nth-child(6) { animation-delay: -1.5s; }
.meter i:nth-child(7) { animation-delay: -1.8s; }
.meter i:nth-child(8) { animation-delay: -2.1s; }
@keyframes meter {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}

/* Scan line that sweeps a screen */
.scan {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}
.scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 30%;
  background: linear-gradient(to bottom, transparent, rgba(143, 233, 238, 0.18) 85%, rgba(143, 233, 238, 0.7));
  animation: scan 4.5s linear infinite;
}
@keyframes scan { to { top: 100%; } }

/* ---------- Light surfaces on a dark page ----------
   Device screens and paper-like cards keep light-theme colours,
   so everything inside them reads dark-on-light. */
.device-screen,
.light-surface {
  --ink: #0b1020;
  --ink-2: #2a3247;
  --muted: #646e85;
  --line: rgba(11, 16, 32, 0.1);
  --line-strong: rgba(11, 16, 32, 0.18);
  --link: var(--blue);
}

/* ---------- Family side app UI (inside phone frames) ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 44px 15px 15px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink);
  background: #fff;
}
.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.app-top strong { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.app-top span { color: var(--blue); font-size: 10px; font-weight: 600; }
.app-cover {
  position: relative;
  height: 25%;
  flex: none;
  margin-bottom: 10px;
  border-radius: 4px;
  overflow: hidden;
}
.app-cover img { width: 100%; height: 100%; object-fit: cover; }
.app-cover em {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #fff;
  background: rgba(10, 14, 28, 0.7);
}
.app-field {
  margin-bottom: 7px;
  padding: 6px 9px;
  border-radius: 3px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.app-field label { display: block; font-family: var(--font-mono); font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.app-field b { font-weight: 600; font-size: 11px; }
.app-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 9px; }
.app-chips span {
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 9px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.app-chips .is-on { color: #fff; background: var(--ink); box-shadow: none; }
.app-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: auto;
  padding: 7px 9px;
  border-radius: 3px;
  background: var(--teal-soft);
  font-weight: 500;
}
.app-switch {
  position: relative;
  flex: none;
  width: 28px;
  height: 15px;
  background: var(--teal);
}
.app-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  background: #fff;
}
.app-switch.is-off { background: #cfd5e2; }
.app-switch.is-off::after { right: auto; left: 2px; }
.app-btn {
  margin-top: 10px;
  padding: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  color: #fff;
  background: var(--grad);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.app-ai {
  margin-bottom: 8px;
  padding: 8px 9px;
  font-size: 9.5px;
  color: #e6e9f8;
  background: var(--night);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.app-ai b { color: #fff; }
.app-ai em { font-style: normal; font-family: var(--font-mono); font-size: 8px; color: #ff8cc6; letter-spacing: 0.08em; }

/* ---------- AI photo restoration: before / after slider ---------- */
@property --pos {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}
.restore {
  --pos: 50%;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bezel);
  container-type: inline-size;
  user-select: none;
  -webkit-user-select: none;
  animation: sweep 7s ease-in-out infinite alternate;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}
.restore.is-touched { animation: none; }
@keyframes sweep {
  0%, 12% { --pos: 18%; }
  88%, 100% { --pos: 82%; }
}
.restore img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.restore-after { filter: saturate(1.18) contrast(1.06) brightness(1.03); }
/* The "original print": faded, grey, soft, scratched */
.restore-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.restore-before img { filter: grayscale(1) sepia(0.38) contrast(0.78) brightness(1.08) blur(0.8px); }
.restore-before::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(40, 28, 10, 0.55) 100%),
    repeating-linear-gradient(97deg, transparent 0 34%, rgba(255, 255, 255, 0.35) 34.1% 34.25%, transparent 34.4% 100%),
    repeating-linear-gradient(83deg, transparent 0 61%, rgba(255, 255, 255, 0.25) 61.1% 61.2%, transparent 61.3% 100%),
    repeating-radial-gradient(circle at 30% 40%, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.restore-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 18px rgba(0, 194, 203, 0.9);
  pointer-events: none;
}
.restore-line::after {
  content: "‹ ›";
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--grad);
  transform: translate(-50%, -50%);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
.restore-tag {
  position: absolute;
  top: 5%;
  z-index: 3;
  padding: 0.7cqw 1.4cqw;
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.7cqw, 12px);
  letter-spacing: 0.08em;
  pointer-events: none;
}
.restore-tag--before { left: 4%; color: #2c2416; background: rgba(240, 230, 210, 0.9); }
.restore-tag--after { right: 4%; color: #fff; background: linear-gradient(100deg, var(--sky), var(--pink)); }
.restore input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.restore input[type="range"]:focus-visible + .restore-line { box-shadow: 0 0 0 3px var(--blue); }
.restore-caption { margin-top: 12px; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--muted); text-align: center; }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Next-page band ---------- */
.next-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(32px, 5vw, 56px);
}
.next-band h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.next-band p { margin: 6px 0 0; color: var(--muted); }
@media (max-width: 700px) { .next-band { flex-direction: column; text-align: center; } }

/* ---------- Footer ---------- */
.site-footer {
  padding: 64px 0 40px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.footer-grid h4 {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a:hover { color: var(--link); }
.footer-tagline { margin-top: 12px; color: var(--muted); max-width: 34ch; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-bottom strong { color: var(--ink); font-weight: 600; }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Page transitions (View Transitions API) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.3s var(--ease) both; }
::view-transition-new(root) { animation: vt-in 0.5s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .slide { transition-duration: 0.6s !important; }
  .js .reveal { opacity: 1; transform: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}
