/* redetzke.aero — README style. Dark page by default (light on request), dark terminal, markdown-ish headings. */

@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url("fonts/jetbrains-mono-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-600.woff2") format("woff2"); }

/* Dark is the default. theme.js sets data-theme="light" only when a visitor picks light. */
:root {
  --bg: #0f131a;
  --surface: #161c26;
  --surface-2: #1c2330;
  --line: #2a3242;
  --line-soft: #232a37;
  --fg: #e6e9ef;
  --fg-2: #aab2c0;
  --fg-3: #8691a3;
  --hash: #5b6577;
  --accent: #8aa6ff;
  --prompt: #f08a55;
  --ok: #6fcf97;

  --term-bg: #0a0d13;
  --term-bar: #141923;
  --term-fg: #d9dee7;
  --term-dim: #9aa4b5;
  --term-comment: #6b7587;
  --term-key: #7fa7ff;
  --term-str: #8fd6a4;
  --term-prompt: #e8743b;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --max: 72rem;
  --gutter: clamp(1rem, 4vw, 5rem);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --line: #d8dce3;
  --line-soft: #e3e6eb;
  --fg: #1b2230;
  --fg-2: #4a5364;
  --fg-3: #6b7587;
  --hash: #a0a8b6;
  --accent: #3b5ccc;
  --prompt: #d0632b;
  --ok: #2f7d4f;
  --term-bg: #151b26;
  --term-bar: #1e2533;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--prompt); }
a:focus-visible { outline: 2px solid var(--prompt); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- header / footer ---------- */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.75rem;
  padding-block: 1.75rem;
  font-family: var(--mono);
  font-size: 0.9375rem;
}
.site-header .home { color: var(--fg); text-decoration: none; font-weight: 700; }
.site-header .home span { color: var(--prompt); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }

/* light/dark switch, added to the header nav by theme.js */
.theme-toggle {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-3);
  font: inherit;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--prompt); text-decoration: underline; text-underline-offset: 0.2em; }
.theme-toggle:focus-visible { outline: 2px solid var(--prompt); outline-offset: 3px; border-radius: 2px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.75rem;
  padding-block: 1.5rem 2rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg-3);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--fg-3); }

/* ---------- terminal ---------- */

.terminal {
  background: var(--term-bg);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgb(21 27 38 / 0.18);
  overflow: hidden;
  margin-block: 1rem 3.5rem;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--term-bar);
}
.terminal-bar i { width: 12px; height: 12px; border-radius: 50%; background: #e8743b; }
.terminal-bar i:nth-child(2) { background: #e6b84a; }
.terminal-bar i:nth-child(3) { background: #5db37e; }
.terminal-bar span { margin-left: 10px; font-family: var(--mono); font-size: 0.8125rem; color: var(--term-comment); }

.terminal {
  --term-pad: clamp(1.25rem, 3vw, 2.25rem);
  font-family: var(--mono);
  font-size: clamp(0.875rem, 1.6vw, 1.375rem);
  line-height: 1.55;
  color: var(--term-fg);
}
.terminal pre {
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem) var(--term-pad) 1.55em;
  overflow-x: auto;
  font: inherit;
}
.terminal pre:empty { padding-bottom: 0; }

/* the typing line under the output */
.prompt-line {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0 var(--term-pad) clamp(1.5rem, 3.5vw, 2.5rem);
  cursor: text;
}
.prompt-line form { flex: 1; min-width: 0; margin: 0; }
.prompt-line input {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--term-fg);
  caret-color: var(--term-prompt);
  font: inherit;
  font-size: max(16px, 1em); /* 16px+ stops iOS from zooming in on focus */
}
.prompt-line input::placeholder { color: var(--term-comment); opacity: 1; }
.terminal:focus-within { box-shadow: 0 0 0 2px var(--term-prompt), 0 20px 40px rgb(21 27 38 / 0.18); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.terminal .p { color: var(--term-prompt); }
.terminal .k { color: var(--term-key); }
.terminal .s { color: var(--term-str); }
.terminal .c { color: var(--term-comment); }
.terminal .d { color: var(--term-dim); }
.terminal a { color: var(--term-fg); }
.terminal a:hover { color: var(--term-prompt); }
.terminal .name {
  display: inline-block;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--term-fg);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
@media (max-width: 600px) { .terminal pre { white-space: pre-wrap; } }

/* ---------- markdown-ish content ---------- */

h1, h2, h3 { font-family: var(--mono); line-height: 1.2; text-wrap: balance; }
h2 { font-size: clamp(1.375rem, 2.4vw, 1.875rem); margin: 0 0 1.25rem; }
h2::before { content: "## "; color: var(--hash); }
h3 { font-size: 1.125rem; margin: 1.75rem 0 0.5rem; }
h3::before { content: "### "; color: var(--hash); }

section { margin-bottom: 3.5rem; }
p { margin: 0 0 1rem; max-width: 42rem; }
ul { margin: 0 0 1rem; padding-left: 1.4rem; max-width: 42rem; }
li + li { margin-top: 0.5rem; }
strong { font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 2rem 4rem;
}
.cols > * { min-width: 0; }

/* apps table */
.apps {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.apps .row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  gap: 0.5rem 1.25rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line-soft);
}
.apps .head {
  border-top: 0;
  padding-block: 0.7rem;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg-3);
}
.apps .app-name { font-family: var(--mono); font-weight: 700; color: var(--fg); text-decoration: none; }
.apps .app-name:hover { color: var(--accent); }
.apps .desc { color: var(--fg-2); }
.apps .links { display: flex; gap: 1rem; font-family: var(--mono); font-size: 0.8125rem; }

@media (max-width: 760px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .apps .head { display: none; }
  .apps .row { grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line-soft); }
  .apps .row:nth-child(2) { border-top: 0; }
}

/* key/value list */
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  margin: 0 0 1rem;
}
.kv dt { font-family: var(--mono); font-size: 0.875rem; color: var(--fg-3); padding-top: 0.15em; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- app pages ---------- */

.crumbs { font-family: var(--mono); font-size: 0.875rem; color: var(--fg-3); margin: 1rem 0 0.75rem; }
.crumbs a { color: var(--fg-3); }

.app-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
  margin-bottom: 3rem;
}
.app-hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  letter-spacing: -0.02em;
}
.app-hero p { margin: 0.35rem 0 0; color: var(--fg-2); font-size: 1.125rem; }
.app-hero .grow { flex: 1 1 20rem; min-width: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.9375rem;
  text-decoration: none;
}
.btn:hover { background: var(--accent); color: #ffffff; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btns { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.label-ok {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin-bottom: 1.5rem;
  max-width: 42rem;
}
.label-ok svg { flex: none; color: var(--ok); }
.label-ok strong { display: block; }
.label-ok span { color: var(--fg-2); font-size: 0.9375rem; }

.meta { font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-3); margin-bottom: 1.5rem; }

.legal h3 { margin-top: 2rem; }
