:root {
  --ink: #17233f;
  --muted: #5b6680;
  --brand: #5842a8;
  --brand-dark: #3d2d7b;
  --accent: #c9db48;
  --cream: #f7f5ef;
  --white: #ffffff;
  --line: #e4e2eb;
  --danger: #a92f45;
  --shadow: 0 18px 50px rgba(31, 29, 65, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: var(--brand); }
img { max-width: 100%; height: auto; }
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--ink);
  color: white;
}
.skip-link:focus { left: .75rem; top: .75rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(88, 66, 168, .12);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.nav-wrap {
  width: min(1160px, calc(100% - 2rem));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 850;
  letter-spacing: -.03em;
  text-decoration: none;
}
.brand span { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.nav-links a { color: var(--ink); font-size: .95rem; font-weight: 650; text-decoration: none; }
.nav-links a:hover { color: var(--brand); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .72rem 1.15rem;
  border: 1px solid var(--brand);
  border-radius: 999px;
  color: white;
  background: var(--brand);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--brand-dark); }
.button.secondary { color: var(--brand); background: white; }
.button.ghost { border-color: var(--line); color: var(--ink); background: transparent; }

.hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 20%, rgba(201,219,72,.34), transparent 30%),
    radial-gradient(circle at 88% 15%, rgba(130,111,211,.26), transparent 32%),
    linear-gradient(150deg, #ffffff, #f1eefb);
}
.hero-grid {
  width: min(1160px, calc(100% - 2rem));
  margin: auto;
  padding: 5rem 0 4.5rem;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  align-items: center;
  gap: 3.5rem;
}
.eyebrow {
  margin: 0 0 .8rem;
  color: var(--brand);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero h1, .page-hero h1 {
  margin: 0;
  max-width: 800px;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}
.hero .lede { max-width: 680px; color: var(--muted); font-size: 1.18rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-card {
  padding: 2rem;
  border: 1px solid rgba(88, 66, 168, .16);
  border-radius: 26px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
.hero-card strong { display: block; font-size: 2.7rem; line-height: 1; color: var(--brand); }
.hero-card p { color: var(--muted); }

.page-hero {
  padding: 4.5rem 0 2.2rem;
  background: linear-gradient(145deg, #fff, #f1eefb);
}
.page-hero .inner, .content-shell, .section-inner {
  width: min(1040px, calc(100% - 2rem));
  margin: auto;
}
.page-hero h1 { font-size: clamp(2.1rem, 4vw, 3.7rem); }
.page-hero p { max-width: 700px; color: var(--muted); }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 680;
}
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb + .eyebrow { margin-bottom: .45rem; }

.section { padding: 4rem 0; }
.section.white { background: white; }
.section h2 { margin-top: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.035em; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 8px 30px rgba(31,29,65,.05);
}
.card h3 { margin: 0 0 .5rem; }
.card p { color: var(--muted); }
.price { font-size: 2.4rem; font-weight: 850; letter-spacing: -.04em; color: var(--brand); }

.content-shell {
  margin-top: 2rem;
  margin-bottom: 4rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow);
}
.legacy-content > :first-child { margin-top: 0; }
.legacy-content h1, .legacy-content h2, .legacy-content h3 { line-height: 1.18; letter-spacing: -.025em; }
.legacy-content table { width: 100%; border-collapse: collapse; }
.legacy-content th, .legacy-content td { padding: .7rem; border: 1px solid var(--line); text-align: left; }
.legacy-content [style*="width"] { max-width: 100% !important; }
.legacy-content [style*="float"] { float: none !important; }
.legacy-content p, .legacy-content li { overflow-wrap: anywhere; }

.auth-wrap { width: min(520px, calc(100% - 2rem)); margin: 4rem auto; }
.auth-card { padding: 2rem; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { margin-top: 0; }
label { display: block; margin: 1rem 0 .35rem; font-weight: 750; }
input {
  width: 100%;
  min-height: 48px;
  padding: .75rem .9rem;
  border: 1px solid #c9c6d5;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}
input:focus { outline: 3px solid rgba(88,66,168,.18); border-color: var(--brand); }
.form-actions { margin-top: 1.25rem; }
.notice { padding: .9rem 1rem; border-radius: 12px; background: #f1eefb; }
.notice.error { color: var(--danger); background: #fff0f3; }
.muted { color: var(--muted); }

.member-bar {
  padding: 1rem 0;
  background: var(--ink);
  color: white;
}
.member-bar .inner { width: min(1040px, calc(100% - 2rem)); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.member-bar form { margin: 0; }
.member-bar .button { min-height: 38px; padding: .5rem .9rem; border-color: rgba(255,255,255,.35); background: transparent; }

.library-section { padding-top: 2rem; }
.library-section .section-inner { width: min(1160px, calc(100% - 2rem)); }
.library-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.2fr);
  align-items: end;
  gap: 2rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 30px rgba(31,29,65,.05);
}
.library-toolbar label { margin: 0; font-size: 1.1rem; }
.library-toolbar p { margin: .2rem 0 0; }
.category-jump { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.2rem 0 2rem; }
.category-jump a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .48rem .75rem;
  border: 1px solid #d9d4eb;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #f7f5fd;
  font-size: .88rem;
  font-weight: 750;
  text-decoration: none;
}
.category-jump a:hover { border-color: var(--brand); background: white; }
.category-jump span {
  min-width: 1.45rem;
  padding: .05rem .35rem;
  border-radius: 999px;
  color: white;
  background: var(--brand);
  font-size: .72rem;
  text-align: center;
}
.goal-groups { display: grid; gap: 1.4rem; }
.goal-group {
  scroll-margin-top: 110px;
  padding: clamp(1.1rem, 3vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 8px 30px rgba(31,29,65,.04);
}
.goal-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.goal-group-header .eyebrow { margin-bottom: .25rem; }
.goal-group-header h2 { margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
.goal-group-header p:not(.eyebrow) { max-width: 720px; margin: .3rem 0 0; color: var(--muted); }
.goal-count {
  flex: 0 0 auto;
  padding: .38rem .65rem;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #ebe7f8;
  font-size: .78rem;
  font-weight: 800;
}
.goal-subgroups { display: grid; gap: 1rem; margin-top: 1rem; }
.goal-subgroup {
  padding: 1rem;
  border: 1px solid #ddd8ee;
  border-left: 4px solid var(--brand);
  border-radius: 14px;
  background: #f8f7fc;
}
.goal-subgroup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}
.goal-subgroup-header h3 { margin: 0; font-size: 1.12rem; }
.goal-subgroup-header span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.goal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.goal-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: white;
  font-weight: 720;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.goal-link span:last-child { color: var(--brand); font-size: 1.1rem; }
.goal-link:hover {
  border-color: rgba(88,66,168,.55);
  color: var(--brand);
  box-shadow: 0 7px 20px rgba(31,29,65,.08);
  transform: translateY(-1px);
}

.goal-content-shell {
  width: min(1160px, calc(100% - 2rem));
  padding: clamp(1rem, 3vw, 2rem);
}
.goal-collection-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 440px);
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: .4rem .3rem 1.35rem;
  border-bottom: 1px solid var(--line);
}
.goal-collection-toolbar .eyebrow { margin-bottom: .2rem; }
.goal-total { margin: 0; color: var(--muted); font-weight: 700; }
.goal-search label { margin: 0 0 .35rem; font-size: .9rem; }
.goal-list-content > :first-child { margin-top: 0; }
.goal-list-content > :last-child { margin-bottom: 0; }
.goal-list-content > div:empty,
.goal-list-content > span:empty,
.goal-list-content p:empty { display: none; }
.goal-items {
  display: grid;
  gap: .8rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: goal-item;
}
.goal-items > li {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 1.05rem 1.15rem 1.05rem 4.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(31,29,65,.035);
  line-height: 1.58;
  overflow-wrap: anywhere;
  counter-increment: goal-item;
}
.goal-items > li::before {
  content: counter(goal-item);
  position: absolute;
  top: .95rem;
  left: 1rem;
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  color: var(--brand-dark);
  background: #ebe7f8;
  font-size: .78rem;
  font-weight: 850;
}
.goal-items > li:hover { border-color: #cfc8e8; background: #fdfcff; }
.goal-items > li p:first-child { margin-top: 0; }
.goal-items > li p:last-child { margin-bottom: 0; }
.goal-items > li[hidden] { display: none; }
.goal-items [style] {
  color: inherit !important;
  background: transparent !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.site-footer { padding: 2.5rem 0; color: #d8dcef; background: var(--ink); }
.site-footer .inner { width: min(1040px, calc(100% - 2rem)); margin: auto; }
.site-footer a { color: white; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 3.5rem; }
  .cards { grid-template-columns: 1fr; }
  .nav-links a:not(.button) { display: none; }
  .library-toolbar, .goal-collection-toolbar { grid-template-columns: 1fr; gap: 1rem; }
  .goal-list { grid-template-columns: 1fr; }
  .goal-group-header { display: block; }
  .goal-count { display: inline-block; margin-top: .75rem; }
}

@media (max-width: 520px) {
  .page-hero { padding-top: 3rem; }
  .content-shell { border-radius: 18px; }
  .goal-content-shell { width: min(100% - 1rem, 1160px); padding: .7rem; }
  .goal-collection-toolbar { padding: .65rem .45rem 1rem; }
  .goal-items { gap: .6rem; }
  .goal-items > li { padding: .9rem .9rem .9rem 3.5rem; font-size: .96rem; }
  .goal-items > li::before { top: .8rem; left: .75rem; width: 1.95rem; height: 1.95rem; }
  .category-jump { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; }
  .category-jump a { flex: 0 0 auto; }
  .member-bar .inner { align-items: flex-start; }
}
