/* Margo brand layer: tokens, the public header and footer, and the landing page.
   Every class is prefixed mg- so nothing here touches the rest of the app. */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --mg-forest: #1D3933;
  --mg-forest-deep: #173931;
  --mg-ivory: #F3F0E8;
  --mg-sage: #CFDACD;
  --mg-sage-soft: #E3E9DF;
  --mg-white: #FFFFFF;
  --mg-text: #1D3933;
  --mg-text-soft: rgba(29, 57, 51, .74);
  --mg-text-faint: rgba(29, 57, 51, .58);
  --mg-border: rgba(29, 57, 51, .16);
  --mg-border-soft: rgba(29, 57, 51, .09);
  --mg-radius-sm: 10px;
  --mg-radius-card: 20px;
  --mg-radius-pill: 999px;
  --mg-container: 1200px;
  --mg-font: 'Manrope', 'Inter', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mg-shadow: 0 1px 2px rgba(29, 57, 51, .05), 0 12px 32px -12px rgba(29, 57, 51, .18);
}

/* ---------- shared pieces ---------- */

.mg-container { width: min(calc(100% - 40px), var(--mg-container)); margin-inline: auto; }

.mg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--mg-radius-pill); border: 1px solid var(--mg-forest);
  background: var(--mg-forest); color: var(--mg-ivory);
  padding: 12px 22px; font-family: var(--mg-font); font-weight: 650; font-size: 1rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.mg-btn:hover { background: #142A26; color: var(--mg-white); }
.mg-btn:focus-visible, .mg-link:focus-visible, .mg-chip:focus-visible, .mg-ask:focus-visible {
  outline: 3px solid rgba(29, 57, 51, .35); outline-offset: 3px;
}
.mg-btn--lg { padding: 16px 28px; font-size: 1.0625rem; }
.mg-btn--light { background: var(--mg-ivory); color: var(--mg-forest); border-color: var(--mg-ivory); }
.mg-btn--light:hover { background: var(--mg-white); color: var(--mg-forest); }
.mg-btn--ghost { background: transparent; color: var(--mg-ivory); border-color: rgba(243, 240, 232, .45); }
.mg-btn--ghost:hover { background: rgba(243, 240, 232, .1); color: var(--mg-white); }
.mg-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.mg-link { color: var(--mg-forest); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(29, 57, 51, .35); text-underline-offset: 3px; }
.mg-link:hover { text-decoration-color: var(--mg-forest); }

/* ---------- public header ---------- */

.mg-header { font-family: var(--mg-font); }
.mg-header--ivory { background: rgba(243, 240, 232, .9); border-bottom-color: var(--mg-border-soft); }
.mg-logo { height: 30px; width: auto; display: block; }
@media (min-width: 640px) { .mg-logo { height: 34px; } }
.mg-header .mg-nav-link { color: var(--mg-text-soft); font-weight: 600; }
.mg-header .mg-nav-link:hover { color: var(--mg-forest); }

/* ---------- footer ---------- */

.mg-footer { font-family: var(--mg-font); background: var(--mg-ivory); border-top: 1px solid var(--mg-border-soft); color: var(--mg-text-soft); }
.mg-footer a { color: var(--mg-text-soft); transition: color .15s ease; }
.mg-footer a:hover { color: var(--mg-forest); }
.mg-footer__head { color: var(--mg-forest); font-weight: 700; }
.mg-footer__legal { border-top: 1px solid var(--mg-border-soft); color: var(--mg-text-faint); font-size: .75rem; line-height: 1.6; }

/* ---------- landing page ---------- */

.mg { font-family: var(--mg-font); color: var(--mg-text); background: var(--mg-ivory); -webkit-font-smoothing: antialiased; }
:where(.mg) :where(h1, h2, h3, p, dl, dd) { margin: 0; }

.mg-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: var(--mg-radius-pill);
  background: var(--mg-sage-soft); color: var(--mg-forest);
  font-size: .8125rem; font-weight: 700; letter-spacing: .01em;
}
.mg-eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mg-forest); }

.mg-h1 { font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 750; }
.mg-h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 720; }
.mg-h3 { font-size: 1.1875rem; line-height: 1.3; letter-spacing: -.01em; font-weight: 700; }
.mg-lede { font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); line-height: 1.55; color: var(--mg-text-soft); }
.mg-body { font-size: 1rem; line-height: 1.6; color: var(--mg-text-soft); }
.mg-small { font-size: .875rem; line-height: 1.55; color: var(--mg-text-faint); }

