:root {
  color-scheme: light;
  --ink: #080808;
  --paper: #ffffff;
  --muted: #686f7a;
  --line: #e6e8ec;
  --soft: #f5f7fa;
  --accent: #1e6bff;
  --accent-2: #0aa37f;
  --danger: #c92438;
  --shadow: 0 18px 60px rgba(12, 18, 28, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 10px clamp(16px, 4vw, 44px);
  background: #050505;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #fff;
  color: #000;
  font-size: 13px;
  border-radius: 12px;
}

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

.nav-links a,
.user-pill,
.icon-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.nav-links a:hover,
.icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.icon-button {
  cursor: pointer;
}

main {
  padding-top: 68px;
}

.auth-shell {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 480px);
  align-items: stretch;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
}

.compact-visual {
  min-height: 520px;
}

.auth-shell.is-logged-in {
  display: none;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(30, 107, 255, 0.12), transparent 44%),
    linear-gradient(210deg, rgba(10, 163, 127, 0.16), transparent 48%),
    #fafbfe;
}

.signal-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 45% 45%, #000 0 35%, transparent 75%);
  animation: drift 14s linear infinite;
}

.orbit {
  position: absolute;
  width: 360px;
  aspect-ratio: 1;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}

.orbit::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 58px;
  width: 14px;
  height: 14px;
  background: var(--accent);
}

.orbit-a {
  top: 14%;
  left: 18%;
}

.orbit-b {
  right: 12%;
  bottom: 10%;
  width: 280px;
  animation-duration: 24s;
  animation-direction: reverse;
}

.orbit-b::before {
  background: var(--accent-2);
}

.pulse-card {
  position: absolute;
  left: clamp(24px, 8vw, 100px);
  bottom: clamp(28px, 8vw, 110px);
  width: min(320px, calc(100% - 48px));
  padding: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: var(--radius);
}

.pulse-card span,
.metric span,
.tool-item span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.pulse-card strong {
  display: block;
  margin-top: 8px;
  font-size: 42px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 6vw, 54px);
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.section-kicker {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 10px 0 12px;
  line-height: 1.02;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(38px, 6vw, 76px);
}

h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.muted {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 30px 0 20px;
  padding: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tab {
  min-height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.tab.active {
  background: #111;
  color: #fff;
}

.auth-form,
.admin-composer {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #2f3440;
  font-weight: 700;
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d7dae0;
  background: #fff;
  color: var(--ink);
  min-height: 46px;
  padding: 11px 12px;
  outline: none;
  border-radius: var(--radius-sm);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.12);
}

.turnstile-box {
  min-height: 70px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  background: #111;
  color: #fff;
}

.secondary-button {
  background: #fff;
  color: #111;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(12, 18, 28, 0.12);
}

.notice {
  margin-top: 14px;
  min-height: 22px;
  color: var(--muted);
  line-height: 1.5;
}

.notice.error {
  color: var(--danger);
}

.app-shell {
  padding: clamp(22px, 4vw, 54px);
}

.dashboard-section {
  min-height: calc(78vh - 68px);
  display: grid;
  align-items: end;
  grid-template-columns: minmax(0, 1fr);
  padding: clamp(30px, 7vw, 86px) 0;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 36px;
}

.metric,
.tool-item,
.admin-composer,
.news-card {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 36px rgba(14, 20, 28, 0.06);
  border-radius: var(--radius);
}

.metric {
  padding: 22px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.content-band {
  padding: 58px 0;
  border-top: 1px solid var(--line);
}

.section-heading,
.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-composer {
  margin: 22px 0;
  padding: 20px;
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer-head span {
  color: var(--muted);
  font-size: 13px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.news-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  min-height: 240px;
}

.news-card h3 {
  margin: 0;
  font-size: 22px;
}

.news-card p {
  margin: 0;
  color: #313742;
  line-height: 1.55;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.tiny-button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: #111;
  padding: 0 12px;
  cursor: pointer;
  text-decoration: none;
  border-radius: 999px;
}

.danger-button {
  color: var(--danger);
}

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

.tool-item {
  padding: 22px;
}

.tool-item strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.tool-item p {
  color: var(--muted);
  line-height: 1.55;
}

.tool-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tool-link:hover {
  transform: translateY(-3px);
  border-color: rgba(30, 107, 255, 0.35);
  box-shadow: 0 18px 44px rgba(14, 20, 28, 0.1);
}

.tool-page {
  padding: clamp(22px, 4vw, 54px);
}

.tool-hero {
  min-height: 300px;
  display: grid;
  align-content: end;
  padding: clamp(32px, 6vw, 72px) 0;
}

.tool-hero h1 {
  max-width: 920px;
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

dialog {
  width: min(760px, calc(100% - 24px));
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.dialog-close {
  float: right;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 36px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.verify-page {
  background: #f7f8fb;
}

.verify-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.verify-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  padding: clamp(24px, 5vw, 44px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

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

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(48px, 48px, 0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .user-pill {
    display: none;
  }

  main {
    padding-top: 116px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 260px;
  }

  .auth-panel {
    border-left: 0;
  }

  .status-row,
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .split,
  .composer-head {
    align-items: stretch;
    flex-direction: column;
  }
}
