/* ================================================================
   MAGPIE — Pillowy Sage Design System
   Light, soft, natural — matches the iOS app theme
   ================================================================ */

:root {
  --bg: #FAFBF7;
  --bg-tint: #F1F6EC;
  --bg-deep: #E8F0E2;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --border: rgba(63, 107, 75, 0.10);
  --border-strong: rgba(92, 140, 110, 0.24);
  --primary: #5C8C6E;
  --primary-deep: #3F6B4B;
  --primary-soft: #D8E8D0;
  --primary-bubble: #86B898;
  --butter: #F5D88A;
  --butter-soft: #FFF4C4;
  --coral: #E89B8A;
  --text: #1F2A20;
  --text-secondary: #6B7A6E;
  --text-tertiary: #9AA89E;
  --shadow-sm: 0 2px 8px rgba(31, 42, 32, 0.06);
  --shadow-md: 0 8px 32px rgba(31, 42, 32, 0.08);
  --shadow-lg: 0 20px 60px rgba(31, 42, 32, 0.10);
  --font-sans: "Instrument Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
}

::selection {
  background: rgba(92, 140, 110, 0.25);
}


/* ================================================================
   LAYOUT SHELL
   ================================================================ */

.page-shell {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 2.8vw, 2rem) 2rem;
  position: relative;
  z-index: 1;
}


/* ================================================================
   HEADER
   ================================================================ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1.5rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  text-decoration: none;
}

.brand-text {
  display: grid;
  gap: 0.3rem;
}

.wordmark {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}


/* ================================================================
   NAV
   ================================================================ */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav a {
  color: var(--text-tertiary);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}


/* ================================================================
   TYPOGRAPHY
   ================================================================ */

.eyebrow,
.dash-label,
.soul-card-label {
  margin: 0;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.display-heading {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--text);
}

.accent {
  color: var(--primary);
}

.section-body,
.lead {
  color: var(--text-secondary);
  font-size: 1.02rem;
}


/* ================================================================
   BUTTONS
   ================================================================ */

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.35rem;
  padding: 0.95rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(92, 140, 110, 0.25);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  background: var(--primary-deep);
  box-shadow: 0 8px 24px rgba(92, 140, 110, 0.3);
}

.cta-button-large {
  padding: 1.1rem 2.4rem;
  font-size: 1.08rem;
}

.cta-arrow {
  font-size: 1.1em;
  opacity: 0.8;
}


/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 0.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a,
.site-footer p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 0.88rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}


/* ================================================================
   HOME — LAYOUT
   ================================================================ */

.home-main {
  display: grid;
  gap: clamp(5rem, 12vw, 10rem);
}

.hero-panel,
.section-card,
.closer-card {
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}


/* ================================================================
   1. HERO — HOOK
   ================================================================ */

.hero-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: min(36rem, calc(100svh - 6rem));
  padding: clamp(2rem, 5vw, 4rem) 0;
  gap: 2rem;
}

.hero-copy {
  max-width: 28rem;
}

.hero-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6.5vw, 5.4rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-wrap: balance;
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-top: 2rem;
}

.hero-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-stage::before {
  content: "";
  position: absolute;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  background: radial-gradient(circle, var(--primary-soft), transparent 70%);
  pointer-events: none;
  opacity: 0.6;
}

.magpie-hero {
  width: min(100%, 22rem);
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 16px 40px rgba(31, 42, 32, 0.12));
}


/* ================================================================
   SHARED SECTION LAYOUTS
   ================================================================ */

.section-card {
  padding: 0;
}

.feature-layout,
.portrait-layout {
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
}

.feature-layout {
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1fr);
  align-items: center;
}

.portrait-layout {
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  align-items: start;
}

.feature-copy,
.portrait-copy,
.closer-copy {
  position: relative;
  z-index: 1;
}

.feature-copy .display-heading {
  font-size: clamp(2.5rem, 4.8vw, 4.4rem);
}

.feature-copy .section-body,
.portrait-copy .section-body {
  margin: 1rem 0 0;
  max-width: 33rem;
}


/* ================================================================
   2. CONVERSATION — CHAT DEMO
   ================================================================ */

