:root {
  color-scheme: light;
  --bg: #f7f2ef;
  --panel: #fffdfb;
  --text: #302126;
  --muted: #76636b;
  --primary: #762c43;
  --primary-dark: #531d30;
  --line: #e9dcda;
  --soft: #f5eae9;
  --gold: #ead5ad;
  --ok: #236b50;
  --danger: #aa3043;
  --shadow: 0 16px 48px rgba(73, 30, 43, .06);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 95% 0, #ead6d8 0, transparent 42%),
    radial-gradient(ellipse at 0 40%, #f0e4d3 0, transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }

:focus-visible {
  outline: 3px solid #bc8758;
  outline-offset: 4px;
}

[hidden] { display: none !important; }

.shell {
  width: min(1160px, 100%);
  margin-inline: auto;
  padding: 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 12px;
  background: white;
}
.skip:focus { top: 16px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: var(--gold);
  background: linear-gradient(145deg, #89374f, #491a2c);
  font: italic 30px Georgia, serif;
  box-shadow: 0 8px 20px #762c431f;
}

.brand-name {
  display: block;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.5px;
}
.brand-sub {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  transition: background .15s, box-shadow .15s;
}

.btn.primary {
  background: linear-gradient(135deg, #85324c, #612139);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px #762c4326;
}

.btn.light {
  background: #f4e5cf;
  color: #4d2631;
  border-color: transparent;
}

.btn.ghost { background: transparent; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 750;
  color: var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  background: #fff8;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 36px;
  align-items: center;
  padding: 46px 0 42px;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.15; }

h1 {
  margin-bottom: 24px;
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 750;
  letter-spacing: -.045em;
}

h1 em {
  font-family: Georgia, serif;
  font-weight: 400;
  color: var(--primary);
}

h2 {
  font-size: clamp(27px, 3.3vw, 38px);
  letter-spacing: -.035em;
  margin-bottom: 16px;
}
h3 {
  font-size: 19px;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.lead { font-size: 18px; color: var(--muted); max-width: 680px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { font-size: 12px; color: var(--muted); }
.hero-note { margin: 15px 0 0; font-size: 13px; color: var(--muted); }

.hero-visual {
  position: relative;
  border-radius: 30px;
  background: linear-gradient(155deg, #8a3b53 0, #4a1c30 75%);
  color: white;
  padding: 30px;
  box-shadow: 0 30px 60px #58233724;
  overflow: hidden;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -125px;
  top: -115px;
  border: 1px solid #ead5ad40;
  border-radius: 50%;
  box-shadow: 0 0 0 35px #ead5ad08, 0 0 0 70px #ead5ad06;
  pointer-events: none;
}

.visual-head { position: relative; display: flex; gap: 12px; align-items: center; }
.visual-head .brand-mark { background: #ffffff12; box-shadow: none; }
.visual-head p { margin: 0; }
.visual-sub { color: #ebcdd5; font-size: 12px; }
.visual-label { color: #e6c7cf; font-size: 12px; margin: 25px 0 12px; }

.prompt {
  position: relative;
  padding: 16px;
  border: 1px solid #ffffff24;
  border-radius: 17px;
  background: #ffffff0e;
  margin-bottom: 12px;
  font-size: 15px;
}
.prompt:nth-of-type(even) { margin-left: 22px; }
.prompt span { display: block; color: var(--gold); font-size: 11px; margin-bottom: 6px; }
.prompt p { margin: 0; }
.visual-bottom { color: #e6c7cf; font-size: 12px; margin: 22px 0 0; }

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffaf7c9;
  overflow: hidden;
}
.feature-strip > div { padding: 20px; }
.feature-strip > div + div { border-left: 1px solid var(--line); }
.feature-strip strong { display: block; font-size: 16px; }
.feature-strip span { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }

.section { padding-top: 72px; }
.section-head { max-width: 740px; margin-bottom: 26px; }
.section-head p:last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card p:last-child { margin-bottom: 0; }
.card .number { display: block; color: #a87967; font-size: 12px; margin-bottom: 20px; letter-spacing: .12em; }
.card p { color: var(--muted); font-size: 14px; }

.quote {
  margin: 20px 0 0;
  padding: 16px;
  border-left: 2px solid #c09381;
  border-radius: 0 12px 12px 0;
  background: #f7efec;
  color: #663c49;
  font-size: 14px;
}

.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(125deg, #fffdfa, #f0e2df);
}
.split-panel p:last-child { margin-bottom: 0; }
.check-list { margin: 0; padding-left: 20px; color: var(--muted); }
.check-list li + li { margin-top: 12px; }

.price-card {
  background: linear-gradient(145deg, #702b42, #461b2c);
  color: white;
  border-color: transparent;
}
.price-card .eyebrow { color: var(--gold); }
.price-card p { color: #ebd7dc; }
.price { font-size: 64px; line-height: 1; letter-spacing: -.05em; margin: 22px 0 14px; }
.price span { font-size: 18px; letter-spacing: 0; }
.price-card .fine { color: #e3c6ce; }

.steps { counter-reset: steps; list-style: none; margin: 0; padding: 0; }
.steps li {
  position: relative;
  padding-left: 44px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--muted);
}
.steps li:last-child { margin-bottom: 0; }
.steps li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--soft);
  color: var(--primary);
  font-weight: 750;
}
.steps strong { display: block; color: var(--text); margin-bottom: 5px; }

details {
  border-bottom: 1px solid var(--line);
  padding: 0 4px;
}
summary {
  cursor: pointer;
  padding: 20px 0;
  font-weight: 650;
  font-size: 15px;
}
details p { color: var(--muted); font-size: 14px; padding-bottom: 6px; max-width: 850px; }

.final-cta { text-align: center; padding: 56px 24px; }
.final-cta p { max-width: 620px; margin-inline: auto; }
.final-cta .actions { justify-content: center; }

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.footer a { text-decoration: none; }

.notice {
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff9ef;
  font-size: 14px;
  margin-bottom: 18px;
}
.notice.error { color: var(--danger); background: #fff3f4; border-color: #e9c8cf; }
.notice.success { color: var(--ok); background: #eef7f1; border-color: #cce2d3; }

.dashboard-title { padding: 20px 0 28px; }
.dashboard-title h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 12px; }
.dashboard-title p { margin-bottom: 0; max-width: 670px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.dashboard-grid > * { min-width: 0; }
.stack { display: grid; gap: 20px; }

.connect-card {
  background: linear-gradient(145deg, #fffdfb, #f5e8e6);
  padding: 30px;
}
.connect-card h2 { font-size: 28px; margin-top: 20px; }
.connect-card .actions { margin-top: 22px; }
.connect-card .btn.primary { flex: 1 1 220px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a78e77; flex: 0 0 8px; }
.status-pill.connected { color: var(--ok); }
.status-pill.connected .status-dot { background: var(--ok); }

.balance-number { font-size: 48px; line-height: 1.1; letter-spacing: -.04em; margin: 14px 0 8px; font-weight: 750; }
.balance-number span { font-size: 14px; letter-spacing: 0; font-weight: 400; }
.balance-card .btn { width: 100%; margin-top: 18px; }

.account-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 15px;
  background: var(--soft);
  color: var(--primary);
  font-weight: 750;
}
.account-name { font-size: 16px; font-weight: 700; }
.account-meta { font-size: 12px; color: var(--muted); }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 10px; }
progress { display: block; width: 100%; height: 9px; border: 0; border-radius: 999px; overflow: hidden; background: #eee1dd; accent-color: var(--primary); }
progress::-webkit-progress-bar { background: #eee1dd; border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #b78071, #762c43); border-radius: 999px; }
progress::-moz-progress-bar { background: #762c43; border-radius: 999px; }

.dashboard-section { margin-top: 36px; }
.dashboard-section h2 { font-size: 25px; }

.model-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.model-link {
  padding: 18px;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 16px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}
.model-link.sapphire { background: linear-gradient(135deg, #8a5cff, #6f43ea); }
.model-link.delphina { background: linear-gradient(135deg, #2f86fb, #1f6fe3); }
.model-link.bot { background: linear-gradient(135deg, #4ab96a, #2f9550); }
.model-link.almanac { background: linear-gradient(135deg, #c96a3f, #a94d2d); }

.inline-status { min-height: 22px; font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.inline-status.error { color: var(--danger); }

@media (hover: hover) {
  .btn:hover { background: #f0e4df; }
  .btn.primary:hover { background: #592036; box-shadow: 0 10px 26px #762c4338; }
  .btn.light:hover { background: #ead3b0; }
  .model-link:hover { filter: brightness(1.08); }
}

@media (max-width: 900px) {
  .hero { gap: 24px; }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .model-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .shell {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .topbar { gap: 8px; padding-bottom: 14px; }
  .brand { gap: 9px; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
  .brand-name { font-size: 18px; }
  .brand-sub { font-size: 9px; letter-spacing: .05em; }
  .topbar .btn { padding-inline: 12px; font-size: 12px; }
  .hero { grid-template-columns: 1fr; padding: 32px 0 26px; }
  h1 { font-size: 40px; margin-bottom: 20px; }
  .lead { font-size: 16px; }
  .hero .actions > .btn { flex: 1 1 auto; }
  .hero-visual { padding: 24px; border-radius: 24px; }
  .feature-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-strip > div { padding: 16px; }
  .feature-strip > div + div { border-left: 0; }
  .feature-strip > div:nth-child(even) { border-left: 1px solid var(--line); }
  .feature-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .feature-strip strong { font-size: 14px; }
  .section { padding-top: 48px; }
  .grid.two, .grid.three, .split-panel { grid-template-columns: 1fr; }
  .card { padding: 22px; border-radius: 20px; }
  .split-panel { padding: 24px; gap: 24px; }
  .final-cta { padding: 36px 4px; }
  .dashboard-title { padding: 20px 0 24px; }
  .connect-card { padding: 24px; }
  .connect-card .actions { align-items: stretch; }
  .connect-card .actions > * { width: 100%; }
  .model-link { padding: 16px; font-size: 13px; }
}

@media (max-width: 360px) {
  h1 { font-size: 35px; }
  .brand-sub { font-size: 8px; }
  .topbar .btn { padding-inline: 9px; }
  .model-links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}