/* andermendz.dev · the site's own styles, over Mereframe Components (m/m.css).

   Two columns: a side panel that stays put (who I am, how to reach me; in the blog, where you are in it) and, beside
   it, the content as plain rows or as an article. Every size stops at a cap, so a wide window gets more margin, not
   larger things. On a phone it is one column, the panel first. Everything prefixed sb- is the site's own. */

/* The neutrals: cool, never cream. Day then Night. Unlayered, so they win over the library's. */
:root {
  --paper: light-dark(#F5F6F8, #101114); --paper2: light-dark(#EAECEF, #1C1E22); --paper3: light-dark(#DDE0E4, #31343A);
  --ink0: light-dark(#101114, #F1F2F4); --eighteen: light-dark(#5C6067, #B4B8BF); --faint: light-dark(#989CA3, #74787F);
  --night: #0A0B0D;
  --line: light-dark(rgba(16, 17, 20, .12), rgba(245, 246, 248, .17)); --wash: light-dark(rgba(16, 17, 20, .06), rgba(245, 246, 248, .09));
  --menu: light-dark(#E4E7EB, #2B2E33); --menu-on: light-dark(#D2D6DB, #3E4248);
  --tip: light-dark(#2A2C30, #E4E7EB); --on-tip: light-dark(#F5F6F8, #101114);
}
/* …and the neutral ink and tile tones the library declares apart, in its own layer, never on a .tone */
@layer m.base { :root:not(.tone), [data-theme]:not(.tone) {
  --g: light-dark(#EAECEF, #1C1E22); --g2: light-dark(#DDE0E4, #31343A); --tile: light-dark(#F5F6F8, #26282D);
  --ink: light-dark(#101114, #F1F2F4); --ink2: light-dark(#5C6067, #B4B8BF); --primary: #D2D6DB; --onp: #101114;
} }
.toast[data-tone=bad] .ms { color: inherit; }   /* no red, even when the clipboard says no */

/* The site's sizes, in rem, so that a reader's own font size counts: a note (13.5 px at the usual 16), small print (15),
   the text (16 to 17.5), an article's text (17 to 18.5), a lead (the name, the opening words, a heading: 20 to 22), an
   article's headings (22 to 26) and its title (28 to 38). Seven, and each stops at a cap. The library's small control,
   its hint and its toast take theirs from the same seven. Weights are the library's own: 400, 450, 500, 600. */
.sb { --t-note: .84375rem; --t-small: .9375rem; --t-body: clamp(1rem, .2vw + .9125rem, 1.09375rem); --t-read: clamp(1.0625rem, .2vw + .975rem, 1.15625rem);
  --t-lead: clamp(1.25rem, 1.5vw, 1.375rem); --t-head: clamp(1.375rem, 1.7vw, 1.625rem); --t-title: clamp(1.75rem, 2.5vw, 2.375rem); --ctl-fs-sm: var(--t-small);
  --rp: 28px; --sb-m: clamp(16px, 4vw, 40px); --sb-pad: clamp(22px, 6vw, 24px); }
.sb .tip, .sb-toc :is(a, .group) { font-size: var(--t-note); } .sb .toast { font-size: var(--t-small); }
.sb .facts dd { font-variant-numeric: normal; }   /* figures in a sentence, not in a column */
html { scroll-padding-block: 16px; scrollbar-gutter: stable; }   /* no bar at the top to clear; what takes focus comes whole into the window. Room kept for the scrollbar, so a short page stands where a long one does */
html[data-theme-flip] .tone { transition: none; }   /* the panel turns with the page, not half a second after it */
.sb .link { border-radius: 6px; }   /* its focus ring, rounded like everything else */

.sb-page { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 44px; padding: var(--sb-m) var(--sb-m) 72px; }
@media (min-width: 900px) {
  .sb-page { grid-template-columns: clamp(352px, 30vw, 368px) minmax(0, 680px); justify-content: center; align-items: start;
    column-gap: clamp(44px, 6vw, 96px); padding-block: clamp(44px, 6vw, 88px) 0; }
  /* its first line on the name's line. A line's baseline stands .91 of its size under its top at a line of 1.2, .96 at
     1.3: so the name's, under the panel's padding, and so the first line's own, which each kind of page names. Beside
     the portrait the name stands lower by half of what the portrait (60 px) has over the two lines beside it. */
  .sb-main { --sb-first: calc(var(--t-lead) * .91); padding-top: calc(var(--sb-pad) + var(--t-lead) * .91 - var(--sb-first)); }
  .sb-page:has(.sb-face) > .sb-main { padding-top: calc(var(--sb-pad) + var(--t-lead) * .91 - var(--sb-first) + max(0px, 60px - var(--t-lead) * 1.2 - var(--t-small) * 1.45 - 5px) / 2); }
  .sb-main:has(> .sb-posts) { --sb-first: calc(var(--t-body) * .96); }   /* the list of articles: its first title */
  .sb-main:has(> article) { --sb-first: calc(var(--t-small) * .93); }   /* an article: the line over its title (.93: a line of 19.5 px lands half a pixel off) */
}

/* ── the side panel: name, what I do in a sentence; then how to reach me, the language and the theme ── */
.sb-side { padding: var(--sb-pad); }
/* my portrait, drawn in dots like the globe: black on white as a file, so by day it is laid over the panel as ink
   (multiply). By night it stays a light print, a little dimmed: turned inside out, a face is a negative. The name and
   the line under it stand beside it. */
.sb-who:has(> .sb-face) { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 14px; }
.sb-face { grid-row: span 2; width: 60px; height: 60px; border-radius: 16px; mix-blend-mode: multiply; }
:root[data-theme=dark] .sb-face { filter: brightness(.8); mix-blend-mode: normal; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .sb-face { filter: brightness(.8); mix-blend-mode: normal; } }
.sb-face ~ .sb-name { align-self: end; } .sb-face ~ .sb-role { align-self: start; } .sb-face ~ .sb-say { grid-column: 1 / -1; }
.sb-name { font: 600 var(--t-lead)/1.2 var(--ff); letter-spacing: -.015em; }
.sb-name a { color: inherit; text-decoration: none; border-radius: 6px; }
@media (hover: hover) { .sb-name a:hover { text-decoration: underline; text-underline-offset: .22em; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); } }
/* what I do, then where, a point between them. Each carries its point before it, in a strip at the line's start that
   is cut away: so on one line the point shows between the two, and when the place goes under, no point is left hanging. */
.sb-role { display: flex; flex-wrap: wrap; margin: 5px 0 0 -1em; clip-path: inset(0 0 0 1em); font-size: var(--t-small); color: var(--ink2); }
.sb-role > span { position: relative; padding-left: 1em; }
.sb-role > span::before { content: "·"; position: absolute; left: 0; width: 1em; text-align: center; }
.sb-say { margin-top: 22px; font: 450 var(--t-lead)/1.28 var(--ff); letter-spacing: -.016em; color: var(--ink2); }
.sb-say > :is(b, h1) { display: block; font-weight: 500; color: var(--ink); text-wrap: balance; }   /* the first words on a line of their own (a page's title, where they are one); where they need two, two of a length */
.sb-face ~ .sb-role > span + span { display: none; }   /* the first page says the place once, where I am; on paper it is here (below) */
.sb-back { margin-top: 20px; font-size: var(--t-small); }
.sb-label { margin-top: 28px; font: 500 var(--t-small)/1.3 var(--ff); color: var(--ink2); }
.sb-note { margin-top: 3px; font-size: var(--t-small); line-height: 1.4; }   /* what to write to me about */
.sb-mail { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.sb-mail .ib { --s: 40px; }   /* as tall as the address beside it */
.sb-side .facts { margin-top: 14px; border-top: 1px solid color-mix(in oklab, var(--ink) 10%, transparent); }
.sb-side .facts > div { grid-template-columns: 4.2em minmax(0, 1fr); gap: 8px; align-items: baseline; padding-block: 10px; font-size: var(--t-small); }
.sb-side .facts > div:last-child { border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent); }
/* a line of text, a full-height target: the reach grows around the words, the focus ring still hugs them */
.sb-side .facts a, .sb-rows .link, .sb-rows :is(h2, h3) > a, .sb-close .link, .sb-head .link, .sb-back .link, .sb-feed .link, .sb-foot .link { position: relative; }
:is(.sb-side .facts a, .sb-rows .link, .sb-rows :is(h2, h3) > a, .sb-close .link, .sb-head .link, .sb-back .link, .sb-feed .link, .sb-foot .link)::after { content: ""; position: absolute; inset: -11px 0; }
.sb-feed { margin-top: 28px; font-size: var(--t-small); }
.sb-feed + .sb-feed { margin-top: 10px; }   /* the way home in each language, one under the other */
.sb-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 20px; }
.sb-toc { margin-top: 28px; }
/* The side panel stays put beside the content, 24 px under the window's top; taller than the window, it scrolls
   within itself sooner than run off. On the first page where I am comes after the content, in the source and on the
   page: the content column's last block, then the page's last line. In a window tall enough for the panel and the
   place one under the other (the globe as small as 120 px), site.js marks the page (data-kept) and the place joins
   the panel: the two share one tall cell, the place a panel's height (--sb-side) down, its globe the size that fits
   (--sb-globe). What stays put spans every row: Chrome holds it by the grid, not by its cell. */
@media (min-width: 900px) {
  .sb-page { grid-template-rows: 1fr auto auto; row-gap: 0; }
  .sb-side { grid-area: 1 / 1 / -1; position: sticky; top: 24px; max-height: calc(100dvh - 48px); overflow-y: auto; }
  .sb-main { grid-area: 1 / 2; }
  .sb-where { grid-area: 2 / 2; margin-top: clamp(40px, 4.4vw, 56px); }
  .sb-foot { grid-area: 3 / 2; }
  .sb-page[data-kept] > .sb-where { grid-area: 1 / 1 / -1; position: sticky; top: calc(40px + var(--sb-side)); margin-top: calc(16px + var(--sb-side)); animation: m-fade var(--dur-short) var(--ease); }
  .sb-page[data-kept] .sb-globe { width: min(13.5rem, var(--sb-globe)); }
  .sb-close { display: none; }
}
@media (max-width: 899.98px) { .sb-toc { display: none; } }   /* an article on a phone is read straight down */
@media (max-width: 380px) { .sb-role { font-size: .875rem; } .sb-side .facts > div { font-size: .90625rem; } }   /* each on one line on a small phone */
@media (max-width: 355.98px) {   /* the smallest phones: each address without its name (it says whose it is), the envelope gone */
  .sb-side .facts > div { grid-template-columns: minmax(0, 1fr); }
  .sb-side .facts dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* still read out */
  .sb-mail .btn .ms { display: none; }
}
@media (max-width: 339.98px) { .sb-say { font-size: 1.1875rem; } }   /* the first clause whole on its line, with room to spare */
/* between a phone and two columns the panel is wide: who on the left, how to reach me on the right */
@media (min-width: 760px) and (max-width: 899.98px) {
  .sb-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; }
  .sb-reach > :first-child { margin-top: 0; }
}

/* ── the content: headed parts, each a list of rows on hairlines ── */
.sb-main { container-type: inline-size; }
.sb-main:focus { outline: none; }
.sb-main > * + :is(section, .sb-next) { margin-top: clamp(40px, 4.4vw, 56px); }
.sb-main h2 { font: 500 var(--t-lead)/1.2 var(--ff); letter-spacing: -.016em; }
.sb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.sb-head .link { font-size: var(--t-small); }
.sb-rows { grid-template-columns: minmax(0, 1fr); margin-top: 14px; border-top: 1px solid var(--line); }   /* (a row as wide as the column and no wider, whatever stands in it) */
.sb-posts { margin-top: 0; border-top: 0; }   /* the list of articles has its heading in the panel: it opens on its first title, on the name's line, not on a rule */
.sb-posts > li:first-child { padding-top: 0; }
/* a row: its name, what stands at its end (an address, a date), then its sentence across. The end sits beside the name
   where both fit on a line, and goes under it where they don't, so a long name is never squeezed into two lines. */
.sb-rows > li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 20px; padding-block: 18px; }
.sb-rows :is(h2, h3) { font: 600 var(--t-body)/1.3 var(--ff); letter-spacing: -.006em; }
.sb-rows h3 > span { font-weight: 450; }   /* the role, then where */
.sb-rows :is(h2, h3) > a { color: inherit; border-radius: 6px; text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: .22em; }
@media (hover: hover) { .sb-rows :is(h2, h3) > a:hover { text-decoration-color: currentColor; } }
.sb-rows p { order: 1; flex: 0 0 100%; padding-right: max(0px, 100% - 36em); color: var(--ink2); line-height: 1.5; text-wrap: pretty; }   /* a line of its own, a measure of 36em; no word left alone on a last line */
.sb-rows .sb-end { font-size: var(--t-small); line-height: 1.2; }   /* (no taller than the name beside it) */
.sb-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }   /* where a piece of work lives: one address, or two */
.sb-when { color: var(--ink2); }
.sb-post :is(h2, h3, .sb-when) { flex: 0 0 100%; }   /* an article's date always under its title: a long title and a short one make the same row */
.sb-rows .sb-tech { font-size: var(--t-note); }   /* what it is made with, under its sentence */
/* the first pieces of work each open on a stage: a panel in the work's own tone (its hue and chroma on it, the seed of
   its picture) and, on it, the work's real screen at its real size: a window 624 px wide, cut by the stage's foot and,
   in a narrow column, by its side, never shrunk. A phone's screen is a thing, not a window: it keeps its share of the
   stage, in a taller one. No words on a stage: the name is under it. For a pointer, the whole stage leads where the
   work's first address does. */
.sb-stage { flex: 0 0 100%; min-width: 0; display: block; aspect-ratio: 2 / 1; margin-bottom: 8px; padding: 0; border-radius: 16px; }
/* the screen's box is the window's full width and ends at the stage's foot, and the picture is cut inside it from its
   top left: never smaller than its real size, and nothing of it lying over the words under the stage */
.sb-stage > img { display: block; width: 624px; max-width: none; height: calc(100% - 28px); margin: 28px 0 0 max(28px, (100% - 624px) / 2); object-fit: cover; object-position: left top;
  border-radius: 12px 12px 0 0; box-shadow: 0 0 0 1px var(--line); }
@container (max-width: 679px) { .sb-stage > img { border-top-right-radius: 0; } }   /* (cut by the stage's side: no corner there) */
.sb-stage[data-frame=phone] { aspect-ratio: 4 / 3; }
.sb-stage[data-frame=phone] > img { width: 44%; margin-inline: auto; object-fit: cover; object-position: top; border-radius: 9% 9% 0 0 / 5.6% 5.6% 0 0;
  box-shadow: 0 0 0 5px #0B0B0C, 0 0 0 6px color-mix(in oklab, var(--ink) 28%, transparent); }   /* its bezel: black by day and by night, as a phone is */
@media (hover: hover) { a.sb-stage { transition: background-color var(--dur-short) var(--ease); } a.sb-stage:hover { background: color-mix(in oklab, var(--g), var(--ink) 5%); } }
/* by night a picture stays a light print, a little dimmed (as the portrait does) */
:root[data-theme=dark] :is(.sb-stage, .sb-cover, .prose) img { filter: brightness(.86); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) :is(.sb-stage, .sb-cover, .prose) img { filter: brightness(.86); } }
.sb-feature { padding-block: 22px; }
@container (max-width: 660px) {   /* a narrow column, a phone: each on its own line, an address after its sentence */
  .sb-rows :is(h2, h3, .sb-when) { flex: 0 0 100%; }
  .sb-rows .sb-links { order: 2; margin-top: 4px; }
}
.sb-main .facts { border-top: 1px solid var(--line); }
.sb-main .facts > div { padding-block: 14px; font-size: var(--t-small); }
.sb-main .facts > div:first-child { padding-top: 14px; }
.sb-main .facts dd > span { display: block; text-wrap: balance; }
.sb-main .facts dd > span + span { margin-top: 6px; }   /* two qualifications, told apart when each wraps */
@media (max-width: 560px) { .sb-main .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }   /* a phone: the name over its value */
/* where the panel has scrolled away (a phone, a very short window), the page ends on how to reach me */
.sb-close { margin-top: clamp(40px, 4.4vw, 56px); color: var(--ink2); }
/* every page's last line: what it is built on and, on the first page, the page as a sheet of paper (the print styles
   below). Its two ends are centred on one another: an icon's baseline is its foot, not its words'. */
.sb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 18px;
  border-top: 1px solid var(--line); font-size: var(--t-small); color: var(--ink2); }