.chat-demo {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.chat-bubble {
  max-width: 88%;
  padding: 0.85rem 1.15rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-magpie {
  align-self: flex-start;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 20px 20px 20px 6px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
}

.chat-sender {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.chat-user {
  align-self: flex-end;
  background: var(--primary);
  border: none;
  border-radius: 20px 20px 6px 20px;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(92, 140, 110, 0.2);
}

.chat-cursor {
  align-self: flex-start;
  width: 2px;
  height: 1.1rem;
  margin-left: 1.15rem;
  background: var(--primary);
  opacity: 0.5;
  animation: blink 1.1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0; }
}


/* ================================================================
   3. SOUL FILE / PORTRAIT
   ================================================================ */

.portrait-copy .display-heading {
  font-size: clamp(2.3rem, 4.5vw, 4rem);
}

.found-sub {
  margin: 0.7rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  font-style: italic;
  color: var(--text-secondary);
}

.soul-card {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.soul-card-portrait {
  margin: 0.4rem 0 1.2rem;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.8vw, 1.75rem);
  line-height: 1.2;
  color: var(--text);
}

.dashboard-grid {
  display: grid;
  gap: 1.2rem;
}

.dash-module {
  padding: 0.9rem 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.dash-label {
  margin: 0 0 0.45rem;
}

.compass-wrap {
  display: flex;
  justify-content: center;
}

.compass-chart {
  width: min(100%, 20rem);
  height: auto;
  overflow: visible;
}

.compass-ring,
.compass-axis {
  fill: none;
  stroke: rgba(92, 140, 110, 0.18);
  stroke-width: 1;
}

.compass-ring-mid {
  stroke: rgba(92, 140, 110, 0.12);
}

.compass-ring-inner {
  stroke: rgba(92, 140, 110, 0.07);
}

.compass-shape {
  fill: rgba(92, 140, 110, 0.12);
  stroke: rgba(92, 140, 110, 0.5);
  stroke-width: 2;
}

.compass-point {
  fill: rgba(92, 140, 110, 0.7);
}

.compass-label {
  fill: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.spectrum-list {
  display: grid;
  gap: 0.85rem;
}

.spectrum-row {
  display: grid;
  gap: 0.4rem;
}

.spectrum-poles {
  display: flex;
  justify-content: space-between;
  color: var(--text-tertiary);
  font-size: 0.72rem;
}

.spectrum-track {
  position: relative;
  height: 3px;
  border-radius: 999px;
  background: var(--bg-deep);
}

.spectrum-dot {
  position: absolute;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(92, 140, 110, 0.25);
  transform: translate(-50%, -50%);
}

.soul-card-fade {
  position: relative;
  margin-top: 0.45rem;
  padding-top: 1.5rem;
  text-align: center;
}

.soul-card-fade::before {
  content: "";
  position: absolute;
  inset: -1.7rem 0 auto;
  height: 4.8rem;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.95));
  pointer-events: none;
}

.fade-dots {
  margin: 0;
  color: var(--text-tertiary);
  font-family: var(--font-serif);
  font-size: 1.6rem;
}


/* ================================================================
   4. SEARCHING — ORB ANIMATION
   ================================================================ */

.searching-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.searching-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem 0;
}

.searching-orb {
  position: relative;
  width: 12rem;
  height: 12rem;
}

.orb-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle, var(--primary), var(--primary-deep));
  box-shadow: 0 0 30px rgba(92, 140, 110, 0.3), 0 0 60px rgba(92, 140, 110, 0.12);
}

.orb-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 999px;
  border: 1.5px solid rgba(92, 140, 110, 0.2);
  transform: translate(-50%, -50%);
  animation: pulse 4s ease-in-out infinite;
}

.orb-ring-1 {
  width: 5rem;
  height: 5rem;
  border-color: rgba(92, 140, 110, 0.25);
  animation-delay: 0s;
}

.orb-ring-2 {
  width: 8rem;
  height: 8rem;
  border-color: rgba(92, 140, 110, 0.16);
  animation-delay: 0.6s;
}

