/* ════════════════════════════════════════════════════════════
   site.css — single source of truth (v3)
   Direction: Inter · uniform small type · thin-line block grid
   One set of tokens, heights, animations & components for EVERY
   screen incl. the home field. (refs: Giacomo Nanni, CAN-V6, 5AM)
   ════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:        #111111;
  --text:      #f0efe8;            /* primary — ~94% L, AA AAA on --bg */
  --ui:        #181818;
  --ui-hi:     #1e1e1e;
  --border:    #2a2a2a;
  /* Legibility pass: both greys clear the ~60% lightness floor and pass
     WCAG AA (4.5:1) on --bg. Hierarchy is carried by weight + the uppercase
     /small form of labels, not by dimming text into illegibility. */
  --meta:      #b3b2a9;            /* labels / tertiary — ~68% L, ≈9:1 */
  --meta-hi:   #d4d3cb;            /* secondary body — ~81% L, ≈13:1 */
  --accent:    #5fa898;
  --accent-dim: rgba(95,168,152,.12);
  --leaf:      #7bbf6a;            /* greenhouse-only growth tone */
  --leaf-dim:  rgba(123,191,106,.12);
  --font:      'Necto Mono', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  --font-prose: 'Ortica', 'Georgia', 'Noto Serif', serif;

  /* unified type scale — small but legible */
  --fs-label: 11px;
  --fs-sm:    12.5px;
  --fs-body:  14px;
  --fs-md:    16px;
  --fs-title: 18px;
  --fs-lg:    20px;
  --fs-xl:    25px;

  --s1:4px; --s2:8px; --s3:16px; --s4:24px;
  --s5:32px; --s6:48px; --s7:64px; --s8:96px;

  /* shared element heights — IDENTICAL on every screen */
  --hdr:36px;
  --marquee:30px;
  --bar:38px;
  --maxw:1180px;
  --pad:28px;

  --ease: cubic-bezier(.7,0,.18,1);

  /* JS-02: named easing curves */
  --ease-out-expo:     cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-snap:         cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-standard:     cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  letter-spacing: -0.003em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale; /* Firefox macOS subpixel smoothing */
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}
/* Eliminate 300ms tap delay on touch devices for all interactive elements */
a, button, [role="button"], [tabindex] { touch-action: manipulation; }
table, .tnum, time, .meta, .year, .code { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
::selection { background: var(--accent); color: var(--bg); }
.skip-link { position: absolute; top: -100px; left: var(--pad); z-index: 999; background: var(--accent); color: #111; padding: 8px 16px; font-size: var(--fs-sm); font-weight: 500; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 8px; }
img { max-width: 100%; display: block; }

/* ── LINKS ──────────────────────────────────────────────────── */
a { color: var(--accent); font-weight: 500; text-decoration: none; position: relative; }
a:hover { color: #111; background: var(--accent); }
/* JS-01: link hover clip-path reveal */
a:not(header.site nav a):not(.logo):not(.skip-link):not(.lp-name)::after {
  content: ''; position: absolute; inset: 0; background: var(--accent);
  clip-path: inset(0 100% 0 0); transition: clip-path 180ms var(--ease-standard); z-index: -1;
}
a:not(header.site nav a):not(.logo):not(.skip-link):not(.lp-name):hover { background: transparent; }
a:not(header.site nav a):not(.logo):not(.skip-link):not(.lp-name):hover::after { clip-path: inset(0 0 0 0); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; background: transparent; color: var(--accent); }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── TYPE ───────────────────────────────────────────────────── */
h1 { font-size: var(--fs-title); font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-md); font-weight: 500; line-height: 1.3; }
h3 { font-size: var(--fs-body); font-weight: 600; line-height: 1.3; }
.label, .lbl { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--meta); font-weight: 500; }
.meta { font-size: var(--fs-label); color: var(--meta); letter-spacing: .01em; }
.code { color: var(--accent); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.glyph { color: var(--accent); font-weight: 400; }
.glyph-dim { color: var(--meta); font-weight: 400; }

/* ── HEADER ─────────────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 40;
  height: var(--hdr); flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0;
  background: var(--ui);                 /* subtly lifted off the page so the bar reads as chrome */
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-size: 24px;
  color: var(--bg);
  font-weight: 500;
  display: inline-grid; place-items: center;
  width: var(--hdr); height: var(--hdr);
  background: var(--accent);
  text-decoration: none; line-height: 1;
  transition: background .15s;
}
.logo:hover { background: var(--accent); background: color-mix(in oklch, var(--accent), #fff 15%); color: var(--bg); }
.hdr-clock {
  font-size: var(--fs-label); color: var(--meta); letter-spacing: .04em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  display: flex; align-items: center; padding: 0 var(--pad); height: 100%;
  border-left: 1px solid var(--border);
}
header.site nav { display: flex; gap: 0; margin-left: auto; height: 100%; align-items: stretch; }
header.site nav a {
  font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .07em;
  color: var(--text); font-weight: 500; transition: color .12s; white-space: nowrap;
  display: flex; align-items: center; padding: 0 16px; position: relative;
  border-left: 1px solid var(--border);
}
header.site nav a:hover { color: var(--accent); background: transparent; }
/* JS-01: nav underline draw */
header.site nav a::after {
  content: ''; position: absolute; bottom: 0; left: 16px; right: 16px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 160ms var(--ease-out-expo);
}
header.site nav a:hover::after { transform: scaleX(1); }
/* active page: brightest label + a persistent teal underline indicator */
header.site nav a[aria-current="page"] { color: #fff; background: transparent; }
header.site nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ── MAIN ───────────────────────────────────────────────────── */
main { flex: 1 0 auto; width: 100%; }
main.contained { max-width: var(--maxw); margin: 0 auto; padding: var(--s6) var(--pad) var(--s8); }
main.full { padding: 0; }

/* ── PAGE HEAD ──────────────────────────────────────────────── */
.page-head {
  display: flex; align-items: baseline; gap: var(--s4);
  padding: var(--s4) var(--pad);
  border-bottom: 1px solid var(--border);
}
.page-head h1 { white-space: nowrap; display: inline-flex; align-items: baseline; gap: 10px; }
.page-head .sub { font-size: var(--fs-label); color: var(--meta); text-transform: uppercase; letter-spacing: .06em; }
.page-head .rule { flex: 1; height: 0; }
main.contained .page-head { padding-left: 0; padding-right: 0; }
main.contained .page-head .rule { height: 1px; background: var(--border); transform: translateY(-3px); }

/* ── FIELD BLOCKS ───────────────────────────────────────────── */
.field { margin-bottom: var(--s5); }
.field > .lbl { display: block; margin-bottom: var(--s2); }
.field > .box { border: 1px solid var(--border); padding: var(--s4); }
.fields-2 { display: grid; grid-template-columns: 1fr; gap: 0 var(--s5); }
@media (min-width: 900px) { .fields-2 { grid-template-columns: 1fr 1fr; } }
.block { border: 1px solid var(--border); padding: var(--s4); }

/* ── PROSE ──────────────────────────────────────────────────── */
.prose { max-width: 66ch; overflow-wrap: break-word; hanging-punctuation: first last; font-family: var(--font-prose); font-weight: 300; }
.prose p { margin-bottom: var(--s4); font-size: var(--fs-body); }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { margin: var(--s5) 0 var(--s3); }
.prose h3 { margin: var(--s4) 0 var(--s2); }
.prose ul, .prose ol { margin: 0 0 var(--s4) 1.3em; }
.prose li { margin-bottom: var(--s2); }
.prose blockquote { border-left: 1px solid var(--border); padding-left: var(--s4); margin: var(--s5) 0; color: var(--meta-hi); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }
.callout { background: var(--accent); color: var(--bg); font-weight: 500; padding: 1px 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ── TAG ────────────────────────────────────────────────────── */
.tag { display: inline-block; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .05em; color: var(--meta); border: 1px solid var(--border); padding: 2px 7px; }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ════════════════════════════════════════════════════════════
   PROJECTS — full-bleed block rows (shared by index + projects)
   ════════════════════════════════════════════════════════════ */
.proj-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: var(--s3) var(--pad);
  border-bottom: 1px solid var(--border);
}
.proj-toolbar .grp { display: flex; align-items: center; gap: 12px; }
.fbtn {
  background: none; border: none; font-family: var(--font);
  font-size: var(--fs-label); letter-spacing: .07em; text-transform: uppercase;
  color: var(--meta); cursor: pointer; padding: 0; transition: color .12s;
  white-space: nowrap;
}
.fbtn:hover { color: var(--meta-hi); }
.fbtn.active { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.f-sep { color: var(--border); font-size: var(--fs-label); user-select: none; }

.proj-list { border-bottom: 1px solid var(--border); }
.proj-row {
  display: grid;
  grid-template-columns: 1fr 230px 56px;
  align-items: baseline;
  gap: var(--s4);
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s, padding-left .15s;
}
.proj-row:last-child { border-bottom: 0; }
.proj-row.head { cursor: default; padding-top: 10px; padding-bottom: 10px; flex-shrink: 0; background: var(--bg); z-index: 2; border-bottom: 1px solid var(--border); }
.proj-row.head > * { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--meta); }
.proj-row:not(.head):hover { background: var(--ui); padding-left: calc(var(--pad) + 8px); }
.proj-title { min-width: 0; }
.proj-title .t { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.01em; color: var(--text); transition: color .12s; }
.proj-row:not(.head):hover .proj-title .t { color: var(--accent); }
.proj-title .cat { margin-left: 11px; font-size: var(--fs-label); color: var(--meta); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.proj-type { font-size: var(--fs-sm); color: var(--meta-hi); }
.proj-year { font-size: var(--fs-sm); color: var(--meta); text-align: right; }
.proj-row.hidden { display: none; }

/* floating hover preview */
#preview {
  position: fixed; left: 50%; top: 50%; z-index: 50; pointer-events: none;
  width: 460px; max-width: calc(100vw - 48px);
  opacity: 0; visibility: hidden; transform: translate(-50%, -46%) scale(.98);
  box-shadow: 0 26px 70px rgba(0,0,0,.5);
  transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
  border: 1px solid var(--border); background: var(--bg);
  transition: opacity .16s ease, transform .22s var(--ease), visibility 0s linear .22s;
}
#preview.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); transition: opacity .16s ease, transform .22s var(--ease); }
#preview .pv-img { aspect-ratio: 3 / 2; overflow: hidden; }
#preview .pv-img img { width: 100%; height: 100%; object-fit: cover; }
#preview .pv-cap { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-top: 1px solid var(--border); }
#preview .pv-cap .code { color: var(--accent); }
#preview .pv-cap .yr { color: var(--meta); font-size: var(--fs-label); }

/* ── IMAGE PLACEHOLDER ──────────────────────────────────────── */
.img-ph {
  width: 100%;
  background-color: var(--ui);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 9px, rgba(120,120,112,.07) 9px, rgba(120,120,112,.07) 10px);
  display: flex; align-items: center; justify-content: center;
  color: var(--meta); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .1em; text-align: center; padding: 8px;
}

/* ════════════════════════════════════════════════════════════
   PROJECT DETAIL (overlay card + standalone)
   ════════════════════════════════════════════════════════════ */
.card-overlay { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; display: none; flex-direction: column; }
.card-overlay.on { display: flex; }
.card-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--hdr); padding: 0 0 0 var(--pad); /* no right padding — close button is flush */
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.card-bar { background: var(--ui); }   /* match header chrome lift */
.card-bar .back { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--meta-hi); cursor: pointer; background: none; border: none; font-family: var(--font); white-space: nowrap; }
.card-bar .back:hover { color: var(--accent); background: transparent; }
.card-close {
  width: var(--hdr); height: 100%; flex-shrink: 0; /* square, fills bar height exactly */
  display: flex; align-items: center; justify-content: center;
  border: none; border-left: 1px solid var(--border);
  background: none; color: var(--meta-hi); cursor: pointer; font-size: 16px; line-height: 1;
}
.card-close:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.detail-grid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .detail-grid { grid-template-columns: 1fr 320px; } }
.detail-main { padding: var(--s6) var(--pad); border-bottom: 1px solid var(--border); }
.detail-aside { padding: var(--s6) var(--pad); }
@media (min-width: 1000px) { .detail-main { border-bottom: 0; border-right: 1px solid var(--border); } }
.detail-head .code { display: block; margin-bottom: var(--s2); }
.detail-head h1 { font-size: var(--fs-xl); font-weight: 500; line-height: 1.15; margin-bottom: var(--s3); }
.detail-head .subtitle { color: var(--meta-hi); font-size: var(--fs-md); max-width: 60ch; }

