/* KinCare landing page. Sub-pages (privacy/terms/delete) keep styles.css. */

:root {
  color-scheme: light dark;
  --bg: #f6faf9;
  --bg-tint: #e9f6f3;
  --surface: #ffffff;
  --text: #0b1b22;
  --text-2: #4a5b63;
  --line: rgba(11, 27, 34, 0.08);
  --brand: #0f9e8e;
  --brand-ink: #06756a;
  --brand-soft: rgba(15, 158, 142, 0.1);
  --bar: rgba(246, 250, 249, 0.72);
  --device-edge: #11181b;
  --shadow-lg: 0 40px 80px -24px rgba(11, 27, 34, 0.28), 0 12px 24px -12px rgba(11, 27, 34, 0.18);
  --shadow-md: 0 20px 48px -20px rgba(11, 27, 34, 0.22);
  --radius: 28px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wrap: min(1120px, calc(100% - 32px));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1416;
    --bg-tint: #0f1f21;
    --surface: #132225;
    --text: #eef6f5;
    --text-2: #a3b5b8;
    --line: rgba(238, 246, 245, 0.1);
    --brand: #2cc4b1;
    --brand-ink: #5ad8c8;
    --brand-soft: rgba(44, 196, 177, 0.14);
    --bar: rgba(11, 20, 22, 0.7);
    --device-edge: #000;
    --shadow-lg: 0 40px 80px -24px rgba(0, 0, 0, 0.7);
    --shadow-md: 0 20px 48px -20px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html {
  font: 100%/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

main { overflow-x: clip; } /* rotated hero device must not cause sideways scroll */

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

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

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

h1, h2, h3 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  color: var(--text);
  text-wrap: balance;
}

p { margin: 0; }

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
}
.skip:focus { top: 12px; }

