@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Manrope:wght@400;500;600;700;800&family=Unbounded:wght@600;700&display=swap');

:root {
  --paper: #f3f1e9;
  --paper-deep: #e8e5da;
  --paper-light: #faf8f1;
  --ink: #101113;
  --ink-soft: #202226;
  --muted: #71736e;
  --line: rgba(16, 17, 19, .17);
  --line-inverse: rgba(255, 255, 255, .16);
  --acid: #9bff00;
  --acid-dark: #6db600;
  --amber: #b97700;
  --blue: #285bd7;
  --violet: #6642b8;
  --danger: #cb3d27;
  --mint: var(--acid);
  --mint-strong: var(--acid-dark);
  --text: var(--ink);
  --surface: var(--paper-light);
  --surface-2: var(--paper-deep);
  --shadow: 0 22px 60px rgba(20, 20, 18, .08);
  --shadow-soft: 0 12px 28px rgba(20, 20, 18, .07);
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 17, 19, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 17, 19, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  font: 500 15px/1.55 Manrope, system-ui, sans-serif;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--acid-dark);
  outline-offset: 3px;
}
button:disabled { cursor: wait; opacity: .55; }

.brand-cut {
  position: fixed;
  z-index: -1;
  top: 6vh;
  right: -13vw;
  width: 60vw;
  height: 9px;
  background: var(--acid);
  transform: rotate(-18deg);
  transform-origin: right center;
  opacity: .46;
  pointer-events: none;
}
.shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 110px; position: relative; }

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: block; object-fit: cover; border-radius: 50%; }
.brand b { font-family: Unbounded, sans-serif; letter-spacing: -.055em; display: block; font-size: 16px; }
.brand small {
  color: var(--muted);
  display: block;
  font: 600 8px/1.4 "IBM Plex Mono", monospace;
  letter-spacing: .12em;
  margin-top: 2px;
}
.top-actions { display: flex; align-items: center; gap: 12px; }
.trial-chip {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 8px 13px;
  font: 600 10px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
}
.avatar {
  border: 1px solid var(--ink);
  background: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--acid);
  font-weight: 800;
}

.view { display: none; animation: reveal .28s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
.hero, .page-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 60px 0 40px; }
.hero h1, .page-head h1 {
  max-width: 850px;
  font-size: clamp(40px, 6.4vw, 78px);
  letter-spacing: -.075em;
  line-height: .96;
  margin: 13px 0 18px;
  font-weight: 800;
}
.hero h1 span { color: var(--muted); }
.hero-copy, .page-head p { max-width: 660px; color: var(--muted); margin: 0; font-size: 15px; }
.hero-copy b { color: var(--ink); font-weight: 800; }
.eyebrow {
  color: var(--muted);
  font: 600 10px/1.4 "IBM Plex Mono", monospace;
  letter-spacing: .13em;
  margin: 0;
}

.primary-btn, .ghost-btn {
  position: relative;
  border-radius: 2px;
  padding: 14px 19px;
  border: 1px solid var(--ink);
  cursor: pointer;
  font-weight: 800;
  transition: transform .18s, background .18s, color .18s;
  text-decoration: none;
}
.primary-btn { background: var(--acid); color: var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.ghost-btn { background: transparent; }
.primary-btn:hover, .ghost-btn:hover { transform: translate(-2px, -2px); }
.ghost-btn:hover { background: var(--ink); color: var(--paper); }
.text-btn { border: 0; padding: 0; color: var(--ink); background: none; font-weight: 800; cursor: pointer; text-align: left; }
.text-btn::after { content: " ↗"; color: var(--ink); }
.full { width: 100%; }

.welcome-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  margin: -8px 0 24px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .24);
}
.welcome-strip[hidden] { display: none; }
.welcome-strip p { color: var(--muted); margin: 2px 0 0; font-size: 12px; }
.welcome-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--acid);
  font: 600 11px "IBM Plex Mono", monospace;
}