@media (min-width: 900px) { .sb-foot { margin-top: clamp(40px, 4.4vw, 56px); padding-bottom: 104px; } }   /* the page's foot belongs to the content's column, so the panel beside it can stay to the very end */
.sb-foot .link { padding: 0; border: 0; background: none; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; }

/* ── where I am: a second panel on the same tone, the content's last block, or under the first where the window has
      room for both (above). The globe is drawn (site.js) in the panel's own colours: a disc of its deeper tone for the
      sea, its ink in dots for the land, one mark. No light, no gloss. ── */
.sb-where { display: grid; grid-template: auto auto 1fr / minmax(0, 1fr) auto; container-type: inline-size; padding: var(--sb-pad); }
.sb-where > * { grid-column: 1 / -1; }   /* narrow (under the panel, a phone): each part across, one under another */
.sb-where > .sb-label { margin-top: 0; }
.sb-where-place { margin-top: 3px; font: 600 var(--t-body)/1.3 var(--ff); letter-spacing: -.006em; }
.sb-globe { width: min(100%, 13.5rem); aspect-ratio: 1; margin: 16px auto 0; border-radius: 50%; background: var(--g2); color: var(--ink); }
.sb-globe > canvas { display: block; width: 100%; height: 100%; border-radius: 50%; opacity: 0; transition: opacity .5s var(--ease); cursor: grab; touch-action: pan-y; user-select: none; }
.sb-globe[data-on] > canvas { opacity: 1; }
.sb-globe > canvas:active { cursor: grabbing; }
.sb-where-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-top: 16px; font-size: var(--t-small); color: var(--ink2); }
@container (min-width: 440px) {   /* wide (the content's last block, a tablet): the place at the head and the time at the foot on the left, the globe on the right */
  .sb-where > * { grid-column: 1; }
  .sb-where > .sb-globe { grid-area: 1 / 2 / span 3; width: 13.5rem; margin: 0 0 0 24px; }
  .sb-where-foot { flex-direction: column; align-self: end; }
}

