:root {
  color-scheme: dark;
  --bg: #06090c;
  --panel: #090e12;
  --panel-strong: #0b1116;
  --line: #303940;
  --text: #f2f7f4;
  --muted: #a7b5b2;
  --green: #38d996;
  --red: #ff6565;
  --gold: #f3c969;
  --blue: #6fb7ff;
  --danger: #ff8b8b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.public-shell {
  min-height: 100vh;
  overflow: hidden;
}

.public-topbar {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px clamp(18px, 4vw, 44px);
  pointer-events: none;
}

.brand-lockup,
.top-login-button {
  pointer-events: auto;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #38d996;
  background: #071610;
  border-radius: 8px;
  color: var(--green);
  font-size: 14px;
}

.top-login-button,
.primary-link,
.login-panel button,
.google-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.top-login-button {
  min-width: 58px;
  max-width: 84px;
  min-height: 34px;
  padding: 0 12px;
  background: #f2f7f4;
  color: #07110d;
  overflow: hidden;
  box-shadow: 0 12px 32px #000000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  padding: 112px clamp(18px, 4vw, 44px) 42px;
}

.hero-chart-canvas,
.chart-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60vh;
}

.hero-chart-canvas {
  z-index: 0;
  background: #06090c;
}

.chart-vignette {
  display: none;
}

.hero-copy {
  position: relative;
  z-index: 3;
  max-width: min(760px, 100%);
  padding-bottom: 20px;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 650px;
  margin: 18px 0 0;
  color: #d8e2de;
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.primary-link {
  background: var(--green);
  color: #04110b;
}

.primary-link:not(.ready) {
  background: #1c252d;
  border-color: #303940;
  color: #dbe6e2;
}

.session-state {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.login-modal {
  position: fixed;
  z-index: 11;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-modal[hidden] {
  display: none;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 5, 8, 0.72);
  backdrop-filter: blur(10px);
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 36px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 22px;
  box-shadow: 0 26px 90px #000000;
  backdrop-filter: blur(18px);
}

.login-head {
  position: relative;
  padding-right: 46px;
}

.login-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0;
}

.login-head p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.login-close-button {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.google-login-button {
  width: 100%;
  background: #f7fbff;
  color: #101820;
}

.google-login-button.disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.login-panel label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #cbd8d4;
  font-size: 14px;
  font-weight: 700;
}

.login-panel input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #04080c;
  color: var(--text);
  padding: 0 12px;
  font-size: 16px;
}

.login-panel input:focus {
  outline: 2px solid #1f7f5a;
  border-color: #38d996;
}

.email-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
  align-items: end;
}

.email-code-row label {
  margin-bottom: 0;
}

.login-panel button {
  width: 100%;
  background: var(--green);
  color: #04110b;
}

.secondary-login-button {
  margin-top: 10px;
  border-color: var(--line) !important;
  background: #111820 !important;
  color: var(--text) !important;
}

.login-panel button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.login-error {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.login-error.success {
  color: var(--green);
}

@media (max-width: 760px) {
  .public-topbar {
    padding: 16px 18px;
  }

  .chart-hero {
    padding: 104px 18px 30px;
  }

  .chart-vignette {
    display: none;
  }

  h1 {
    font-size: clamp(40px, 14vw, 64px);
  }

  .hero-lead {
    font-size: 16px;
  }

  .login-modal {
    padding: 18px;
  }

  .login-panel {
    width: auto;
  }
}