.score-grid { display: grid; grid-template-columns: 1.38fr 1fr; gap: 16px; }
.score-card, .ai-card, .panel, .metric-card, .price-card, .chat-panel {
  border: 1px solid var(--line);
  border-radius: 3px;
}
.score-card {
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(170px, .72fr) 1fr;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  color: var(--paper-light);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: var(--shadow);
}
.score-number {
  min-height: 260px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  overflow: hidden;
  border-right: 1px solid var(--line-inverse);
}
.score-number::after {
  content: "";
  position: absolute;
  width: 135%;
  height: 7px;
  left: -18%;
  top: 50%;
  background: var(--paper-light);
  transform: rotate(-26deg);
}
.score-number b { font-size: clamp(64px, 8vw, 100px); line-height: .78; letter-spacing: -.1em; }
.score-number span { color: var(--acid); font: 600 12px "IBM Plex Mono", monospace; margin: 0 0 3px 8px; }
.score-number i { position: absolute; right: 19px; top: 26px; width: 23px; height: 12px; background: var(--acid); transform: skewY(-20deg); }
.score-copy { align-self: end; padding: 34px; }
.score-copy h2 { font-size: 30px; margin: 10px 0; letter-spacing: -.05em; }
.score-copy > p:last-child { color: rgba(250, 248, 241, .64); margin: 0; }
.score-card .eyebrow { color: rgba(250, 248, 241, .56); }
.status-dot { width: 8px; height: 8px; background: var(--acid); border-radius: 50%; display: inline-block; margin-right: 7px; }

.ai-card {
  padding: 30px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  color: var(--ink);
  background: var(--acid);
  border-color: var(--ink);
}
.ai-card .text-btn { grid-column: 2; align-self: end; }
.ai-card h3 { font-size: 24px; line-height: 1.08; margin: 9px 0; letter-spacing: -.04em; }
.ai-card p:not(.eyebrow) { margin: 0; color: rgba(16, 17, 19, .67); }
.ai-card .eyebrow { color: rgba(16, 17, 19, .58); }
.signal-logo { width: 48px; height: 48px; display: block; border-radius: 50%; object-fit: cover; }
.signal-logo.small { width: 34px; height: 34px; flex: 0 0 auto; }
.ai-orb { display: none; }

