/* =============================================================================
   PetFamily Landing — Design System v4.0 Hub Era (DS_DIGEST / Hub Design Language)
   ============================================================================= */

/* --- 1. Tokens --- */
:root {
  /* Brand */
  --accent: #D94848;
  --accent-secondary: #E09500;
  --accent-subtle: rgba(217, 72, 72, 0.12);
  --accent-muted: #FFEBEB;

  /* Hub tints */
  --hub-health-cyan: #59D9F2;
  --hub-weight-purple: #8C73FF;
  --hub-background-blue: #598CFF;

  /* Text */
  --text-primary: #1C1C1E;
  --text-secondary: #6C6C70;
  --text-tertiary: #AEAEB2;

  /* Surfaces */
  --background-top: #FAFAFA;
  --background-bottom: #F8F8FA;
  --card-background: #FFFFFF;
  --card-border: rgba(229, 229, 234, 0.5);

  /* Semantic */
  --success: #34C759;
  --warning: #FF9500;
  --info: #007AFF;
  --feature-health: #FF2D55;
  --feature-pets: #FF9500;
  --feature-expenses: #34C759;

  /* Typography scale (PFTypography) */
  --font-display: 2.125rem;
  --font-large-title: 1.75rem;
  --font-title1: 1.5rem;
  --font-title2: 1.25rem;
  --font-title3: 1.125rem;
  --font-headline: 1rem;
  --font-body: 1rem;
  --font-callout: 0.9375rem;
  --font-subheadline: 0.875rem;
  --font-caption1: 0.75rem;
  --font-caption2: 0.6875rem;
  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;

  /* Spacing (PFSpacing) */
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 24px;
  --space-huge: 32px;
  --space-massive: 48px;

  /* Radius */
  --card-radius: 16px;
  --card-radius-small: 12px;
  --button-radius: 12px;
  --chip-radius: 999px;
  --icon-radius: 26px;

  /* Shadows (PFCard) */
  --shadow-standard: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 3px 8px rgba(0, 0, 0, 0.06);
  --shadow-glass: 0 4px 10px rgba(0, 0, 0, 0.05);

  /* Layout */
  --container-max: 1080px;
  --padding-h: 24px;
  --section-gap: var(--space-massive);

  /* Hub background radials */
  --hub-radial-coral: rgba(217, 72, 72, 0.12);
  --hub-radial-blue: rgba(89, 140, 255, 0.1);
}

/* --- 2. Reset + hub background --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-stack);
  font-size: var(--font-body);
  line-height: 1.5;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--background-top) 0%, var(--background-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background: radial-gradient(
    ellipse 760px 520px at 5% -8%,
    var(--hub-radial-coral),
    transparent 70%
  );
}

body::after {
  background: radial-gradient(
    ellipse 920px 640px at 102% 105%,
    var(--hub-radial-blue),
    transparent 72%
  );
}

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

a {
  color: var(--accent);
}

ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* --- 3. Typography utilities --- */
.text-display {
  font-size: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.text-large-title {
  font-size: var(--font-large-title);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.text-title1 {
  font-size: var(--font-title1);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.text-title2 {
  font-size: var(--font-title2);
  font-weight: 600;
  line-height: 1.3;
}

.text-title3 {
  font-size: var(--font-title3);
  font-weight: 600;
  line-height: 1.35;
}

.text-headline {
  font-size: var(--font-headline);
  font-weight: 600;
  line-height: 1.4;
}

.text-body {
  font-size: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-tertiary {
  color: var(--text-tertiary);
}

/* --- 4. Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--padding-h);
}

.section {
  padding-block: var(--section-gap);
}

.section--tight-top {
  padding-block-start: var(--space-huge);
  padding-block-end: var(--section-gap);
}

/* --- 5. Components --- */
.hub-card {
  background: var(--card-background);
  border: 0.5px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-elevated);
}

.hub-card--flat {
  box-shadow: var(--shadow-standard);
}

.hub-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-caption1);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--accent-subtle);
  border-radius: var(--chip-radius);
}

