:root {
  color-scheme: light;
  --navy: #082b50;
  --navy-dark: #051e38;
  --orange: #f59b00;
  --orange-dark: #c96f00;
  --ink: #152333;
  --muted: #607080;
  --line: #dce2e8;
  --surface: #ffffff;
  --soft: #f4f6f8;
  --green: #168a55;
  --red: #cf3c4f;
  --terminal: #111820;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.6;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(245, 155, 0, 0.45);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 10px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 148px;
  height: 29px;
  object-fit: cover;
}

.brand span {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.service-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.state-dot {
  width: 9px;
  height: 9px;
  background: #98a5b2;
  border-radius: 50%;
}

.service-state.is-ready {
  color: var(--green);
}

.service-state.is-ready .state-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 138, 85, 0.13);
}

.service-state.is-offline {
  color: var(--red);
}

.service-state.is-offline .state-dot {
  background: var(--red);
}

.hero {
  display: grid;
  align-items: center;
  min-height: min(62vh, 560px);
  padding: 64px 24px 72px;
  background: var(--navy);
  border-bottom: 7px solid var(--orange);
}

.hero-inner {
  width: min(920px, 100%);
  margin: 0 auto;
  color: white;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffc55f;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 820px;
  margin: 0 auto;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 690px;
  margin: 24px auto 0;
  color: #dfe8f1;
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 750;
  text-decoration: none;
}

.primary-action {
  gap: 10px;
  color: var(--navy-dark);
  background: var(--orange);
  border: 1px solid var(--orange);
}

.primary-action:hover {
  background: #ffad1f;
}

.secondary-action {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.secondary-action:hover {
  border-color: white;
}

.requirements {
  margin: 18px 0 0;
  color: #aebfd0;
  font-size: 14px;
}

.install-section,
.workflow-section,
.privacy-section {
  padding: 84px 24px;
}

.install-section {
  background: var(--soft);
}

.section-inner {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.section-heading {
  max-width: 680px;
  margin-bottom: 30px;
}

.section-heading h2,
.privacy-inner h2 {
  margin: 0;
  color: var(--navy);
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: 0;
}

.section-heading > p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.platform-switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  background: #e4e9ee;
  border-radius: 7px;
}

.platform-button {
  min-height: 38px;
  padding: 7px 15px;
  color: #445464;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.platform-button.is-active {
  color: var(--navy);
  background: white;
  box-shadow: 0 1px 3px rgba(9, 31, 54, 0.15);
  font-weight: 700;
}

.terminal {
  overflow: hidden;
  color: #e8eef4;
  background: var(--terminal);
  border: 1px solid #25313d;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(9, 31, 54, 0.14);
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 7px 10px 7px 18px;
  color: #9fb0c0;
  background: #18222c;
  border-bottom: 1px solid #2b3742;
  font-size: 13px;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 10px;
  color: #d7e1ea;
  background: transparent;
  border: 1px solid #42505e;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
}

.copy-button:hover {
  background: #24313d;
}

.terminal pre {
  min-height: 76px;
  margin: 0;
  padding: 26px;
  overflow-x: auto;
  font: 15px/1.7 Consolas, "Cascadia Code", monospace;
}

.terminal code {
  color: #f4f7fa;
  font-family: Consolas, "Cascadia Code", monospace;
}

.workflow-section {
  background: white;
}

.compact-heading {
  margin-bottom: 44px;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 38px;
  margin: 0 0 46px;
  padding: 0;
  list-style: none;
}

.workflow li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: start;
}

.step-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--navy);
  background: var(--orange);
  border-radius: 50%;
  font-weight: 850;
}

.workflow h3 {
  margin: 1px 0 7px;
  color: var(--navy);
  font-size: 18px;
  letter-spacing: 0;
}

.workflow p {
  margin: 0;
  color: var(--muted);
}

.workflow code,
.privacy-section code {
  color: var(--navy);
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 0.93em;
}

.run-terminal {
  max-width: 760px;
  margin: 0 auto;
}

.run-terminal pre {
  min-height: auto;
  padding-bottom: 18px;
}

