:root {
  --bg: #070a0c;
  --bg-elevated: #0e1419;
  --bg-soft: #121a21;
  --line: rgba(232, 240, 245, 0.08);
  --line-strong: rgba(232, 240, 245, 0.16);
  --text: #e8f0f5;
  --muted: #8b9aab;
  --faint: #5c6b7a;
  --accent: #3dffc0;
  --accent-dim: rgba(61, 255, 192, 0.12);
  --accent-ink: #04140f;
  --warn: #ffb454;
  --danger: #ff6b7a;
  --ok: #3dffc0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font-brand: "Syne", sans-serif;
  --font-body: "Sora", sans-serif;
  --max: 1120px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(61, 255, 192, 0.14), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(90, 140, 255, 0.1), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, rgba(255, 180, 84, 0.06), transparent 45%),
    linear-gradient(180deg, #070a0c 0%, #0a1015 50%, #070a0c 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

a { color: var(--accent); text-decoration: none; }
a:hover { filter: brightness(1.08); }

img { max-width: 100%; height: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  backdrop-filter: blur(16px);
  background: rgba(7, 10, 12, 0.72);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
  color: var(--text) !important;
}

.brand span { color: var(--accent); }

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem 1.25rem;
  font-size: 0.9rem;
}

.nav-desktop a {
  color: var(--muted);
  padding: 0.35rem 0;
}

.nav-desktop a:hover { color: var(--text); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
}

.nav-mobile {
  display: none;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 12, 0.95);
  padding: 0.75rem 1.25rem 1rem;
}

.nav-mobile.open { display: grid; gap: 0.35rem; }

.nav-mobile a,
.nav-mobile button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.nav-mobile a:hover,
.nav-mobile button:hover { background: var(--bg-soft); }

@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .nav-toggle { display: none; }
  .nav-mobile,
  .nav-mobile.open { display: none !important; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink) !important;
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border-color: var(--line-strong);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); }

.btn-danger {
  background: rgba(255, 107, 122, 0.12);
  color: var(--danger) !important;
  border-color: rgba(255, 107, 122, 0.25);
}

.site-main {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.site-main.full-bleed {
  max-width: none;
  padding: 0;
}

.messages {
  max-width: var(--max);
  margin: 0.75rem auto 0;
  padding: 0 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  font-size: 0.9rem;
  color: var(--text);
}

.page-title {
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.04em;
  margin: 0 0 0.35rem;
}

.page-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.panel {
  background: linear-gradient(180deg, rgba(18, 26, 33, 0.9), rgba(14, 20, 25, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}

.stack { display: grid; gap: 1rem; }

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4rem;
  background: var(--faint);
}

.status-dot.online { background: var(--ok); box-shadow: 0 0 0 4px rgba(61, 255, 192, 0.15); }
.status-dot.offline,
.status-dot.error,
.status-dot.halted { background: var(--danger); }
.status-dot.deploying,
.status-dot.restarting,
.status-dot.waitlisted { background: var(--warn); }
.status-dot.paused { background: var(--faint); }

.tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin: 0 0 1.25rem;
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.tabs a {
  flex: 0 0 auto;
  color: var(--muted);
  padding: 0.7rem 0.9rem;
  border-radius: 10px 10px 0 0;
  font-size: 0.88rem;
  white-space: nowrap;
}

.tabs a:hover,
.tabs a.active {
  color: var(--text);
  background: var(--accent-dim);
}

.form-grid { display: grid; gap: 0.9rem; }

.form-grid p {
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.form-grid label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  font: inherit;
}

textarea {
  min-height: 160px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(61, 255, 192, 0.35);
  border-color: rgba(61, 255, 192, 0.45);
}

.auth-shell {
  min-height: calc(100vh - var(--header-h) - 4rem);
  display: grid;
  place-items: center;
  padding: 1rem 0 2rem;
}

.auth-card {
  width: min(100%, 440px);
  padding: 1.5rem;
}

.auth-card h1 {
  font-family: var(--font-brand);
  letter-spacing: -0.04em;
  margin: 0 0 0.35rem;
  font-size: 1.7rem;
}

.auth-card .hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.auth-card .links {
  margin-top: 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
  display: grid;
  gap: 0.45rem;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 20, 25, 0.75);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.list-row:hover {
  border-color: rgba(61, 255, 192, 0.28);
  transform: translateY(-1px);
}

.list-row a.title {
  color: var(--text) !important;
  font-weight: 600;
  font-size: 1.02rem;
}

.meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
}

.badge.warn {
  background: rgba(255, 180, 84, 0.12);
  color: var(--warn);
}

.logs {
  background: #05080b;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow: auto;
  max-height: min(55vh, 28rem);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #b7c4d1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.25rem 2.5rem;
  color: var(--faint);
  font-size: 0.85rem;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.85rem 1.1rem; }

/* Landing */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 2rem 1.25rem 3.5rem;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, transparent 20%, rgba(7, 10, 12, 0.55) 55%, rgba(7, 10, 12, 0.96) 100%),
    radial-gradient(ellipse 80% 60% at 70% 35%, rgba(61, 255, 192, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 60%, rgba(90, 140, 255, 0.14), transparent 55%),
    repeating-linear-gradient(
      -12deg,
      transparent 0 14px,
      rgba(255, 255, 255, 0.015) 14px 15px
    );
}

