/* blog.ondalo.ca: the brand's dark water, built for reading. No JavaScript, no inline styles.
   Tokens come from site/css/site.css. Font URLs are relative to this file (fonts/ sits next to it). */
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --abyss: #01060b;
  --navy: #020d17;
  --deep: #0b3a5c;
  --foam: #e8f7fb;
  --mist: #a9cbd8;
  --text: #d4e8ef;
  --aqua: #3ee0d0;
  --coral: #ff8f7a;
  --line: rgba(169, 203, 216, .2);
  --tick: rgba(62, 224, 208, .5);
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --glow: 0 0 28px rgba(62, 224, 208, .28), 0 0 2px rgba(232, 247, 251, .35);
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0C5.6 3.4 6.6 4.4 10 5 6.6 5.6 5.6 6.6 5 10 4.4 6.6 3.4 5.6 0 5 3.4 4.4 4.4 3.4 5 0Z' fill='%233ee0d0'/%3E%3C/svg%3E");
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M1 3.5c2-2.6 4-2.6 6 0s4 2.6 6 0M1 7.5c2-2.6 4-2.6 6 0s4 2.6 6 0' fill='none' stroke='%233ee0d0' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  --swell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 10'%3E%3Cpath d='M2 5c4.5-4 9-4 13 0s9 4 13 0 9-4 13 0 9 4 13 0' fill='none' stroke='%233ee0d0' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --gutter: clamp(1rem, 4vw, 3rem);
  --frame: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--abyss); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--foam);
  background: radial-gradient(130% 36rem at 50% -10rem, rgba(11, 58, 92, .5), rgba(2, 13, 23, .35) 60%, rgba(1, 6, 11, 0)) no-repeat, var(--abyss);
  font: 400 1.125rem/1.7 var(--sans);
}
main { flex: 1; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--aqua); color: var(--abyss); }

.skip { position: absolute; left: -999px; top: 0; z-index: 10; background: var(--aqua); color: var(--abyss); padding: .6rem 1rem; border-radius: 3px; font: 500 .8rem/1 var(--mono); }
.skip:focus { left: 1rem; top: 1rem; }

/* header and footer share one frame, wider than the reading column */
.bar { max-width: var(--frame); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; }
.site-header { border-bottom: 1px solid var(--line); background: rgba(1, 6, 11, .55); }
.site-header .bar { min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; color: var(--foam); font: 400 1.75rem/1 var(--serif); text-decoration: none; }
.glyph { width: 30px; height: 22px; flex: none; fill: none; stroke: var(--aqua); stroke-width: 3; stroke-linecap: round; }
.site-header nav { display: flex; align-items: center; gap: .9rem; font: 500 .76rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.site-header nav a { display: inline-flex; align-items: center; gap: .9rem; text-decoration: none; }
.site-header nav a + a::before { content: ""; width: .5rem; height: .5rem; background: var(--star) center / contain no-repeat; opacity: .8; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--aqua); }
.lang { font-weight: 700; }

