/* thevenom.dev — see DESIGN.md for the rules behind these values */

:root {
  --ink: #0b0c0e;
  --ink-2: #121418;
  --ink-3: #1a1d23;
  --line: #2a2e36;
  --line-hi: #3a3f49;
  --text: #ece6d6;
  --text-dim: #9a958a;
  --text-faint: #5e5b55;
  --amber: #ffb000;
  --amber-dim: #b37b00;
  --amber-glow: rgba(255, 176, 0, 0.18);

  --font-display: "Pixelify Sans", "Courier New", monospace;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
  --s7: 104px;

  --wrap: 960px;
  --measure: 68ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: var(--amber-dim);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--amber);
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--amber-glow);
}

::selection {
  background: var(--amber);
  color: var(--ink);
}

p {
  margin: 0 0 var(--s3);
  max-width: var(--measure);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s4);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--s3);
  top: var(--s3);
  background: var(--amber);
  color: var(--ink);
  padding: var(--s2) var(--s3);
  z-index: 10;
}

/* ---------- Display type ---------- */

.display,
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 600;
  text-shadow: 0 0 18px var(--amber-glow);
}

h2 {
  font-size: 1.75rem;
  margin-bottom: var(--s4);
}

h3 {
  font-size: 1.125rem;
  margin-bottom: var(--s2);
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 var(--s3);
}

.lede {
  font-size: 1.125rem;
  color: var(--text-dim);
}

.dim {
  color: var(--text-dim);
}

.faint {
  color: var(--text-faint);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  height: 64px;
}

.site-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.site-name .tld {
  color: var(--amber);
}

.nav {
  display: flex;
  gap: var(--s4);
  align-items: center;
}

.nav a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-decoration: none;
  padding: var(--s1) 0;
  border-bottom: 2px solid transparent;
}

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

.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--amber);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 12px 18px;
  color: var(--text);
  background: var(--ink-3);
  border: 1px solid;
  border-color: var(--line-hi) #000 #000 var(--line-hi);
  cursor: pointer;
}

.btn:hover {
  background: #22262d;
}

.btn:active {
  border-color: #000 var(--line-hi) var(--line-hi) #000;
  transform: translateY(1px);
}

.btn-primary {
  background: var(--amber);
  color: var(--ink);
  border-color: #ffd36b #7a5400 #7a5400 #ffd36b;
}

.btn-primary:hover {
  background: #ffbf33;
}

.btn-primary:active {
  border-color: #7a5400 #ffd36b #ffd36b #7a5400;
}

.btn[aria-disabled="true"] {
  background: var(--ink-2);
  color: var(--text-faint);
  border-color: var(--line);
  cursor: not-allowed;
  transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s5);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: var(--s7) 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

/* The only scanlines on the site. Keep them barely there. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.028) 0,
    rgba(255, 255, 255, 0.028) 1px,
    transparent 1px,
    transparent 4px
  );
}

/* Starfield canvas (assets/js/fx.js). Rendered at 1/3 resolution and scaled up
   with hard pixels. Dimmed behind the text column so copy stays readable. */
.hero > .wrap {
  position: relative;
  z-index: 1;
}

.fx-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.3) 30%, #000 65%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.3) 30%, #000 65%);
}

@media (max-width: 820px) {
  .fx-stars {
    -webkit-mask-image: none;
    mask-image: none;
    opacity: 0.45;
  }
}

.hero--home {
  min-height: min(78vh, 720px);
  display: flex;
  align-items: center;
}

.prompt {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  margin: 0 0 var(--s4);
}

.prompt .cmd {
  color: var(--text);
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.2em;
  background: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero h1 {
  margin-bottom: var(--s4);
}

.hero .lede {
  max-width: 52ch;
}

/* ---------- Sections ---------- */

.section {
  padding: var(--s7) 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.section-head h2 {
  margin: 0;
}

/* ---------- Window frame (Win95-ish bevel, but dark) ---------- */

.window {
  background: var(--ink-2);
  border: 1px solid;
  border-color: var(--line-hi) #000 #000 var(--line-hi);
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.titlebar .ctl {
  display: flex;
  gap: 4px;
}

.titlebar .ctl i {
  width: 6px;
  height: 6px;
  background: var(--line-hi);
}

.window.is-active .titlebar {
  color: var(--ink);
  background: var(--amber);
  border-bottom-color: var(--amber-dim);
}

.window.is-active .titlebar .ctl i {
  background: var(--ink);
}

.window-body {
  padding: var(--s4);
}

/* ---------- Tool cards ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s4);
}

.tool-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.08s steps(2);
}

a.tool-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--amber-dim);
}

.tool-card .window-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tool-card h3 {
  font-size: 1.25rem;
  color: var(--text);
}

.tool-card p {
  color: var(--text-dim);
  font-size: 0.9375rem;
}

.tool-card .go {
  margin-top: auto;
  padding-top: var(--s3);
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber);
}

.tool-card.is-empty {
  background: transparent;
  border: 1px dashed var(--line);
}

.tool-card.is-empty .titlebar {
  border-bottom-style: dashed;
  color: var(--text-faint);
}

.tool-card.is-empty h3,
.tool-card.is-empty p {
  color: var(--text-faint);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0 0 var(--s3);
  padding: 0;
  list-style: none;
}

.tags li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 1px 8px;
}

/* ---------- Tool detail ---------- */

.tool-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s6);
  align-items: center;
}

@media (max-width: 820px) {
  .tool-hero {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }
}

.spec {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s2) var(--s4);
  font-size: 0.9375rem;
}

.spec dt {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding-top: 3px;
}

.spec dd {
  margin: 0;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s5) var(--s5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding-left: var(--s4);
  position: relative;
}

.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  background: var(--amber);
}

.features p {
  color: var(--text-dim);
  margin: 0;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s4);
}

.shot {
  margin: 0;
}

.shot .frame {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: var(--ink-3);
  border: 1px dashed var(--line-hi);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  padding: var(--s3);
}

.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.shot figcaption {
  margin-top: var(--s2);
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* ---------- Downloads / checksums ---------- */

.dl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.dl-table th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 0 var(--s3) var(--s2) 0;
  border-bottom: 1px solid var(--line);
}

.dl-table td {
  padding: var(--s3) var(--s3) var(--s3) 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.hash {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  word-break: break-all;
  color: var(--text-dim);
}

.pending {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.table-scroll {
  overflow-x: auto;
}

.codeblock {
  margin: var(--s3) 0 0;
  padding: var(--s3) var(--s4);
  background: #000;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

.codeblock .c {
  color: var(--text-faint);
}

.note {
  border-left: 2px solid var(--amber);
  padding: var(--s2) 0 var(--s2) var(--s4);
  margin: var(--s5) 0 0;
  max-width: var(--measure);
}

.note p:last-child {
  margin-bottom: 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s6);
}

@media (max-width: 820px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }
}

/* ---------- Coffee strip ---------- */

.coffee {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}

.coffee p {
  margin: 0;
  color: var(--text-dim);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--s5) 0;
  font-size: 0.875rem;
  color: var(--text-faint);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s3);
}

.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--amber);
}

.site-footer nav {
  display: flex;
  gap: var(--s4);
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .nav {
    gap: var(--s3);
  }
  .nav .nav-coffee {
    display: none;
  }
  .hero,
  .section {
    padding: var(--s6) 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
  .tool-card {
    transition: none;
  }
}