.hub-pill--premium {
  background: rgba(89, 140, 255, 0.14);
  color: var(--hub-background-blue);
}

.hub-pill--new {
  background: var(--accent-subtle);
  color: var(--accent);
}

.section-header {
  margin-bottom: var(--space-xxl);
}

.section-header__eyebrow {
  display: inline-block;
  margin: 0 0 var(--space-sm);
  font-size: var(--font-caption1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-header__eyebrow--accent { color: var(--accent); }
.section-header__eyebrow--cyan { color: var(--hub-health-cyan); }
.section-header__eyebrow--purple { color: var(--hub-weight-purple); }
.section-header__eyebrow--blue { color: var(--hub-background-blue); }
.section-header__eyebrow--warning { color: var(--warning); }

.section-header__title {
  margin: 0 0 var(--space-md);
  font-size: var(--font-title1);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.section-header__lead {
  margin: 0;
  max-width: 52ch;
  font-size: var(--font-callout);
  color: var(--text-secondary);
  line-height: 1.55;
}

.section-header--center {
  text-align: center;
}

.section-header--center .section-header__lead {
  margin-left: auto;
  margin-right: auto;
}

.section-header .hub-pill {
  margin-bottom: var(--space-sm);
}

.feature-list {
  margin: var(--space-lg) 0 0;
  padding-left: 1.2rem;
}

.feature-list li {
  margin-bottom: var(--space-sm);
  font-size: var(--font-callout);
  color: var(--text-primary);
  line-height: 1.5;
}

.feature-list li::marker {
  color: var(--accent);
}

.feature-list--cyan li::marker { color: var(--hub-health-cyan); }
.feature-list--purple li::marker { color: var(--hub-weight-purple); }
.feature-list--blue li::marker { color: var(--hub-background-blue); }

.disclaimer {
  margin: var(--space-lg) 0 0;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-caption1);
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--card-radius-small);
  border-left: 3px solid var(--hub-background-blue);
}

/* Hub tiles (hero strip) */
.hub-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-huge);
  text-align: left;
}

.hub-tile {
  display: block;
  padding: var(--space-lg);
  color: inherit;
  text-decoration: none;
  background: var(--card-background);
  border: 0.5px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-standard);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.hub-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.hub-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-md);
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
}

.hub-tile__icon--cyan {
  background: rgba(89, 217, 242, 0.18);
  color: #2eb8d4;
}

.hub-tile__icon--purple {
  background: rgba(140, 115, 255, 0.18);
  color: var(--hub-weight-purple);
}

.hub-tile__icon--blue {
  background: rgba(89, 140, 255, 0.14);
  color: var(--hub-background-blue);
}

.hub-tile__title {
  margin: 0 0 var(--space-xxs);
  font-size: var(--font-subheadline);
  font-weight: 600;
}

.hub-tile__text {
  margin: 0;
  font-size: var(--font-caption1);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Feature row (text + screenshot) */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-huge);
  align-items: center;
}

.feature-row--reverse .feature-row__content {
  order: 2;
}

.feature-row--reverse .feature-row__media {
  order: 1;
}

.feature-row__content {
  min-width: 0;
}

/* Screenshot frame */
.screenshot-frame {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  aspect-ratio: 390 / 844;
  border-radius: var(--card-radius);
  border: 0.5px solid var(--card-border);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  background-color: var(--card-background);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.screenshot-frame--hub {
  background-image: linear-gradient(145deg, rgba(217, 72, 72, 0.08), rgba(89, 140, 255, 0.12)),
    url("images/screenshot-hub.png");
}

.screenshot-frame--tasks {
  background-image: linear-gradient(145deg, rgba(217, 72, 72, 0.1), transparent),
    url("images/screenshot-tasks.png");
}

.screenshot-frame--health {
  background-image: linear-gradient(145deg, rgba(89, 217, 242, 0.15), transparent),
    url("images/screenshot-health.png");
}

.screenshot-frame--ai {
  background-image: linear-gradient(145deg, rgba(89, 140, 255, 0.12), transparent),
    url("images/screenshot-ai.png");
}

.screenshot-frame--calendar {
  background-image: linear-gradient(145deg, rgba(217, 72, 72, 0.06), rgba(89, 140, 255, 0.1)),
    url("images/screenshot-calendar.png");
}

.screenshot-frame__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  font-size: var(--font-caption1);
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: center;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(248, 248, 250, 0.92) 0%,
    rgba(250, 250, 250, 0.85) 100%
  );
  opacity: 0;
  visibility: hidden;
}

