/* ==========================================================================
   Beton — petrovs.info
   Light poured concrete, black ink, hairline rules. Architecture drawn in SVG
   with the same concrete textures (see layouts/_partials/defs.html).
   ========================================================================== */

:root {
  --ground: #cbcbc8;       /* average tone of img/ground.jpg */
  --ink: #161616;
  --ink-soft: #3d3d3b;
  --ink-dim: #5c5c59;
  --rule: #2b2b2a;
  --rule-soft: rgba(22, 22, 22, .28);
  --night: #181818;
  --on-night: #d6d6d2;

  --sans: "Sofia Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --code-bg: #282a36;      /* Dracula, see syntax.css */

  --track: .045em;         /* the typewriter spacing used for small text */
  --wide: .22em;           /* spaced capitals */
  --max: 1440px;
  --rail: 256px;
  --side: 300px;
}

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

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

body {
  display: flex; flex-direction: column; min-height: 100vh;
  margin: 0;
  font: 400 1rem/1.5 var(--sans);
  color: var(--ink);
  background: var(--ground) url("../img/ground.jpg") 0 0 / 512px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: 12px; top: -100px; z-index: 10; padding: 8px 14px; background: var(--ink); color: #fff; }
.skip:focus { top: 12px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ext { width: .55em; height: .55em; margin-left: .35em; fill: none; stroke: currentColor; stroke-width: 1.5; vertical-align: .1em; opacity: .6; }

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead { border-bottom: 1px solid var(--rule); }

.masthead__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 clamp(20px, 3vw, 44px);
  max-width: var(--max); margin: 0 auto;
  padding: clamp(22px, 3vw, 40px) clamp(16px, 4vw, 60px) clamp(18px, 2.4vw, 32px);
}

.wordmark {
  margin: 0;
  font: 900 clamp(3.2rem, 7.4vw, 6.6rem)/.86 var(--sans);
  letter-spacing: -.045em;
  margin-left: -.04em;
}
.wordmark a:hover { text-decoration: none; }

.tagline {
  margin: .7em 0 0;
  font: 400 clamp(.95rem, 1.35vw, 1.2rem)/1.35 var(--sans);
  letter-spacing: .12em;
}

.planet { width: clamp(150px, 15vw, 220px); height: auto; color: var(--ink); overflow: visible; }

/* --------------------------------------------------------------------------
   Three columns
   -------------------------------------------------------------------------- */

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--side);
  width: 100%; max-width: var(--max); margin: 0 auto;
}

/* Left rail */

.rail { display: flex; flex-direction: column; border-right: 1px solid var(--rule); min-width: 0; }
.rail__stick { flex: 1; display: flex; flex-direction: column; }