.orb-ring-3 {
  width: 11.5rem;
  height: 11.5rem;
  border-color: rgba(92, 140, 110, 0.08);
  animation-delay: 1.2s;
}

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 0.5;
  }
}

.searching-status {
  margin: 0;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

.searching-layout .feature-copy .display-heading {
  font-size: clamp(2.5rem, 4.8vw, 4.4rem);
}


/* ================================================================
   5. WHY YOU MATCH
   ================================================================ */

.feature-layout-found {
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
}

.section-match .display-heading {
  font-size: clamp(2.5rem, 4.8vw, 4.4rem);
}

.match-card {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.match-card-label {
  margin: 0 0 0.6rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.match-card-name {
  margin: 0 0 0.8rem;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}

.match-card-body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--text-secondary);
}


/* ================================================================
   6. SEAL / CLOSER
   ================================================================ */

.closer-card {
  display: flex;
  justify-content: center;
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.closer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  max-width: 36rem;
}

.closer-headline {
  font-size: clamp(2.2rem, 4.8vw, 3.8rem);
}

.seal-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.seal-points span {
  color: var(--text-tertiary);
  font-size: 0.88rem;
}

.seal-points span:not(:last-child)::after {
  content: "/";
  margin-left: 0.7rem;
  color: var(--border-strong);
}

.closer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
}

.closer-magpie {
  width: 5rem;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(31, 42, 32, 0.08));
}


/* ================================================================
   RESPONSIVE — DESKTOP
   ================================================================ */

@media (min-width: 840px) {
  .dashboard-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
  }

  .dash-module {
    min-height: 100%;
  }
}


/* ================================================================
   RESPONSIVE — TABLET
   ================================================================ */

@media (max-width: 1040px) {
  .hero-panel,
  .feature-layout,
  .portrait-layout,
  .feature-layout-found,
  .searching-layout {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    order: -1;
  }

  .hero-panel {
    min-height: auto;
    text-align: center;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
  }

  .magpie-hero {
    width: min(60%, 16rem);
  }
}


/* ================================================================
   RESPONSIVE — MOBILE
   ================================================================ */

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .page-shell {
    padding-inline: 1rem;
    padding-bottom: 1.5rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 1.1rem;
  }

  .hero-title {
    font-size: clamp(2.4rem, 10vw, 3.2rem);
  }

  .magpie-hero {
    width: min(50%, 12rem);
  }

  .searching-visual {
    padding: 2rem 0;
  }

  .searching-orb {
    width: 9rem;
    height: 9rem;
  }

  .orb-ring-1 { width: 4rem; height: 4rem; }
  .orb-ring-2 { width: 6.5rem; height: 6.5rem; }
  .orb-ring-3 { width: 8.5rem; height: 8.5rem; }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ================================================================
   REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cta-button,
  .site-nav a {
    transition: none;
  }

  .chat-cursor {
    animation: none;
    opacity: 0.5;
  }

  .orb-ring {
    animation: none;
  }
}


/* ================================================================
   SUBPAGES (privacy, support, etc.)
   ================================================================ */

body:not(.home-page) .page-shell {
  max-width: 1120px;
}

body:not(.home-page) main.section {
  max-width: 900px;
  margin: 0 auto;
}

.legal-page {
  margin-top: 0.5rem;
}

.legal-page h1,
body:not(.home-page) main.section h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 0.96;
}

.lead {
  margin: 1rem 0 0;
  max-width: 42rem;
}

.legal-section,
.faq-card,
.alert-card {
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.legal-section + .legal-section,
.faq-card + .faq-card {
  margin-top: 1rem;
}

.legal-section h2,
.faq-card h2,
.alert-card h2 {
  margin: 0 0 0.55rem;
  font-size: 1.16rem;
}

.legal-section p,
.legal-section li,
.faq-card p,
.alert-card p {
  margin: 0;
  color: var(--text-secondary);
}

.legal-section p + p,
.faq-card p + p,
.alert-card p + p {
  margin-top: 0.8rem;
}

.legal-section ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
}

.legal-section li + li {
  margin-top: 0.55rem;
}

.faq-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.alert-card {
  margin-top: 1.5rem;
  background: var(--bg-tint);
}
