/* Sharp Mind After 50 — corewellguide.com
   Palette: calm deep blue/teal + warm orange. Large, readable type for adults 50–70. */

:root {
  --navy: #123a5a;
  --navy-deep: #0c2c45;
  --teal: #1f7a7a;
  --teal-dark: #186363;
  --teal-light: #e3f1ef;
  --teal-mid: #c5e2df;
  --sand: #fbf6ee;
  --sand-2: #f3ead9;
  --accent: #e08a3c;
  --accent-dark: #b85c12; /* 4.5:1 on white */
  --peach: #f3c89c;
  --ink: #25323b;
  --muted: #4a5c68;
  --line: #d4e0de;
  --white: #fff;
  --focus: #b85c12;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(18, 58, 90, 0.10);
  --font-serif: "Noto Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --font-sans: "Source Sans 3", "Segoe UI", Calibri, system-ui, sans-serif;
  --content: 44rem;
  --wrap: 70rem;
}

@font-face {
  font-family: "Noto Serif";
  src: url("/fonts/noto-serif.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/fonts/noto-serif-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.1875rem; /* 19px */
  line-height: 1.7;
  color: var(--ink);
  background: var(--sand);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  body { font-size: 1.25rem; } /* 20px */
}

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--navy);
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.95rem); margin-top: 1.8em; }
h3 { font-size: 1.25rem; color: var(--teal-dark); margin-top: 1.4em; }
p { margin: 0 0 1em; }
a { color: var(--teal-dark); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { color: var(--navy); }
strong { font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 0; color: #fff; }

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}
.wrap-narrow { width: min(100% - 2rem, var(--content)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.7rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--navy);
  min-width: 0;
}
.logo:hover { color: var(--navy); }
.logo-mark {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
}
.logo-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  display: block;
}
.logo-tag {
  display: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.3;
}
@media (min-width: 900px) {
  .logo-tag { display: block; }
  .logo-name { font-size: 1.25rem; }
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.site-nav a {
  display: inline-block;
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  min-height: 2.75rem;
  line-height: 1.65rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--teal-light);
  color: var(--teal-dark);
}
.site-nav a.nav-cta {
  background: var(--accent-dark);
  color: #fff;
  margin-left: 0.25rem;
}
.site-nav a.nav-cta:hover,
.site-nav a.nav-cta[aria-current="page"] {
  background: #9e4d0d;
  color: #fff;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  min-height: 3rem;
  text-align: center;
}
.btn:focus-visible { outline-offset: 3px; }
.btn-accent {
  background: var(--accent-dark);
  color: #fff !important;
}
.btn-accent:hover { background: #9e4d0d; color: #fff !important; }
.btn-teal {
  background: var(--teal);
  color: #fff !important;
}
.btn-teal:hover { background: var(--teal-dark); color: #fff !important; }
.btn-lg { font-size: 1.25rem; padding: 0.95rem 1.85rem; min-height: 3.4rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0f3352 0%, #15506b 55%, #1f7a7a 100%);
  color: #fff;
  padding: 2.75rem 0 3.25rem;
}
.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 3rem; }
}
.hero .kicker {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--peach);
  margin: 0 0 0.75rem;
}
.hero h1 {
  color: #fff;
  margin: 0 0 0.6em;
}
.hero .lead {
  font-size: 1.2rem;
  color: #dcefee;
  max-width: 36rem;
  margin-bottom: 1.25rem;
}
.hero-art {
  position: absolute;
  right: -6rem;
  bottom: -7rem;
  width: 26rem;
  opacity: 0.55;
  pointer-events: none;
}
@media (max-width: 859px) { .hero-art { display: none; } }

.signup-card {
  background: var(--white);
  color: var(--ink);
  border-radius: 18px;
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}
.signup-card h2 {
  font-size: 1.45rem;
  margin: 0 0 0.35em;
}
.signup-card .card-lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

/* ---------- Signup form ---------- */
.signup-form .signup-fields {
  display: grid;
  gap: 0.75rem;
}
.signup-form .field { margin: 0; }
.signup-form label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.signup-form input[type="text"],
.signup-form input[type="email"] {
  width: 100%;
  font-family: inherit;
  font-size: 1.125rem;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  min-height: 3rem;
}
.signup-form input:focus {
  border-color: var(--teal);
  outline: 3px solid var(--peach);
  outline-offset: 0;
}
.signup-form .field-submit { margin-top: 0.25rem; }
.signup-form .field-submit .btn { width: 100%; }
.signup-note {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Trust / bullets ---------- */
.bullets {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
}
.bullets li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.65rem;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 1.2rem;
  height: 1.2rem;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5 6.2 12 13 4'/%3E%3C/svg%3E") center / 0.85rem no-repeat;
  border-radius: 50%;
}

