/* =============================================================================
   CEDIS Lab — css/components.css
   -----------------------------------------------------------------------------
   Reusable pieces: type styles and cards (same as KERNEL), the lab mark and
   the KERNEL wordmark, buttons, the web drawing on the home page, then the
   parts of each page. State is expressed with real attributes (aria-pressed,
   aria-current, [hidden]); js/lab.js sets them.
   ============================================================================= */
/* Type styles and shared building blocks (same as KERNEL) */
.eyebrow { font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 600; color: var(--link); }
.h2 { font-size: clamp(2.4rem, 5.8vw, 4.4rem); line-height: 1.04; letter-spacing: -0.035em; }
.h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; letter-spacing: -0.03em; }
.lead { font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.38; font-weight: 600; color: var(--fg-2); max-width: 36em; letter-spacing: -0.015em; }
.lead strong { color: var(--fg); font-weight: 600; }
.body { color: var(--fg-2); max-width: 36em; }
.body strong { color: var(--fg); font-weight: 600; }
.link { color: var(--link); text-decoration: none; font-size: 1.1rem; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; color: var(--fg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 2.6vw, 32px); min-width: 0; }
.night { background: var(--tile); border: 1px solid var(--hair); color: var(--white); --fg: var(--white); --fg-2: var(--gray); --line: var(--hair); --link: var(--sig); border-radius: 28px; padding: clamp(20px, 2.6vw, 34px); min-width: 0; }
.note { font-size: .875rem; color: var(--fg-2); }
.mono { font-family: var(--f-mono); }

/* Brand
     .lab    the CEDIS Lab mark (inline SVG symbol #cedis-mark) with the lab
             name. Lines and nodes take currentColor; the hub takes the fill:
             black on dark backgrounds, white on light (set where it is used).
     .kw     the KERNEL wordmark: stroked letters (#w-kernel) and red "2.1" */