.screenshot-frame--placeholder .screenshot-frame__label {
  opacity: 1;
  visibility: visible;
}

/* Placeholder: gradient only — no url() until PNGs exist (avoids 404s) */
.screenshot-frame--placeholder.screenshot-frame--hub {
  background-image: linear-gradient(145deg, rgba(217, 72, 72, 0.08), rgba(89, 140, 255, 0.12));
}

.screenshot-frame--placeholder.screenshot-frame--tasks {
  background-image: linear-gradient(145deg, rgba(217, 72, 72, 0.1), transparent);
}

.screenshot-frame--placeholder.screenshot-frame--health {
  background-image: linear-gradient(145deg, rgba(89, 217, 242, 0.15), transparent);
}

.screenshot-frame--placeholder.screenshot-frame--ai {
  background-image: linear-gradient(145deg, rgba(89, 140, 255, 0.12), transparent);
}

.screenshot-frame--placeholder.screenshot-frame--calendar {
  background-image: linear-gradient(145deg, rgba(217, 72, 72, 0.06), rgba(89, 140, 255, 0.1));
}

/* Trust grid */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.trust-card {
  padding: var(--space-xl);
  text-align: center;
  background: var(--card-background);
  border: 0.5px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-standard);
}

.trust-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
}

.trust-card__title {
  margin: 0 0 var(--space-xs);
  font-size: var(--font-subheadline);
  font-weight: 600;
}

.trust-card__text {
  margin: 0;
  font-size: var(--font-caption1);
  color: var(--text-secondary);
  line-height: 1.45;
}

/* CTA badge (App Store) */
.cta-badge {
  display: inline-block;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.cta-badge:hover {
  opacity: 0.88;
}

.cta-badge:active {
  transform: scale(0.98);
}

.cta-badge img {
  display: block;
  height: 56px;
  width: auto;
}

/* --- 6. Page: index --- */
.hero {
  text-align: center;
  padding-block: var(--space-massive) var(--space-huge);
}

.hero__icon {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-xl);
  border-radius: var(--icon-radius);
  box-shadow: var(--shadow-elevated);
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent-muted), var(--card-background));
}

.hero__icon--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-title1);
  font-weight: 700;
  color: var(--accent);
  background: linear-gradient(145deg, var(--accent-muted), #fff);
}

.hero__pill-row {
  margin-bottom: var(--space-lg);
}