.section { padding: 3rem 0; }
.section-sand { background: var(--sand); }
.section-white { background: #fff; }
.section-teal { background: var(--teal-light); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.section-head h2 { margin: 0; }
.section-kicker {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--accent-dark);
  margin: 0 0 0.4rem;
}

/* ---------- Post cards ---------- */
.post-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .post-grid { grid-template-columns: 1fr 1fr; }
}
.post-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(18, 58, 90, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}
.post-card .meta {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.post-card h3 {
  margin: 0 0 0.45em;
  font-size: 1.3rem;
  color: var(--navy);
}
.post-card .excerpt {
  color: var(--ink);
  flex: 1;
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}
.post-card .more {
  font-weight: 700;
  color: var(--teal-dark);
}

.band {
  background: var(--navy);
  color: #fff;
  padding: 2.75rem 0;
  text-align: center;
}
.band h2 { color: #fff; margin-bottom: 0.4em; }
.band p { color: #dcefee; max-width: 36rem; margin: 0 auto 1.25rem; }

/* ---------- Articles ---------- */
main { flex: 1; }
.page-hero {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 2.2rem 0 1.8rem;
}
.page-hero .crumbs {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.page-hero .crumbs a { color: var(--teal-dark); text-decoration: none; }
.page-hero .crumbs a:hover { text-decoration: underline; }
.article-meta {
  color: var(--muted);
  font-size: 1rem;
  margin: 0.3rem 0 0;
}

article.article { padding: 2.2rem 0 3.5rem; }
.article-body { width: min(100% - 2rem, var(--content)); margin-inline: auto; }
.article-body > h1:first-child { display: none; } /* title lives in page-hero */

.article-body blockquote.disclosure,
.article-body > blockquote:first-of-type {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--sand);
  border-left: 5px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-size: 1.05rem;
  color: var(--ink);
}
.article-body blockquote p { margin: 0; }

.cta-box {
  background: var(--teal-light);
  border: 1px solid var(--teal-mid);
  border-radius: 16px;
  padding: 1.4rem 1.5rem 1.3rem;
  margin: 2rem 0;
  text-align: center;
}
.cta-box .cta-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--navy);
  margin: 0 0 0.4em;
}
.cta-box p { margin: 0 0 0.8em; }
.cta-box p:last-child { margin-bottom: 0; }
.cta-button,
a.cta-button {
  display: inline-block;
  background: var(--accent-dark);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  min-height: 3rem;
  line-height: 1.5rem;
}
.cta-button:hover,
a.cta-button:hover { background: #9e4d0d; color: #fff !important; }
.cta-box.cta-guide { background: var(--sand); border-color: var(--sand-2); }

.article-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2rem 0 1.6rem;
  font-size: 1.05rem;
  overflow-x: auto;
  display: block;
}
.article-body th, .article-body td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.article-body th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}
.article-body tr:nth-child(even) td { background: #f2f8f7; }

.article-body ul, .article-body ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
.article-body li { margin-bottom: 0.35rem; }

.article-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4rem 0 1.4rem;
}

.article-body h2:last-of-type { /* Sources often last h2 — just keep spacing */ }

.sources, .article-body h2 + ul:last-of-type a {
  overflow-wrap: anywhere;
}
.article-body ul li a[href^="http"] {
  font-size: 0.98em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.medical-disclaimer {
  margin: 2rem 0 0;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.55;
}
.article-body hr + p:has(> em) {
  margin: 2rem 0 0;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.55;
}
.article-body hr + p:has(> em) em { font-style: normal; color: var(--muted); }
.medical-disclaimer p { margin: 0; }

.related {
  padding: 0 0 3rem;
}
.related h2 { margin-top: 0; }

/* ---------- Landing / legal / thank-you ---------- */
.landing { padding: 2.5rem 0 3.5rem; }
.landing-card {
  background: #fff;
  border-radius: 20px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
@media (min-width: 640px) {
  .landing-card { padding: 2.4rem 2.4rem; }
}
.landing-card h1 { margin-bottom: 0.4em; }
.landing-card .subhead {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 1.3rem;
}
.whats-inside {
  margin: 2rem 0 0;
}
.habit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.habit-list li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: var(--teal-light);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.habit-num {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.thank-you {
  text-align: center;
  padding: 3.5rem 0 4rem;
}
.thank-you h1 { margin-bottom: 0.4em; }
.thank-you .lead { font-size: 1.2rem; color: var(--muted); max-width: 32rem; margin: 0 auto 1.6rem; }
.checkmark {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.prose { padding: 2.2rem 0 3.5rem; }
.prose .wrap-narrow h2:first-of-type { margin-top: 0.4em; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: #c9dde0;
  padding: 2.6rem 0 1.4rem;
  margin-top: auto;
  font-size: 1.05rem;
}
.footer-grid {
  display: grid;
  gap: 1.8rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-footer .logo-name { color: #fff; }
.site-footer .logo { color: #fff; margin-bottom: 0.6rem; }
.site-footer .tagline { color: #b9d6d6; margin: 0 0 0.6rem; }
.site-footer .fine { color: #9cb8bc; font-size: 0.95rem; margin: 0; }
.site-footer h2 {
  color: #f3c89c;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0.3rem 0 0.7rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: #e8f4f3; text-decoration: none; }
.site-footer a:hover { color: var(--peach); text-decoration: underline; }
.site-footer .logo-tag { display: none; }
.footer-bottom {
  padding-top: 1.1rem;
  color: #9cb8bc;
  font-size: 0.95rem;
}

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 4rem 0; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-card { transition: none; }
}

@media print {
  .site-header, .site-footer, .signup-card, .cta-box, .band, .skip-link, .related { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  a { color: inherit; }
  .hero { background: none; color: #000; }
  .hero h1 { color: #000; }
}
