:root {
  --primary: #3420bc;
  --primary-hover: #27168d;
  --bg: #f4effb;
  --surface: #fffdf7;
  --text: #1c1640;
  --muted: #4f416e;
  --border: #dbd2eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 1rem;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  z-index: 100;
}
.skip-link:focus { top: 0; }

.shell {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 2px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.site-nav {
  display: flex;
  gap: 0.85rem 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav > a,
.nav-dropdown > summary {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.site-nav > a:hover,
.nav-dropdown > summary:hover { color: var(--primary); }
.nav-dropdown {
  position: relative;
}
.nav-dropdown > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after {
  content: "▾";
  font-size: 0.7em;
  opacity: 0.75;
}
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  z-index: 40;
  min-width: 13.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(28, 22, 64, 0.18);
}
.nav-dropdown-panel a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
}
.nav-dropdown-panel a:hover,
.nav-dropdown-panel a:focus-visible {
  background: #efe8ff;
  color: var(--primary);
}
@media (max-width: 640px) {
  .site-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .nav-dropdown-panel {
    position: fixed;
    left: 1rem;
    right: 1rem;
    width: auto;
    min-width: 0;
  }
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  text-align: left;
}

.prose { max-width: 650px; margin: 0 auto; }
.page-atmosphere { margin: 0 0 1.25rem; border-radius: 14px; overflow: hidden; border: 2px solid var(--border); box-shadow: 4px 4px 0 var(--text); }
.page-atmosphere img { display: block; width: 100%; height: auto; object-fit: cover; max-height: 220px; }
.prose h1 { font-size: 2rem; margin-bottom: 1.5rem; }
article.prose h2 { font-size: 1.5rem; margin: 2rem 0 1rem; padding-top: 1.5rem; border-top: 2px solid var(--border); }
article.prose h2:first-of-type { border-top: 0; padding-top: 0; }
article.prose h3 { font-size: 1.05rem; margin: 1.5rem 0 .35rem; }
article.prose h3 + p { margin-bottom: 0; padding-bottom: .9rem; border-bottom: 1px dashed var(--border); }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.prose p { margin-bottom: 1rem; color: var(--text); }
.prose a { color: var(--primary); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.prose a:hover { color: var(--primary-hover); }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9375rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
.prose th { background: var(--surface); }

.habit-pulse {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.habit-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}
.habit-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-weight: 500;
}
.habit-checklist input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.habit-pulse-note {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 0;
}

.crumbs { margin-bottom: 1rem; font-size: 0.875rem; color: var(--muted); }
.crumbs a { color: var(--primary); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }

footer { text-align: center; padding: 2rem 0; border-top: 2px solid var(--border); color: var(--muted); font-size: 0.875rem; }
.footer-nav { margin-top: 1rem; display: flex; justify-content: center; gap: 0.85rem 1.25rem; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { color: var(--primary); }
.related-paths {
  margin: 2rem 0 0;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
}
.related-paths h2 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  border: 0;
  padding: 0;
}
.related-paths p { margin-bottom: 0.65rem; }
.related-paths ul {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 0.35rem;
}


/* Landing pages: Mental Age / Generation */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(13rem, 0.9fr);
  gap: 1.5rem 1.75rem;
  align-items: start;
  background: linear-gradient(145deg, #fffdf7 0%, #efe8ff 55%, #f7f1e8 100%);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 1.75rem 1.85rem;
  box-shadow: 5px 5px 0 var(--text);
}
.landing-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-width: 0;
  padding-top: 0.15rem;
}
.landing-hero .eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}
.landing-hero h1 {
  font-size: clamp(1.85rem, 1.2vw + 1.45rem, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: none;
}
.landing-lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  max-width: 34rem;
}
.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.15rem;
}
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--text);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface); }
.landing-trust {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}
.landing-hero-visual {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 rgba(28, 22, 64, 0.25);
  aspect-ratio: 5 / 4;
  max-height: 260px;
  width: 100%;
  background: #ddd6f0;
}
.landing-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.landing-body > h2:first-of-type { margin-top: 0.5rem; }
.landing-sticky-cta {
  position: sticky;
  bottom: 0.75rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: rgba(255, 253, 247, 0.96);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(28, 22, 64, 0.12);
  backdrop-filter: blur(8px);
}
.landing-sticky-cta p {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  flex: 1 1 12rem;
}
.habit-pulse[data-ikya-pulse] {
  position: relative;
}
.pulse-summary {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #efe8ff;
  border: 1px dashed var(--border);
  font-weight: 600;
  color: var(--text);
}
.pulse-summary[data-state="ready"] {
  background: #e4f7ea;
  border-style: solid;
  border-color: #8fcea3;
}
.pulse-summary .pulse-cta-inline {
  display: inline-block;
  margin-top: 0.55rem;
}
.habit-checklist label.is-checked {
  color: var(--primary);
}
@media (max-width: 860px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding: 1.35rem 1.25rem;
    gap: 1.15rem;
  }
  .landing-hero-visual {
    order: -1;
    max-height: 190px;
    aspect-ratio: 16 / 9;
  }
  .landing-hero h1 {
    font-size: clamp(1.7rem, 6.2vw, 2.1rem);
  }
  .landing-sticky-cta { bottom: 0.5rem; }
}
@media (max-width: 480px) {
  .landing-hero .eyebrow { letter-spacing: 0.05em; }
  .landing-cta-row .btn-primary,
  .landing-cta-row .btn-ghost { width: 100%; }
}