.lab { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.lab .mark { width: 28px; height: 28px; flex: none; fill: #000000; }
.lab-n { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.lab-n b { font-weight: 500; color: var(--gray); }
.kw { display: block; height: 1em; width: auto; max-width: 100%; overflow: visible; }
.kw .w { stroke: currentColor; stroke-width: 6; fill: none; }
.kw .v { stroke: var(--ver); stroke-width: 6; fill: none; }

/* Scroll-in reveal (position only, never opacity; only when scripts run) */
.js .rise { transition: transform 1s cubic-bezier(.2, .7, .1, 1); }
.js .rise:not(.in) { transform: translateY(36px); }

/* Buttons (same as KERNEL, in lab gold) */
.pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font: 500 1.0625rem/1 var(--f); padding: 14px 24px; border-radius: 999px; background: var(--sig); color: var(--sig-ink); transition: filter .2s ease, box-shadow .2s ease; white-space: nowrap; }
.pill-btn:hover { filter: brightness(1.06); box-shadow: 0 0 30px rgba(var(--sig-rgb), .4); }
.pill-btn svg { width: 20px; height: 20px; }
.ghost-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #3A3A3C; background: transparent; color: var(--fg); border-radius: 999px; padding: 13px 22px; font: 500 1.0625rem/1 var(--f); cursor: pointer; text-decoration: none; white-space: nowrap; }
.ghost-btn:hover { border-color: var(--sig); }
.light .ghost-btn, .white .ghost-btn { border-color: #C7C7CC; }
.light .ghost-btn:hover, .white .ghost-btn:hover { border-color: var(--ink); }
.ghost-btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 22px; background: #1C1C1E; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--gray); font-size: .9rem; font-weight: 500; padding: 8px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #3A3A3C; color: var(--white); }
.light .seg, .white .seg { background: #E3E3E8; }
.light .seg button, .white .seg button { color: var(--ink-2); }
.light .seg button[aria-pressed="true"], .white .seg button[aria-pressed="true"] { background: #FFFFFF; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.copy { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 1px solid var(--line); background: transparent; color: var(--fg-2); border-radius: 999px; padding: 7px 13px; font: 500 .8125rem var(--f); cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.copy:hover { color: var(--fg); border-color: currentColor; }
.copy svg { width: 15px; height: 15px; }
.copy.copied { color: var(--green); border-color: rgba(48, 209, 88, .5); }
.light .copy.copied, .white .copy.copied { color: #1B7F3A; border-color: rgba(27, 127, 58, .5); }

/* Round icon badge: gold ring with a soft glow on dark, plain on light */
.ic { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%; color: var(--link); border: 1.5px solid currentColor; box-shadow: 0 0 18px -4px rgba(var(--sig-rgb), .55), inset 0 0 12px -4px rgba(var(--sig-rgb), .4); }
.light .ic, .white .ic { box-shadow: none; background: var(--card); }
.ic svg { width: 60%; height: 60%; }

/* Home: the lab lockup above the headline */
.lockup { display: grid; gap: 14px; justify-items: center; }
.lockup .lab { gap: 14px; }
.lockup .lab .mark { width: 54px; height: 54px; }
.lockup .lab-n { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; }
.lockup .meta { font-size: .98rem; font-weight: 600; color: var(--gray); max-width: 30em; }

/* Home: the web drawing. The lab mark drawn large as a grid edge: six
   resources (.node) on the threads (.thread), joined by spokes (.spoke) to
   the hub. Gold packets (.pk) travel out from the hub, white ones (.pk.up)
   travel back in. */
.web { position: relative; z-index: 1; display: block; width: 100%; height: auto; overflow: visible; }
.web .thread { fill: none; stroke: rgba(245, 245, 247, .55); stroke-width: 2.2; stroke-linejoin: round; }
.web .thread.in { stroke: rgba(245, 245, 247, .38); }
.web .spoke { fill: none; stroke: rgba(var(--sig-rgb), .5); stroke-width: 1.6; stroke-dasharray: 2 7; stroke-linecap: round; }
.web .node { fill: #000000; stroke: var(--white); stroke-width: 2.4; }
.web .ping { fill: none; stroke: var(--sig); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ping 3s ease-out infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
.web .hub { fill: #000000; stroke: var(--sig); stroke-width: 2.6; filter: drop-shadow(0 0 10px rgba(var(--sig-rgb), .8)); }
.web .hub-t { fill: var(--sig); font: 600 15px var(--f-mono); letter-spacing: .14em; }
.web .pk { fill: var(--sig); filter: drop-shadow(0 0 5px var(--sig)); }
.web .pk.up { fill: #FFFFFF; opacity: .85; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .8)); }
.web .lbl { fill: rgba(245, 245, 247, .82); font: 500 21px var(--f); letter-spacing: -0.01em; }
.web-cap { position: relative; z-index: 1; margin: 18px auto 0; color: var(--gray); font-size: .95rem; max-width: 40em; }
.web-cap b { color: var(--white); font-weight: 600; }

/* Home: research area cards (also used for area links elsewhere) */
.area-card { display: grid; gap: 14px; align-content: start; text-decoration: none; color: inherit; transition: box-shadow .25s ease, transform .25s ease; }
.area-card:hover { box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .35); transform: translateY(-2px); }
.area-card h3 { font-size: clamp(1.2rem, 1.8vw, 1.4rem); letter-spacing: -0.025em; line-height: 1.15; }
.area-card p { color: var(--fg-2); font-size: .95rem; }
.area-card .more { color: var(--link); font-weight: 500; font-size: .95rem; margin-top: auto; }

/* Home: the research areas as a quadrant infographic, at every size. Four
   cards, two by two, around a ring of four coloured quarters (01 Grid-edge,
   02 Digital twin, 03 Health, 04 Security) with the lab mark at its centre.
   The ring covers the cards' inner corners and the text keeps clear of it.
   Sizes follow the grid's width (container units, cqi).
     · 901 px and wider: the text sits in the outer part of each card and
       the ring beside it (each card's inner side is padded by the ring)
     · 900 px and under: the text runs across the card, with the ring below
       it (top cards) or above it (bottom cards); phones hide "Read more"
   Shadows as in the infographic: white cards lifted off the page, the ring
   floating above them (its quarters and centre are shaded in the SVG). */
.area-grid { position: relative; container-type: inline-size; grid-auto-rows: 1fr; }
.area-grid > * { --ring: clamp(240px, 32cqi, 340px); }
.area-grid > :nth-child(1) { --q: #8C5D00; --qc: #F2B441; }
.area-grid > :nth-child(2) { --q: #B4531A; --qc: #F0883E; }
.area-grid > :nth-child(3) { --q: #1B7F3A; --qc: #2FB35A; }
.area-grid > :nth-child(4) { --q: #1F5FB8; --qc: #2F7FE0; }
.area-grid .area-card { background: #FFFFFF; border: 1px solid rgba(0, 0, 0, .06); box-shadow: 0 26px 50px -22px rgba(0, 0, 0, .42), 0 10px 22px -10px rgba(0, 0, 0, .16), 0 1px 3px rgba(0, 0, 0, .06);
  align-content: stretch; gap: 10px 12px; padding: 28px;
  grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: auto auto auto minmax(var(--clear, 0px), 1fr) auto; grid-template-areas: "t t t" "d d d" "m m m" "s s s" "n i ."; }
.area-grid .area-card:nth-child(2) { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "t t t" "d d d" "m m m" "s s s" ". i n"; text-align: right; }
.area-grid .area-card:nth-child(3) { grid-template-rows: auto minmax(var(--clear, 0px), 1fr) auto auto auto; grid-template-areas: "n i ." "s s s" "t t t" "d d d" "m m m"; }
.area-grid .area-card:nth-child(4) { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto minmax(var(--clear, 0px), 1fr) auto auto auto; grid-template-areas: ". i n" "s s s" "t t t" "d d d" "m m m"; text-align: right; }
.area-grid .area-card:hover { transform: none; box-shadow: 0 30px 56px -22px rgba(0, 0, 0, .5), 0 12px 24px -10px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .06); }
.js .area-grid .rise:not(.in) { transform: none; }
.area-card h3 { grid-area: t; }
.area-card p { grid-area: d; }
.area-card .more { grid-area: m; color: var(--q); }
.area-card .num { grid-area: n; align-self: center; font: 700 clamp(2rem, 4cqi, 2.8rem)/1 var(--f); letter-spacing: -0.03em; color: var(--q); }
.area-grid .area-card .ic { grid-area: i; align-self: center; width: 52px; height: 52px; color: var(--q); }
.quad-hub { position: absolute; left: 50%; top: 50%; width: var(--ring); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; z-index: 1; border-radius: 50%; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .35), 0 4px 10px rgba(0, 0, 0, .08); }
.quad-hub svg { display: block; width: 100%; height: 100%; overflow: visible; }
.quad-hub .gap, .quad-hub .halo { fill: #FFFFFF; }
.quad-hub .core { fill: #000000; }
.quad-hub .mk { color: var(--sig); fill: #000000; }
.quad-hub .lbl { font: 600 12.5px var(--f); letter-spacing: .14em; fill: #FFFFFF; dominant-baseline: central; }
.quad-hub .rim { opacity: .32; }
.quad-hub .core-t { font: 600 10px var(--f-mono); letter-spacing: .16em; fill: #FFFFFF; }
@media (min-width: 901px) {
  .area-grid .area-card:nth-child(odd) { padding-right: calc(var(--ring) / 2 + 18px); }
  .area-grid .area-card:nth-child(even) { padding-left: calc(var(--ring) / 2 + 18px); }
}
@media (max-width: 900px) {
  .area-grid > * { --ring: 40cqi; --clear: max(0px, calc(20cqi - 66px)); }
  .area-grid .area-card { padding: 20px; gap: 8px 10px; border-radius: 24px; }
  .area-card h3 { font-size: 1.15rem; }
  .area-card p { font-size: .9rem; }
  .area-card .num { font-size: 1.9rem; }
  .area-grid .area-card .ic { width: 44px; height: 44px; }
}
@media (max-width: 520px) {
  .area-grid { gap: 10px; }
  .area-grid > * { --ring: 46cqi; --clear: max(0px, calc(23cqi - 52px)); }
  .area-grid .area-card { padding: 14px; gap: 6px 8px; border-radius: 22px; }
  .area-card h3 { font-size: 1rem; line-height: 1.18; letter-spacing: -0.02em; }
  .area-card p { font-size: .8rem; line-height: 1.4; }
  .area-card .more { display: none; }
  .area-card .num { font-size: 1.55rem; }
  .area-grid .area-card .ic { width: 32px; height: 32px; }
}
@media (max-width: 360px) {
  .area-grid > * { --ring: 44cqi; }
  .area-grid .area-card { column-gap: 6px; padding: 12px; }
  .area-card .num { font-size: 1.2rem; }
  .area-grid .area-card .ic { width: 26px; height: 26px; }
}

/* IDEAS wordmark: the word set in Nasalization, the IDEAS logo font (from the
   IDEAS site; a copy is in assets/fonts/), in the IDEAS red. */
@font-face { font-family: "Nasalization"; src: url("../assets/fonts/nasalization-rg.otf") format("opentype"); font-display: swap; }
.iw { display: block; font-family: "Nasalization", var(--f); font-weight: 400; font-size: 1.24em; line-height: .82; letter-spacing: .02em; color: #F0484D; white-space: nowrap; }
.k-lock .iw { font-size: clamp(2.35rem, 4.95vw, 3.45rem); }

/* A heading whose second line stays on one row: the size follows the page
   width so the line fits (Home: "Toward autonomous energy intelligence.").
   On phones the line may wrap. */
.h2.fit-line { font-size: min(clamp(2.4rem, 5.8vw, 4.4rem), 3.4rem, calc((100vw - 80px) / 19)); }
.h2.fit-line .one-row { white-space: nowrap; }
@media (max-width: 640px) { .h2.fit-line { font-size: clamp(2rem, 9vw, 2.4rem); } .h2.fit-line .one-row { white-space: normal; } }

/* KERNEL wordmark on the lab pages (black backgrounds) */
.k-lock { display: grid; gap: 10px; justify-items: start; }
.k-lock .kw { font-size: clamp(1.9rem, 4vw, 2.8rem); color: var(--white); }
.k-lock .meta { font-size: .95rem; font-weight: 600; color: var(--gray); }

/* Facts list: label above value, a hairline above each row */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; margin: 0; }
.facts div { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); min-width: 0; }
.facts dt { color: var(--fg-2); font-size: .85rem; }
.facts dd { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.facts dd .mono { font-size: .95em; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.chips li { font-size: .875rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.dark .chips li { background: var(--tile-2); }

/* Home: name and mark */
.big-mark { width: 100%; max-width: 420px; height: auto; color: var(--ink); fill: #FFFFFF; justify-self: center; }
.def { display: grid; gap: 10px; }
.def h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.03em; line-height: 1.1; }
.def .say { font: 500 .9rem var(--f-mono); color: var(--ink-2); letter-spacing: .02em; }
.def p { color: var(--ink-2); max-width: 36em; }
.def p strong { color: var(--ink); font-weight: 600; }

/* Research: inner-page jump chips and the area body */
.jump { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; border: 1px solid #3A3A3C; color: var(--white); text-decoration: none; font-size: .9rem; font-weight: 500; }
.jump:hover { border-color: var(--sig); }
.jump svg { width: 18px; height: 18px; color: var(--sig); }
.plain { display: grid; gap: 8px; padding: 20px 22px; border-radius: 22px; background: var(--surface); }
.plain .k { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--link); }
.plain p { font-size: 1.12rem; line-height: 1.5; color: var(--fg); }
.topics { list-style: none; padding: 0; display: grid; gap: 0; }
.topics li { display: grid; gap: 4px; padding: 16px 0; border-top: 1px solid var(--line); }
.topics li:last-child { border-bottom: 1px solid var(--line); }
.topics b { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.topics span { color: var(--fg-2); font-size: .95rem; }
.related { display: grid; gap: 10px; }
.related .k { font-size: .85rem; color: var(--fg-2); }
.rel-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: center; padding: 16px 18px; border-radius: 20px; background: var(--black); color: var(--white); text-decoration: none; border: 1px solid var(--black); transition: box-shadow .2s ease; }
.rel-card:hover { box-shadow: 0 0 0 3px rgba(var(--sig-rgb), .35); }
.rel-card .kw { font-size: 1.1rem; grid-row: span 2; }
.rel-card b { font-size: .98rem; font-weight: 600; }
.rel-card span { font-size: .875rem; color: var(--gray); }
.rel-none { font-size: .95rem; color: var(--fg-2); padding: 14px 18px; border-radius: 18px; border: 1px dashed var(--line); }

/* Projects */
.proj-card { display: grid; gap: clamp(24px, 4vw, 40px); }
.proj-card .desc { color: var(--gray); font-size: 1.1rem; max-width: 34em; }
.proj-card .desc strong { color: var(--white); font-weight: 600; }
/* A dark card on a light or white band (Projects: KERNEL) keeps its dark
   chips and buttons, and lifts off the page with a soft shadow. */
.light .night, .white .night { --surface: var(--tile-2); border-color: transparent; box-shadow: 0 28px 60px -34px rgba(0, 0, 0, .55); }
.light .night .ghost-btn, .white .night .ghost-btn { border-color: #3A3A3C; }
.light .night .ghost-btn:hover, .white .night .ghost-btn:hover { border-color: var(--sig); }
.light .night .pill-btn, .white .night .pill-btn { background: var(--sig); color: var(--sig-ink); }
.light .night .pill-btn:hover, .white .night .pill-btn:hover { box-shadow: 0 0 30px rgba(var(--sig-rgb), .4); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--fg); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--sig); box-shadow: 0 0 10px rgba(var(--sig-rgb), .8); }
.next-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.next-list li { display: grid; gap: 8px; align-content: start; }
.next-list h3 { font-size: 1.15rem; letter-spacing: -0.02em; }
.next-list p { color: var(--fg-2); font-size: .95rem; }

/* People: portrait slot and profile */
.portrait { position: relative; aspect-ratio: 4 / 5; width: 100%; max-width: 100%; border-radius: 28px; overflow: hidden; background: var(--tile); border: 1px solid var(--hair); display: grid; place-items: center; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .pm { position: absolute; width: 130%; height: auto; color: rgba(245, 245, 247, .07); fill: var(--tile); }
.portrait .ini { position: relative; font: 700 clamp(3.4rem, 8vw, 5rem)/1 var(--f); letter-spacing: -0.04em; color: var(--white); }
.role { font-size: 1rem; font-weight: 600; color: var(--link); }
.profile { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 24px; margin: 0; }
.profile dt { color: var(--fg-2); font-size: .9rem; padding-top: 2px; }
.profile dd { margin: 0; font-weight: 500; }
.profile a { color: var(--link); text-decoration: none; }
.profile a:hover { text-decoration: underline; }
.empty { display: grid; gap: 12px; justify-items: start; padding: clamp(22px, 3vw, 34px); border-radius: 28px; border: 1.5px dashed var(--line); }
.empty h3 { font-size: 1.3rem; letter-spacing: -0.02em; }
.empty p { color: var(--fg-2); max-width: 40em; }

/* Publications */
.pub { display: grid; gap: 12px; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pub-meta time { font: 500 .9rem var(--f-mono); color: var(--fg-2); }
.pub h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); letter-spacing: -0.02em; line-height: 1.25; }
.pub .by { color: var(--fg-2); }
.pub .by b { color: var(--fg); font-weight: 600; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.pub-links .link { font-size: 1rem; }
.cite { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.cite-top { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.cite pre { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair-l); font: 400 .8rem/1.6 var(--f-mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Join: openings, ways of working, the steps to get in touch */
.opp { display: grid; gap: 12px; align-content: start; }
.opp .tag, .opp .link { justify-self: start; }
.opp h3 { font-size: 1.25rem; letter-spacing: -0.025em; line-height: 1.15; }
.opp p { color: var(--fg-2); font-size: .95rem; }
.opp .tag.open { color: var(--sig-deep); border-color: rgba(140, 93, 0, .45); }
.opp .tag.open::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.way { display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 2px solid var(--sig); }
.way h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.025em; }
.way p { color: var(--fg-2); }
.steps { list-style: none; padding: 0; display: grid; gap: 0; counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(st); grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--sig); color: var(--sig-ink); font: 700 .95rem var(--f-mono); }
.steps b { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.steps span { color: var(--fg-2); font-size: .95rem; }
/* Drop-down lists on phones (Research: "What we work on"). js/lab.js adds
   .acc-on and wraps each item's title in a button; the open item's text
   drops down below its title, and the arrow turns. */
.topics.acc-on li { padding: 0; gap: 0; }
.steps.acc-on li { padding: 0; row-gap: 0; }
.steps.acc-on li::before { grid-row: 1; align-self: center; margin: 12px 0; }
.steps.acc-on .acc-btn, .steps.acc-on .acc-body { grid-column: 2; }
.acc-on .acc-btn { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 58px; padding: 14px 2px 14px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.acc-on .acc-btn::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--fg-2); border-bottom: 2px solid var(--fg-2); transform: translateY(-3px) rotate(45deg); transition: transform .25s ease; }
.acc-on li.open .acc-btn::after { transform: translateY(2px) rotate(-135deg); border-color: var(--link); }
.acc-on .acc-body { display: none; padding: 0 0 18px; }
.acc-on li.open .acc-body { display: block; animation: acc-drop .28s ease; }
@keyframes acc-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .acc-on li.open .acc-body { animation: none; } .acc-on .acc-btn::after { transition: none; } }
.steps code, .subj { font: 500 .88em var(--f-mono); background: var(--tile-2); color: var(--white); padding: 2px 7px; border-radius: 6px; overflow-wrap: anywhere; }

/* Contact: channel cards and the message helper */
.chan { display: grid; gap: 10px; }
.chan .k { font-size: .85rem; color: var(--fg-2); }
.chan .addr { font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 700; letter-spacing: -0.03em; overflow-wrap: anywhere; user-select: all; }
.chan .addr a { color: inherit; text-decoration: none; }
.chan .addr a:hover { text-decoration: underline; }
.chan p:not(.addr) { color: var(--fg-2); font-size: .95rem; }
.compose { display: grid; gap: 16px; }
.compose h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); letter-spacing: -0.03em; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: .9rem; font-weight: 600; }
.field .hint { font-size: .82rem; color: var(--fg-2); }
.field input, .field select, .field textarea { width: 100%; min-width: 0; font: 400 1rem/1.4 var(--f); color: var(--ink); background: var(--paper); border: 1px solid var(--hair-l); border-radius: 14px; padding: 12px 14px; }
.field textarea { resize: vertical; min-height: 9em; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sig-deep); box-shadow: 0 0 0 3px rgba(140, 93, 0, .2); }
.field [aria-invalid="true"] { border-color: #C0362C; }
.err { font-size: .85rem; color: #B3261E; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.draft { display: grid; gap: 12px; padding: 18px; border-radius: 20px; background: var(--black); color: var(--white); }
.draft .k { font-size: .8rem; color: var(--gray); }
.draft dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: .9rem; }
.draft dt { color: var(--gray); }
.draft dd { margin: 0; overflow-wrap: anywhere; }
.draft pre { margin: 0; font: 400 .85rem/1.6 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: #E5E5EA; max-height: 18em; overflow: auto; }
.draft .btn-row .link { font-size: 1rem; }
.draft .copy { border-color: #3A3A3C; color: var(--gray); }

/* Toast (copy confirmations) */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 50; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 999px; background: rgba(22, 22, 24, .92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, .12); color: var(--white); font-size: .92rem; transition: opacity .3s ease, transform .3s ease; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
