/* vitali87.com. Paper, ink and apricot. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f3ea;
  --surface: #fffdf8;
  --ink: #17191d;
  --muted: #5b616b;
  --rule: #d9d1c0;
  --accent: #a94510;
  --apricot: #f08a3c;
  --apricot-soft: #fbe5d2;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 44rem;
  --wide: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

/* Dark theme. It applies when the visitor picks it with the switch, or when
   their system asks for it and they have not picked light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #101215;
    --surface: #181b20;
    --ink: #ece6da;
    --muted: #a0a6b0;
    --rule: #2c3139;
    --accent: #f5a468;
    --apricot: #f08a3c;
    --apricot-soft: #3a2415;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101215;
  --surface: #181b20;
  --ink: #ece6da;
  --muted: #a0a6b0;
  --rule: #2c3139;
  --accent: #f5a468;
  --apricot: #f08a3c;
  --apricot-soft: #3a2415;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: -0.018em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.5rem, 1.6rem + 4.2vw, 4.25rem); font-variation-settings: "opsz" 144; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.4rem); margin-top: 0.15em; }
h3 { font-size: 1.35rem; letter-spacing: -0.01em; line-height: 1.2; }
p, ul, ol, dl, pre, figure, table { margin: 0 0 1.1em; }
p { text-wrap: pretty; }

code, pre, kbd { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--apricot-soft); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--apricot);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: 0.9em; overflow-wrap: normal; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; padding-block: 0.7rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono); font-weight: 600; font-size: 0.95rem; color: var(--ink); text-decoration: none;
}
.mark { width: 1.75rem; height: 1.75rem; flex: none; }
.mark rect { fill: var(--ink); }
.mark path { fill: none; stroke: var(--apricot); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.mark circle { fill: var(--paper); }
.mark .tip { fill: var(--apricot); }
.brand { margin-right: auto; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; flex: none;
  border: 1.5px solid var(--rule); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.2s ease;
}
.theme-toggle:hover { background: var(--apricot-soft); border-color: var(--ink); transform: rotate(180deg); }
.theme-toggle[hidden] { display: none; }
@media (max-width: 40rem) { .site-header nav { order: 3; flex-basis: 100%; } }
.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0.1rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  font-family: var(--mono); font-size: 0.82rem; color: var(--muted); text-decoration: none;
  padding: 0.35rem 0; display: inline-block; border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--apricot); }

/* shared section rhythm */
main > section, main > article { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
main > section + section { border-top: 1px solid var(--rule); }
.label {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--accent);
  margin: 0 0 0.5rem;
}
.lead { font-size: 1.2em; line-height: 1.5; }
h1 + .lead { margin-top: 1.3rem; }
.more { font-family: var(--mono); font-size: 0.88rem; margin-top: 1.4rem; }
.more a::after { content: " \2192"; }
h2 + p, h2 + .cards, h2 + ul, h2 + dl, h2 + ol, h2 + pre, h2 + .table-scroll, h2 + .faq { margin-top: 1.1rem; }
.minor { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 2.2rem 0 0.4rem; }

/* hero */
.hero { padding-top: clamp(3rem, 9vw, 6.5rem) !important; padding-bottom: clamp(1.5rem, 4vw, 2.5rem) !important; }
.query {
  font-family: var(--mono); font-size: clamp(0.72rem, 0.6rem + 0.5vw, 0.86rem); color: var(--muted);
  margin: 0 0 1.6rem; overflow-wrap: anywhere;
}
.query .kw { color: var(--accent); font-weight: 600; }
.query .str { color: var(--ink); }
.hero h1 {
  font-size: clamp(3.2rem, 1.2rem + 10.5vw, 7.4rem);
  font-weight: 620; line-height: 0.92; letter-spacing: -0.035em;
  margin-left: -0.04em;
}
.altnames { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; font-size: 1.02rem; color: var(--muted); margin: 1.1rem 0 0; }
.tagline {
  font-family: var(--display); font-style: italic; font-weight: 420;
  font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.7rem); line-height: 1.1; color: var(--accent);
  margin: 1.6rem 0 1.2rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }
