/* Foundry website. Static, no build step, no external requests.
   Brand: Forge Red #E74334, Ink #1C1C1C, Paper #F5F5F5 (see assets/brand/README.md). */

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --forge: #e74334;
  --ink: #1c1c1c;
  --paper: #f5f5f5;

  --bg: #ffffff;
  --surface: #f5f5f5;
  --surface-2: #ececec;
  --text: #1c1c1c;
  --muted: #5c5c5c;
  --border: #dcdcdc;
  --accent-text: #b52a1b; /* Forge Red darkened for text on light: 6.3:1 on white */
  --button-bg: #b52a1b;
  --button-fg: #ffffff;
  --button-hover: #9c2316;
  --key-bg: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 18px 48px rgb(0 0 0 / 16%);
  --focus: #1c1c1c;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1c;
    --surface: #242424;
    --surface-2: #2c2c2c;
    --text: #f5f5f5;
    --muted: #a8a8a8;
    --border: #383838;
    --accent-text: #ff6b5a; /* 6.1:1 on Ink */
    --button-bg: #f05a4b;
    --button-fg: #1c1c1c;
    --button-hover: #ff7566;
    --key-bg: #2c2c2c;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 24px 64px rgb(0 0 0 / 55%);
    --focus: #f5f5f5;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent-text);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

strong {
  font-weight: 400;
  color: var(--text);
}

h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.wrap {
  width: min(100% - 32px, var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--button-bg);
  color: var(--button-fg);
  border-radius: 8px;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a:not(.button) {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.97rem;
}

.nav a:not(.button):hover {
  background: var(--surface);
}

.nav .button {
  margin-left: 8px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 2px solid var(--button-bg);
  background: var(--button-bg);
  color: var(--button-fg);
  font: inherit;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.button:hover {
  background: var(--button-hover);
  border-color: var(--button-hover);
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

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

.button.small {
  min-height: 40px;
  padding: 6px 18px;
  font-size: 0.95rem;
}

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

.hero {
  padding: clamp(40px, 8vw, 88px) 0 clamp(32px, 6vw, 64px);
  text-align: center;
  background:
    radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--forge) 14%, transparent), transparent 70%),
    var(--bg);
}

.hero .logo {
  width: min(260px, 62vw);
  margin: 0 auto clamp(24px, 4vw, 40px);
}

.hero h1 {
  font-size: clamp(2.1rem, 5.6vw, 3.9rem);
  max-width: 20ch;
  margin-inline: auto;
}

.hero .lead {
  max-width: 62ch;
  margin: 20px auto 0;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.cta-note {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

.window {
  margin: clamp(32px, 6vw, 56px) auto 0;
  max-width: 1040px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: #272822;
}

.window img {
  width: 100%;
}

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

.section {
  padding: clamp(48px, 8vw, 96px) 0;
}

.section.alt {
  background: var(--surface);
}

.eyebrow {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.section h2 {
  font-size: clamp(1.7rem, 3.8vw, 2.6rem);
  max-width: 24ch;
}

.section .intro {
  max-width: 62ch;
  margin-top: 16px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 20px;
  margin-top: clamp(28px, 5vw, 48px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.alt .card {
  background: var(--bg);
}

.card h3 {
  font-size: 1.25rem;
  margin: 14px 0 8px;
}

.card p {
  color: var(--muted);
  font-size: 1rem;
}

.card .icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--forge) 16%, transparent);
  color: var(--accent-text);
}

.card .icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Showcase rows ----------------------------------------------------- */

.show {
  display: grid;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  margin-top: clamp(40px, 7vw, 72px);
}

@media (min-width: 900px) {
  .show {
    grid-template-columns: 5fr 7fr;
  }

  .show.flip {
    grid-template-columns: 7fr 5fr;
  }

  .show.flip .show-text {
    order: 2;
  }
}

.show h3 {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
}

.show p {
  margin-top: 14px;
  color: var(--muted);
}

.show ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.show li {
  position: relative;
  padding-left: 22px;
  margin-top: 8px;
}

.show li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--forge);
}

.shot {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface-2);
}

/* ---- Keyboard ---------------------------------------------------------- */

.keys {
  display: grid;
  gap: 12px 32px;
  margin: clamp(28px, 5vw, 44px) 0 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
}

.keys li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.keys .what {
  color: var(--text);
}

.keys .combo {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

kbd {
  display: inline-block;
  min-width: 2em;
  padding: 3px 8px;
  text-align: center;
  background: var(--key-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 7px;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: nowrap;
}

.fine {
  margin-top: 20px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---- Languages --------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
}

/* ---- Download ---------------------------------------------------------- */

.downloads .card {
  display: flex;
  flex-direction: column;
}

.downloads .card .button {
  margin-top: auto;
  align-self: flex-start;
}

.downloads .card p {
  margin-bottom: 20px;
}

.downloads .card h3 {
  margin-top: 0;
}

.os {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ---- Open source ------------------------------------------------------- */

.oss {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.oss h2 {
  max-width: none;
}

.oss h2,
.oss .intro {
  margin-inline: auto;
}

.oss .cta {
  margin-top: 28px;
}

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

.site-footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px 40px;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* ---- 404 --------------------------------------------------------------- */

.lost {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 0;
}

.lost .logo {
  width: min(220px, 56vw);
  margin: 0 auto 32px;
}

.lost h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
}

.lost p {
  margin: 16px auto 0;
  max-width: 44ch;
  color: var(--muted);
}

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

@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }

  .nav a.hide-small {
    display: none;
  }

  .keys li {
    flex-direction: column;
    align-items: flex-start;
  }

  .keys .combo {
    justify-content: flex-start;
  }

  .button {
    width: 100%;
  }

  .nav .button {
    width: auto;
  }

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

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  .button {
    border-color: ButtonText;
  }
}