.specs dl { display: grid; grid-template-columns: 1fr; }
.specs .spec { display: flex; flex-direction: column; gap: 3px; padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.specs .spec:first-child { padding-top: 0; }
.specs dt { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--meta); }
.specs dd { font-size: var(--fs-sm); color: var(--text); }

figure { margin: var(--s5) 0; }
figure img { width: 100%; height: auto; }
figure:first-of-type { margin-top: var(--s6); }
figcaption { font-size: var(--fs-label); color: var(--meta); margin-top: var(--s2); }

.crumb { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--meta); }
.crumb a { color: var(--meta); font-weight: 500; }
.crumb a:hover { color: #111; background: var(--accent); }

/* ════════════════════════════════════════════════════════════
   ARCHIVE TABLE (writing)
   ════════════════════════════════════════════════════════════ */
table.archive { width: 100%; border-collapse: collapse; }
table.archive th { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--meta); text-align: left; font-weight: 500; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--border); }
table.archive td { font-size: var(--fs-sm); color: var(--text); padding: 14px 16px 14px 0; border-bottom: 1px solid var(--border); vertical-align: baseline; }
table.archive tbody tr { cursor: pointer; transition: background .12s; }
table.archive tbody tr:hover { background: var(--ui); }
table.archive .c-title { font-size: var(--fs-body); }
table.archive tbody tr:hover .c-title { color: var(--leaf); }
table.archive .c-year { color: var(--meta); white-space: nowrap; }
table.archive .c-tag { color: var(--meta); }
table.archive .c-growth { white-space: nowrap; font-size: var(--fs-body); }