.button {
  display: inline-block; font-family: var(--mono); font-size: 0.86rem; font-weight: 600;
  padding: 0.7rem 1.15rem; border-radius: 999px; text-decoration: none;
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink);
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.button:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { background: var(--apricot-soft); border-color: var(--ink); color: var(--ink); }

/* entity graph */
.graph { padding-top: 0 !important; border-top: 0 !important; }
.egraph {
  background-image: radial-gradient(var(--rule) 1.1px, transparent 1.2px);
  background-size: 22px 22px;
  border: 1px solid var(--rule); border-radius: 14px;
  padding: clamp(0.5rem, 2vw, 1.25rem);
}
.egraph svg { display: none; width: 100%; }
.g-edge { stroke: var(--muted); stroke-width: 1.3; }
.g-arrow { fill: var(--muted); }
.g-edge-label rect { fill: var(--paper); }
.g-edge-label text { font: 600 10.5px var(--mono); letter-spacing: 0.09em; fill: var(--muted); }
.g-node rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; transition: fill 0.12s ease; }
.g-node .g-text { font: 500 15px var(--mono); fill: var(--ink); }
.g-node .g-type { font: 500 10.5px var(--mono); letter-spacing: 0.05em; fill: var(--muted); }
.g-node.t-project rect { stroke: var(--accent); stroke-width: 2; }
.g-node.t-idea rect { stroke: var(--accent); stroke-dasharray: 5 4; }
.g-ring { fill: var(--paper); stroke: var(--apricot); stroke-width: 3; }
.g-node .g-badge { fill: var(--ink); stroke: none; }
.g-node .g-name { font: 600 15px var(--mono); fill: var(--paper); }
.g-link:hover rect { fill: var(--apricot-soft); }
.g-link { cursor: pointer; }
.triples { list-style: none; margin: 0; padding: 0.4rem 0.5rem; font-family: var(--mono); font-size: 0.8rem; line-height: 1.5; }
.triples li { padding: 0.45rem 0; border-bottom: 1px dashed var(--rule); overflow-wrap: anywhere; }
.triples li:last-child { border-bottom: 0; }
.triples .t-rel { color: var(--muted); margin-inline: 0.15rem; }
.triples .t-node { color: var(--ink); background: var(--paper); }
.triples a.t-node { color: var(--accent); }
.caption { font-size: 0.88rem; color: var(--muted); margin: 0.9rem 0 0; max-width: 44rem; }

@media (min-width: 54rem) {
  .egraph svg { display: block; }
  .egraph .triples {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}

/* cards and lists */
.cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 1.4rem 1.4rem 1.2rem; display: flex; flex-direction: column;
  border-top: 4px solid var(--apricot);
}
.card h3 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { font-size: 0.98em; }
.facts, .links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; font-family: var(--mono); font-size: 0.76rem; }
.facts { gap: 0.35rem 0.4rem; margin: auto 0 0.9rem; color: var(--muted); }
.facts li { border: 1px solid var(--rule); border-radius: 999px; padding: 0.12rem 0.6rem; background: var(--paper); }
.links { gap: 0.3rem 1.1rem; margin: 0; font-size: 0.84rem; font-weight: 600; }

