:root {
  color-scheme: dark;
  --bg: #0b0c0a;
  --surface: #12130f;
  --surface-strong: #181a13;
  --line: rgba(230, 231, 210, 0.13);
  --line-strong: rgba(215, 214, 64, 0.38);
  --text: #f1f2e9;
  --muted: #a2a595;
  --quiet: #74786b;
  --accent: #d7d640;
  --accent-ink: #171805;
  --danger: #e0776f;
  --radius: 16px;
  --font-sans: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --font-mono: Consolas, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 24%, rgba(215, 214, 64, 0.07), transparent 25rem),
    linear-gradient(135deg, transparent 0 61%, rgba(241, 242, 233, 0.018) 61% 61.3%, transparent 61.3%);
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.site-header {
  position: relative;
  z-index: 3;
  height: 72px;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(100% - 40px, 1400px);
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 760;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(215, 214, 64, 0.22);
  border-radius: 11px;
  object-fit: cover;
  image-rendering: pixelated;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-link {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 180ms ease;
}

.header-link:hover {
  color: var(--text);
}

.language-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, 38px);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 19, 15, 0.84);
}

.lang-button {
  width: 38px;
  height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.lang-button:hover {
  background: rgba(241, 242, 233, 0.08);
}

.lang-button:active {
  transform: scale(0.96);
}

.lang-button.active {
  background: var(--accent);
}

.language-flag {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(11, 12, 10, 0.28);
}

.download-main {
  width: min(100% - 40px, 1400px);
  margin-inline: auto;
}

.download-hero {
  position: relative;
  min-height: calc(100dvh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(370px, 0.98fr);
  align-items: center;
  gap: clamp(38px, 6vw, 100px);
  padding: clamp(56px, 8vh, 88px) 0 64px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(3.6rem, 7vw, 7.2rem);
  font-weight: 780;
  letter-spacing: -0.072em;
  line-height: 0.88;
}

.hero-description {
  max-width: 52ch;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.14rem);
  line-height: 1.7;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:active {
  transform: translateY(1px) scale(0.985);
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover {
  background: #e3e25a;
  transform: translateY(-2px);
}

.button-secondary {
  border-color: var(--line);
  background: rgba(18, 19, 15, 0.68);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.download-status {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.status-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

[data-download-state="checking"] .status-indicator {
  animation: status-pulse 1.2s ease-in-out infinite;
}

[data-download-state="error"] .status-indicator {
  background: var(--danger);
}

.hero-visual {
  position: relative;
  min-height: 590px;
  display: grid;
  align-items: center;
  isolation: isolate;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 7% 2% 5% 12%;
  z-index: -2;
  border-radius: var(--radius);
  background: var(--accent);
  clip-path: polygon(17% 0, 100% 0, 82% 100%, 0 100%);
  opacity: 0.82;
}

.hero-character {
  position: absolute;
  right: clamp(230px, 24vw, 330px);
  bottom: 0;
  z-index: -1;
  width: clamp(260px, 27vw, 390px);
  height: auto;
  max-height: 620px;
  object-fit: contain;
  object-position: bottom;
  filter: saturate(0.72) contrast(1.06) drop-shadow(0 28px 40px rgba(11, 12, 10, 0.38));
}

.file-console {
  width: min(100%, 430px);
  margin-left: auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(18, 19, 15, 0.96);
  box-shadow: 0 30px 90px rgba(5, 6, 4, 0.34);
}

.console-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.console-state {
  color: var(--accent);
}

.file-block {
  padding: 30px 28px 26px;
}

.file-type {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(215, 214, 64, 0.08);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.file-name {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.42rem, 2.2vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.file-summary {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.file-facts {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1px;
  background: var(--line);
}

.file-fact {
  min-height: 90px;
  padding: 20px 22px;
  background: var(--surface);
}

.fact-label {
  display: block;
  margin-bottom: 8px;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fact-value {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.usage-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: clamp(36px, 7vw, 100px);
  padding: 96px 0 112px;
  border-top: 1px solid var(--line);
}

.usage-copy h2,
.support-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.run-list {
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: runbook;
}

.run-list li {
  position: relative;
  min-height: 88px;
  padding: 4px 0 26px 58px;
  counter-increment: runbook;
}

.run-list li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 40px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

.run-list li::before {
  content: counter(runbook, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
}

.run-title {
  display: block;
  margin-bottom: 7px;
  font-size: 1.06rem;
  font-weight: 730;
}

.run-copy {
  display: block;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.6;
}

.support-panel {
  position: relative;
  align-self: start;
  overflow: hidden;
  padding: 38px;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.support-panel::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -42px;
  width: 190px;
  aspect-ratio: 1;
  border-radius: 42px;
  background: url("/newhero.png") center / cover no-repeat;
  image-rendering: pixelated;
  opacity: 0.12;
  transform: rotate(-8deg);
}

.support-panel p {
  position: relative;
  z-index: 1;
  max-width: 34ch;
  margin: 20px 0 30px;
  color: var(--muted);
  line-height: 1.7;
}

.support-links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.text-link {
  color: var(--text);
  font-weight: 700;
  text-underline-offset: 5px;
  text-decoration-color: var(--line-strong);
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.text-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.site-footer {
  width: min(100% - 40px, 1400px);
  min-height: 78px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
}

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

.hero-copy,
.file-console,
.hero-character {
  opacity: 1;
  transform: none;
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy {
    animation: enter-up 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .file-console {
    animation: enter-side 760ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .hero-character {
    animation: character-enter 900ms 120ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes enter-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes enter-side {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes character-enter {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1050px) {
  .download-hero {
    grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
    gap: 30px;
  }

  .hero-character {
    right: 210px;
    width: 300px;
  }

  h1 {
    font-size: clamp(3.4rem, 7vw, 5.6rem);
  }
}

@media (max-width: 820px) {
  .header-inner,
  .download-main,
  .site-footer {
    width: min(100% - 32px, 680px);
  }

  .header-link {
    display: none;
  }

  .download-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 56px 0 72px;
  }

  .hero-copy {
    width: 100%;
  }

  h1 {
    max-width: 9ch;
    font-size: clamp(3.6rem, 14vw, 6rem);
  }

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

  .hero-visual::before {
    inset: 4% 0 2% 5%;
  }

  .hero-character {
    left: -20px;
    right: auto;
    width: min(56vw, 330px);
    max-height: 540px;
  }

  .file-console {
    width: min(76%, 430px);
  }

  .usage-section {
    grid-template-columns: 1fr;
    padding: 72px 0 84px;
  }

  .support-panel {
    padding: 32px;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 66px;
  }

  .header-inner,
  .download-main,
  .site-footer {
    width: calc(100% - 28px);
  }

  .brand span {
    display: none;
  }

  .language-switcher {
    grid-template-columns: repeat(2, 35px);
  }

  .lang-button {
    width: 35px;
  }

  .download-hero {
    padding-top: 44px;
  }

  .eyebrow {
    margin-bottom: 16px;
  }

  h1 {
    max-width: 8.5ch;
    font-size: clamp(3.15rem, 17vw, 4.9rem);
  }

  .hero-description {
    margin-top: 22px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-visual {
    min-height: 470px;
  }

  .hero-character {
    left: -36px;
    width: 230px;
  }

  .file-console {
    width: calc(100% - 64px);
  }

  .file-block {
    padding: 24px 22px 22px;
  }

  .file-name {
    font-size: 1.35rem;
  }

  .file-facts {
    grid-template-columns: 1fr;
  }

  .file-fact {
    min-height: auto;
  }

  .usage-section {
    padding-top: 64px;
  }

  .run-list li {
    padding-left: 50px;
  }

  .support-panel {
    padding: 28px 24px;
  }

  .site-footer {
    min-height: 96px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 22px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .file-console,
  .button-secondary,
  .language-switcher {
    background: var(--surface);
  }
}