/* ════════════════════════════════════════════════════════════
   CV — asymmetric columns (wide main / narrow aside)
   ════════════════════════════════════════════════════════════ */
.cv-id { padding: var(--s5) var(--pad); border-bottom: 1px solid var(--border); }
.cv-id h1 { font-size: var(--fs-xl); font-weight: 500; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cv-id .role { color: var(--meta-hi); font-size: var(--fs-sm); margin-top: var(--s2); }
.cv-cols { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cv-cols { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); } }
.cv-main { border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .cv-main { border-right: 1px solid var(--border); border-bottom: 0; } }
.cv-sec { padding: var(--s5) var(--pad); border-bottom: 1px solid var(--border); }
.cv-sec:last-child { border-bottom: 0; }
.cv-sec > .lbl { display: flex; align-items: baseline; gap: 8px; margin-bottom: var(--s4); }
.cv-entry { display: grid; grid-template-columns: 96px 1fr; gap: var(--s3); padding-bottom: var(--s4); }
.cv-entry:last-child { padding-bottom: 0; }
.cv-entry .period { color: var(--meta); font-size: var(--fs-label); padding-top: 2px; }
.cv-entry .role2 { font-size: var(--fs-body); }
.cv-entry .org { color: var(--meta-hi); font-size: var(--fs-sm); margin: 1px 0 var(--s1); }
.cv-entry .desc { color: var(--meta-hi); font-size: var(--fs-sm); max-width: 52ch; }
.cv-skills { display: flex; flex-direction: column; gap: var(--s3); }
.cv-skills .row { display: grid; grid-template-columns: 84px 1fr; gap: var(--s3); }
.cv-skills .k { color: var(--meta); font-size: var(--fs-label); }
.cv-skills .v { font-size: var(--fs-sm); color: var(--meta-hi); }
.cv-contact { display: flex; flex-direction: column; gap: var(--s2); }
.cv-contact a { font-size: var(--fs-sm); }
.print-contact { display: none; }
@media (max-width: 640px) { .cv-entry { grid-template-columns: 1fr; gap: var(--s1); } }

