:root {
  color-scheme: dark;
  --bg: #081013;
  --panel: #101a22;
  --panel-soft: #14252d;
  --line: rgba(164, 230, 255, 0.14);
  --text: #edf8fb;
  --muted: #94a9b1;
  --cyan: #38d9ff;
  --violet: #9a7cff;
  --green: #86ff8f;
  --red: #ff6b7a;
  --yellow: #ffd166;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 217, 255, 0.12), transparent 30rem),
    linear-gradient(135deg, #081013, #111827 52%, #071317);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: 360px;
  height: 360px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 217, 255, 0.18), rgba(56, 217, 255, 0.07) 34%, transparent 68%);
  filter: blur(8px);
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 180ms ease;
}

body.has-cursor-glow .cursor-glow {
  opacity: 1;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px max(16px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 19, 0.88);
  backdrop-filter: blur(18px);
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-glow {
    display: none;
  }
}

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

.brand-mark {
  width: 26px;
  height: 26px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(56, 217, 255, 0.65), inset 0 0 10px rgba(154, 124, 255, 0.5);
  display: inline-block;
}

.site-nav,
.admin-nav {
  display: flex;
  gap: 16px;
}

.site-nav a,
.admin-nav a {
  color: var(--muted);
  font-weight: 650;
}

.site-nav a:hover,
.admin-nav a:hover,
.admin-nav .is-active {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.hero {
  min-height: 500px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 40px;
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.storm-grid {
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    radial-gradient(circle at 78% 42%, rgba(56, 217, 255, 0.22), transparent 18rem),
    rgba(16, 26, 34, 0.72);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

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

h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.98;
  margin-bottom: 18px;
}

h2 {
  font-size: 1.65rem;
}

.eyebrow,
.label {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.hero-actions,
.admin-actions,
.actions-cell,
.snapshot-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-actions {
  max-width: 760px;
}

.hero-action-break {
  flex-basis: 100%;
  height: 0;
}

.hero-actions .account-cta {
  flex: 0 0 auto;
  width: fit-content;
}

.button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.04);
}

.button.primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border: 0;
  color: #061013;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.05);
}

.button.account-cta {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border: 0;
  color: #061013;
}

.button.danger {
  background: rgba(255, 107, 122, 0.16);
  color: #ffd9de;
}

.button.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.radar-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.radar-ring {
  width: min(280px, 70vw);
  aspect-ratio: 1;
  border: 2px solid rgba(56, 217, 255, 0.72);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: repeating-radial-gradient(circle, rgba(56,217,255,0.1) 0 2px, transparent 2px 34px);
  box-shadow: 0 0 70px rgba(56, 217, 255, 0.2);
}

.radar-ring span {
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1;
  font-weight: 900;
}

.metric-card strong {
  display: block;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  font-size: clamp(1.9rem, 2.85vw, 2.85rem);
  line-height: 1.08;
  font-weight: 900;
}

.index-value strong {
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1;
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.metric-card,
.content-band,
.timeline-item,
.admin-form,
.index-meter-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 26, 34, 0.82);
}

.metric-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  padding: 26px;
  background:
    linear-gradient(145deg, rgba(56, 217, 255, 0.07), transparent 38%),
    rgba(16, 26, 34, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 24px 0 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 217, 255, 0.75), transparent);
}

.metric-card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}

.content-band,
.admin-form,
.index-meter-wrap {
  padding: 30px;
  margin: 28px 0;
}

.seo-content {
  max-width: none;
  width: 100%;
  margin: 42px auto 30px;
  padding: 44px;
  background:
    linear-gradient(180deg, rgba(56, 217, 255, 0.045), transparent 16rem),
    rgba(16, 26, 34, 0.78);
}

.seo-content h2 {
  margin-top: 44px;
  margin-bottom: 14px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.12;
}

.seo-content h2:first-of-type {
  margin-top: 0;
}

.seo-content p,
.seo-content li {
  color: #c8d8dd;
  font-size: 1.03rem;
}

.seo-content ul {
  margin: 0 0 20px;
  padding-left: 22px;
}

.seo-content p {
  max-width: 76ch;
}

.legal-content {
  max-width: 980px;
}

.legal-content h2 {
  margin-top: 30px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  color: #c8d8dd;
  max-width: 82ch;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-bottom: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

table.wide-table {
  min-width: 980px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-new { background: rgba(56, 217, 255, 0.18); color: var(--cyan); }
.badge-up { background: rgba(134, 255, 143, 0.16); color: var(--green); }
.badge-down { background: rgba(255, 107, 122, 0.18); color: #ff9faa; }
.badge-stable { background: rgba(255, 209, 102, 0.16); color: var(--yellow); }

.split-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
}

.index-list {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 0;
}

.index-list.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.index-list li {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.index-list span {
  display: block;
  color: var(--cyan);
  font-weight: 900;
}

.review-grid {
  display: grid;
  gap: 14px;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.review-card h3 {
  padding: 16px 16px 0;
  margin-bottom: 12px;
}

.review-card img {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.review-card p {
  color: var(--muted);
  padding: 16px;
  margin: 0;
}

.badge-wall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.badge-wall h2 {
  margin-bottom: 0;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
}

.badge-list a {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.badge-list img {
  display: block;
  max-width: 195px;
  height: auto;
}

.page-intro {
  max-width: 740px;
  margin-bottom: 26px;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-item {
  padding: 20px;
}

.timeline-item time {
  color: var(--green);
  font-weight: 800;
}

.timeline-list.small .timeline-item p {
  color: var(--muted);
}

.index-meter-wrap {
  display: grid;
  gap: 18px;
}

.volatility-focus {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 24px;
}

.volatility-copy {
  max-width: 760px;
}

.volatility-copy strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.index-meter {
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.index-meter-fill {
  width: var(--score);
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--violet), var(--red));
}

.index-value {
  display: flex;
  align-items: end;
  gap: 14px;
}

.index-history-card {
  overflow: hidden;
}

.index-history-current {
  text-align: right;
}

.index-history-current span {
  color: var(--muted);
  display: block;
  font-weight: 750;
}

.index-history-current strong {
  font-size: 2rem;
}

.index-chart-wrap {
  overflow-x: auto;
}

.index-chart {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
}

.chart-grid-line {
  stroke: rgba(164, 230, 255, 0.12);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--muted);
  font-size: 12px;
}

.chart-area {
  fill: url(#indexAreaGradient);
}

.chart-line {
  fill: none;
  stroke: var(--cyan);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.chart-point {
  fill: var(--green);
  stroke: #081013;
  stroke-width: 3;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-low { background: var(--green); }
.legend-normal { background: var(--cyan); }
.legend-high { background: var(--yellow); }
.legend-very-high { background: var(--red); }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
}

.code-sample {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  color: var(--green);
  padding: 14px;
}

.change-value {
  font-weight: 850;
  color: var(--green);
}

.link-split {
  width: 110px;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 107, 122, 0.28);
  margin-bottom: 6px;
}

.link-split span {
  display: block;
  height: 100%;
  background: var(--green);
}

.url-text {
  overflow-wrap: anywhere;
  color: var(--muted);
}

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

.backlink-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  padding: 18px;
}

.backlink-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
}

.backlink-stats strong {
  font-size: 1.45rem;
}

.change-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 850;
  padding: 4px 9px;
  white-space: nowrap;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 36px max(16px, calc((100vw - 1180px) / 2));
  background:
    linear-gradient(90deg, rgba(56, 217, 255, 0.08), transparent 38%),
    rgba(8, 16, 19, 0.72);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.footer-brand {
  max-width: 480px;
}

.footer-brand p {
  margin: 14px 0 12px;
}

.footer-brand small {
  color: #c8d8dd;
  font-weight: 750;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
  max-width: 520px;
}

.footer-nav a {
  color: var(--muted);
  font-weight: 750;
}

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

.lang-switch {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.auth-layout {
  min-height: 58vh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(56, 217, 255, 0.08), transparent 42%),
    rgba(16, 26, 34, 0.86);
  padding: 32px;
}

.auth-card h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
}

.auth-switch {
  margin: 0;
  color: var(--muted);
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.account-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 26, 34, 0.82);
  padding: 28px;
}

.account-details {
  display: grid;
  gap: 14px;
  margin: 0;
}

.account-details div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.account-details dt {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.account-details dd {
  margin: 4px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.form-error {
  color: #ffb3bc;
}

.admin-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(8, 16, 19, 0.94);
  padding: 22px;
}

.admin-nav {
  flex-direction: column;
  margin-top: 28px;
}

.admin-main {
  width: min(1080px, calc(100% - 32px));
  padding: 32px 0 64px;
}

.admin-page-head {
  margin-bottom: 22px;
}

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

.admin-form h2 {
  margin-bottom: 18px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}

input[type="hidden"] {
  display: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(56, 217, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(56, 217, 255, 0.12);
  outline: none;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

label.wide {
  grid-column: 1 / -1;
}

.admin-form.nested {
  background: rgba(255, 255, 255, 0.035);
}

.actions-cell form {
  display: inline-flex;
}

@media (max-width: 820px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 62px;
    right: 16px;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
  }

  .site-nav.is-open,
  .nav-toggle {
    display: flex;
  }

  .hero,
  .dashboard-grid,
  .split-layout,
  .volatility-focus,
  .index-list.four,
  .backlink-card-grid,
  .account-grid,
  .form-grid,
  .admin-body {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 28px;
  }

  .metric-card strong {
    font-size: clamp(1.85rem, 9vw, 2.55rem);
  }

  .seo-content,
  .content-band,
  .admin-form,
  .index-meter-wrap {
    padding: 22px;
  }

  .footer-inner {
    display: grid;
    gap: 22px;
  }

  .badge-wall {
    display: grid;
  }

  .badge-list {
    justify-content: flex-start;
  }

  .footer-nav {
    justify-content: flex-start;
  }

  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
