/* The family's shared base: page, header, mark, nav, type, panels, lists, facts, prose, code, tables, search, controls, footer.
   Each site loads tokens.css, then this, then its own parts. francescodimaggio.nl/style/ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  max-width: 672px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg); color: var(--ink);
  font: 17px/1.55 var(--sans); -webkit-tap-highlight-color: transparent;
}
/* Short texts break into even lines, so no line ends with a single word. */
h1, h2, .lead, .caption, a.panel .title { text-wrap: balance; }
main { flex: 1; display: flex; flex-direction: column; gap: 10px; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--dim); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.label { font: 500 11px/20px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.panel { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 28px; }
.mark { display: flex; align-items: center; gap: 8px; font: 600 13px var(--mono); letter-spacing: 0.04em; text-decoration: none; text-transform: uppercase; white-space: nowrap; }
/* The logo: the ripple from the preview image; the dot is the same living dot as on the timeline. */
.mark svg { width: 18px; height: 18px; overflow: visible; }
.mark svg .core { fill: var(--accent); stroke: none; }
.mark svg .ring { transform-box: fill-box; transform-origin: center; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.2); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .mark svg .ring { animation: none; } }
.end { display: flex; align-items: center; gap: 6px; min-width: 0; }
/* 28 px high in the layout; the tap area reaches 4 px above and below. */
.icon, #theme { flex: none; width: 32px; height: 36px; margin: -4px 0; display: flex; align-items: center; justify-content: center;
         padding: 0; border: 0; background: none; color: var(--dim); cursor: pointer; }
.icon:hover { color: var(--ink); }
.icon svg { width: 16px; height: 16px; }
#theme svg { display: none; }
#theme[data-state="auto"] .auto, #theme[data-state="light"] .light, #theme[data-state="dark"] .dark { display: block; }
/* Search floats under the header: the page underneath does not move. */
#search { position: absolute; z-index: 10; top: calc(46px + env(safe-area-inset-top)); right: 16px;
          width: min(420px, calc(100% - 32px)); display: grid; gap: 4px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.25); }
#search input { width: 100%; height: 44px; padding: 0 12px; font: 16px var(--sans); color: var(--ink); -webkit-appearance: none;
                background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-control); outline: none; }
#search input:focus { border-color: var(--ink); }
#search .none { padding: 12px 0 4px; font-size: 15px; color: var(--dim); }
/* The node panel floats under the header: the page underneath does not move. */
body { position: relative; }
.hint { margin: 0; font-size: 15px; color: var(--dim); }
.control { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 44px; padding: 0 14px;
           border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--bg); color: var(--ink);
           font: 500 11px/20px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-align: left;
           text-decoration: none; cursor: pointer; }
.control:active { opacity: 0.7; }
.control .arrow { font-size: 16px; }
nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; margin-bottom: min(24px, 3vh);
      padding-bottom: 10px; border-bottom: 1px solid var(--line); }
nav::-webkit-scrollbar { display: none; }
nav a { flex: none; text-decoration: none; }
nav a:hover, nav a[aria-current] { color: var(--ink); }
nav sup { margin-left: 2px; font-size: 8px; line-height: 0; vertical-align: 5px; color: var(--dim); }
/* Phones: tighter gaps, left-aligned; spreading three items leaves wide holes. */
@media (max-width: 480px) { nav { gap: 12px; } }
h1 { margin: 0 0 4px; font-size: clamp(28px, 7vw, 36px); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.lead { margin: 0 0 min(8px, 1vh); font-size: 16px; color: var(--dim); }
h2.label { margin: min(16px, 2vh) 0 0; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1em; text-align: justify; text-align-last: left; hyphens: auto; -webkit-hyphens: auto;
           hyphenate-limit-chars: 6 3 2; -webkit-hyphenate-limit-before: 3; -webkit-hyphenate-limit-after: 2; }
.prose h2 { font-size: 20px; line-height: 1.3; font-weight: 600; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 17px; font-weight: 600; margin: 1.4em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-control); }
.prose figure { margin: 1.4em 0; }
.prose figcaption { margin-top: 6px; font-size: 14px; color: var(--dim); }
code { font: 0.88em var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
pre { overflow-x: auto; padding: 12px 14px; font: 13px/1.5 var(--mono); background: var(--bg);
      border: 1px solid var(--line); border-radius: var(--radius-control); -webkit-text-size-adjust: none; }
pre code { padding: 0; border: 0; background: none; font-size: inherit; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 20px; }
th { text-align: left; font: 500 11px/20px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
th, td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
a.panel { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; }
a.panel { transition: border-color 150ms, background-color 150ms; }
a.panel:hover { border-color: var(--ink); }
a.panel:hover .arrow { color: var(--ink); }
a.panel:active { opacity: 0.8; }
a.panel .label { display: block; color: var(--ink); }
/* Accent only for what is on: current parts. */
a.panel.on .label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--accent); }
a.panel .title { display: block; margin: 4px 0; font-size: 16px; line-height: 22px; font-weight: 600; }
/* Filled: the one main thing to do on a page (open the Remote, download a tool). */
.primary { background: var(--ink); border-color: var(--ink); }
a.primary .label, a.primary .title, a.primary .arrow, a.primary:hover .arrow { color: var(--bg); }
a.primary .caption { color: var(--bg); opacity: 0.7; }
a.primary:hover { border-color: var(--ink); }
.prose.body { margin-top: 10px; }
.caption { display: block; font-size: 15px; line-height: 20px; color: var(--dim); }
.arrow { font: 400 18px/20px var(--mono); color: var(--dim); }
/* Previous and next at the foot of an item: two columns, no panel. */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: min(16px, 2vh); }
.pager a { display: flex; flex-direction: column; gap: 4px; max-width: 48%; text-decoration: none; }
.pager a:last-child { margin-left: auto; text-align: right; }
.pager b { font-size: 15px; line-height: 20px; font-weight: 600; }
.pager a:hover b { text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
/* Lists: one row per item inside a panel. Title and short lines on the left; on the right a value, or → without one. */
.list { margin: 0; padding: 0; list-style: none; }
.list li + li { border-top: 1px solid var(--line); }
.list a { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 60px; padding: 12px 0; text-decoration: none; }
.list .text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.list b { font-size: 15px; line-height: 20px; font-weight: 600; text-wrap: balance; }
.list .sub { font-size: 14px; line-height: 18px; color: var(--dim); }
.list .sub strong { font-weight: 600; color: var(--ink); }
.list a:hover b { text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
.list .label { flex: none; display: flex; align-items: center; gap: 6px; }
.list .arrow { flex: none; }
.list a:hover .arrow { color: var(--ink); }
.list .on .label { color: var(--ink); }
.list .on .label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.panel.lists { padding: 0 14px; }
.crumb { text-decoration: none; }
.crumb:hover { color: var(--ink); }
.meta { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 15px; line-height: 20px; }
.meta dt { margin: 0; }
.meta dd { margin: 0; overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; gap: 12px; margin-top: min(20px, 3vh); padding-top: 10px; border-top: 1px solid var(--line); }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }
footer .links { display: flex; align-items: center; gap: 14px; }
footer .links a { display: flex; padding: 7px; margin: -7px; color: var(--dim); }
footer .links svg { width: 14px; height: 14px; }
.mark a { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.mark .slash { color: var(--dim); font-weight: 400; }
