:root {
  --ruby: #a32235;
  --ruby-dark: #651528;
  --coal: #181a1c;
  --ink: #23262a;
  --muted: #616a73;
  --line: #d7dce0;
  --paper: #f8f6f2;
  --panel: #ffffff;
  --green: #2f7d59;
  --amber: #a66517;
  --focus: #246b7a;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(248, 246, 242, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: max-content;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  color: var(--ruby);
}

main {
  display: grid;
  gap: 34px;
  padding: 32px clamp(18px, 4vw, 54px) 48px;
}

.download-shell,
.workflow,
.gate-strip {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.download-shell {
  display: grid;
  gap: 16px;
}

.release-panel,
.terminal-panel,
.workflow,
.gate-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(24, 26, 28, 0.08);
}

.release-panel {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 360px;
  overflow: hidden;
}

.release-art {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(163, 34, 53, 0.18), rgba(47, 125, 89, 0.12)),
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.7), transparent 32%),
    #292321;
}

.release-art img {
  filter: drop-shadow(0 22px 22px rgba(0, 0, 0, 0.26));
}

.release-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(24px, 5vw, 56px);
}

.eyebrow {
  margin: 0;
  color: var(--ruby);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--coal);
  font-size: clamp(2.25rem, 6vw, 4.75rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 8px;
  color: var(--coal);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: #3f464c;
  font-size: 1.08rem;
}

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

.primary-action,
.secondary-action,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.primary-action {
  background: var(--ruby);
  color: #fff;
}

.primary-action:hover {
  background: var(--ruby-dark);
}

.secondary-action,
.copy-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.secondary-action:hover,
.copy-button:hover {
  border-color: var(--focus);
}

.download-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.terminal-panel {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.panel-title {
  margin-bottom: 4px;
  color: var(--coal);
  font-weight: 800;
}

.panel-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  display: block;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f1eee8;
  color: var(--coal);
  white-space: nowrap;
}

#copy-status {
  grid-column: 2;
  color: var(--green);
  min-height: 1.2rem;
  font-size: 0.9rem;
}

.workflow {
  padding: clamp(20px, 4vw, 34px);
}

.section-head {
  max-width: 820px;
  margin-bottom: 22px;
}

.section-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

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

label,
fieldset {
  display: grid;
  gap: 7px;
  color: var(--coal);
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 107, 122, 0.25);
  outline-offset: 2px;
}

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

.network-list {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
}

.network-list legend {
  padding: 0 6px;
  color: var(--coal);
}

.network-list label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
}

.network-list input {
  width: 18px;
  min-height: 18px;
}

.envelope-output {
  margin: 18px 0 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #1f2325;
  color: #f5f0e8;
  font-size: 0.86rem;
}

.gate-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 24px;
  align-items: start;
  padding: clamp(20px, 4vw, 34px);
  background:
    linear-gradient(90deg, rgba(163, 34, 53, 0.08), rgba(47, 125, 89, 0.09)),
    #fff;
}

.gate-strip p:last-child {
  margin-bottom: 0;
  color: #444d54;
}

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

.gate-list li {
  border-left: 4px solid var(--green);
  padding: 8px 10px;
  background: rgba(47, 125, 89, 0.08);
  font-weight: 700;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
  padding: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .topbar,
  .terminal-panel,
  .release-panel,
  .workflow-grid,
  .gate-strip {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .release-art {
    min-height: 180px;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  #copy-status {
    grid-column: 1;
  }
}

/* Image downloader grid */
.downloader-panel {
  margin: 28px 0 8px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

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

.dl-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.dl-card .dl-os {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--coal);
}

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

.dl-card .dl-meta {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.dl-card.eligible {
  border-color: var(--ruby);
  box-shadow: 0 0 0 1px var(--ruby);
}

.dl-card.eligible .dl-meta {
  color: var(--ruby);
  font-weight: 600;
}

a.dl-card.eligible:hover {
  box-shadow: 0 0 0 2px var(--ruby);
}

.dl-card.ineligible {
  opacity: 0.35;
  filter: grayscale(0.6);
}

a.dl-card.ineligible:hover {
  opacity: 0.7;
  filter: grayscale(0.2);
}

.downloader-grid > .download-note {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}

.copy-button.copy-ok {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
}

.copy-button.copy-fail {
  background: var(--ruby);
  color: #ffffff;
  border-color: var(--ruby);
}
