:root {
  --bg: #0f1318;
  --bg-alt: #141a21;
  --panel: #1a212b;
  --text: #e6edf3;
  --muted: #9aa4b2;
  --accent: #6fdc8c;
  --accent-2: #5ab1ff;
  --danger: #f38ba8;
  --shadow: rgb(15 19 24 / 60%);
  --radius: 12px;
  --mono:
    "JetBrains Mono", "Fira Code", "SFMono-Regular", "Menlo", "Consolas",
    monospace;
  --sans: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(1200px 800px at 20% -20%, #203040 0%, transparent 60%),
    radial-gradient(800px 600px at 90% 20%, #1c2a33 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: calc(var(--header-height, 5rem) + 1.5rem) clamp(1.25rem, 4vw, 4rem)
    3rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 1.25rem clamp(1.25rem, 4vw, 4rem);
  background: rgb(15 19 24 / 96%);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgb(15 19 24 / 50%);
}

.site-subheader {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
}

.site-id {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 1.1rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.site-identifier {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.site-identifier:hover {
  color: var(--accent-2);
}

.site-name {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-tag {
  color: var(--muted);
  font-size: 0.85rem;
}

.site-tagline {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: none;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.site-tagline.is-typing::after {
  content: "▌";
  display: inline-block;
  margin-left: 0.2em;
  color: var(--text);
  animation: caret-blink 1.1s steps(2, start) infinite;
}

@keyframes caret-blink {
  0%,
  45% {
    opacity: 1;
  }

  55%,
  100% {
    opacity: 0;
  }
}

.site-tagline-strong {
  color: var(--text);
  font-weight: 600;
}

.site-tagline-body {
  display: inline;
}

.prompt {
  color: var(--accent);
}

.status {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.content {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  flex: 1 1 auto;
}

.panel {
  background: var(--panel);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px var(--shadow);
  transition: opacity 160ms ease;
}

.panel.is-loading {
  opacity: 0.6;
}

.panel h1 {
  margin-top: 0;
  font-family: var(--mono);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.panel h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2rem;
}

.panel a {
  color: var(--accent-2);
  text-decoration: none;
}

.panel a:hover {
  text-decoration: underline;
}

.terminal {
  background: var(--bg-alt);
  padding: clamp(1.2rem, 3vw, 2rem);
  border-radius: var(--radius);
  border: 1px solid rgb(111 220 140 / 20%);
  box-shadow: 0 10px 30px var(--shadow);
  font-family: var(--mono);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: var(--terminal-max-height, 70vh);
  height: var(--terminal-max-height, 70vh);
  min-height: 0;
}

.terminal-header {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.nav-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.nav-mode-label {
  color: var(--muted);
}

.nav-mode-option {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.nav-mode-option[aria-pressed="true"] {
  color: var(--accent);
}

.nav-mode-separator {
  color: var(--muted);
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0;
  cursor: pointer;
}

.mobile-nav-toggle:hover {
  color: var(--accent);
}

.terminal-screen {
  background: rgb(8 11 15 / 90%);
  border-radius: 10px;
  border: 1px solid rgb(154 164 178 / 20%);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  box-shadow: inset 0 0 18px rgb(0 0 0 / 35%);
  flex: 1 1 0;
}

.terminal-history {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.4rem;
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
}

.terminal-input-block {
  margin-top: auto;
  display: grid;
  gap: 0.5rem;
}

.terminal-line {
  font-size: 0.9rem;
  color: var(--text);
}

.terminal-line-system {
  color: var(--muted);
}

.terminal-line-output {
  color: #cde6ff;
}

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

.terminal-form {
  display: grid;
  gap: 0.5rem;
  align-self: start;
  width: 100%;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  border-radius: 6px;
  padding: 0 0.5rem;
  border: 1px solid transparent;
  height: 2.75rem;
  min-height: 2.75rem;
  width: 100%;
}

.terminal-input-row-active {
  border-color: rgb(111 220 140 / 25%);
  box-shadow: inset 0 0 0 1px rgb(111 220 140 / 12%);
}

.prompt-path {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  outline: none;
  line-height: 1.2;
}

#terminal-input.error {
  color: var(--danger);
}

.terminal-hints {
  font-size: 0.75rem;
  color: var(--muted);
}

.terminal-suggestions-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  gap: 0.35rem;
  height: 100%;
  flex: 1 1 0;
}

.terminal-suggestions {
  display: grid;
  gap: 0.4rem;
  overflow: auto;
  min-height: 0;
  padding: 0;
  flex: 1 1 auto;
  max-height: none;
  align-content: start;
}

.terminal-suggestions-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 0 0 auto;
}

body.nav-mode-classic .terminal-screen,
body.nav-mode-classic .terminal-suggestions-block {
  display: none;
}

.suggestion {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  background: rgb(255 255 255 / 2%);
}

.suggestion.active,
.suggestion:hover {
  background: rgb(111 220 140 / 12%);
  color: var(--accent);
}

.command-list {
  border-top: 1px solid rgb(154 164 178 / 20%);
  padding-top: 0.8rem;
  min-height: 220px;
  flex: 1 1 auto;
  overflow: auto;
}

.command-list-title {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.command-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

body.nav-mode-command .command-list {
  display: none;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.tree-children-row {
  padding-left: 1.8rem;
}

.tree-children {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0.4rem;
  display: grid;
  gap: 0.3rem;
}

.tree-item-ellipsis {
  color: var(--muted);
  font-family: var(--mono);
}

.tree-ellipsis {
  font-family: var(--mono);
}

.tree-branch {
  color: var(--muted);
  font-family: var(--mono);
  min-width: 2.4rem;
}

.tree-item-child .tree-branch {
  opacity: 0.8;
}

.tree-link {
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
}

.tree-link:hover {
  color: var(--accent-2);
}

.tree-item.is-active .tree-link {
  color: var(--accent);
  text-shadow: 0 0 12px rgb(111 220 140 / 50%);
}

.tree-item.is-parent .tree-link {
  color: var(--accent-2);
}

.tree-path {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--mono);
  text-decoration: none;
}

.tree-path:hover {
  color: var(--accent-2);
}

.noscript {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.offers-pricing {
  margin-top: 1.5rem;
}

.offers-slider {
  background: rgb(8 11 15 / 60%);
  border: 1px solid rgb(90 177 255 / 20%);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
}

.offers-output-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.offers-output-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}

.offers-slider-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.offers-slider-input {
  width: 100%;
  accent-color: var(--accent-2);
}

.offers-slider-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

.offers-slider-blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.offers-block {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgb(154 164 178 / 20%);
  background: rgb(8 11 15 / 35%);
  color: var(--muted);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.offers-block-left {
  text-align: left;

  --highlight: rgb(111 220 140 / 15%);
  --highlight-border: rgb(111 220 140 / 45%);
}

.offers-block-center {
  text-align: center;

  --highlight: rgb(90 177 255 / 15%);
  --highlight-border: rgb(90 177 255 / 45%);
}

.offers-block-right {
  text-align: right;

  --highlight: rgb(243 139 168 / 15%);
  --highlight-border: rgb(243 139 168 / 45%);
}

.offers-block.is-active {
  background: var(--highlight);
  border-color: var(--highlight-border);
  color: var(--text);
}

.offers-block-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.offers-block.is-active .offers-block-title {
  color: inherit;
}

.offers-block-body {
  font-size: 0.8rem;
  line-height: 1.4;
}

.offers-output-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.offers-output-amount {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--accent);
}

.offers-output-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.offers-solidarity {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgb(111 220 140 / 10%);
  border: 1px solid rgb(111 220 140 / 25%);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.1;
  align-self: baseline;
  white-space: nowrap;
}

.offers-solidarity-amount {
  color: var(--accent);
}

.offers-fineprint {
  margin: 1.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

@media (width <= 720px) {
  .offers-output-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .offers-solidarity {
    white-space: normal;
  }

  .offers-slider-blocks {
    grid-template-columns: 1fr;
  }

  .offers-block-center,
  .offers-block-right {
    text-align: left;
  }
}

.site-footer {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

@media (width >= 1150px) {
  .content {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    align-items: start;
  }

  .terminal {
    order: 1;
    position: sticky;
    top: var(--terminal-offset-top, 2rem);
    max-height: var(--terminal-max-height, calc(100vh - 4rem));
    height: var(--terminal-max-height, calc(100vh - 4rem));
  }

  .panel {
    order: 2;
  }
}

@media (width <= 1149px) {
  .page {
    padding-top: 1.5rem;
  }

  .site-header {
    position: sticky;
  }

  .terminal {
    order: 1;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    height: auto;
    max-height: none;
  }

  .terminal-header {
    display: none;
  }

  .site-id {
    flex-wrap: wrap;
    width: 100%;
  }

  .site-subheader {
    width: 100%;
    margin-top: 0.5rem;
    max-height: 8rem;
    overflow: hidden;
    transition:
      opacity 600ms ease,
      transform 600ms ease,
      max-height 600ms ease,
      margin-top 600ms ease;
  }

  body.is-subheader-hidden .site-subheader {
    opacity: 0;
    transform: translateY(-4px);
    max-height: 0;
    margin-top: 0;
    pointer-events: none;
  }

  .site-tagline {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    flex-basis: 100%;
  }

  .terminal-screen,
  .terminal-suggestions-block {
    display: none;
  }

  .nav-mode-toggle {
    display: none;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  body.nav-menu-hidden .command-list {
    display: none;
  }

  .panel {
    order: 2;
  }
}