/* ── WRITING / POST META ────────────────────────────────────── */
.post-meta { font-size: var(--fs-label); color: var(--meta); margin: var(--s2) 0 var(--s5); }
.post-meta .sep { color: var(--border); margin: 0 6px; }
.last-mod { font-size: var(--fs-label); color: var(--meta); margin-top: var(--s6); }

/* ════════════════════════════════════════════════════════════
   GREENHOUSE — digital garden hub (more playful)
   ════════════════════════════════════════════════════════════ */
.gh-intro { padding: var(--s6) var(--pad) var(--s5); border-bottom: 1px solid var(--border); }
.gh-intro .lead { font-size: var(--fs-md); color: var(--text); line-height: 1.5; font-family: var(--font-prose); font-weight: 300; max-width: 70ch; }
.gh-intro .lead .leaf { color: var(--leaf); }
.gh-intro .meta { margin-top: var(--s3); }

.gh-beds { display: grid; grid-template-columns: 1fr; }
@media (min-width: 720px) { .gh-beds { grid-template-columns: 1fr 1fr; } }
.gh-bed {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: var(--s5) var(--pad) var(--s6);
  min-height: 230px;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: background .25s;
}
.gh-bed:hover { background: var(--leaf-dim); color: inherit; }
@media (min-width: 720px) { .gh-bed:nth-child(odd) { border-right: 1px solid var(--border); } }
.gh-bed .bed-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gh-bed .bed-stage { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--meta); }
.gh-bed h2 { font-size: var(--fs-lg); margin-top: var(--s3); transition: color .2s; }
.gh-bed:hover h2 { color: var(--leaf); }
.gh-bed .bed-desc { font-size: var(--fs-sm); color: var(--meta-hi); margin-top: var(--s2); max-width: 40ch; }
.gh-bed .bed-count { margin-top: auto; padding-top: var(--s4); font-size: var(--fs-label); color: var(--meta); letter-spacing: .04em; }
.gh-bed.dormant { cursor: default; }
.gh-bed.dormant:hover { background: var(--ui); }
.gh-bed.dormant:hover h2 { color: var(--meta-hi); }