/* ── an article: its head, its picture, its prose at the page's own sizes, what it is filed under ── */
.sb-kicker { font: 500 var(--t-small)/1.3 var(--ff); color: var(--ink2); }
.sb-title { margin-top: 8px; font: 600 var(--t-title)/1.1 var(--ff); letter-spacing: -.024em; text-wrap: balance; }
.sb-meta { margin-top: 14px; font-size: var(--t-small); color: var(--ink2); }
.sb-cover { margin: 28px 0 0; }
.sb-cover > img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px; background: var(--g);
  outline: 1px solid var(--line); outline-offset: -1px; }   /* (an edge of its own: a dark picture on a night page has none) */
.sb-main .prose { max-width: none; margin-top: 32px; font-size: var(--t-read); line-height: 1.65; }
.sb-main .prose :is(h2, h3) { font: 600 var(--t-head)/1.2 var(--ff); letter-spacing: -.018em; text-wrap: balance; }
.sb-main .prose h3 { font-size: var(--t-lead); letter-spacing: -.01em; }
.sb-main .prose blockquote { font-size: var(--t-lead); border-left-width: 2px; }
.sb-main .prose img { display: block; max-width: 100%; height: auto; border-radius: 16px; }
.sb-main .prose figcaption { margin-top: 10px; font-size: var(--t-note); line-height: 1.45; color: var(--ink2); }
.sb-main .prose .codeblock { margin-block: 1.4em; }
.sb-main .prose .codeblock pre { border-radius: inherit; font-size: .90625rem; line-height: 1.6; }   /* as large as lets a line of 72 characters fit the column; where a narrow screen needs a scrollbar, it stays inside the block's corners */
/* a live example in an article: the library's own parts, to press, in a hairline frame; its caption under it */
.sb-demo > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 20px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.sb-demo :is(.panel, .sb-demo-cell) { flex: 1 1 5.5em; display: grid; place-items: center; padding: 18px 10px; border-radius: 14px; }