.hero__visual {
  position: absolute;
  right: -8%;
  top: 8%;
  width: min(720px, 92vw);
  height: min(520px, 55vh);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(145deg, rgba(18, 26, 33, 0.7), rgba(7, 10, 12, 0.2)),
    radial-gradient(circle at 30% 30%, rgba(61, 255, 192, 0.2), transparent 40%);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  overflow: hidden;
}

.hero__visual::before {
  content: "";
  position: absolute;
  inset: 18% 12%;
  border-radius: 18px;
  border: 1px solid rgba(61, 255, 192, 0.2);
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(61, 255, 192, 0.5) 8% 8.4%, transparent 8.4%),
    linear-gradient(180deg, rgba(61, 255, 192, 0.08), transparent 40%);
  animation: pulse-line 4.5s ease-in-out infinite;
}

.hero__visual::after {
  content: "ONLINE · gateway connected";
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}

@keyframes pulse-line {
  0%, 100% { opacity: 0.45; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-6px); }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.hero .brand-hero {
  font-family: var(--font-brand);
  font-size: clamp(2.6rem, 9vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
  margin: 0 0 1rem;
  color: var(--text);
  animation: rise 0.7s ease both;
}

.hero h1 {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(1.25rem, 3.4vw, 1.85rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  max-width: 18ch;
  color: var(--text);
  animation: rise 0.8s ease 0.08s both;
}

.hero p.lead {
  margin: 0 0 1.5rem;
  max-width: 36ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
  animation: rise 0.8s ease 0.14s both;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  animation: rise 0.85s ease 0.2s both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
}

.section h2 {
  font-family: var(--font-brand);
  letter-spacing: -0.04em;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.5rem;
}

.section > p {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { align-items: center; padding-bottom: 4.5rem; }
  .hero__content { padding-right: min(42vw, 420px); }
}

.feature {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(14, 20, 25, 0.55);
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-family: var(--font-brand);
  letter-spacing: -0.02em;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.prose-page {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
  color: var(--muted);
}

.prose-page h1,
.prose-page h2 {
  color: var(--text);
  font-family: var(--font-brand);
  letter-spacing: -0.03em;
}

.prose-page h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.75rem; }
.prose-page ol { padding-left: 1.2rem; }
.prose-page code {
  font-size: 0.86em;
  background: var(--bg-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.pricing-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr 1fr; }
}

.price-card h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-brand);
  font-size: 1.35rem;
}

.price-card .amount {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 0.75rem;
}

@media (max-width: 640px) {
  .actions-mobile-stack {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .actions-mobile-stack .btn,
  .actions-mobile-stack form { width: 100%; }
  .actions-mobile-stack button { width: 100%; }
}