/* organic sprout that grows on hover */
.sprout { position: absolute; right: var(--pad); bottom: 0; width: 80px; height: 120px; pointer-events: none; }
.sprout .stem { stroke: var(--leaf); stroke-width: 1.5; fill: none; stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset .7s var(--ease); }
.sprout .leaf, .sprout .bloom { transform: scale(0); transform-origin: center; transform-box: fill-box; opacity: 0; transition: transform .45s var(--ease), opacity .45s ease; }
.sprout .leaf { fill: var(--leaf); }
.sprout .bloom { fill: var(--accent); }
.gh-bed:hover .sprout .stem { stroke-dashoffset: 0; }
.gh-bed:hover .sprout .leaf { transform: scale(1); opacity: .85; transition-delay: .35s; }
.gh-bed:hover .sprout .leaf.l2 { transition-delay: .5s; }
.gh-bed:hover .sprout .bloom { transform: scale(1); opacity: 1; transition-delay: .6s; }

/* ── greenhouse section header (full-width label + rule) ── */
.gh-sec-head { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s4) var(--pad) var(--s3); border-bottom: 1px solid var(--border); }
.gh-sec-head h2 { font-size: var(--fs-md); }
.gh-sec-head .glyph { font-size: var(--fs-md); }
.gh-sec-head .sub { font-size: var(--fs-label); color: var(--meta); text-transform: uppercase; letter-spacing: .06em; }
.gh-sec-head .rule { flex: 1; height: 0; }