/* hero */
.mg-hero { position: relative; overflow: hidden; }
.mg-hero__art {
  position: absolute; inset: 0; pointer-events: none;
  background: url('../img/margo/hero-light.jpg') right bottom / cover no-repeat;
  opacity: .28;
}
@media (min-width: 1024px) { .mg-hero__art { opacity: 1; } }
.mg-hero__inner { position: relative; padding: 56px 0 72px; }
@media (min-width: 768px) { .mg-hero__inner { padding: 96px 0 128px; } }
.mg-hero__copy { max-width: 660px; }
.mg-hero__copy > * + * { margin-top: 24px; }
.mg-hero__copy .mg-lede { max-width: 560px; }

/* the prompt box: one big button that reads like a chat box */
.mg-ask {
  display: flex; align-items: center; gap: 14px; width: 100%; max-width: 580px; min-height: 68px;
  padding: 10px 10px 10px 22px; border-radius: 22px;
  background: var(--mg-white); border: 1px solid var(--mg-border); box-shadow: var(--mg-shadow);
  color: var(--mg-text); text-decoration: none; text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mg-ask:hover { border-color: rgba(29, 57, 51, .4); transform: translateY(-1px); }
.mg-ask__text { flex: 1; min-width: 0; font-size: 1.0625rem; font-weight: 550; color: var(--mg-text-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mg-ask__caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 2px; vertical-align: -0.18em; background: var(--mg-forest); animation: mg-blink 1.1s steps(1) infinite; }
.mg-ask__go { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: var(--mg-forest); color: var(--mg-ivory); display: inline-flex; align-items: center; justify-content: center; }
.mg-ask__go svg { width: 20px; height: 20px; }
@keyframes mg-blink { 50% { opacity: 0; } }

.mg-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 600px; }
.mg-chip {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: var(--mg-radius-pill);
  background: rgba(255, 255, 255, .7); border: 1px solid var(--mg-border);
  color: var(--mg-forest); font-size: .875rem; font-weight: 600; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
a.mg-chip:hover { background: var(--mg-white); border-color: rgba(29, 57, 51, .4); }
.mg-chip--static { background: var(--mg-white); cursor: default; }
.mg-chip--more { background: transparent; border-style: dashed; color: var(--mg-text-faint); cursor: default; }

/* sections */
.mg-section { padding: 72px 0; }
@media (min-width: 768px) { .mg-section { padding: 112px 0; } }
.mg-section--white { background: var(--mg-white); }
.mg-section--sage { background: var(--mg-sage-soft); }
.mg-section__head { max-width: 720px; }
.mg-section__head > * + * { margin-top: 16px; }
.mg-section__head--center { margin-inline: auto; text-align: center; }

/* conversation demo */
.mg-demo { display: grid; gap: 40px; align-items: center; }
@media (min-width: 1024px) { .mg-demo { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; } }
.mg-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.mg-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 1rem; line-height: 1.5; color: var(--mg-text-soft); }
.mg-points svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--mg-forest); }