.section-heading { margin: 58px 0 18px; display: flex; justify-content: space-between; align-items: end; }
.section-heading h2 { margin: 6px 0 0; font-size: 28px; letter-spacing: -.05em; }
.muted { color: var(--muted); font: 500 11px "IBM Plex Mono", monospace; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.metric-card {
  padding: 20px 20px 24px;
  min-height: 162px;
  background: rgba(250, 248, 241, .45);
  border-width: 0 1px 1px 0;
  border-radius: 0;
  transition: background .2s;
}
.metric-card:first-child { border-left: 1px solid var(--line); }
.metric-card:hover { background: var(--paper-light); }
.metric-index { color: var(--acid-dark); font: 600 10px "IBM Plex Mono", monospace; }
.metric-card p { color: var(--muted); margin: 25px 0 3px; font-size: 12px; }
.metric-card strong { display: block; font-size: clamp(20px, 2vw, 27px); letter-spacing: -.05em; }
.metric-icon { display: none; }
.change { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.change.positive { color: var(--acid-dark); }
.change.negative { color: var(--amber); }

.lower-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-top: 18px; }
.panel { padding: 26px; background: rgba(250, 248, 241, .58); box-shadow: var(--shadow-soft); }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.panel-head h3 { font-size: 21px; margin: 6px 0 0; letter-spacing: -.04em; }
.legend { color: var(--muted); font: 500 9px "IBM Plex Mono", monospace; display: flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 3px; display: inline-block; }
.legend .revenue { background: var(--acid-dark); }
.legend .expense { background: #8a8b86; margin-left: 7px; }
.chart { height: 210px; margin-top: 20px; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--muted); text-align: center; font-size: 12px; border: 1px dashed var(--line); }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: rgba(16, 17, 19, .09); stroke-width: 1; }
.area { fill: url(#areaGradient); }
.line-revenue, .line-expense { fill: none; stroke-linecap: square; stroke-linejoin: miter; }
.line-revenue { stroke: var(--acid-dark); stroke-width: 3; }
.line-expense { stroke: #898b85; stroke-width: 2; }
.chart-label { fill: var(--muted); font: 9px "IBM Plex Mono"; }
.count { width: 31px; height: 31px; display: grid; place-items: center; background: var(--ink); color: var(--acid); font: 600 11px "IBM Plex Mono", monospace; }
.insight { display: flex; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.insight:last-child { border-bottom: 0; }
.insight b { font-size: 13px; }
.insight p { color: var(--muted); margin: 3px 0 0; font-size: 11px; line-height: 1.5; }
.severity { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid currentColor; font-weight: 900; }
.severity.warning { color: var(--amber); }
.severity.critical { color: var(--danger); }
.severity.info { color: var(--blue); }

.page-head.centered { text-align: center; justify-content: center; }
.page-head.centered h1 { font-size: clamp(38px, 6vw, 70px); }
.metric-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding: 32px; max-width: 880px; margin: 0 auto; }
.metric-form label, .profile-form label { display: grid; gap: 8px; color: var(--muted); font: 500 11px "IBM Plex Mono", monospace; }
.metric-form input, .metric-form textarea, .chat-form textarea, .profile-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-bottom-color: var(--ink);
  background: var(--paper-light);
  color: var(--ink);
  border-radius: 0;
  padding: 14px;
  outline: none;
  transition: border-color .2s, background .2s;
}
.metric-form input:focus, .metric-form textarea:focus, .chat-form textarea:focus, .profile-form input:focus {
  border-color: var(--ink);
  background: #fffef9;
}
.metric-form textarea { min-height: 100px; resize: vertical; }
.wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }
.form-note { max-width: 880px; margin: 0 auto 14px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.form-note > span { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; background: var(--ink); color: var(--acid); font: 600 11px "IBM Plex Mono", monospace; }
.form-note p { margin: 0; }
.form-note b { color: var(--ink); }

.advisor-layout { max-width: 900px; margin: 0 auto; }
.chat-panel { overflow: hidden; background: rgba(250, 248, 241, .7); box-shadow: var(--shadow); }
.messages { min-height: 390px; max-height: 55vh; overflow-y: auto; padding: 28px; }
.message { display: flex; gap: 12px; margin-bottom: 20px; }
.message > div:last-child { border-left: 3px solid var(--acid-dark); padding: 8px 14px; max-width: 78%; }
.message.user { justify-content: flex-end; }
.message.user > div { color: var(--paper-light); background: var(--ink); border: 0; padding: 13px 15px; }
.message b { font-size: 11px; color: var(--ink); }
.message p { margin: 3px 0 0; white-space: pre-wrap; }
.quick-prompts { display: flex; gap: 8px; padding: 0 22px 14px; overflow-x: auto; }
.quick-prompts button { white-space: nowrap; background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 8px 11px; cursor: pointer; font-size: 11px; }
.quick-prompts button:hover { border-color: var(--ink); color: var(--ink); }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 50px; max-height: 140px; resize: none; }
.chat-form button { border: 1px solid var(--ink); background: var(--acid); color: var(--ink); width: 50px; border-radius: 0; font-size: 23px; cursor: pointer; }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }
.price-card { padding: 30px; position: relative; display: flex; flex-direction: column; background: rgba(250, 248, 241, .66); }
.price-card.featured { color: var(--paper-light); background: var(--ink); border-color: var(--ink); transform: translateY(-8px); box-shadow: 8px 8px 0 var(--acid); }
.price-card.featured .eyebrow, .price-card.featured .price span, .price-card.featured ul { color: rgba(250, 248, 241, .58); }
.price-card.featured .price { border-color: var(--line-inverse); }
.popular { position: absolute; right: 20px; top: 20px; color: var(--acid); font: 600 9px "IBM Plex Mono", monospace; letter-spacing: .1em; }
.price-card h2 { font-size: 30px; margin: 9px 0; letter-spacing: -.05em; }
.price { display: flex; align-items: baseline; gap: 6px; padding: 10px 0 18px; border-bottom: 1px solid var(--line); }
.price b { font-size: 29px; letter-spacing: -.04em; }
.price span { color: var(--muted); font-size: 11px; }
.price-card ul { list-style: none; margin: 22px 0 28px; padding: 0; color: var(--muted); flex: 1; }
.price-card li { padding: 8px 0 8px 22px; position: relative; }
.price-card li::before { content: "↗"; position: absolute; left: 0; color: var(--acid-dark); }
.price-card.featured li::before { color: var(--acid); }

