/* Site stylesheet for janbrockmann.me, built on Jan's brand design system (Dot TTY).
   Colors, fonts and radius come from tokens.css (a copy of the brand tokens); fonts.css self-hosts the fonts.
   Brand rules (full text in the brand README):
   1. Orange means focus: one big orange thing per screen; small marks don't count.
   2. Status is a shape, drawn in CSS, never a glyph.
   3. Doto spells, mono punctuates: Doto only at 48px+, uppercase, letters, digits, + and -.
   4. Plain English inside the terminal: commands are verb + object.
   5. Put it in a pane, and don't nest panes.
   6. The bar is the signature: once per page, at the bottom edge (the site footer).
   Components and their class names are ported from the brand guide.html. Port more from there when a page needs them.
   Doto: set font-variation-settings: "ROND" 100 on every rule that uses it (the font shorthand resets it). */

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; }
body { font: 400 16px/1.65 var(--sans); color: var(--text); -webkit-font-smoothing: antialiased; font-variation-settings: "ROND" 100;
  min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
::selection { background: var(--accent); color: var(--bg); }
a { color: var(--text); text-decoration: none; }
code { font-family: var(--mono); font-size: .9em; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- helpers ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 32px; }
.acc { color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nw { white-space: nowrap; }
.display { font-family: var(--display); font-weight: 900; font-variation-settings: "ROND" 100; text-transform: uppercase; letter-spacing: -.02em; }
.pip { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; display: inline-block; }

/* ---------- components ---------- */
/* pane: 1px rounded border with the title cut into the top edge. Sits on --bg, never nested */
.pane { --px: 24px; --pb: 22px; position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: 26px var(--px) var(--pb); min-width: 0; }
.pane > .t { position: absolute; top: 0; left: 16px; transform: translateY(-50%); padding: 0 8px; background: var(--bg); font: 400 12px/1.2 var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pane > .t .pip { width: 6px; height: 6px; }   /* pip in the title = this pane is live */

.cursor { display: inline-block; width: .6em; height: 1.15em; background: var(--accent); vertical-align: -.22em; margin-left: .1em; animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* prompt: user in white, the › in orange */
.prompt { font-family: var(--mono); }
.prompt .u { color: var(--text); font-weight: 500; }
.prompt .c { color: var(--accent); font-weight: 600; }

.btn { display: inline-flex; gap: 12px; align-items: center; font: 500 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--bg); padding: 12px 12px 12px 16px; border-radius: 6px; }
.btn:hover { background: var(--text); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 16px; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--text); }
.link { font-family: var(--mono); color: var(--text); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line); text-decoration-thickness: 1px; }
.link:hover { text-decoration-color: var(--accent); }

/* list: name in mono, what it is in muted Geist. Fixed first column so the descriptions line up across rows */
.list { list-style: none; font: 400 14px/1.5 var(--mono); margin: 0 calc(-1 * var(--px)); }
.list li { display: grid; grid-template-columns: 220px 1fr; gap: 4px 24px; align-items: baseline; padding: 7px var(--px); border-left: 3px solid transparent; }
.list b { font-weight: 500; color: var(--text); }
.list .d { font: 400 14px/1.5 var(--sans); color: var(--muted); }

/* status is a shape, not a color */
.st { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.st.done { background: var(--text); }
.st.run  { background: var(--accent); box-shadow: 0 0 0 4px var(--halo); }

/* status bar = the signature (the orange segment is always the name) */
.bar { display: flex; align-items: stretch; background: var(--surface); font: 400 12px/30px var(--mono); border-radius: 6px; overflow: hidden; white-space: nowrap; }
.bar .seg { padding: 0 14px; }
.bar .sig { background: var(--accent); color: var(--bg); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.bar .fill { flex: 1; }
.bar a.seg { color: var(--muted); }
.bar a.seg:hover { color: var(--text); }
.bar a.seg:focus-visible { outline-offset: -2px; }   /* the bar clips overflow */

/* dot grid: finer and dimmer than Doto's dots, only behind display moments. Masks read only alpha, so the token's color doesn't matter */
.dots::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, var(--grid) 1px, transparent 1.5px); background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 75% 40%, var(--bg) 20%, transparent 75%); mask-image: radial-gradient(ellipse 70% 80% at 75% 40%, var(--bg) 20%, transparent 75%); }

/* section heading: muted mono # plus a Doto word (short names only, see brand rule 3) */
.sec { display: flex; align-items: baseline; gap: 18px; margin-bottom: 18px; }
.sec .h { font: 500 20px/1 var(--mono); color: var(--muted); }
.sec .w { font: 900 56px/1 var(--display); font-variation-settings: "ROND" 100; text-transform: uppercase; letter-spacing: -.02em; }
.intro { color: var(--muted); max-width: 640px; font-size: 17px; margin-bottom: 12px; }
.intro b { color: var(--text); font-weight: 600; }
.intro + .pane { margin-top: 24px; }   /* room for the pane title after an intro (About Experience, side projects list) */
.sec, .cs { scroll-margin-top: 76px; }   /* in-page jump targets land below the sticky nav, like blog headings */

