/* UmlCraft website. Tokens first, then layout, then sections. */

:root {
  --bg: #f2f1ee;
  --bg-raised: #faf9f7;
  --bg-sunken: #e9e8e4;
  --ink: #101014;
  --ink-strong: #000;
  --muted: rgba(16, 16, 20, .62);
  --faint: rgba(16, 16, 20, .42);
  --line: rgba(16, 16, 20, .16);
  --line-strong: rgba(16, 16, 20, .4);
  --accent: #2f62c8;
  --accent-soft: rgba(47, 98, 200, .1);
  --invert-bg: #101014;
  --invert-fg: #f2f1ee;
  --scanline: rgba(16, 16, 20, .03);
  --shadow: 0 1px 0 rgba(16, 16, 20, .04), 0 18px 50px -24px rgba(16, 16, 20, .35);

  --f-display: "Archivo", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bar: 52px;
  --rail: 0px;
  --gutter: 16px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121316;
  --bg-raised: #17181c;
  --bg-sunken: #0b0b0d;
  --ink: #f2f1ee;
  --ink-strong: #fff;
  --muted: rgba(242, 241, 238, .64);
  --faint: rgba(242, 241, 238, .42);
  --line: rgba(242, 241, 238, .14);
  --line-strong: rgba(242, 241, 238, .4);
  --accent: #7ea4ff;
  --accent-soft: rgba(126, 164, 255, .12);
  --invert-bg: #f2f1ee;
  --invert-fg: #0b0b0c;
  --scanline: rgba(255, 255, 255, .025);
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 24px 60px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

@media (min-width: 720px) { :root { --gutter: 32px; } }
@media (min-width: 1240px) { :root { --rail: 220px; } }

/* ───────── Base ───────── */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 8px); }

/* No page scrollbar: the ruler on the right shows the position. */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(to bottom, var(--scanline) 0 1px, transparent 1px 4px);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Language switch: only the active language is shown. */
html[lang="en"] [lang="de"], html[lang="de"] [lang="en"] { display: none !important; }

/* Screenshots that follow the site theme. */
:root[data-theme="dark"] .only-light, :root[data-theme="light"] .only-dark { display: none; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
code {
  font: 500 .86em var(--f-mono);
  padding: .08em .36em;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  white-space: nowrap;
}
em { font-style: normal; color: var(--accent); }
b { font-weight: 600; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--invert-bg); color: var(--invert-fg); padding: 8px 14px;
  font: 700 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
}
.skip:focus { left: 8px; }

.num {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 20px; padding: 0 5px;
  background: var(--accent); color: #fff;
  font: 700 10px/1 var(--f-mono); letter-spacing: .06em;
}
:root[data-theme="dark"] .num { color: #0b0b0c; }

/* ───────── Top bar ───────── */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: stretch;
  height: var(--bar);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-strong);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--gutter) 0 14px;
  border-right: 1px solid var(--line);
  text-decoration: none;
}
.brand-name { font: 600 18px/1 var(--f-display); letter-spacing: -.02em; }
.brand-name b { color: var(--accent); font-weight: 600; }

