/* Transmute — transmute.run
   One stylesheet for the front page, the Danish front page, the guides and the 404.
   Light and dark follow the system setting. One accent colour. */

:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --ink: #16191d;
  --ink-2: #4b535c;
  --ink-3: #737c84;
  --line: #dde1e3;
  --accent: #0f7b6c;
  --accent-hover: #0b6558;
  --on-accent: #ffffff;

  --term-bg: #16191d;
  --term-fg: #e6eae8;
  --term-dim: #97a1a7;
  --term-accent: #5fd3bc;
  --term-string: #c8e39a;

  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 68ch;
  --page: 62rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --surface: #1a1d20;
    --ink: #e8eaea;
    --ink-2: #a3abb1;
    --ink-3: #7c858c;
    --line: #2b3034;
    --accent: #3fcdb2;
    --accent-hover: #6adcc6;
    --on-accent: #0f1a17;

    --term-bg: #0b0d0e;
    --term-fg: #e6eae8;
    --term-dim: #8e979d;
  }
}

/* Base */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

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

h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); letter-spacing: -0.025em; max-width: 24ch; }
h2 { font-size: 1.55rem; margin-top: 0; }
h3 { font-size: 1.125rem; margin-top: 1.6em; }
p, ul, ol, table, pre, blockquote { margin: 0 0 1.1em; }
p, li, blockquote { max-width: var(--measure); }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 600; }
small { font-size: 0.875rem; color: var(--ink-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  padding: 0.5rem 0.75rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; z-index: 10;
}
.skip:focus { top: 1rem; }

/* Header and footer */

.wrap { width: min(100% - 2.5rem, var(--page)); margin-inline: auto; }

.site-header { padding: 1.25rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.wordmark { font-weight: 600; font-size: 1.125rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--ink); }
.wordmark::before {
  content: ""; display: inline-block; width: 0.55em; height: 0.55em; margin-right: 0.5em;
  background: var(--accent); border-radius: 2px; transform: rotate(45deg) translateY(-1px);
}
.site-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); margin-top: 5rem; padding: 2.5rem 0 3rem; font-size: 0.925rem; color: var(--ink-2); }
.site-footer .wrap { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } }
.site-footer p { margin: 0 0 0.5em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--ink); }

/* Terminal blocks */

pre {
  background: var(--term-bg);
  color: var(--term-fg);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  tab-size: 2;
}
pre code { font: inherit; background: none; padding: 0; color: inherit; }
code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
pre .p, pre .prompt { color: var(--term-accent); user-select: none; }
pre .out, pre .cm, pre .nm { color: var(--term-dim); }
pre .str { color: var(--term-string); }
pre .kw { color: var(--term-fg); font-weight: 500; }
pre .cmd { color: var(--term-fg); }

/* Front page */

.hero { padding: 3rem 0 1rem; }
@media (min-width: 900px) { .hero { padding-top: 5rem; } }
.hero .lede { font-size: 1.2rem; color: var(--ink-2); max-width: 52ch; margin-bottom: 1.6rem; }
.hero .install { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 2rem; }
.hero .install code { font-size: 0.95rem; padding: 0.45em 0.8em; background: var(--surface); border: 1px solid var(--line); }
.hero pre { margin: 0; }

.btn {
  display: inline-block; padding: 0.55em 1.1em; border-radius: 8px; font-weight: 500; font-size: 0.975rem;
  text-decoration: none; border: 1px solid transparent; line-height: 1.3;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-quiet { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-quiet:hover { border-color: var(--ink-3); color: var(--ink); }

.section { padding: 3.25rem 0 0; }
.section > .wrap > h2 { margin-bottom: 1rem; }
.section .intro { color: var(--ink-2); margin-bottom: 1.75rem; }

.examples { display: grid; gap: 2rem; }
.example h3 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.example p { color: var(--ink-2); font-size: 0.95rem; margin-bottom: 0.7rem; }
.example pre { margin: 0; }

.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 820px) { .two-col { grid-template-columns: 1fr 1fr; } }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55em 0.75em 0.55em 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 0.875rem; }
td code { white-space: nowrap; }
td:first-child { white-space: nowrap; }
.table-wrap { overflow-x: auto; margin-bottom: 1.1em; }
.table-wrap table { margin: 0; min-width: 28rem; }

.formats dt { font-weight: 600; margin-top: 0.9em; }
.formats dd { margin: 0.15em 0 0; color: var(--ink-2); max-width: var(--measure); }

.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
@media (min-width: 820px) { .guide-list { grid-template-columns: 1fr 1fr; column-gap: 3rem; } }
.guide-list li { margin: 0; padding: 0.85em 0; border-top: 1px solid var(--line); max-width: none; }
.guide-list a { font-weight: 500; text-decoration: none; color: var(--ink); }
.guide-list a:hover { color: var(--accent); }
.guide-list span { display: block; color: var(--ink-2); font-size: 0.925rem; margin-top: 0.15em; }

.faq details { border-top: 1px solid var(--line); padding: 0.9em 0; max-width: var(--measure); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-3); flex-shrink: 0; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0.75em 0 0; color: var(--ink-2); }

.maker { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 720px) { .maker { grid-template-columns: 1fr 1fr; } }
.maker p { margin-bottom: 0.7em; }

/* Guide pages */

.prose { padding: 2rem 0 0; }
@media (min-width: 900px) { .prose { padding-top: 3.5rem; } }
.prose h1 { max-width: 22ch; }
.prose h2 { margin-top: 2.2em; font-size: 1.4rem; }
.prose h2:first-of-type { margin-top: 1.5em; }
.prose blockquote {
  border-left: 3px solid var(--accent); padding: 0.6em 1em; margin: 1.2em 0;
  background: var(--surface); border-radius: 0 6px 6px 0; color: var(--ink-2);
}
.prose blockquote p { margin: 0; }
.prose .meta { color: var(--ink-2); font-size: 0.925rem; margin: -0.3em 0 2em; }
.prose > .wrap > p:first-of-type { font-size: 1.15rem; color: var(--ink-2); }

.aside {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; margin: 3rem 0 0; max-width: var(--measure);
}
.aside h2 { font-size: 1.1rem; margin: 0 0 0.5em; }
.aside p { margin: 0 0 0.6em; font-size: 0.975rem; }
.aside p:last-child { margin: 0; }
.aside ul { margin: 0.4em 0 0; font-size: 0.975rem; }

.error-page { padding: 6rem 0; }
.error-page h1 { margin-bottom: 0.4em; }