/* case study card number */
.cs .num { font: 900 56px/1 var(--display); font-variation-settings: "ROND" 100; color: var(--muted); }
.cs .num + h2 { margin-top: 12px; }

/* markdown-style heading marker (#, ##) next to Geist titles */
.mk { font-family: var(--mono); font-weight: 400; color: var(--muted); margin-right: .35em; }

/* ---------- site chrome ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: var(--bg); background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 1px solid var(--line); }
.nav .wrap { overflow-x: auto; white-space: nowrap; display: flex; gap: 24px; align-items: center; height: 52px; font: 400 13px var(--mono); }
.nav a { color: var(--muted); }
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; }
.nav .nav-brand { color: var(--text); font-weight: 500; }
.nav-links { margin-left: auto; display: flex; gap: 24px; }

.site-footer { padding: 48px 0 64px; }
.foot-note { font: 12px var(--mono); color: var(--muted); margin-top: 16px; }

/* ---------- pages ---------- */
/* home */
.hero { position: relative; padding: 56px 0 64px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .wrap { position: relative; }
.hero-pane { --px: 40px; --pb: 34px; padding-top: 40px; background: color-mix(in srgb, var(--bg) 60%, transparent); }
.hero .prompt { font-size: 15px; }
.hero h1 { font-size: clamp(48px, 10vw, 144px); line-height: .86; margin: 26px 0 30px; }
.hero .lede-big { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.hero .lede { font-size: 18px; color: var(--muted); max-width: 720px; margin-top: 8px; }
.hero .lede b { color: var(--text); font-weight: 600; }
.hero .lede + .prompt { margin-top: 30px; }   /* second prompt: the page index */
.hero .prompt + .list { margin-top: 8px; }
.actions { display: flex; gap: 16px; align-items: center; margin-top: 24px; flex-wrap: wrap; }

.block { padding: 64px 0; border-bottom: 1px solid var(--line); }
.block .pane + .pane { margin-top: 40px; }   /* stacked panes in one section (skills, education) */
.about-layout .block:last-child { border-bottom: 0; }   /* no 680px line above the footer bar */
.about-layout .toc { margin-top: 64px; }   /* = .block padding-top, so the pane lines up with the Results heading */

/* experience: native <details name="experience"> accordion */
.job + .job { border-top: 1px solid var(--line); }
.job summary { display: grid; grid-template-columns: 9px 1fr auto; gap: 16px; align-items: start; padding: 18px 0; cursor: pointer; list-style: none; }
.job:first-of-type summary { padding-top: 6px; }
.job summary::-webkit-details-marker { display: none; }
.job summary::after { content: "+"; font: 400 18px/25px var(--mono); color: var(--muted); }
.job[open] summary::after { content: "\2212"; }
.job summary:hover::after { color: var(--text); }
.job .st { margin-top: 8px; }
.job-head { min-width: 0; }
.job-title { display: block; font: 600 18px/1.4 var(--sans); }
.job-meta { display: block; font: 400 13px/1.5 var(--mono); color: var(--muted); margin-top: 2px; }
.job-body { font: 400 15px/1.6 var(--sans); padding: 0 0 20px calc(9px + 16px + 1.1em); }
.job-body li::marker { color: var(--muted); }
.job-body li + li { margin-top: .35em; }
.job-intro { font: 400 15px/1.6 var(--sans); color: var(--muted); padding: 0 0 10px calc(9px + 16px); }   /* aligned with .job-title */
.job-body b { font-weight: 600; }

/* other pages */
.page { padding: 56px 0 72px; }
.page-head { margin-bottom: 40px; }

/* blog index: the whole row is the link */
.posts { list-style: none; margin: -6px calc(-1 * var(--px)) -8px; }
.posts a { display: block; padding: 12px var(--px); border-left: 3px solid transparent; }
.posts a:hover, .posts a:focus-visible { background: var(--selected); border-left-color: var(--accent); }
.posts a:focus-visible { outline-offset: -2px; }
.posts .b-meta { display: block; }
.post-title { display: block; font: 600 19px/1.35 var(--sans); color: var(--text); margin-top: 4px; }
.post-excerpt { display: block; font: 400 15px/1.55 var(--sans); color: var(--muted); margin-top: 4px; }
.posts li.muted { padding: 12px var(--px); }

/* blog post */
.post-main { max-width: 680px; min-width: 0; }
.b-meta { font: 12px var(--mono); color: var(--muted); }
.b-title { font: 700 clamp(32px, 5vw, 48px)/1.08 var(--sans); letter-spacing: -.035em; margin: 14px 0 32px; }
.toc { display: none; position: sticky; top: 76px; align-self: start; }
.toc ul { list-style: none; font: 400 13px/1.5 var(--mono); }
.toc li + li { margin-top: 8px; }
.toc a { display: block; position: relative; color: var(--muted); }
.toc a:hover { color: var(--text); }
.toc .lvl-3 { padding-left: 14px; }
.toc a[aria-current] { color: var(--text); }
.toc a[aria-current]::before { content: ""; position: absolute; left: -14px; top: calc(.75em - 3px); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* side projects */
.projects { display: grid; gap: 40px; }

/* ---------- prose: rendered markdown (posts, manifesto, small pages, project cards) ---------- */
.prose { font: 400 17px/1.7 var(--sans); color: var(--text); overflow-wrap: anywhere; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .table-wrap { margin: 0 0 1.1em; }
.prose > :first-child { margin-top: 0; }
.pane.prose > :last-child { margin-bottom: 0; }
.prose h2 { font: 600 26px/1.25 var(--sans); letter-spacing: -.02em; margin: 2em 0 .5em; }
.prose h3 { font: 600 20px/1.3 var(--sans); letter-spacing: -.01em; margin: 1.6em 0 .45em; }
.prose h4 { font: 600 17px/1.4 var(--sans); margin: 1.4em 0 .35em; }
.prose h2::before { content: "##"; }
.prose h3::before { content: "###"; }
.prose h2::before, .prose h3::before { font-family: var(--mono); font-weight: 400; color: var(--muted); margin-right: .35em; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 76px; }
.prose a:not([class]) { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
.prose a:not([class]):hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li::marker { color: var(--muted); }
.prose li + li { margin-top: .3em; }
.prose li > ul, .prose li > ol { margin: .3em 0 0; }
.prose strong, .prose b { font-weight: 600; }
.prose :not(pre) > code { font-size: .88em; background: var(--surface); padding: 2px 6px; border-radius: 4px; }
.prose .code-pane { margin: 28px 0; }
.prose .code-pane pre { font: 400 14px/1.75 var(--mono); overflow-x: auto; overflow-wrap: normal; tab-size: 4; background: none; }
.prose .code-pane pre code { font-size: inherit; }
.prose blockquote { border-left: 2px solid var(--muted); padding: 2px 0 2px 16px; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose img { display: block; margin: 28px 0; border: 1px solid var(--line); border-radius: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.prose .table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; overflow-wrap: normal; }
.prose th { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; }
.prose td { font-size: 15px; }
.prose th, .prose td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }

/* ---------- project cards: components ported from the brand guide ---------- */
.flag { font: 400 13px var(--mono); margin-right: 14px; white-space: nowrap; }
.flag i { font-style: normal; color: var(--muted); }
.label { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.metric { margin: 28px 0; }
.metric .big { display: block; font: 900 104px/.85 var(--display); font-variation-settings: "ROND" 100; color: var(--accent); letter-spacing: -.03em; }
.metric .big .sym { font: 600 .38em/1 var(--mono); letter-spacing: 0; margin-left: .08em; }
.metric .big .sym.pre { margin: 0 .08em 0 0; }   /* unit before the number, e.g. $ */
.metric .m-l { display: flex; margin-top: 18px; }
.log { list-style: none; font: 400 14px/2.1 var(--mono); }
.log li { display: grid; grid-template-columns: auto 9px 1fr; gap: 12px; align-items: center; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.prose .log { padding-left: 0; }
.prose .log li + li { margin-top: 0; }
.note { border-left: 2px solid var(--muted); padding: 2px 0 2px 16px; font-size: 15px; }
.note b { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }

/* ---------- prism: brand code colors (keywords orange, comments and punctuation muted, the rest text) ---------- */
.token.comment, .token.prolog, .token.doctype, .token.cdata, .token.punctuation, .token.operator { color: var(--muted); }
/* keep this rule last: Prism aliases decorators as punctuation */
.token.keyword, .token.boolean, .token.decorator, .token.annotation, .token.atrule, .token.important { color: var(--accent); }

/* ---------- media queries ---------- */
@media (min-width: 1024px) {
  .post-layout { display: grid; grid-template-columns: minmax(0, 680px) 220px; gap: 56px; justify-content: space-between; }
  .toc { display: block; }
  .toc-inline { display: none; }   /* the sidebar .toc takes over */
}
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 40px 0 48px; }
  .hero-pane { --px: 22px; --pb: 26px; padding-top: 32px; }
  .block { padding: 48px 0; }
  .page { padding: 32px 0 48px; }
  .sec .w { font-size: 48px; }
  .prose h2 { font-size: 22px; }
  .bar-tagline { display: none; }
  .list li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 559px) {
  .nav-last { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}