.topnav { display: none; align-items: stretch; }
.topnav a {
  display: flex; align-items: center; padding: 0 16px;
  font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.topnav a:hover { color: var(--ink); }
.topnav a.is-active { color: var(--invert-fg); background: var(--invert-bg); margin: 14px 4px; padding: 0 8px; }
@media (min-width: 1240px) { .topnav { display: flex; } }

.topbar-tools { display: flex; align-items: stretch; margin-left: auto; }
.tool {
  display: grid; place-items: center; width: 50px;
  background: none; border: 0; border-left: 1px solid var(--line);
  color: var(--ink); cursor: pointer;
  font: 700 11px/1 var(--f-mono); letter-spacing: .1em;
}
.tool:hover { background: var(--bg-sunken); }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-gh svg { fill: currentColor; stroke: none; }
:root[data-theme="dark"] .i-moon, :root[data-theme="light"] .i-sun { display: none; }

.cta-top {
  display: none; align-items: center; padding: 0 22px;
  background: var(--invert-bg); color: var(--invert-fg); text-decoration: none;
  font: 700 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.cta-top:hover { background: var(--accent); color: #fff; }
@media (min-width: 640px) { .cta-top { display: flex; } }

/* ───────── Fixed decorations ───────── */

.deco { display: none; }
@media (min-width: 1240px) {
  .deco { display: block; position: fixed; inset: var(--bar) 0 0 auto; width: var(--rail); pointer-events: none; z-index: 5; }
}
.deco-title {
  position: absolute; top: 22px; right: 34px;
  font: 800 24px/1 var(--f-display); letter-spacing: .01em; text-align: right;
  color: var(--ink);
  transition: opacity .25s;
}
.deco-title.is-swapping { opacity: 0; }
.deco-index {
  position: absolute; right: 34px; bottom: 28px; margin: 0; padding: 0; list-style: none; text-align: right;
}
.deco-index li { pointer-events: auto; }
.deco-index a {
  font: 700 15px/1.3 var(--f-display); letter-spacing: .04em; text-transform: uppercase;
  color: var(--faint); text-decoration: none;
}
.deco-index a:hover { color: var(--muted); }
.deco-index a.is-active { color: var(--ink); }

.ruler {
  position: absolute; top: 0; right: 0; bottom: 0; width: 18px;
  border-left: 1px solid var(--line);
  background:
    repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px 64px) right top / 12px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 16px) right top / 6px 100% no-repeat;
}
.ruler-mark { position: absolute; right: 0; top: 0; width: 18px; height: 2px; background: var(--accent); }

/* ───────── Sections ───────── */

main { margin-right: var(--rail); border-right: 1px solid var(--line); }
@media (max-width: 1239px) { main { border-right: 0; } }

.section { border-bottom: 1px solid var(--line-strong); }

.crumb {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  font: 500 11px/1.4 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.crumb-r { color: var(--faint); text-align: right; }

.pad { padding: clamp(32px, 6vw, 72px) var(--gutter); }

h1, h2, h3 { font-family: var(--f-display); margin: 0; color: var(--ink); }
h1 {
  font-weight: 700; font-size: clamp(40px, 7.2vw, 88px); line-height: 1.02; letter-spacing: -.035em;
  max-width: 15ch; margin: 0 auto; text-wrap: balance;
}
h2 { font-weight: 700; font-size: clamp(32px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -.03em; max-width: 18ch; }
h3 { font-weight: 600; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }

.body { color: var(--muted); max-width: 62ch; margin: 18px 0 0; }
.note { color: var(--faint); font-size: 14px; margin: 22px 0 0; }
.opt {
  display: flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.actions.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 20px;
  border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--ink);
  font: 700 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn-solid { background: var(--invert-bg); color: var(--invert-fg); border-color: var(--invert-bg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-wide { width: 100%; justify-content: center; margin-top: 18px; }

/* ───────── Hero ───────── */

.hero-inner { text-align: center; padding: clamp(40px, 7vw, 88px) var(--gutter) 40px; }
.hero-icon {
  width: clamp(80px, 9vw, 104px); margin: 0 auto 22px;
  border-radius: 22%; box-shadow: var(--shadow);
}
.hero-tag { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.hero-name { font: 600 24px/1 var(--f-display); letter-spacing: -.02em; }
.hero-name b { color: var(--accent); font-weight: 600; }
.lead { color: var(--muted); font-size: clamp(16px, 1.6vw, 18px); max-width: 60ch; margin: 26px auto 0; }
.hero .actions { justify-content: center; }
.meta { margin: 22px 0 0; font: 500 11px/1.5 var(--f-mono); letter-spacing: .14em; color: var(--faint); }

/* Screenshot frames */
.shot { margin: 0; }
.shot-frame {
  display: block; width: 100%; padding: 0; cursor: zoom-in;
  background: var(--bg-raised); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.shot-frame img { width: 100%; }
.shot figcaption {
  display: flex; justify-content: space-between; gap: 16px; padding: 12px 2px 0;
  font: 500 11px/1.4 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.cap-r { color: var(--faint); }
.hero-shot { padding: 8px var(--gutter) clamp(40px, 6vw, 72px); max-width: 1180px; margin: 0 auto; }

/* ───────── Cells (highlights, principles) ───────── */

/* Hairline grids: the 1px gap shows the line colour between cells. */
.cells, .timeline, .crates { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); }
@media (min-width: 720px) { .cells, .crates { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .cells { grid-template-columns: repeat(3, 1fr); } }
.cell, .timeline li, .crate { background: var(--bg); transition: background .2s; }
.cell:hover, .crate:hover { background: var(--bg-raised); }
.cell { position: relative; padding: 36px var(--gutter) 40px; }
.cells-more { border-top: 1px solid var(--line); }
.cell-num { position: absolute; top: 16px; right: 18px; font: 500 11px/1 var(--f-mono); color: var(--faint); letter-spacing: .1em; }
.cell h3 { margin-bottom: 12px; padding-right: 28px; }
.cell p { margin: 0; color: var(--muted); font-size: 15px; }

/* ───────── Diagrams tabs ───────── */

.tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 36px 0 0; border: 1px solid var(--line-strong); width: fit-content; max-width: 100%; }
.tabs [role="tab"] {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border: 0; border-right: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer;
  font: 700 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
}
.tabs [role="tab"]:last-child { border-right: 0; }
.tabs [role="tab"] .num { background: var(--line-strong); }
.tabs [role="tab"][aria-selected="true"] { background: var(--invert-bg); color: var(--invert-fg); }
.tabs [role="tab"][aria-selected="true"] .num { background: var(--accent); }
.tabs [role="tab"]:not([aria-selected="true"]):hover { background: var(--bg-raised); color: var(--ink); }

.panel { display: grid; gap: 28px; margin-top: 28px; align-items: start; }
@media (min-width: 1080px) { .panel { grid-template-columns: 300px 1fr; gap: 40px; } }
.panel[hidden] { display: none; }

.ticks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ticks li {
  position: relative; padding: 14px 0 14px 28px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 15px;
}
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 21px; width: 10px; height: 10px;
  border: 2px solid var(--accent); background: var(--accent-soft);
}

/* ───────── Gallery ───────── */

.gallery { display: grid; gap: 40px 32px; padding: clamp(32px, 5vw, 56px) var(--gutter); }
@media (min-width: 860px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* ───────── Astah ───────── */

.split { display: grid; }
@media (min-width: 1080px) { .split { grid-template-columns: 1.1fr .9fr; } .split > .pad { border-right: 1px solid var(--line); } }

.flow {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  padding: clamp(32px, 5vw, 64px) var(--gutter);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}
.flow-node {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: min(280px, 100%); padding: 18px 20px;
  background: var(--bg-raised); border: 1px solid var(--line-strong);
  text-align: center;
}
.flow-main { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.flow-main img { border-radius: 22%; margin-bottom: 4px; }
.flow-k { font: 700 22px/1 var(--f-display); letter-spacing: -.01em; }
.flow-s { font: 500 11px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.flow-arrow {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 64px; width: 2px; background: var(--accent);
}
.flow-arrow i {
  position: absolute; bottom: -1px; left: 50%; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg);
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
}
.flow-arrow span {
  position: absolute; left: 14px; white-space: nowrap;
  font: 500 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  background: var(--bg); padding: 3px 6px;
}

/* ───────── Get it ───────── */

.get { display: grid; }
@media (min-width: 1080px) { .get { grid-template-columns: 1.35fr .65fr; } .get-main { border-right: 1px solid var(--line); } }
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 1fr; gap: 6px; counter-increment: s; }
@media (min-width: 640px) { .steps li { grid-template-columns: 110px 1fr; align-items: center; gap: 16px; } }
.step-k { font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.step-k::before { content: "0" counter(s) " "; color: var(--accent); }
.cmd {
  display: flex; align-items: stretch; min-width: 0;
  background: var(--invert-bg); color: var(--invert-fg);
  border: 1px solid var(--invert-bg);
}
.cmd code {
  flex: 1; min-width: 0; overflow-x: auto; padding: 14px 16px;
  background: none; border: 0; color: inherit; font-size: 13px; white-space: pre;
  scrollbar-width: none;
}
.cmd code::-webkit-scrollbar { display: none; }
.cmd code::before { content: "$ "; opacity: .45; }
.copy {
  flex: none; padding: 0 14px; border: 0; border-left: 1px solid color-mix(in srgb, var(--invert-fg) 25%, transparent);
  background: none; color: inherit; cursor: pointer;
  font: 700 10px/1 var(--f-mono); letter-spacing: .14em;
}
.copy:hover { background: var(--accent); color: #fff; }

.steps-side { margin-top: 22px; }
@media (min-width: 640px) { .steps-side li { grid-template-columns: 1fr; gap: 6px; } }
.note code { white-space: normal; overflow-wrap: anywhere; }
.signing {
  margin: 22px 0 0; padding: 12px 16px;
  border-left: 2px solid var(--accent); background: var(--accent-soft);
  color: var(--muted); font-size: 14px;
}

.downloads { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.downloads li {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.dl-os { font: 700 22px/1.1 var(--f-display); letter-spacing: -.01em; }
.dl-req { grid-row: 2; font: 500 11px/1.5 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.downloads .btn { grid-row: 1 / 3; grid-column: 2; }
@media (min-width: 720px) {
  .downloads li { grid-template-columns: 130px 1fr auto; }
  .dl-req { grid-row: auto; }
  .downloads .btn { grid-row: auto; grid-column: auto; }
}

.get-side { display: grid; align-content: start; }
.side-block { padding: 36px var(--gutter); border-bottom: 1px solid var(--line); }
.side-block .body { margin-top: 0; font-size: 15px; }
.facts { margin: 0; padding: 24px var(--gutter) 36px; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.facts dt { font: 500 11px/1.6 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 0; font: 500 13px/1.6 var(--f-mono); text-align: right; }

/* ───────── Roadmap ───────── */

.timeline { list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .timeline { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .timeline { grid-template-columns: repeat(4, 1fr); } }
.timeline li { position: relative; padding: 30px var(--gutter) 34px; }
.timeline h3 { font-size: 18px; margin: 14px 0 8px; }
.timeline p { margin: 0; color: var(--muted); font-size: 14px; }
.tl-k {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
}
.done .tl-k::before { content: ""; width: 14px; height: 14px; background: var(--accent); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.next { background: var(--bg-raised); }
.next .tl-k { color: var(--accent); }
.next .tl-k::before { content: ""; width: 12px; height: 12px; border: 2px dashed var(--accent); border-radius: 50%; }

/* ───────── Crates ───────── */

@media (min-width: 1080px) { .crates { grid-template-columns: repeat(4, 1fr); } }
.crate { padding: 26px var(--gutter) 28px; }
a.crate { text-decoration: none; }
@media (min-width: 1080px) { .crate-more { grid-column: span 3; } }
.crate-more > span { font: 700 11px/1.6 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.crate > code { font-size: 13px; background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.crate p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

/* ───────── Closing & footer ───────── */

.closing { text-align: center; padding: clamp(56px, 9vw, 112px) var(--gutter); border-bottom: 1px solid var(--line-strong); }
.closing .opt { justify-content: center; }
.closing-text { font: 600 clamp(24px, 3.2vw, 38px)/1.2 var(--f-display); letter-spacing: -.02em; max-width: 26ch; margin: 0 auto; }

.footer {
  margin-right: var(--rail);
  display: grid; gap: 14px; padding: 36px var(--gutter) 48px;
  color: var(--faint); font-size: 13px;
}
.footer p { margin: 0; max-width: 80ch; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.footer-brand img { border-radius: 22%; }
.footer-links { display: flex; gap: 20px; font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
.footer-links a { text-decoration: none; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ───────── Lightbox ───────── */

.lightbox {
  width: min(96vw, 1800px); max-width: none; max-height: 94vh; padding: 0;
  border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--ink);
}
.lightbox::backdrop { background: rgba(10, 10, 12, .72); backdrop-filter: blur(4px); }
.lightbox img { width: 100%; max-height: 94vh; object-fit: contain; }
.lightbox-close {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px;
  background: var(--invert-bg); color: var(--invert-fg); border: 0; cursor: pointer;
  font: 400 24px/1 var(--f-body);
}

/* ───────── Reveal on scroll ───────── */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
