:root {
  --bg: #07120d;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --text: #f5fff7;
  --muted: #aab8ad;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #d9ff80;
  --accent-2: #6df0b5;
  --danger: #ff8d8d;
  --warning: #ffd37a;
  --success: #9cffb0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 255, 128, 0.12), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(109, 240, 181, 0.13), transparent 28%),
    linear-gradient(135deg, #07120d 0%, #0d1a12 55%, #050906 100%);
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }

a { color: inherit; text-decoration: none; }

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent 75%);
  pointer-events: none;
  z-index: -1;
}

.hero {
  padding: 24px clamp(18px, 4vw, 48px) 70px;
}

.nav-shell,
.section-shell,
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(7, 18, 13, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  position: sticky;
  top: 16px;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #09120c;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(217, 255, 128, 0.18);
}

.brand strong { display: block; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 3px; }

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a,
.ghost-btn,
.secondary-btn,
.primary-btn,
.mini-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-links a:hover,
.ghost-btn:hover,
.secondary-btn:hover,
.primary-btn:hover,
.mini-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 255, 128, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #07120d;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 40px rgba(109, 240, 181, 0.14);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 700;
}

.hero-content {
  max-width: var(--max);
  margin: 74px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(290px, 0.82fr);
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.hero-card,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.105), rgba(255,255,255,0.055));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy { padding: clamp(28px, 6vw, 58px); }
.hero-card { padding: 26px; align-self: stretch; }

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.eyebrow span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 22px var(--accent-2);
}

h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  margin: 18px 0 18px;
  max-width: 780px;
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

h2 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h3 { margin-bottom: 8px; font-size: 1.2rem; }
h4 { margin-bottom: 0; }

.hero-copy p,
.section-heading p,
.panel p,
li,
.muted-note {
  color: var(--muted);
  line-height: 1.6;
}

.hero-copy p { font-size: 1.12rem; max-width: 680px; }
.hero-actions,
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.status-row span { color: var(--muted); }
.status-row strong { text-align: right; }

.pulse-meter {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  margin: 28px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(0,0,0,0.14);
}

.pulse-meter span {
  flex: 1;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(to top, var(--accent-2), var(--accent));
  opacity: 0.72;
  animation: pulse 1.8s ease-in-out infinite alternate;
}
.pulse-meter span:nth-child(1) { height: 36%; animation-delay: 0s; }
.pulse-meter span:nth-child(2) { height: 66%; animation-delay: 0.12s; }
.pulse-meter span:nth-child(3) { height: 48%; animation-delay: 0.24s; }
.pulse-meter span:nth-child(4) { height: 82%; animation-delay: 0.36s; }
.pulse-meter span:nth-child(5) { height: 58%; animation-delay: 0.48s; }

@keyframes pulse {
  from { transform: scaleY(0.88); opacity: 0.45; }
  to { transform: scaleY(1.02); opacity: 0.9; }
}