.account-status { color: var(--muted); border-bottom: 1px solid var(--ink); padding: 8px 0; font: 500 10px "IBM Plex Mono", monospace; }
.account-status i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; margin-right: 7px; background: var(--acid-dark); }
.profile-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; max-width: 980px; margin: 0 auto; }
.profile-stack { display: grid; gap: 18px; }
.profile-form { display: grid; gap: 17px; align-content: start; }
.profile-form input:disabled { color: var(--muted); opacity: .8; }
.profile-title { align-items: center; margin-bottom: 6px; }
.profile-monogram { width: 46px; height: 46px; display: grid; place-items: center; background: var(--ink); color: var(--acid); font-weight: 900; }
.plan-badge { padding: 6px 9px; color: var(--ink); background: var(--acid); font: 600 9px "IBM Plex Mono", monospace; text-transform: uppercase; }
.renewal { color: var(--muted); font-size: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.renewal b { color: var(--ink); }
.usage-row { margin: 15px 0; }
.usage-row > div:first-child { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.usage-row b { color: var(--ink); }
.progress { height: 6px; background: var(--paper-deep); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .6s ease; }
.security-card { display: flex; gap: 13px; align-items: flex-start; }
.security-card p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.security-icon { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; background: var(--acid); color: var(--ink); }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  padding: 7px;
  color: var(--paper-light);
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 0 15px 45px rgba(0, 0, 0, .2);
  z-index: 10;
}
.bottom-nav button { border: 0; background: transparent; color: rgba(250, 248, 241, .56); padding: 10px 16px; cursor: pointer; font-size: 11px; font-weight: 700; }
.bottom-nav button span { margin-right: 7px; color: rgba(250, 248, 241, .34); font: 600 9px "IBM Plex Mono", monospace; }
.bottom-nav button.active { background: var(--acid); color: var(--ink); }
.bottom-nav button.active span { color: var(--ink); }
.nav-head, .nav-status { display: none; }
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -100px);
  background: var(--ink);
  color: var(--paper-light);
  border-left: 6px solid var(--acid);
  padding: 13px 18px;
  font-weight: 800;
  z-index: 100;
  transition: transform .3s ease;
  box-shadow: var(--shadow);
}
.toast.show { transform: translate(-50%, 0); }

@media (min-width: 1000px) {
  .shell { width: min(1130px, calc(100% - 252px)); margin: 0 40px 0 auto; }
  .bottom-nav {
    left: 22px;
    top: 110px;
    bottom: auto;
    width: 184px;
    min-height: 438px;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 15px;
  }
  .nav-head { display: grid; gap: 3px; padding: 9px 10px 18px; margin-bottom: 7px; border-bottom: 1px solid var(--line-inverse); }
  .nav-head span { color: var(--acid); font: 600 8px "IBM Plex Mono", monospace; letter-spacing: .18em; }
  .nav-head b { font-size: 14px; }
  .bottom-nav button { width: 100%; display: flex; align-items: center; padding: 13px; text-align: left; }
  .bottom-nav button span { width: 25px; margin-right: 8px; text-align: left; }
  .nav-status { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 13px 10px 4px; color: rgba(250, 248, 241, .5); font-size: 9px; border-top: 1px solid var(--line-inverse); }
  .nav-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); }
}

@media (max-width: 900px) {
  .score-grid, .lower-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { background-size: 32px 32px; }
  .brand-cut { top: 15vh; width: 100vw; right: -38vw; height: 6px; }
  .shell { width: calc(100% - 24px); padding-bottom: 104px; }
  .topbar { height: 72px; }
  .brand-mark { width: 39px; height: 39px; }
  .brand small { display: none; }
  .trial-chip { display: none; }
  .hero, .page-head { align-items: stretch; flex-direction: column; padding: 40px 0 28px; }
  .hero h1, .page-head h1 { font-size: 39px; }
  .hero .primary-btn { width: 100%; }
  .welcome-strip { grid-template-columns: auto 1fr; }
  .welcome-strip .primary-btn { grid-column: 1 / -1; width: 100%; }
  .score-card { grid-template-columns: 128px 1fr; min-height: 220px; }
  .score-number { min-height: 220px; padding: 18px; }
  .score-number b { font-size: 58px; }
  .score-number::after { height: 5px; }
  .score-copy { padding: 23px 19px; }
  .score-copy h2 { font-size: 21px; }
  .score-copy > p:last-child { font-size: 11px; }
  .ai-card { padding: 23px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 16px; min-height: 145px; }
  .metric-card strong { font-size: 18px; }
  .metric-form { grid-template-columns: 1fr; padding: 20px; }
  .wide { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .bottom-nav { width: calc(100% - 16px); bottom: max(8px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav button { min-width: 0; padding: 8px 7px; display: grid; gap: 2px; place-items: center; font-size: 9px; }
  .bottom-nav button span { margin: 0; }
  .legend { display: none; }
  .messages { padding: 20px; }
  .message > div:last-child { max-width: 88%; }
}

@media (max-width: 390px) {
  .score-card { grid-template-columns: 1fr; }
  .score-number { min-height: 150px; border-right: 0; border-bottom: 1px solid var(--line-inverse); }
  .score-copy { padding: 22px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 128px; }
}