.mg-chat { background: var(--mg-ivory); border: 1px solid var(--mg-border-soft); border-radius: 28px; padding: 20px; box-shadow: var(--mg-shadow); }
@media (min-width: 640px) { .mg-chat { padding: 28px; } }
.mg-chat__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--mg-border-soft); }
.mg-chat__who { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .9375rem; }
.mg-chat__avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--mg-sage); display: inline-flex; align-items: center; justify-content: center; }
.mg-chat__avatar img { width: 20px; height: auto; display: block; }
.mg-chat__tag { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mg-text-faint); }
.mg-chat__thread { display: grid; gap: 14px; }
.mg-msg { max-width: 92%; padding: 14px 16px; border-radius: 18px; font-size: .9375rem; line-height: 1.55; }
.mg-msg--you { justify-self: end; background: var(--mg-forest); color: var(--mg-ivory); border-bottom-right-radius: 6px; }
.mg-msg--margo { justify-self: start; background: var(--mg-white); border: 1px solid var(--mg-border-soft); border-bottom-left-radius: 6px; }
.mg-msg p + p, .mg-msg p + ol, .mg-msg ol + p { margin-top: 10px; }
.mg-msg ol { margin: 0; padding-left: 20px; list-style: decimal; }
.mg-msg li + li { margin-top: 6px; }
.mg-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 10px; border-radius: 8px; background: rgba(243, 240, 232, .14); font-size: .8125rem; font-weight: 600; }
.mg-file svg { width: 14px; height: 14px; }
.mg-sums { margin: 12px 0; border: 1px solid var(--mg-border-soft); border-radius: 12px; overflow: hidden; }
.mg-sums div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 12px; font-size: .875rem; }
.mg-sums div + div { border-top: 1px solid var(--mg-border-soft); }
.mg-sums dt { color: var(--mg-text-soft); }
.mg-sums dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.mg-sums .mg-sums__total { background: var(--mg-sage-soft); }
.mg-next { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-next span { padding: 7px 12px; border-radius: var(--mg-radius-pill); border: 1px solid var(--mg-border); background: var(--mg-white); font-size: .8125rem; font-weight: 600; }

/* capability tiles */
.mg-tiles { display: grid; gap: 16px; margin-top: 48px; }
@media (min-width: 640px) { .mg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .mg-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mg-tile { background: var(--mg-white); border: 1px solid var(--mg-border-soft); border-radius: var(--mg-radius-card); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.mg-section--white .mg-tile { background: var(--mg-ivory); }
.mg-tile__verb { font-size: 1.75rem; line-height: 1.1; letter-spacing: -.03em; font-weight: 750; }
.mg-tile__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--mg-sage); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.mg-tile__icon svg { width: 22px; height: 22px; color: var(--mg-forest); }

/* steps */
.mg-steps { display: grid; gap: 16px; margin-top: 48px; counter-reset: mg-step; }
@media (min-width: 900px) { .mg-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mg-step { border-top: 2px solid var(--mg-forest); padding: 24px 4px 0; display: grid; gap: 10px; align-content: start; }
.mg-step::before { counter-increment: mg-step; content: '0' counter(mg-step); font-size: .875rem; font-weight: 750; letter-spacing: .06em; color: var(--mg-text-faint); }

/* trust */
.mg-trust { display: grid; gap: 0; margin-top: 48px; border-top: 1px solid var(--mg-border); }
@media (min-width: 800px) { .mg-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; } }
.mg-trust__item { padding: 24px 0; border-bottom: 1px solid var(--mg-border); display: grid; gap: 6px; }
.mg-not { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mg-not__label { font-weight: 700; margin-right: 6px; }
.mg-not span.mg-chip { background: transparent; }

/* closing call to action */
.mg-close { position: relative; overflow: hidden; background: var(--mg-forest-deep); color: var(--mg-ivory); }
.mg-close__art { position: absolute; inset: 0; pointer-events: none; background: url('../img/margo/section-dark.jpg') right bottom / cover no-repeat; opacity: .45; }
@media (min-width: 1024px) { .mg-close__art { opacity: 1; } }
.mg-close__inner { position: relative; padding: 88px 0; max-width: 640px; }
@media (min-width: 768px) { .mg-close__inner { padding: 136px 0; } }
.mg-close__inner > * + * { margin-top: 24px; }
.mg-close .mg-lede { color: rgba(243, 240, 232, .78); }
.mg-close__actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  .mg-ask__caret { animation: none; }
  .mg-btn, .mg-ask, .mg-chip { transition: none; }
}

/* ---------- logo on sign-in, sign-up and other single-card pages ---------- */

.mg-logo-auth { width: 190px; max-width: 100%; height: auto; }
.mg-logo-auth--sm { width: 150px; }

/* ---------- landing: numbers band, founder note, letter preview ---------- */

.mg-section--forest { background: var(--mg-forest); color: var(--mg-ivory); }
.mg-section--forest .mg-h2 { max-width: 820px; }
.mg-stats { display: grid; gap: 32px; margin-top: 56px; }
@media (min-width: 800px) { .mg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; } }
.mg-stat { border-top: 1px solid rgba(243, 240, 232, .28); padding-top: 24px; }
.mg-stat__num { font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -.04em; font-weight: 750; color: var(--mg-sage); }
.mg-stat__text { margin-top: 14px; font-size: 1.0625rem; line-height: 1.5; color: rgba(243, 240, 232, .86); max-width: 320px; }
.mg-stats__source { margin-top: 40px; font-size: .8125rem; line-height: 1.5; color: rgba(243, 240, 232, .6); }

.mg-tile__verb { font-size: 1.375rem; line-height: 1.2; }

.mg-founder { margin: 0 auto; max-width: 880px; text-align: center; }
.mg-founder__eyebrow { font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mg-text-faint); }
.mg-founder__quote { margin: 20px 0 0; font-size: clamp(1.6rem, 3.6vw, 2.6rem); line-height: 1.2; letter-spacing: -.025em; font-weight: 700; }
.mg-founder__by { margin-top: 24px; font-size: 1rem; font-weight: 600; color: var(--mg-text-soft); }

.mg-letter { margin-top: 12px; padding: 14px; border: 1px solid var(--mg-border-soft); border-radius: 12px; background: var(--mg-ivory); display: grid; gap: 8px; }
.mg-letter__title { font-size: .8125rem; font-weight: 700; }
.mg-letter__line { display: block; height: 7px; border-radius: 4px; background: var(--mg-sage); }
.mg-letter__line--short { width: 58%; }