.section-shell {
  padding: 72px clamp(18px, 4vw, 48px);
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}
.section-heading.left-align { margin-inline: 0; text-align: left; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.panel { padding: 24px; }

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.panel-title-row p { margin-bottom: 0; font-size: 0.94rem; }

.tag {
  display: inline-flex;
  white-space: nowrap;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(217, 255, 128, 0.28);
  color: var(--accent);
  background: rgba(217, 255, 128, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

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

label {
  display: grid;
  gap: 7px;
  color: #dbe8de;
  font-weight: 750;
  font-size: 0.88rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: rgba(0,0,0,0.22);
  padding: 12px 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select { color-scheme: dark; }

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(217, 255, 128, 0.62);
  box-shadow: 0 0 0 4px rgba(217, 255, 128, 0.08);
}

textarea { resize: vertical; min-height: 120px; }
.wide-label { margin-top: 16px; }

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.snapshot-grid div,
.forecast-card,
.report-box,
.source-card,
.logic-card,
.template-card,
.deploy-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.16);
}

.snapshot-grid div { padding: 14px; }
.snapshot-grid span,
.forecast-card span,
.source-card span { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 6px; }
.snapshot-grid strong { font-size: 1rem; }

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.forecast-card { padding: 16px; min-height: 158px; }
.forecast-card strong { font-size: 1.1rem; }
.forecast-card p { font-size: 0.9rem; margin: 10px 0; }
.forecast-card small { color: var(--text); font-weight: 800; }
.forecast-card.bullish { border-color: rgba(156, 255, 176, 0.44); background: rgba(156, 255, 176, 0.08); }
.forecast-card.bearish { border-color: rgba(255, 141, 141, 0.44); background: rgba(255, 141, 141, 0.08); }
.forecast-card.neutral { border-color: rgba(255, 211, 122, 0.34); background: rgba(255, 211, 122, 0.06); }

.report-box { overflow: hidden; }
.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.report-toolbar div { display: flex; gap: 8px; }
.mini-btn { padding: 8px 11px; font-size: 0.82rem; }

pre {
  margin: 0;
  padding: 16px;
  max-height: 520px;
  overflow: auto;
  color: #eaf7ed;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.6;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.source-card {
  padding: 18px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.source-card h3 { margin-bottom: 0; }
.source-card p { font-size: 0.92rem; margin-bottom: auto; }
.source-card a { color: var(--accent); font-weight: 800; }
.source-card a:hover { text-decoration: underline; }

.split-section { padding-top: 40px; }
.logic-grid,
.template-grid,
.deploy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.logic-card,
.template-card,
.deploy-card { padding: 20px; }
.template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.deploy-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.matrix-panel { margin-top: 16px; }
.matrix-table { display: grid; gap: 1px; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); }
.matrix-table [role="row"] { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); background: rgba(255,255,255,0.05); }
.matrix-table span { padding: 12px 14px; border-right: 1px solid var(--line); color: var(--muted); }
.matrix-table span:last-child { border-right: none; }
.matrix-head span { color: var(--text); font-weight: 900; background: rgba(217, 255, 128, 0.08); }

ol, ul { padding-left: 20px; margin-bottom: 0; }
li + li { margin-top: 8px; }

.step {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: #07120d;
  font-weight: 950;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin-bottom: 14px;
}

code {
  color: var(--accent);
  background: rgba(217, 255, 128, 0.08);
  border: 1px solid rgba(217, 255, 128, 0.16);
  padding: 2px 6px;
  border-radius: 8px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 40px clamp(18px, 4vw, 48px) 70px;
  color: var(--muted);
}
.site-footer p { margin: 8px 0 0; color: var(--muted); }
.site-footer a { color: var(--accent); font-weight: 800; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(217, 255, 128, 0.28);
  background: rgba(7, 18, 13, 0.92);
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1040px) {
  .hero-content,
  .dashboard-grid { grid-template-columns: 1fr; }
  .source-grid,
  .logic-grid,
  .deploy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .nav-shell { position: static; align-items: flex-start; }
  .nav-shell,
  .site-footer { flex-direction: column; }
  .nav-links { justify-content: flex-start; }
  .brand { min-width: auto; }
  .form-grid,
  .forecast-grid,
  .snapshot-grid,
  .source-grid,
  .logic-grid,
  .template-grid,
  .deploy-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.5rem, 16vw, 4.4rem); }
  .hero { padding-bottom: 30px; }
  .section-shell { padding-block: 44px; }
}

@media print {
  .nav-links,
  .hero-actions,
  .button-row,
  .report-toolbar div,
  .site-footer a,
  .toast { display: none !important; }
  body { background: #fff; color: #111; }
  .hero-copy,
  .hero-card,
  .panel,
  .source-card,
  .forecast-card,
  .snapshot-grid div { background: #fff; color: #111; border-color: #ddd; box-shadow: none; }
  p, li, .muted-note, .snapshot-grid span, .forecast-card span { color: #333; }
  pre { color: #111; max-height: none; }
}