/* ── NOW feed (sticker / post-it notes) ── */
.gh-now { border-bottom: 1px solid var(--border); padding: var(--s4) var(--pad) var(--s5); }
#now-feed { display: flex; gap: var(--s4); flex-wrap: wrap; padding: var(--s2) 0; }
.now-card {
  flex: 0 1 340px;
  border-radius: 6px;
  padding: var(--s4);
  display: flex; flex-direction: column; gap: var(--s3);
  background: var(--ui); background: color-mix(in oklch, var(--bg), #e8e8e0 6%);
  border: 1px solid var(--border); border: 1px solid color-mix(in oklch, var(--border), #e8e8e0 12%);
  box-shadow: 2px 3px 0 rgba(0,0,0,.25);
  font-family: var(--font-prose); font-weight: 300;
}
.now-card .now-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.now-card .now-title { font-family: var(--font); font-size: var(--fs-sm); font-weight: 500; color: var(--accent); }
.now-card .now-text { font-size: var(--fs-sm); color: var(--text); line-height: 1.6; }
.now-card .now-text a { color: var(--accent); border-bottom: 1px solid rgba(95,168,152,.3); }
.now-card .now-text a:hover { border-color: var(--accent); }
.now-card .now-text em { font-style: italic; color: var(--meta-hi); }
.now-card .now-when { font-size: var(--fs-label); color: var(--meta); letter-spacing: .03em; margin-top: auto; }

/* ── WRITING: 2/3 list + 1/3 live preview ── */
.gh-writing { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .gh-writing { grid-template-columns: 2fr 1fr; } }
.gw-list { border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .gw-list { border-right: 1px solid var(--border); border-bottom: 0; } }
.gw-row { display: grid; grid-template-columns: 1fr 70px 56px; align-items: baseline; gap: var(--s3); padding: 14px var(--pad); border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s, padding-left .15s; }
.gw-row:last-child { border-bottom: 0; }
.gw-row .t { font-size: var(--fs-md); color: var(--text); transition: color .12s; }
.gw-row .growth { font-size: var(--fs-body); }
.gw-row .yr { font-size: var(--fs-sm); color: var(--meta); text-align: right; }
.gw-row:hover, .gw-row.active { background: var(--leaf-dim); padding-left: calc(var(--pad) + 8px); }
.gw-row:hover .t, .gw-row.active .t { color: var(--leaf); }

.gw-preview { padding: var(--s5) var(--pad); }
@media (min-width: 900px) { .gw-preview { position: sticky; top: var(--hdr); align-self: start; } }
.gw-preview .pv-thumb { aspect-ratio: 3 / 2; margin-bottom: var(--s4); }
.gw-preview .pv-growth { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--meta); margin-bottom: var(--s2); display: block; }
.gw-preview h3 { font-size: var(--fs-lg); font-weight: 500; line-height: 1.2; margin-bottom: var(--s2); }
.gw-preview .pv-meta { font-size: var(--fs-label); color: var(--meta); margin-bottom: var(--s3); }
.gw-preview .pv-meta .sep { color: var(--border); margin: 0 5px; }
.gw-preview .pv-excerpt { font-size: var(--fs-sm); color: var(--meta-hi); line-height: 1.6; max-width: 46ch; }
.gw-preview .pv-open { display: inline-block; margin-top: var(--s4); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; }

/* ── TYPE ART ───────────────────────────────────────────────── */
.type-art { color: var(--accent); font-size: var(--fs-sm); line-height: 1.2; white-space: pre; overflow-x: auto; }

/* ════════════════════════════════════════════════════════════
   MARQUEE — scrolling ironic band (above footer, every screen)
   ════════════════════════════════════════════════════════════ */
.marquee {
  height: var(--marquee); flex-shrink: 0;
  border-top: 1px solid #000;
  background: #0a0a0a;                 /* always dark — light type, high contrast */
  overflow: hidden; display: flex; align-items: center;
}
.marquee__track { display: flex; white-space: nowrap; will-change: transform; animation: marquee 52s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { display: inline-flex; align-items: center; gap: 9px; padding: 0 26px; font-size: var(--fs-label); color: #d4d2c8; letter-spacing: .02em; }
.marquee__item .g { color: #6fc3b0; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── FOOTER ─────────────────────────────────────────────────── */
footer.site {
  height: var(--bar); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad); border-top: 1px solid var(--border); background: var(--bg);
}
footer.site .copy { font-size: var(--fs-label); color: var(--meta); display: inline-flex; align-items: center; gap: 8px; }
footer.site .copy .g { color: var(--accent); }
footer.site .colophon-link { font-size: var(--fs-label); color: var(--meta); font-weight: 500; font-family: var(--font); background: none; border: 0; cursor: pointer; letter-spacing: .02em; }
footer.site .colophon-link:hover { color: var(--bg); background: var(--accent); }

/* ── COLOPHON OVERLAY ───────────────────────────────────────── */
.cph-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 16px; overflow-y: auto; }
.cph-overlay[hidden] { display: none; }
.cph-card { background: var(--bg); border: 1px solid var(--border); max-width: 760px; width: 100%; position: relative; overflow: hidden; }
/* faint curve-stitch texture behind the colophon content (drawn by patterns.js) */
.cph-pattern { position: absolute; inset: 0; z-index: 0; pointer-events: none; color: var(--text); opacity: .05; }
.cph-pattern svg { width: 100%; height: 100%; display: block; }
.cph-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: var(--hdr); padding: 0 0 0 var(--s4); border-bottom: 1px solid var(--border); background: var(--bg); }
.cph-body { position: relative; z-index: 1; }
.cph-title { font-size: var(--fs-sm); font-weight: 500; line-height: 1; }
.cph-close { width: var(--hdr); height: 100%; display: grid; place-items: center; border: none; border-left: 1px solid var(--border); background: none; color: var(--meta); cursor: pointer; font-size: 16px; line-height: 1; font-family: system-ui, sans-serif; padding: 0; margin-left: auto; }
.cph-close:hover { border-color: var(--accent); color: var(--accent); }
.cph-body { padding: var(--s5) var(--s4) var(--s6); }
.cph-grid { display: grid; grid-template-columns: 1fr; gap: var(--s5) var(--s5); }
@media (min-width: 620px) { .cph-grid { grid-template-columns: 1fr 1fr; } }
.cph-cell .lbl { display: flex; align-items: baseline; gap: 8px; margin-bottom: var(--s2); }
.cph-cell p { font-size: var(--fs-sm); color: var(--meta-hi); line-height: 1.55; }
.cph-cell a { color: var(--accent); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
.page-head { flex-wrap: wrap; }

@media (max-width: 760px) {
  :root { --pad: 16px; }
  header.site nav a { letter-spacing: .04em; padding: 0 10px; font-size: 10px; }
  .proj-row { grid-template-columns: 1fr auto; }
  .proj-type { display: none; }
  .proj-title .t { font-size: var(--fs-md); }
  #preview { display: none; }
  main.contained { padding: var(--s5) var(--pad) var(--s7); }
  .page-head .solar-line { flex-basis: 100%; order: 3; }
  .gw-row { grid-template-columns: 1fr 40px 48px; }
  .gw-row .t { font-size: var(--fs-body); }
  footer.site .legend { display: none; }
  footer.site .copy { font-size: 10px; }
  .cv-skills .row { grid-template-columns: 70px 1fr; }
  .cph-overlay { padding: 0; }
  .cph-card { max-width: none; min-height: 100vh; border: 0; }
  .cph-card .cph-body { overflow-y: auto; }
  .gw-preview { display: none; }
  .marquee__item { font-size: 11px; }
  #side-panel { display: none; }

  /* ── card overlay: single column + larger close glyph on mobile ── */
  .card-close { font-size: 18px; } /* width/height handled by var(--hdr) + height:100% */
  .card-bar .back { font-size: var(--fs-sm); }
  .detail-grid { grid-template-columns: 1fr !important; }
  .detail-main { border-right: 0 !important; border-bottom: 1px solid var(--border); }
  .detail-aside { border-right: 0 !important; }

  /* ── CV: collapse period column ── */
  .cv-entry { grid-template-columns: 1fr; gap: var(--s1); }
  .cv-entry .period { padding-top: 0; }

  /* ── logbook: stack entry head ── */
  .log-entry-head { flex-direction: column; gap: var(--s1); }
}

@media (max-width: 620px) { .hdr-clock { display: none; } }

@media (max-width: 560px) {
  .now-card { flex: 0 1 100%; }
  #projects-view .pv-count { margin-left: 0; flex-basis: 100%; order: 9; }
  .cph-bar { padding: 0 var(--s3); }
  .cph-body { padding: var(--s4) var(--s3) var(--s5); }

  /* ── header: tightest screen — shorten nav labels ── */
  header.site nav a { padding: 0 8px; font-size: 9px; }
}

/* ── PRINT ──────────────────────────────────────────────────── */
@media print {
  :root { --bg:#fff; --text:#000; --accent:#000; --leaf:#000; --border:#bbb; --meta:#555; --meta-hi:#333; }
  header.site, footer.site, nav, .crumb, .proj-toolbar, .card-bar, .marquee { display: none; }
  body { display: block; }
  .cv-main { border-right: 1px solid #bbb; }
  a { font-weight: 400; color: #000; }
  a:hover { background: transparent; color: #000; }
  .cv-sec, .cv-entry { page-break-inside: avoid; }
  .print-contact { display: block; }
}

/* ════════════════════════════════════════════════════════════
   PERMACOMPUTING / TRANSPARENCY (Greenhouse cluster)
   ════════════════════════════════════════════════════════════ */

/* superscript annotation symbols, à la Giacomo Nanni — used in
   place of icons (∿ DE IT ↗ …) */
.sup { font-size: .62em; vertical-align: super; line-height: 0; color: var(--meta); letter-spacing: .02em; margin-left: 1px; font-weight: 500; }
.sup.g { color: var(--accent); }

/* transparency note block */
.transparency { font-size: var(--fs-sm); color: var(--meta-hi); max-width: 62ch; line-height: 1.55; }
.transparency a { color: var(--accent); }
.transparency .k { color: var(--meta); }

/* solar status line */
.solar-line { font-size: var(--fs-label); letter-spacing: .04em; color: var(--meta); text-transform: none; font-variant-numeric: tabular-nums; }

/* the greenhouse follows the sun: ease colour shifts smoothly */
body.greenhouse,
body.greenhouse footer.site,
body.greenhouse .page-head,
body.greenhouse .gh-intro,
body.greenhouse .gh-bed,
body.greenhouse .box,
body.greenhouse .field > .box,
body.greenhouse table.archive td,
body.greenhouse table.archive th,
body.greenhouse .img-ph,
body.greenhouse .prose blockquote {
  transition: background-color 1.4s linear, color 1.4s linear, border-color 1.4s linear;
}

/* dithered sky band — the sky where the viewer is, ordered-dithered */
.gh-sky { height: 56px; border-bottom: 1px solid var(--border); position: relative; overflow: hidden;
  background: linear-gradient(var(--sky-a, #0b1222), var(--sky-b, #161a26)); transition: background 1.4s linear; }
.gh-sky::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(0,0,0,.55) .6px, transparent .7px), radial-gradient(rgba(255,255,255,.28) .5px, transparent .6px);
  background-size: 3px 3px, 3px 3px; background-position: 0 0, 1.5px 1.5px; mix-blend-mode: overlay; }
.gh-sky .sky-cap { position: absolute; left: var(--pad); bottom: 8px; font-size: var(--fs-label); letter-spacing: .05em; color: rgba(255,255,255,.7); text-shadow: 0 1px 2px rgba(0,0,0,.5); z-index: 1; }

/* ordered-dither placeholder texture (permacomputing image stand-in) */
body.greenhouse .img-ph,
.img-ph.dither {
  background-color: var(--ui);
  background-image:
    radial-gradient(var(--meta) .55px, transparent .6px),
    radial-gradient(var(--meta) .55px, transparent .6px);
  background-size: 4px 4px, 4px 4px;
  background-position: 0 0, 2px 2px;
  image-rendering: pixelated;
  color: var(--meta-hi);
}

/* ── MOTION ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .marquee__track { animation: none !important; }
  .sprout .stem { stroke-dashoffset: 0; }
  .sprout .leaf, .sprout .bloom { transform: scale(1); opacity: 1; }
}
