/* bazyl.net – shares the book's type (Manrope) and navy/green with neuron.bazyl.net. */

@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/fonts/Manrope-400.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/fonts/Manrope-500.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/fonts/Manrope-600.woff2) format("woff2"); }

:root {
  --bg: #f1f4f3;
  --ink: #1c2b37;        /* the book's navy */
  --text: #3d4a55;
  --muted: #5f6c77;
  --link: #1a6b57;       /* the book's green */
  --rule: #d6dedc;
  /* token tints, cycled through the opening sentence */
  --t0: #d3e9e1;
  --t1: #dbe5f2;
  --t2: #efe5d1;
  --t3: #e6dff0;
  --gutter: clamp(16px, 5vw, 56px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16222b;
    --ink: #eef3f1;
    --text: #c3cfcd;
    --muted: #93a2a6;
    --link: #8fd0bd;
    --rule: #2b3a45;
    --t0: rgba(143, 208, 189, .2);
    --t1: rgba(150, 180, 225, .2);
    --t2: rgba(230, 200, 150, .18);
    --t3: rgba(190, 170, 230, .2);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.6 Manrope, system-ui, sans-serif;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 600; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bg); padding: 8px 12px; z-index: 2; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- top */
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; padding-bottom: 22px; }
.mark { color: var(--ink); font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
.lang { color: var(--muted); font-size: .9rem; text-decoration: none; padding: 4px 9px; border: 1px solid var(--rule); border-radius: 3px; }
.lang:hover { color: var(--ink); border-color: var(--muted); }

/* ---------------------------------------------------------------- opening sentence, as tokens */
.hello { margin: clamp(48px, 11vh, 120px) 0 clamp(64px, 12vh, 128px); }
.hello h1 {
  font-size: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.lede {
  max-width: 30ch;
  color: var(--ink);
  font-size: clamp(1.375rem, 1.05rem + 1.4vw, 2.25rem);
  line-height: 1.32;
  letter-spacing: -.02em;
}
.t {
  /* a band behind the letters rather than the whole line box, so lines stay apart */
  background: linear-gradient(var(--c), var(--c)) 0 58% / 100% 1.02em no-repeat;
  transition: opacity .14s ease-out;
}
.t0 { --c: var(--t0); }
.t1 { --c: var(--t1); }
.t2 { --c: var(--t2); }
.t3 { --c: var(--t3); }
.fnm { line-height: 0; background: none; color: var(--link); font-size: .62em; vertical-align: .85em; margin-left: .06em; }
.fn { margin-top: 18px; max-width: 60ch; color: var(--muted); font-size: 1rem; transition: opacity .5s ease-out; }
.stream .fn { opacity: 0; }
.stream .t { opacity: 0; }
.stream .t.on { opacity: 1; }
/* the cursor hangs off the newest token, outside the text flow, so it never wraps a line */
.t.cur { position: relative; }
.t.cur::after {
  content: ""; position: absolute; left: 100%; top: .2em;
  width: .08em; height: 1em; margin-left: .05em; background: var(--ink);
}
.done .t.cur::after { animation: blink 1.1s steps(1) 3 forwards; }
@keyframes blink { 50% { opacity: 0; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- sections */
.sec {
  display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 16px 40px;
  border-top: 1px solid var(--rule); padding: 36px 0 44px;
}
.sec h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.005em; padding-top: 6px; }

.work li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 46rem; }
.work li.has-img { grid-template-columns: minmax(0, 1fr) 96px; }
.work li + li { margin-top: 34px; }
.work h3 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); letter-spacing: -.025em; line-height: 1.2; }
.work h3 a { color: var(--ink); text-decoration: none; }
.work h3 a:hover { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; }
.work .host { color: var(--muted); font-size: .9rem; margin: 2px 0 10px; }
.work p:not(.host) { max-width: 62ch; }
.work img { border-radius: 2px; box-shadow: 0 1px 2px rgba(28, 43, 55, .18), 0 8px 24px -10px rgba(28, 43, 55, .35); }

.contact li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: baseline; padding: 6px 0; }
.contact span { color: var(--muted); font-size: .95rem; }
.contact a { font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); font-weight: 500; letter-spacing: -.015em; overflow-wrap: anywhere; }

.foot { padding-bottom: 40px; color: var(--muted); font-size: .875rem; }
.foot p { border-top: 1px solid var(--rule); padding-top: 28px; }

.nf { padding-top: 12vh; padding-bottom: 20vh; }
.nf h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); letter-spacing: -.03em; margin-bottom: 20px; }
.nf p + p { margin-top: 8px; }

@media (max-width: 720px) {
  .sec { grid-template-columns: minmax(0, 1fr); padding: 28px 0 36px; }
  .sec h2 { padding-top: 0; color: var(--muted); }
  .work li.has-img { grid-template-columns: minmax(0, 1fr) 72px; gap: 18px; }
  .contact li { grid-template-columns: 5.5rem minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .t { transition: none; }
  .t.cur::after { display: none; }
}