.rail__nav {
  margin: 0 16px 0 0; padding: 30px 0 26px 38px;
  list-style: none;
  border-bottom: 1px solid var(--rule);
}
.rail__nav li + li { margin-top: 4px; }
.rail__nav a {
  display: block;
  padding: 5px 8px 6px 14px;
  font: 500 1.25rem/1.3 var(--sans);
  letter-spacing: .035em;
}
.rail__nav a > span[aria-hidden] { font-weight: 400; }
.nobr { white-space: nowrap; }
.rail__nav a:hover { text-decoration: none; background: rgba(22, 22, 22, .09); }
.rail__nav a.is-active { background: var(--ink); color: #f0f0ec; }
/* small drawn glyphs next to menu items (rocket.html, astronaut.html) */
.glyph { width: 1.3em; height: 1.3em; margin-left: .45em; vertical-align: -.28em; fill: currentColor; overflow: visible; }
.glyph .ring { fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; }
.glyph .ring--trunk { stroke-width: 1.5; }

/* the building stays planted at the bottom of the viewport while the page scrolls */
.rail__building {
  position: sticky; bottom: 0;
  margin: auto 0 0; padding-top: 40px;
}
.rail__building svg { display: block; width: 100%; height: clamp(130px, calc(100vh - 730px), 440px); }
@media (max-height: 820px) { .rail__building { display: none; } }
.rail__building figcaption {
  padding: 20px 28px 28px 42px;
  background: var(--night);
  color: var(--on-night);
  font: 500 .8rem/1.8 var(--sans);
  letter-spacing: var(--wide);
  text-transform: uppercase;
}
.rail__building figcaption::after {
  content: ""; display: block; width: 34px; height: 2px; margin-top: 14px; background: var(--on-night);
}

/* Main column */

.main { min-width: 0; padding: 16px clamp(16px, 1.6vw, 22px) 48px; }

.hero { position: relative; margin: 0 0 20px; background: var(--night); }
.hero__art { display: block; width: 100%; height: auto; aspect-ratio: 820 / 230; }
.hero__walker { filter: grayscale(1) brightness(.92); }
.hero__scan { filter: grayscale(1) invert(1) contrast(1.4); mix-blend-mode: multiply; opacity: .75; }
.section-title {
  margin: 0;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--rule);
  font: 600 1.3rem/1.2 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.rows { margin: 0; padding: 0 0 0 6px; list-style: none; }
.row {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  padding: 13px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.row__date {
  padding-top: 3px;
  font: 400 .92rem/1.4 var(--sans);
  letter-spacing: .08em;
  color: var(--ink-soft);
}
.row__body { padding-left: 24px; border-left: 1px solid var(--rule); min-width: 0; }
.row__title {
  display: inline-block;
  font: 600 1.2rem/1.3 var(--sans);
  letter-spacing: .025em;
  text-wrap: pretty;
}
.row__tags {
  margin: 4px 0 0;
  display: flex; flex-wrap: wrap; gap: 0 1.1em;
  font: 400 .9rem/1.45 var(--sans);
  letter-spacing: var(--track);
  color: var(--ink-dim);
}
.row__tags a:hover { color: var(--ink); }

.older {
  margin: 14px 4px 0; text-align: right;
  font: 500 .85rem/1.4 var(--sans); letter-spacing: var(--wide); text-transform: uppercase;
}

.year + .year { margin-top: 34px; }

/* Page headers */

.page-head { padding: 22px 4px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.crumb { margin: 0 0 12px; font: 400 .92rem/1.4 var(--sans); letter-spacing: var(--track); color: var(--ink-dim); overflow-wrap: anywhere; }
.crumb a { color: var(--ink); font-weight: 600; }
.page-title {
  margin: 0;
  font: 900 clamp(2.6rem, 5vw, 4.4rem)/.95 var(--sans);
  letter-spacing: -.035em;
  text-wrap: balance;
}
.page-title--post { font-size: clamp(2.1rem, 3.8vw, 3.4rem); line-height: 1.02; letter-spacing: -.025em; max-width: 24ch; }
.page-sub { margin: 12px 0 0; font: 400 1rem/1.4 var(--sans); letter-spacing: .1em; color: var(--ink-soft); }

.meta {
  display: flex; flex-wrap: wrap; gap: 4px 0;
  margin: 18px 0 0;
  font: 400 .92rem/1.4 var(--sans); letter-spacing: .08em; color: var(--ink-soft);
}
.meta > * + *::before { content: ""; display: inline-block; width: 1px; height: .95em; margin: 0 14px; background: var(--rule); vertical-align: -.1em; }
.meta a { color: var(--ink); }

.terms {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 28px;
  margin: 0; padding: 0 4px; list-style: none;
}
.terms li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--rule-soft);
  font: 500 1.02rem/1.35 var(--sans); letter-spacing: .03em;
}
.terms span { color: var(--ink-dim); }

/* Article */

.article { max-width: 760px; padding-inline: 4px; }

.lede {
  margin: 22px 0 26px;
  font: 400 clamp(1.15rem, 1.7vw, 1.35rem)/1.45 var(--sans);
  letter-spacing: .01em;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.prose { max-width: 68ch; font-size: 1.1rem; line-height: 1.65; overflow-wrap: break-word; }
.page-head + .prose { margin-top: 24px; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose pre, .prose figure, .prose dl { margin: 0 0 1.1em; }
.prose h2, .prose h3, .prose h4 { margin: 1.9em 0 .6em; line-height: 1.2; text-wrap: balance; }
.prose h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.prose h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; }
.prose h4 { font-size: 1.05rem; font-weight: 700; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ">"; position: absolute; left: -1.25em; color: var(--ink-dim); }
.prose li + li { margin-top: .3em; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }

.prose img { display: block; height: auto; margin: 1.6em 0; outline: 1px solid var(--rule); outline-offset: -1px; }
.prose img[src$=".gif"] { outline: none; }   /* animated doodles, not screenshots */

/* image with a handwritten-style note beside it (raw HTML in content) */
.prose .aside-note { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin: 0 0 1.4em; }
.prose .aside-note img { margin: 0; }
.aside-note figcaption { display: flex; align-items: center; gap: 10px; font-style: italic; color: var(--ink-soft); }
.aside-note__arrow { flex: none; width: 70px; height: auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 560px) { .aside-note__arrow { width: 48px; transform: rotate(38deg) translate(4px, -8px); } }  /* caption wraps below: point up at the photo */

.prose blockquote { margin-left: 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--ink); color: var(--ink-soft); }

.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: .95em; }
.prose th, .prose td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule-soft); text-align: left; }
.prose th { font-weight: 700; letter-spacing: .04em; border-bottom-color: var(--rule); }