.eyebrow {
  margin-bottom: 12px;
  color: var(--brand-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Translucent nav ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}

.bar-inner {
  width: var(--wrap);
  height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }

.bar-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.bar-links a {
  color: var(--text-2);
  font-size: 0.9375rem;
}
.bar-links a:hover { color: var(--text); text-decoration: none; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: transform 120ms ease-out, background-color 150ms ease;
  touch-action: manipulation;
}
.pill:hover { text-decoration: none; background: var(--brand-ink); }
.pill:active { transform: scale(0.96); }

@media (prefers-color-scheme: dark) {
  .pill { color: #04201c; }
  .pill:hover { background: var(--brand-ink); }
}

/* ---------- Hero ---------- */
.hero {
  width: var(--wrap);
  margin: 0 auto;
  padding: 72px 0 96px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 48px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.hero h1 span { color: var(--text-2); }

.lede {
  max-width: 34em;
  margin-top: 24px;
  color: var(--text-2);
  font-size: 1.1875rem;
  line-height: 1.55;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 32px;
}

.play-badge {
  display: inline-block;
  border-radius: 12px;
  transition: transform 120ms ease-out;
  touch-action: manipulation;
}
/* Google's badge PNG has built-in padding; crop it visually with negative margin */
.play-badge img { width: 200px; margin: -12px; }
.play-badge:active { transform: scale(0.97); }

.text-link {
  font-weight: 600;
  font-size: 1.0625rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 44px 0 0;
  padding: 24px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.facts li { display: grid; }
.facts strong { font-size: 1.0625rem; letter-spacing: -0.01em; }
.facts span { color: var(--text-2); font-size: 0.875rem; }

/* Device frame around real screenshots */
.device {
  margin: 0;
  padding: 10px;
  border-radius: 48px;
  background: var(--device-edge);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  aspect-ratio: 720 / 1565;
  position: relative;
}
.device img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 38px;
}

.hero-stage {
  position: relative;
  height: 640px;
}
.hero-stage::before {
  content: "";
  position: absolute;
  inset: 8% -4% 4% 4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--brand-soft), transparent);
  filter: blur(20px);
}
.hero-stage .device {
  position: absolute;
  width: 290px;
}
.device-front {
  right: 18%;
  top: 0;
  animation: rise 700ms var(--ease) both;
}
.device-back {
  right: 0;
  top: 64px;
  width: 250px !important;
  opacity: 0.9;
  transform: rotate(6deg);
  animation: rise-back 800ms 120ms var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
}
@keyframes rise-back {
  from { opacity: 0; transform: translateY(24px) rotate(6deg); }
}

/* ---------- Sections ---------- */
.section-head {
  width: var(--wrap);
  margin: 0 auto 56px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.features {
  padding: 96px 0 48px;
  background: linear-gradient(var(--bg), var(--bg-tint) 30%, var(--bg-tint) 70%, var(--bg));
}

.feature {
  width: var(--wrap);
  margin: 0 auto 96px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
}
.feature-flip .feature-media { order: 2; }

.feature-media {
  display: flex;
  justify-content: center;
}
.feature-media .device { width: min(300px, 70vw); }

.tag {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.feature h3 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.feature p {
  max-width: 32em;
  margin-top: 16px;
  color: var(--text-2);
  font-size: 1.125rem;
}

.checks {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.checks li {
  position: relative;
  padding-left: 32px;
  font-size: 1rem;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f9e8e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Gallery rail (native momentum + snap) ---------- */
.gallery { padding: 72px 0 96px; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(16px, calc((100% - 1120px) / 2));
  padding: 8px max(16px, calc((100% - 1120px) / 2)) 24px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail:focus-visible { outline-offset: -3px; border-radius: 0; }

.rail figure {
  margin: 0;
  scroll-snap-align: start;
}
.rail img {
  width: 100%;
  aspect-ratio: 720 / 1565;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.rail figcaption {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 0.9375rem;
  text-align: center;
}

/* ---------- Privacy ---------- */
.privacy { padding: 24px 0 64px; }

.privacy-card {
  width: var(--wrap);
  margin: 0 auto;
  padding: 56px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.privacy-card h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.privacy-card p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--text-2);
  font-size: 1.0625rem;
}

.privacy-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 24px;
}
.privacy-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: start;
}
.privacy-list svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 12px;
  background: var(--brand-soft);
  fill: none;
  stroke: var(--brand-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.privacy-list strong { display: block; font-size: 1.0625rem; }
.privacy-list span { color: var(--text-2); font-size: 0.9375rem; }

/* ---------- Download ---------- */
.download { padding: 32px 0 96px; }

.download-card {
  width: var(--wrap);
  margin: 0 auto;
  padding: 56px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0f9e8e, #0b6f7a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.download-icon { border-radius: 18px; margin-bottom: 24px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
.download-card h2 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.download-card p {
  margin: 12px 0 28px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.125rem;
}
.download-card .play-badge:focus-visible { outline-color: #fff; }

.qr {
  margin: 0;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
  flex-shrink: 0;
}
.qr img { width: 160px; height: 160px; }
.qr figcaption { margin-top: 8px; color: #0b1b22; font-size: 0.8125rem; font-weight: 600; }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
}
.foot-inner {
  width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 0.875rem;
}
.foot-brand img { border-radius: 6px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.foot-links a {
  color: var(--text-2);
  font-size: 0.875rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.foot-links a:hover { color: var(--text); }
.foot-note {
  width: var(--wrap);
  margin: 12px auto 0;
  color: var(--text-2);
  font-size: 0.8125rem;
}

/* ---------- Scroll reveal (JS adds .is-in; content visible without JS) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 48px 0 64px;
    text-align: center;
  }
  .lede { margin-inline: auto; }
  .cta-row, .facts { justify-content: center; }
  .hero-stage { height: 520px; max-width: 420px; width: 100%; margin: 0 auto; }
  .hero-stage .device { width: 236px; }
  .device-front { right: auto; left: 8%; }
  .device-back { width: 206px !important; }

  .feature,
  .privacy-card { grid-template-columns: 1fr; gap: 40px; }
  .feature { margin-bottom: 80px; }
  .feature-flip .feature-media { order: 0; }
  .feature-copy { text-align: left; }

  .download-card { flex-direction: column; text-align: center; }
  .qr { display: none; } /* visitors on a phone tap the badge instead */
}

@media (max-width: 600px) {
  .bar-inner { gap: 12px; }
  .brand span { display: none; } /* logo alone keeps room for Privacy + Terms */
  .bar-links { gap: 16px; }
  .bar-links .wide, .bar-links .long { display: none; }
  .pill { padding: 0 14px; }
  .hero h1 { font-size: 2.375rem; }
  .lede { font-size: 1.0625rem; }
  .facts { gap: 12px 20px; }
  .facts span { font-size: 0.8125rem; }
  .hero-stage { height: 440px; }
  .hero-stage .device { width: 200px; border-radius: 38px; padding: 8px; }
  .hero-stage .device img { border-radius: 30px; }
  .device-back { width: 172px !important; top: 48px; }
  .privacy-card, .download-card { padding: 32px 24px; }
  .section-head { margin-bottom: 40px; }
  .rail { grid-auto-columns: 62vw; gap: 16px; }
  .features { padding-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .device-front, .device-back { animation: none; }
  .js .reveal { transform: none; transition: opacity 200ms ease; }
  .pill:active, .play-badge:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .bar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