.hero__title {
  margin: 0 0 var(--space-md);
  font-size: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__tagline {
  margin: 0 auto var(--space-xxl);
  max-width: 36rem;
  font-size: var(--font-callout);
  color: var(--text-secondary);
  line-height: 1.55;
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  align-items: center;
}

.cta-section {
  text-align: center;
  padding-block: var(--space-massive);
}

.cta-section .hub-card {
  padding: var(--space-huge) var(--space-xxl);
}

.cta-section__title {
  margin: 0 0 var(--space-md);
  font-size: var(--font-large-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cta-section__text {
  margin: 0 auto var(--space-xxl);
  max-width: 32rem;
  color: var(--text-secondary);
  font-size: var(--font-callout);
}

/* --- 7. Page: legal --- */
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-lg);
  padding-inline: var(--padding-h);
  border-bottom: 0.5px solid var(--card-border);
  background: rgba(250, 250, 250, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.legal-header--sticky {
  position: sticky;
  top: 0;
  z-index: 100;
}

.legal-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 0;
  max-width: var(--container-max);
}

.legal-header__home {
  font-size: var(--font-title3);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.legal-header__home:hover {
  opacity: 0.88;
}

.legal-header__title {
  font-size: var(--font-callout);
  color: var(--text-secondary);
}

.legal-shell {
  padding-block: var(--space-huge) var(--space-massive);
}

.legal-page {
  padding: var(--space-huge) var(--space-xxl);
}

.legal-page__title {
  font-size: var(--font-large-title);
  font-weight: 700;
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.02em;
}

.legal-page__meta {
  font-size: var(--font-subheadline);
  color: var(--text-secondary);
  margin: 0 0 var(--space-xxl);
}

.legal-page__intro {
  margin: 0 0 var(--space-huge);
  color: var(--text-primary);
  font-size: var(--font-callout);
  line-height: 1.55;
}

.legal-page__section {
  margin-bottom: var(--space-huge);
}

.legal-page__section h2 {
  font-size: var(--font-title2);
  font-weight: 600;
  margin: 0 0 var(--space-md);
  color: var(--text-primary);
}

.legal-page__section h3 {
  font-size: var(--font-title3);
  font-weight: 600;
  margin: var(--space-xxl) 0 var(--space-sm);
  color: var(--text-primary);
}

.legal-page__section p {
  margin: 0 0 var(--space-md);
  font-size: var(--font-callout);
  line-height: 1.55;
  color: var(--text-primary);
}

.legal-page__section ul {
  margin: 0 0 var(--space-md);
  padding-left: 1.25rem;
}

.legal-page__section li {
  margin-bottom: var(--space-sm);
  font-size: var(--font-callout);
  line-height: 1.5;
  color: var(--text-primary);
}

.legal-page__section ul ul {
  margin-top: var(--space-sm);
  margin-bottom: 0;
}

.legal-page__section a {
  color: var(--accent);
  text-decoration: none;
}

.legal-page__section a:hover {
  text-decoration: underline;
}

.legal-page__all-caps {
  font-size: var(--font-subheadline);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* --- 8. Footer --- */
.footer {
  padding-block: var(--space-huge) var(--space-xxl);
  padding-inline: var(--padding-h);
  border-top: 0.5px solid var(--card-border);
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xl) var(--space-xxl);
  margin-bottom: var(--space-lg);
}

.footer__links a {
  color: var(--text-secondary);
  font-size: var(--font-callout);
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__current {
  font-size: var(--font-callout);
  color: var(--text-secondary);
  font-weight: 500;
}

.footer__copy {
  font-size: var(--font-caption1);
  color: var(--text-tertiary);
  margin: 0;
}

/* --- 9. Responsive --- */
@media (min-width: 769px) {
  :root {
    --font-display: 2.75rem;
    --padding-h: 32px;
  }

  .hero__title {
    font-size: var(--font-display);
  }
}

@media (max-width: 1024px) {
  .hub-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-row {
    gap: var(--space-xxl);
  }
}

@media (max-width: 768px) {
  :root {
    --padding-h: 20px;
    --section-gap: var(--space-huge);
    --font-display: 2.125rem;
  }

  .hero {
    padding-block: var(--space-huge) var(--space-xxl);
  }

  .hero__icon {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    margin-bottom: var(--space-lg);
  }

  .hub-tiles {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .feature-row,
  .feature-row--reverse {
    grid-template-columns: 1fr;
  }

  .feature-row--reverse .feature-row__content,
  .feature-row--reverse .feature-row__media {
    order: unset;
  }

  .feature-row__media {
    order: -1;
  }

  .screenshot-frame {
    max-width: 240px;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .legal-page {
    padding: var(--space-xxl) var(--space-lg);
  }

  .cta-section .hub-card {
    padding: var(--space-xxl) var(--space-lg);
  }
}

/* --- 10. Desktop background (pointer devices only — skips iPad/iPhone Safari) --- */
@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
  body {
    background-attachment: fixed;
  }
}

/* --- 11. Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cta-badge,
  .hub-tile,
  a.hub-tile:hover,
  a.hub-tile:active,
  .cta-badge:hover,
  .cta-badge:active {
    transition: none;
    transform: none;
  }
}