/* without the script: what only it can drive steps aside */
html:not(.m-js) :is(.sb-theme, [data-copy], [data-print], .sb-globe, .sb-clock, .sb-demo:has([data-copy])) { display: none !important; }
@media (forced-colors: active) { .sb-theme > [aria-checked=true], .sb-lang > [aria-current] { outline: 2px solid Highlight; outline-offset: -2px; } }   /* the chosen one still shows */
@media print {   /* on paper, a CV of two sheets: ink on white whatever the theme, no controls or pictures, the address as text, the place under the name, where I have worked before what I have built, the rows closer, none cut in two */
  :root { color-scheme: light !important; }
  .sb-ctl, [data-copy], .skip, .sb-where, .sb-toc, .sb-foot, .sb-stage, .sb-close, #writing { display: none !important; }
  .sb { --t-body: 14px; --t-small: 13px; --t-note: 12px; }   /* a CV's sizes (10.5 pt): two sheets of Letter or of A4, in either language */
  .sb-say, .sb-main h2 { font-size: 18px; }
  .sb-page { padding-bottom: 0; row-gap: 28px; }   /* (the sheet has its own margin: the page's would spill onto an empty third) */
  .sb-side { position: static; max-height: none; overflow: visible; }
  .sb-face ~ .sb-role > span + span { display: revert; }
  .sb-main:has(> #experience) { display: flex; flex-direction: column; }
  #experience { order: -1; margin-top: 0; } #work { margin-top: 28px; }
  .sb-mail .btn { min-height: 0; height: auto; padding: 0; background: none; color: var(--ink); }
  .sb-rows > li { padding-block: 12px; }
  .sb-rows > li, .facts > div { break-inside: avoid; }
  .sb-main h2 { break-after: avoid; }   /* a heading goes over with its first row, never left at a sheet's foot */
}
