/* ============================================================
   RetainReady — Shared Stylesheet
   Brand: editorial minimalism, data-forward, warm-but-serious
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand palette */
  --teal-primary: #1A7A6E;
  --teal-deep: #155F55;
  --teal-accent: #7EC8BC;
  --teal-wash: #E0F2EF;
  --navy-primary: #1B2D4F;
  --navy-deep: #0F1D34;
  --amber: #C07B2A;

  /* Neutrals */
  --ink: #111827;
  --gray-50: #F8FAFB;
  --gray-100: #EEF2F4;
  --gray-200: #DDE3E7;
  --gray-300: #C7D0D6;
  --gray-400: #9BA6AF;
  --gray-600: #566471;
  --gray-700: #3A4550;
  --gray-800: #1F2933;
  --white: #FFFFFF;

  /* System */
  --success: #16A34A;
  --error: #DC2626;

  /* Typography */
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --container-max: 1200px;
  --container-pad: clamp(1.25rem, 4vw, 2rem);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--teal-primary); text-decoration: none; transition: color 0.2s var(--ease-out); }
a:hover { color: var(--teal-deep); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy-primary);
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.875rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.375rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.125rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-primary);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.section { padding: clamp(4rem, 10vw, 7rem) 0; }
.section-tight { padding: clamp(3rem, 6vw, 4.5rem) 0; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--container-pad);
  max-width: var(--container-max);
  margin: 0 auto;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
}
.brand .retain { color: var(--teal-primary); }
.brand .ready { color: var(--navy-primary); }
.brand:hover { color: inherit; }
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  position: relative;
}
.nav-links a:hover { color: var(--navy-primary); }
.nav-links a.active { color: var(--navy-primary); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--teal-primary);
  border-radius: 1px;
}
.nav-toggle {
  display: none;
  padding: 0.5rem;
  color: var(--navy-primary);
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 840px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1.5rem var(--container-pad);
    gap: 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    box-shadow: 0 12px 24px -12px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--teal-primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--teal-deep);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(26, 122, 110, 0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--navy-primary);
  border-color: var(--gray-200);
}
.btn-ghost:hover {
  border-color: var(--navy-primary);
  color: var(--navy-primary);
}
.btn-dark {
  background: var(--navy-primary);
  color: var(--white);
}
.btn-dark:hover {
  background: var(--navy-deep);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-arrow { transition: transform 0.25s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
  background: linear-gradient(180deg, #FAFCFB 0%, var(--white) 100%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(ellipse at top right, var(--teal-wash) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0.7;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
}
.hero h1 {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--teal-primary);
  position: relative;
}
.hero-lede {
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  color: var(--gray-700);
  line-height: 1.55;
  max-width: 34ch;
  margin-bottom: 2rem;
}
.hero-cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-visual {
  position: relative;
  aspect-ratio: 1/1;
  max-width: 440px;
  justify-self: end;
}
@media (max-width: 900px) {
  .hero-visual { justify-self: start; max-width: 320px; }
}

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats-strip {
  background: var(--navy-primary);
  color: var(--white);
  padding: 3rem 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}
.stat {
  border-left: 2px solid var(--teal-accent);
  padding-left: 1.25rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  color: var(--white);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.875rem;
  color: var(--teal-accent);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s var(--ease-out);
}
.card:hover {
  border-color: var(--teal-accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(27, 45, 79, 0.1);
}
.card h3 { margin-bottom: 0.75rem; color: var(--navy-primary); }
.card p { color: var(--gray-700); }

/* ============================================================
   FEATURE GRID
   ============================================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  padding: 2rem;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
  transition: all 0.3s var(--ease-out);
}
.feature-card:hover {
  border-color: var(--teal-primary);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -16px rgba(27, 45, 79, 0.12);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 {
  font-size: 1.1875rem;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--gray-700);
  font-size: 0.9375rem;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-wrap {
  max-width: 560px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-group {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
  letter-spacing: 0.02em;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.9375rem;
  transition: all 0.2s var(--ease-out);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--teal-primary);
  box-shadow: 0 0 0 3px rgba(26, 122, 110, 0.15);
}
.form-textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.form-hint { font-size: 0.8125rem; color: var(--gray-600); margin-top: 0.5rem; }
.form-message {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}
.form-message.success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.form-message.error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* Honeypot field (hidden from users) */
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* ============================================================
   PAGE HEADER (non-home pages)
   ============================================================ */
.page-header {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  background: linear-gradient(180deg, var(--teal-wash) 0%, rgba(224, 242, 239, 0) 100%);
}
.page-header .eyebrow { margin-bottom: 1rem; }
.page-header h1 { max-width: 20ch; margin-bottom: 1rem; }
.page-header p { font-size: 1.0625rem; color: var(--gray-700); max-width: 60ch; }

/* ============================================================
   BLOG
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}
.post-card {
  display: block;
  padding: 2rem;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
  transition: all 0.3s var(--ease-out);
  color: inherit;
}
.post-card:hover {
  border-color: var(--teal-primary);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -16px rgba(27, 45, 79, 0.12);
  color: inherit;
}
.post-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}
.post-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--navy-primary);
}
.post-card p {
  color: var(--gray-700);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.post-readmore {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--teal-primary);
}

/* Single post */
.post-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 0;
}
.post-article h1 { margin-bottom: 0.5rem; font-size: clamp(2rem, 4vw, 2.75rem); }
.post-article .post-meta { margin-bottom: 2rem; }
.post-article h2 { margin: 2.5rem 0 1rem; font-size: 1.5rem; }
.post-article h3 { margin: 2rem 0 0.75rem; font-size: 1.25rem; }
.post-article p { margin-bottom: 1.25rem; color: var(--gray-700); font-size: 1.0625rem; line-height: 1.7; }
.post-article ul, .post-article ol { margin: 0 0 1.25rem 1.5rem; color: var(--gray-700); }
.post-article li { margin-bottom: 0.5rem; }
.post-article blockquote {
  border-left: 3px solid var(--teal-primary);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--gray-700);
}
.post-article code {
  font-family: var(--font-mono);
  background: var(--gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875em;
}
.post-article a { color: var(--teal-primary); text-decoration: underline; }

/* ============================================================
   MEMBERS / AUTH
   ============================================================ */
.auth-shell {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem var(--container-pad);
  background: linear-gradient(180deg, #FAFCFB 0%, var(--white) 100%);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  padding: 2.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: 0 20px 40px -20px rgba(27, 45, 79, 0.1);
  text-align: center;
}
.auth-card h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.auth-card p { color: var(--gray-700); margin-bottom: 1.75rem; font-size: 0.9375rem; }
.auth-card .btn { width: 100%; justify-content: center; }
.auth-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0;
  color: var(--gray-400);
  font-size: 0.8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Members dashboard */
.members-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}
.members-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.members-user .user-info {
  font-size: 0.9375rem;
  color: var(--gray-700);
}
.members-user .user-info strong {
  color: var(--navy-primary);
  font-weight: 600;
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.resource-item {
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--white);
}
.resource-item .resource-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--teal-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.resource-item h4 { font-size: 1rem; margin-bottom: 0.375rem; }
.resource-item p { font-size: 0.875rem; color: var(--gray-600); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--navy-primary);
  color: var(--gray-100);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand .brand {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.footer-brand .brand .ready { color: var(--white); }
.footer-brand p {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.75);
  max-width: 32ch;
  line-height: 1.6;
}
.footer h4 {
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.125rem;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.625rem; }
.footer ul a {
  color: rgba(255,255,255,0.75);
  font-size: 0.9375rem;
  transition: color 0.2s;
}
.footer ul a:hover { color: var(--teal-accent); }
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.55);
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.text-center { text-align: center; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }

/* Animated reveal */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }
