:root {
  --bg: #f4f1e9;
  --surface: #fffdf8;
  --surface-2: #f7f4ec;
  --ink: #1f2a24;
  --ink-soft: #4a564e;
  --ink-faint: #76817a;
  --line: #e2ddd0;
  --green: #2f5d3f;
  --green-deep: #234a31;
  --green-soft: #e7efe6;
  --accent: #c2843a;
  --accent-soft: #f3e6d2;
  --danger: #9a3b2f;
  --shadow: 0 18px 40px -28px rgba(31, 42, 36, 0.55);
  --radius: 16px;
  --radius-lg: 24px;
  --maxw: 1080px;
  font-synthesis-weight: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #eef3e8 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(18px, 4vw, 40px) 64px;
}

.brand-bar {
  margin-bottom: clamp(10px, 2.4vw, 20px);
}

.brand {
  display: inline-block;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--green-deep);
  text-decoration: none;
}

.brand:hover {
  color: var(--green);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 14px;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(20px, 4vw, 40px) 0 8px;
}

.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.9rem);
  line-height: 1.04;
  margin: 0 0 18px;
}

.hero h1 .accent {
  color: var(--green);
}

.hero-text {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 28px;
}

/* ---------- Ask box ---------- */
.ask {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.ask-row {
  display: flex;
  gap: 12px;
}

.ask-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 1.04rem;
  color: var(--ink);
  font-family: inherit;
}

.ask-input::placeholder {
  color: var(--ink-faint);
}

.ask-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  background: var(--surface);
}

.ask-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.profile-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.persona-select,
.search-input {
  font-family: inherit;
}

.persona-select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.86rem;
  max-width: 230px;
}

.ask-trust {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- Buttons ---------- */
.button {
  border: none;
  border-radius: 11px;
  padding: 15px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.06s ease, background 0.15s ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--green);
  color: #fbfdf8;
}

.button-primary:hover {
  background: var(--green-deep);
}

/* ---------- Section heads ---------- */
.section-head {
  margin: 0 0 22px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 8px;
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 62ch;
}

main > section {
  margin-top: clamp(40px, 6vw, 68px);
}

/* ---------- Answer stage ---------- */
.answer-stage {
  scroll-margin-top: 20px;
}

.answer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.answer-card + .answer-card {
  margin-top: 20px;
}

.answer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.asked-q {
  flex: 1;
  min-width: 200px;
  font-weight: 600;
  color: var(--ink);
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.cluster {
  background: var(--green-soft);
  color: var(--green-deep);
}

.badge.conf-high {
  background: #dfeede;
  color: #2f6b3f;
}

.badge.conf-medium {
  background: var(--accent-soft);
  color: #94612a;
}

.badge.conf-low {
  background: #f0e3e1;
  color: var(--danger);
}

.answer-body {
  padding: 22px 24px 8px;
}

.answer-lead {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--ink);
}

.answer-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: step;
}

.answer-steps li {
  position: relative;
  padding: 12px 14px 12px 44px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
}

.answer-steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 12px;
  top: 11px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.answer-steps a {
  color: var(--green-deep);
  font-weight: 600;
}

.thinking {
  color: var(--ink-faint);
  font-style: italic;
  padding: 22px 24px;
  margin: 0;
}

.answer-error {
  padding: 22px 24px;
  margin: 0;
  color: var(--danger);
}

/* sources + next steps */
.answer-foot {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

.answer-foot > div {
  padding: 18px 24px;
}

.answer-foot > div + div {
  border-left: 1px solid var(--line);
}

.foot-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-link {
  display: block;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.94rem;
  border-left: 3px solid var(--green);
  padding: 2px 0 2px 12px;
}

.source-link:hover {
  color: var(--green-deep);
}

.source-link .src-host {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.next-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.next-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--green-deep);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.next-chip::after {
  content: " →";
  color: var(--accent);
}

.next-chip:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

.follow-note {
  padding: 0 24px 20px;
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-faint);
}

/* ---------- Journeys ---------- */
.journey-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.journey-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.journey-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--green);
}

.journey-card h3 {
  font-size: 1.22rem;
  margin: 12px 0 6px;
}

.journey-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--green-soft);
  color: var(--green);
}

.journey-icon svg {
  width: 22px;
  height: 22px;
}

.journey-card p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.journey-qs {
  display: grid;
  gap: 4px;
}

.journey-q {
  appearance: none;
  border: none;
  background: none;
  padding: 6px 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--green-deep);
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.12s ease;
}

.journey-q:hover {
  color: var(--accent);
}

.journey-q::before {
  content: "\203A";
  color: var(--accent);
  margin-right: 8px;
  font-weight: 700;
}

/* ---------- Why ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.why-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.why-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-family: Georgia, serif;
  margin-bottom: 12px;
}

.why-card h3 {
  font-size: 1.05rem;
  margin: 0 0 6px;
}

.why-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.why-stat {
  margin: 20px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.why-stat strong {
  color: var(--green-deep);
}

/* ---------- Library ---------- */
.library-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 32px);
}

.search-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--ink);
}

.search-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.results-meta {
  font-size: 0.84rem;
  color: var(--ink-faint);
  margin: 14px 0 16px;
}

.guidance-results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.guidance-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--surface-2);
}

.guidance-card h3 {
  font-family: inherit;
  font-size: 0.98rem;
  margin: 0 0 8px;
  line-height: 1.35;
}

.guidance-card .source-link {
  border: none;
  padding: 0;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--green-deep);
  word-break: break-word;
}

.guidance-meta {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-faint);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
  max-width: 80ch;
}

.site-footer p.ogl-line {
  margin-top: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .ask-row {
    flex-direction: column;
  }
  .button-primary {
    width: 100%;
  }
  .answer-foot {
    grid-template-columns: 1fr;
  }
  .answer-foot > div + div {
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .journey-grid,
  .why-grid,
  .guidance-results {
    grid-template-columns: 1fr;
  }
}