.prose code { font-family: var(--mono); font-size: .82em; padding: .12em .38em; background: rgba(22, 22, 22, .09); font-variant-ligatures: none; }
.prose pre {
  overflow-x: auto;
  padding: 18px 22px;
  font-size: .86rem; line-height: 1.6;
  color: #f8f8f2;
  background: var(--code-bg);
  border-left: 4px solid #bd93f9;
  tab-size: 4;
}
.prose pre code { padding: 0; background: none; font-size: 1em; color: inherit; }
.prose .highlight { margin: 0 0 1.1em; }
.prose .highlight pre { margin: 0; }

.article__foot { max-width: 68ch; margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--rule); }
.article__foot .row__tags { margin: 0 0 24px; font-size: .95rem; }

.comments { margin: 0 0 36px; }
.comments .section-title { padding-inline: 0; margin-bottom: 16px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px 0; font: 600 1.05rem/1.3 var(--sans); letter-spacing: .02em; }
.pager a span { font: 500 .78rem/1 var(--sans); letter-spacing: var(--wide); text-transform: uppercase; color: var(--ink-dim); }
.pager a.pager__next { grid-column: 2; text-align: right; padding: 14px 0 16px 16px; border-left: 1px solid var(--rule); }

/* Right column */

.side {
  position: relative;
  border-left: 1px solid var(--rule);
  padding: 26px 28px 180px;
  font: 400 .92rem/1.5 var(--sans);
  letter-spacing: var(--track);
  overflow: hidden;
}

.side__block + .side__block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule); }
.side h2 { margin: 0 0 10px; font: 700 .98rem/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.side .side__name { font-size: 1.08rem; letter-spacing: .04em; text-transform: none; }
.side .side__name::after { content: ""; display: block; width: 32px; height: 3px; margin-top: 10px; background: var(--ink); }
.side p { margin: 0; color: var(--ink-soft); }
.side p a { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }

.arrows { margin: 0; padding: 0; list-style: none; }
.arrows li { position: relative; padding-left: 24px; line-height: 1.6; }
.arrows li::before { content: ">"; position: absolute; left: 0; color: var(--ink-soft); }

.banners { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.banners img { display: block; width: 88px; height: 31px; filter: grayscale(1); }
.banners a:hover img { filter: none; }

.side__stair { position: absolute; right: 0; bottom: 0; width: 160px; height: auto; }

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

.footer { background: var(--night); color: #bdbdb9; }
.footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px;
  max-width: var(--max); margin: 0 auto;
  padding: 14px clamp(16px, 3.4vw, 48px) 15px;
  font: 400 .88rem/1.4 var(--sans); letter-spacing: .08em;
}
.footer p { margin: 0; }
.footer__c { margin-left: .9em; }
.footer a { margin-left: .9em; text-decoration: underline; text-underline-offset: .2em; }
.footer :focus-visible { outline-color: #fff; }
.footer__flag { display: inline-block; width: 18px; height: 12px; margin-right: 10px; vertical-align: -.05em; background: linear-gradient(#0057b7 50%, #ffd700 50%); }

/* --------------------------------------------------------------------------
   Smaller screens
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  :root { --rail: 220px; }
  .shell { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .side {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 32px;
    border-left: 0; border-top: 1px solid var(--rule);
    padding: 26px clamp(16px, 4vw, 40px) 30px;
  }
  .side__block + .side__block { margin-top: 0; padding-top: 0; border-top: 0; }
  .side__block { padding-bottom: 20px; }
  .banners { grid-column: 1 / -1; margin-top: 0; }
  .side__stair { display: none; }
  .rail__nav { padding-left: 22px; }
  .rail__nav a { font-size: 1.1rem; }
}

@media (max-width: 760px) {
  .wordmark { font-size: clamp(2.6rem, 13.5vw, 4.2rem); }
  .tagline { letter-spacing: .06em; }
  .planet { width: 84px; align-self: start; }

  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { border-right: 0; border-bottom: 1px solid var(--rule); }
  .rail__nav {
    display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
    margin: 0; padding: 10px 16px; border-bottom: 0;
  }
  .rail__nav::-webkit-scrollbar { display: none; }
  .rail__nav li + li { margin-top: 0; }
  .rail__nav a { white-space: nowrap; padding: 4px 10px; font-size: 1rem; }
  .rail__building { display: none; }

  .main { padding-inline: 16px; }
  .rows { padding-left: 0; }
  .row { grid-template-columns: minmax(0, 1fr); padding-block: 12px; }
  .row__date { padding: 0 0 2px; font-size: .85rem; }
  .row__body { padding-left: 0; border-left: 0; }

  .pager { grid-template-columns: 1fr; }
  .pager a.pager__next { grid-column: auto; text-align: left; border-left: 0; border-top: 1px solid var(--rule); padding: 14px 0 16px; }
}