.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.list li { display: grid; grid-template-columns: minmax(8.5rem, 12rem) 1fr; gap: 0.2rem 1.5rem; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.list li > a { font-family: var(--mono); font-size: 0.9rem; font-weight: 600; }
.list li > span { color: var(--muted); font-size: 0.96em; }
@media (max-width: 36rem) { .list li { grid-template-columns: 1fr; } }

/* prose pages */
.prose h2 { margin-top: 2.6rem; }
.prose section { margin-top: 2.8rem; padding: 0.2rem 0; border-radius: 10px; }
.prose section > h2 { margin-top: 0; }
.prose section > .label { margin-bottom: 0.35rem; }
.prose section:target { animation: arrive 2.2s ease-out; }
.prose section:target > h2 { text-decoration: underline; text-decoration-color: var(--apricot); text-decoration-thickness: 0.1em; text-underline-offset: 0.22em; }
@keyframes arrive { from { background: var(--apricot-soft); box-shadow: 0 0 0 0.9rem var(--apricot-soft); } to { background: transparent; box-shadow: 0 0 0 0.9rem transparent; } }
.prose h3 { margin: 1.6rem 0 0.4rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--accent); }
.jump { display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; margin: 1.5rem 0 0; font-family: var(--mono); font-size: 0.78rem; }
.jump a { border: 1px solid var(--rule); border-radius: 999px; padding: 0.22rem 0.75rem; text-decoration: none; color: var(--ink); background: var(--surface); }
.jump a:hover { border-color: var(--accent); color: var(--accent); }
.byline { font-family: var(--mono); font-size: 0.84rem; color: var(--muted); }
.cite { font-family: var(--mono); font-size: 0.84rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 0.8rem 1rem; overflow-wrap: anywhere; }

.crumbs { padding-top: 1.4rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; margin: 0; padding: 0; font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--rule); }
.crumbs a { color: var(--muted); }
.crumbs + article { padding-top: clamp(1.5rem, 4vw, 2.5rem); }

.portrait { margin: 1.8rem 0; }
.portrait img { display: block; width: 11rem; height: 11rem; object-fit: cover; border-radius: 50%; border: 3px solid var(--apricot); padding: 4px; background: var(--paper); }
.portrait.wide img { width: 14rem; height: 14rem; border-radius: 14px; }
.portrait figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.7rem; }
@media (min-width: 48rem) { .prose > .portrait:not(.wide) { float: right; margin: 0.3rem 0 1rem 2rem; } }

.factsheet { border-top: 1px solid var(--rule); margin-top: 1.1rem; }
.factsheet > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.2rem 1.2rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.factsheet dt { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding-top: 0.25em; }
.factsheet dd { margin: 0; }
.factsheet.compact { margin-top: 1.6rem; }
@media (max-width: 30rem) { .factsheet > div { grid-template-columns: 1fr; } }

.bio { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.3rem 0.4rem; margin-top: 1.2rem; }
.bio-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-bottom: 0.7rem; }
.prose .bio h2 { font-size: 1.35rem; margin: 0; }
.count { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.copy {
  margin-left: auto; font-family: var(--mono); font-size: 0.76rem; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0.3rem 0.85rem;
}
.copy:hover { background: var(--apricot-soft); }
.copy[data-done] { background: var(--ink); color: var(--paper); }

.faq { border-top: 1px solid var(--rule); }
.qa { padding: 1rem 0 0.2rem; border-bottom: 1px solid var(--rule); }
.prose .qa h3, .qa h3 { font-size: 1.15rem; margin: 0 0 0.35rem; }

.steps { list-style: none; padding: 0 !important; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 0.2rem 0 0.2rem 3.4rem; margin-bottom: 1.2rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1rem;
  width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--apricot); font-family: var(--mono); font-weight: 700; font-size: 0.95rem; color: var(--accent);
}
.prose .steps h3 { margin: 0.25rem 0 0.3rem; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.94em; min-width: 30rem; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem 0.7rem 0; border-bottom: 1px solid var(--rule); }
thead th { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--ink); }
tbody th { font-weight: 600; }

.notfound { min-height: 55vh; }

/* footer */
.site-footer { border-top: 1px solid var(--rule); padding-block: 2.5rem 3rem; margin-top: 2rem; }
.foot-name { font-family: var(--display); font-size: 1.5rem; font-weight: 560; margin: 0 0 0.8rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1.2rem; }
.foot-name span { font-family: var(--body); font-size: 0.95rem; font-weight: 400; color: var(--muted); }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.3rem; padding: 0; margin: 0 0 1.4rem; font-family: var(--mono); font-size: 0.84rem; }
.fine { font-size: 0.84rem; color: var(--muted); margin: 0 0 0.3rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .site-header, .site-footer, .actions, .copy, .skip { display: none !important; }
  body { background: #fff; color: #000; }
}