.site-footer { margin-top: clamp(4rem, 10vw, 6rem); border-top: 1px solid var(--line); background: rgba(1, 6, 11, .7); color: var(--mist); font: 400 .8rem/1.6 var(--mono); letter-spacing: .06em; }
.site-footer .bar { flex-wrap: wrap; padding-block: 2rem 2.5rem; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.site-footer a:hover { color: var(--aqua); }

/* the reading column: about 68 characters of body text */
.column { width: 100%; max-width: calc(68ch + 2 * var(--gutter)); margin: 0 auto; padding: clamp(2.5rem, 8vw, 5rem) var(--gutter) 0; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: .005em; color: #fff; }
h1 { margin: 0 0 1.1rem; font-size: clamp(2.5rem, 7vw, 4rem); line-height: 1.02; text-shadow: var(--glow); text-wrap: balance; }
.lead { margin: 0; color: var(--mist); font: 400 clamp(1.3rem, 2.6vw, 1.6rem)/1.35 var(--serif); text-wrap: pretty; }

/* a framed mono label: date, update and reading time */
.kicker, .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; font: 500 .72rem/1.4 var(--mono); letter-spacing: .12em; }
/* the wave sits outside the flow, so wrapped lines line up with the text; separators trail, so no line starts with one */
.kicker { position: relative; width: fit-content; max-width: 100%; margin: 0 0 1.4rem; padding: .42rem .7rem .36rem calc(1.25rem + 14px); border: 1px solid rgba(62, 224, 208, .4); color: var(--aqua); }
.kicker::before { content: ""; position: absolute; left: .7rem; top: calc(.42rem + .7em - 5px); width: 14px; height: 10px; background: var(--wave) center / contain no-repeat; }
.kicker span:has(+ span)::after, .meta span:has(+ span)::after { content: "·"; content: "·" / ""; margin-left: .55rem; opacity: .7; }
.meta { margin: 0 0 .55rem; color: var(--mist); }
.draft { color: var(--coral); text-transform: uppercase; }

/* post */
.post-head { padding-bottom: 2.2rem; margin-bottom: 2.6rem; border-bottom: 1px solid var(--line); }
.prose { color: var(--text); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose .table { margin: 0 0 1.4rem; }
.prose h2 { margin: 3rem 0 1rem; font-size: clamp(1.85rem, 4.4vw, 2.4rem); line-height: 1.08; }
.prose h2::after { content: ""; display: block; width: 3.4rem; height: .6rem; margin-top: .7rem; background: var(--swell) left center / 3.4rem .6rem no-repeat; }
.prose h3 { margin: 2.2rem 0 .6rem; font-size: clamp(1.45rem, 3.4vw, 1.7rem); line-height: 1.15; }
.prose h4, .prose h5, .prose h6 { margin: 1.8rem 0 .5rem; color: var(--foam); font: 600 1.05rem/1.4 var(--sans); }
.prose a { color: var(--aqua); text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { color: var(--foam); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: .35rem 0; padding-left: .2rem; }
.prose li::marker { color: var(--aqua); }
.prose blockquote { padding: .1rem 0 .1rem 1.3rem; margin-left: 0; margin-right: 0; border-left: 2px solid var(--aqua); color: var(--foam); font: italic 400 clamp(1.3rem, 2.6vw, 1.5rem)/1.4 var(--serif); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { height: .6rem; margin: 2.8rem 0; border: 0; background: var(--swell) center / 3.4rem .6rem no-repeat; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 3px; }

code, pre { font-family: var(--mono); }
.prose code { font-size: .86em; }
.prose :not(pre) > code { padding: .1em .38em; border: 1px solid rgba(62, 224, 208, .22); border-radius: 3px; background: rgba(62, 224, 208, .07); color: #bff6ef; overflow-wrap: anywhere; }
.prose pre { overflow-x: auto; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 3px; background: var(--navy); color: var(--foam); font-size: .88rem; line-height: 1.6; tab-size: 2; }
.prose pre code { font-size: inherit; }

.prose .table { max-width: 100%; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
.prose th, .prose td { padding: .6rem .9rem .6rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--mist); border-bottom-color: rgba(62, 224, 208, .4); font: 500 .72rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }

/* the about box: a framed block with aqua corner ticks, like the main site's panels */
.about {
  margin-top: 3.5rem;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(var(--tick), var(--tick)) left top / 10px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) left top / 1px 10px no-repeat,
    linear-gradient(var(--tick), var(--tick)) right top / 10px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) right top / 1px 10px no-repeat,
    linear-gradient(var(--tick), var(--tick)) left bottom / 10px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) left bottom / 1px 10px no-repeat,
    linear-gradient(var(--tick), var(--tick)) right bottom / 10px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) right bottom / 1px 10px no-repeat,
    linear-gradient(180deg, rgba(11, 58, 92, .28), rgba(2, 13, 23, .6));
}
.about h2 { margin: 0 0 .6rem; font-size: clamp(1.7rem, 4vw, 2.1rem); line-height: 1.1; }
.about p { margin: 0 0 1.4rem; color: var(--text); }
.about p:last-child { margin-bottom: 0; }

.button { display: inline-block; padding: 1rem 1.5rem .95rem; border-radius: 3px; background: var(--aqua); color: var(--abyss); font: 500 .8rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; box-shadow: 0 0 24px rgba(62, 224, 208, .35); transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { background: #6cf0e3; transform: translateY(-1px); box-shadow: 0 0 34px rgba(62, 224, 208, .5); }
.button:focus-visible { outline-color: var(--foam); }

.back-row { margin: 2.6rem 0 0; }
.back { display: inline-flex; align-items: center; gap: .6rem; color: var(--foam); font: 500 .8rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }
.back::before { content: ""; width: .6rem; height: .6rem; flex: none; background: var(--star) center / contain no-repeat; }
.back:hover { color: var(--aqua); }

/* indexes */
.index-head { padding-bottom: 2.4rem; border-bottom: 1px solid var(--line); }
.posts { margin: 0; padding: 0; list-style: none; }
.posts li { border-bottom: 1px solid var(--line); }
.posts article { position: relative; padding: 1.9rem 0; }
.posts h2 { margin: 0 0 .5rem; font-size: clamp(1.75rem, 4.6vw, 2.3rem); line-height: 1.08; text-wrap: balance; }
.posts h2 a { text-decoration: none; }
.posts h2 a::after { content: ""; position: absolute; inset: 0; } /* the whole entry is the link */
.posts article:hover h2 a { color: var(--aqua); }
.posts article p:last-child { margin: 0; color: var(--mist); }
.empty { margin: 2.4rem 0 0; color: var(--mist); font: 400 clamp(1.4rem, 3vw, 1.7rem)/1.35 var(--serif); }
.empty::before { content: ""; display: block; width: 3.4rem; height: .6rem; margin-bottom: 1rem; background: var(--swell) left center / 3.4rem .6rem no-repeat; }

/* 404 */
.notfound p { margin: 0 0 1rem; }
.notfound-en { margin-top: 2.6rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.notfound .notfound-heading { color: var(--mist); font: 400 clamp(1.6rem, 4vw, 2.2rem)/1.15 var(--serif); }

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .wordmark { font-size: 1.5rem; }
  .glyph { width: 26px; height: 19px; }
  .site-header nav { gap: .6rem; font-size: .68rem; letter-spacing: .08em; }
  .site-header nav a { gap: .6rem; }
  .kicker, .meta { font-size: .68rem; letter-spacing: .08em; }
  /* code runs edge to edge on a phone: more room for the line */
  .prose pre { margin-inline: calc(-1 * var(--gutter)); border-inline: 0; border-radius: 0; padding-inline: var(--gutter); }
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:hover { transform: none; }
}