.terminal-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px 25px;
  color: #65d697;
  font-family: Consolas, "Cascadia Code", monospace;
}

.privacy-section {
  color: white;
  background: var(--navy-dark);
}

.privacy-inner {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
  gap: 72px;
  align-items: center;
}

.privacy-inner h2 {
  color: white;
}

.privacy-inner > p {
  margin: 0;
  color: #cfdae5;
  font-size: 18px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(20px, 5vw, 72px);
  color: #6b7784;
  background: white;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

footer span:first-child {
  color: var(--navy);
  font-weight: 750;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.header-link {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.header-link:hover {
  text-decoration: underline;
}

.statistics-page {
  min-height: 100vh;
  background: var(--soft);
}

.statistics-main {
  padding: 58px 24px 80px;
}

.statistics-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.statistics-heading h1 {
  max-width: none;
  margin: 0;
  color: var(--navy);
  font-size: 44px;
}

.statistics-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.statistics-login {
  max-width: 620px;
  margin-top: 34px;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.statistics-login label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-weight: 700;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.token-row input {
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid #aeb8c2;
  border-radius: 6px;
  font: 16px Consolas, "Cascadia Code", monospace;
}

.token-row input:focus {
  outline: 3px solid rgba(245, 155, 0, 0.25);
  border-color: var(--orange-dark);
}

.form-message {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 14px;
}

.statistics-dashboard {
  margin-top: 34px;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.dashboard-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.text-button {
  padding: 4px 0;
  color: var(--navy);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid article {
  min-width: 0;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-top: 4px solid var(--orange);
  border-radius: 6px;
}

.metric-grid strong,
.metric-grid span {
  display: block;
}

.statistics-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-grid strong {
  color: var(--navy);
  font-size: 28px;
  line-height: 1.2;
}

.metric-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.statistics-panel {
  margin-top: 18px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 20px;
}

.panel-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-scroll {
  overflow-x: auto;
}

.statistics-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.statistics-panel th,
.statistics-panel td {
  padding: 11px 14px;
  border-bottom: 1px solid #edf0f3;
  text-align: right;
  white-space: nowrap;
}

.statistics-panel th {
  color: var(--muted);
  background: #fafbfc;
  font-size: 12px;
  font-weight: 700;
}

.statistics-panel th:first-child,
.statistics-panel td:first-child {
  text-align: left;
}

.statistics-panel tbody tr:last-child td {
  border-bottom: 0;
}

.statistics-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.task-ref {
  max-width: 520px;
  overflow: hidden;
  font-family: Consolas, "Cascadia Code", monospace;
  text-overflow: ellipsis;
}

.statistics-panel .empty-cell {
  padding: 28px 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 60px;
    padding: 9px 16px;
  }

  .brand img {
    width: 104px;
    height: 21px;
  }

  .brand {
    gap: 8px;
  }

  .brand span {
    padding-left: 8px;
    font-size: 14px;
  }

  .service-state {
    font-size: 12px;
  }

  .hero {
    min-height: 520px;
    padding: 54px 20px 62px;
  }

  .hero-copy {
    font-size: 17px;
  }

  h1 {
    font-size: 42px;
  }

  .section-heading h2,
  .privacy-inner h2 {
    font-size: 32px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    width: min(360px, 100%);
    margin-right: auto;
    margin-left: auto;
  }

  .install-section,
  .workflow-section,
  .privacy-section {
    padding: 64px 20px;
  }

  .workflow,
  .privacy-inner {
    grid-template-columns: 1fr;
  }

  .workflow {
    gap: 28px;
  }

  .privacy-inner {
    gap: 26px;
  }

  .terminal pre {
    padding: 22px 18px;
    font-size: 13px;
  }

  .terminal-result {
    padding: 0 18px 22px;
    font-size: 13px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .statistics-main {
    padding: 42px 16px 60px;
  }

  .statistics-heading h1 {
    font-size: 34px;
  }

  .token-row,
  .statistics-columns {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (min-width: 761px) and (max-width: 1080px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
