/* ==========================================================================
   DD station — case study, "night" layout
   The chapter layout of the ink portfolio (big title, facts, sticky chapter
   heads on the left, text on the right, a line in the gutter) in the rain
   atmosphere of this site: night, cobalt-tinted rain video, ice-blue light.
   Pages: work-*.html with <body data-page="case-night">.
   Shares tokens.css / base.css / components.css (backdrop, side menu, reveal).
   ========================================================================== */

body[data-page="case-night"] {
  /* ONE blue for everything that is highlighted: the line, the drop's glow, labels, numbers, links.
     7.9:1 on night. */
  --accent: #7aa2ff;
  --rain: var(--accent);
  --glow: 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent);
  --hatch: rgba(122, 162, 255, .07);
}
/* The rain stays visible: light darkening behind the title, a bit more while reading
   (--night-scrim / --night-dim are set from the scroll position in js/case-night.js).
   The rain's highlights are capped at cobalt, so pale text stays well above 7:1. */
body[data-page="case-night"] .backdrop__scrim { opacity: var(--night-scrim, .3); transition: opacity .2s linear; }
body[data-page="case-night"] .backdrop__light { opacity: calc(1 - var(--night-dim, 0) * .5); }

/* Centred: case pages have no side column (the menu sits behind the MENU button), so no room is kept for it */
.n-case.wrap { padding-left: var(--gutter); padding-right: var(--gutter); max-width: 1440px; margin-inline: auto; }
.n-case { position: relative; padding-bottom: 0; counter-reset: fig; }
.n-case .grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 32px); }
.n-case > * { position: relative; z-index: 1; }

/* Text that looks like it is behind wet glass (SVG filter #wet) */
.wet {
  display: inline-block;
  font-family: var(--font-display); font-weight: 300; line-height: .9; letter-spacing: -.01em;
  color: var(--paper);
  filter: url(#wet);
  padding: .1em .06em .16em; margin: -.1em -.06em -.16em;
}
.wet--sm { filter: url(#wet-sm); font-size: clamp(64px, 7vw, 108px); line-height: 1; letter-spacing: -.03em; }

/* ---------- Head ---------- */
.c-hero { padding-top: clamp(110px, 16vh, 170px); }
.c-hero__kicker { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 18px; color: var(--text-muted); }
.c-hero__kicker a { color: var(--text); text-decoration: none; }
.c-hero__kicker a:hover, .c-hero__kicker a:focus-visible { color: var(--accent); }
.c-hero__title { grid-column: 1 / -1; margin-top: 20px; font-weight: 300; line-height: 1; }
.c-hero__title .wet { font-size: min(13vw, 24vh); }
.c-hero__lead {
  grid-column: 1 / 8; margin-top: clamp(28px, 5vh, 56px);
  font: 300 clamp(20px, 1.8vw, 28px)/1.38 var(--font-body); letter-spacing: -.005em; max-width: 30ch; color: var(--paper);
}
.c-facts { grid-column: 9 / 13; margin-top: clamp(28px, 5vh, 56px); border-top: 1px solid var(--line-strong); }
.c-facts div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.c-facts dt { color: var(--text-muted); }
.c-facts dd { margin: 0; font-size: 14px; line-height: 1.45; }

.c-cover { grid-column: 1 / -1; margin-top: clamp(64px, 10vh, 120px); }
.c-cover figcaption, .c-fig figcaption { margin-top: 12px; color: var(--text-muted); font-size: 11px; }
.c-cover > img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 2px; }
.c-cover--tall { grid-column: 1 / 8; }                   /* a portrait cover (Chip) */
.c-phones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); }
.c-phones img { width: 100%; height: auto; border-radius: clamp(14px, 2vw, 28px); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }

/* ---------- Chapters ---------- */
.c-sec { margin-top: clamp(140px, 22vh, 240px); align-items: start; }
.c-sec__head { grid-column: 1 / 5; position: sticky; top: 120px; }   /* below the site logo in the corner */
.c-sec__body { grid-column: 6 / 13; }
.c-sec__no { line-height: 1; }
.c-sec__label { margin-top: 16px; color: var(--accent); }
.c-sec__title { margin-top: 10px; font: 400 clamp(26px, 2.4vw, 38px)/1.1 var(--font-display); letter-spacing: -.015em; max-width: 14ch; }

.c-sec__body > * + * { margin-top: 20px; }
.c-sec__body p { font-size: 16.5px; line-height: 1.7; max-width: 60ch; color: rgba(243, 241, 235, .78); }
.c-sec__body p strong, .c-sec__body p b, .c-hero__lead strong {
  font-weight: 500; color: #fff;
  background: linear-gradient(transparent 64%, color-mix(in srgb, var(--accent) 34%, transparent) 64%, color-mix(in srgb, var(--accent) 34%, transparent) 92%, transparent 92%);
  padding: 0 .08em; margin: 0 -.08em;
}
.c-sec__body h3 { margin-top: 44px; font: 400 var(--fs-mono)/1.3 var(--font-mono); letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--text-muted); }
.c-sec__body h3 + * { margin-top: 12px; }

/* ---------- Figures ---------- */
.c-fig { margin: 44px 0; }
.c-fig figcaption::before { counter-increment: fig; content: "fig. " counter(fig, decimal-leading-zero) " · "; }
.c-fig > img, .c-fig > video { width: 100%; height: auto; }
.c-fig > img { border: 1px solid var(--line); border-radius: 2px; }
.c-fig video { display: block; background: #000; border-radius: 2px; }
.c-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); align-items: end; margin: 44px 0; }
.c-figs .c-fig { margin: 0; }
.c-figs--narrow { width: min(100%, 640px); }
.c-figs--wide { grid-template-columns: 1fr 1.4fr; }
.c-figs--chip { grid-template-columns: .56fr 1.33fr; align-items: stretch; }   /* the phone video and the landscape photo, both the same height */
.c-figs--chip .c-fig { display: flex; }
.c-figs--chip .c-fig > img, .c-figs--chip .c-fig > video { height: 100%; object-fit: cover; }
.c-figs--three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }       /* a narrow phone video next to a landscape photo */
.c-cards .is-chosen h3 { color: var(--accent) !important; }
.c-cards .stamp { position: absolute; top: 12px; right: 0; }

/* an image still to come: hatched, like rain on glass */
.c-ph {
  position: relative; aspect-ratio: var(--ar, 16 / 9);
  display: grid; place-items: center; text-align: center; padding: 20px;
  border: 1px dashed var(--line-strong);
  background: repeating-linear-gradient(100deg, transparent 0 13px, var(--hatch) 13px 14px), rgba(5, 7, 11, .35);
  color: var(--text-muted);
}
.c-ph span { display: inline-flex; gap: 10px; align-items: center; background: rgba(5, 7, 11, .85); padding: 7px 12px; }
.cross { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1; flex: none; }
.c-ph .cross { width: 16px; height: 16px; }

/* ---------- Quote ---------- */
.c-quote { position: relative; margin: 56px 0; padding-left: clamp(52px, 5vw, 76px); }
.c-quote::before {
  content: "“"; position: absolute; left: 0; top: -.16em;
  font: 300 clamp(80px, 8vw, 120px)/1 var(--font-display); color: var(--accent); filter: url(#wet-sm);
}
.c-quote p { font: 300 clamp(22px, 2.1vw, 32px)/1.28 var(--font-display) !important; letter-spacing: -.01em; max-width: 28ch !important; color: var(--paper) !important; }
.c-quote cite { display: block; margin-top: 14px; font-style: normal; color: var(--text-muted); }

/* ---------- Lists and cards ---------- */
.c-list li { display: grid; grid-template-columns: 46px 1fr; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.55; max-width: 66ch; }
.c-list li:last-child { border-bottom: 1px solid var(--line); }
.c-list .mono { padding-top: 3px; color: var(--accent); }
.c-list b { font-weight: 500; }

.c-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px clamp(18px, 2vw, 30px); }
.c-cards li { position: relative; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.c-cards .mono { color: var(--text-muted); }
.c-cards h3 { margin-top: 8px !important; font: 500 18px/1.25 var(--font-body) !important; letter-spacing: -.005em !important; text-transform: none !important; color: var(--paper) !important; }
.c-cards p { margin-top: 8px !important; font-size: 14px !important; line-height: 1.55 !important; color: var(--text-muted) !important; }
.c-cards .c-cards__to { margin-top: 10px !important; color: var(--accent) !important; font-size: 11px !important; }

/* a small glowing tag, e.g. "Live" */
.stamp {
  display: inline-block; padding: 5px 10px; border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent); box-shadow: var(--glow); font: 400 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}

/* ---------- Solis: prototype, flows, features ---------- */
.c-proto { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(16px, 2.5vw, 32px); align-items: center; margin: 44px 0; }
.c-proto__frame { position: relative; height: min(820px, 88vh); min-height: 560px; }
.c-proto__frame iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; }
.c-proto__notes > * + * { margin-top: 16px; }
.c-proto__notes .c-list li { font-size: 14px; }
.c-proto__open { display: inline-flex; gap: 8px; padding: 10px 2px; color: var(--accent); text-decoration: none; }
.c-proto__open:hover, .c-proto__open:focus-visible { text-decoration: underline; }

.c-flows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); margin: 44px 0; }
.c-flows video { width: 100%; height: auto; aspect-ratio: 540 / 1094; border-radius: clamp(16px, 2vw, 28px); background: #000; display: block; }
.c-flows figcaption { margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.c-flows figcaption b { display: block; color: var(--paper); font-weight: 500; }

.c-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px clamp(14px, 2vw, 26px); }
.c-features img { width: 100%; height: auto; border-radius: clamp(12px, 1.4vw, 20px); }
.c-features .mono { display: block; margin-top: 14px; color: var(--accent); }
.c-features h3 { margin-top: 6px !important; font: 500 16px/1.3 var(--font-body) !important; text-transform: none !important; letter-spacing: -.005em !important; color: var(--paper) !important; }
.c-features p { margin-top: 6px !important; font-size: 13.5px !important; line-height: 1.55 !important; color: var(--text-muted) !important; }

/* ---------- Divider: a thin line of light across the page ---------- */
.c-divider { position: relative; margin-top: clamp(140px, 22vh, 240px); height: 40px; display: grid; place-items: center; }
.c-divider::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 25%, var(--accent) 75%, transparent);
  box-shadow: 0 0 12px var(--accent); opacity: .85;
}
.c-divider span { position: relative; padding: 6px 14px; background: var(--night); color: var(--text-muted); border: 1px solid var(--line); }

/* ---------- Next project ---------- */
.c-next { min-height: 78svh; padding: 22vh 0 14vh; align-content: end; }
.c-next__inner { grid-column: 1 / 10; }
.c-next__label { color: var(--text-muted); margin-bottom: 14px; }
.c-next__link { display: inline-block; text-decoration: none; }
.c-next__link .wet { font-size: min(10vw, 20vh); transition: transform .6s var(--ease-out), color .3s; }
.c-next__link:hover .wet, .c-next__link:focus-visible .wet { transform: translateX(14px); color: #dbe5ff; }
.c-next__row { margin-top: 30px; display: flex; gap: 28px; flex-wrap: wrap; }
.c-next__row a { padding: 8px 0; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.c-next__row a:hover, .c-next__row a:focus-visible { color: var(--accent); border-color: var(--accent); }

/* ---------- The wet line in the gutter (js/case-night.js) ---------- */
.n-line { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.n-line__track { fill: none; stroke: var(--line); stroke-width: 1; }
.n-line__wet { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--accent)); stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.n-line__drop { fill: #dbe5ff; filter: drop-shadow(0 0 5px var(--accent)) drop-shadow(0 0 14px var(--accent)); transition: opacity .3s; }
.n-line__mark { fill: none; stroke: var(--accent); stroke-width: 1; opacity: .25; transition: opacity .5s; }
.n-line__mark.is-on { opacity: 1; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1100px) {
  .c-sec__head { grid-column: 1 / 4; }
  .c-sec__body { grid-column: 5 / 13; }
  .c-features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c-proto { grid-template-columns: 1fr; }
  .c-proto__frame { height: min(720px, 82vh); min-height: 520px; }
}
@media (max-width: 859px) {   /* the side menu becomes the top Menu */
  .n-case .grid { display: block; }
  .n-case.wrap { padding-left: calc(var(--gutter) + 14px); }
  .c-hero { padding-top: 120px; }
  .c-hero__title .wet { font-size: min(20vw, 110px); }
  .c-hero__lead { font-size: 19px; }
  .c-phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-sec { margin-top: 110px; }
  .c-sec__head { position: static; margin-bottom: 24px; }
  .c-sec__title { max-width: none; }
  .wet--sm { font-size: 64px; }
  .c-sec__body p { font-size: 16px; }
  .c-figs, .c-figs--wide, .c-figs--chip, .c-figs--three { grid-template-columns: 1fr; }
  .c-figs--chip .c-fig { display: block; }
  .c-figs--chip .c-fig > img, .c-figs--chip .c-fig > video { height: auto; }
  .c-flows { grid-template-columns: 1fr 1fr; }
  .c-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-next { min-height: 0; padding: 16vh 0 18vh; }
  .c-next__link .wet { font-size: min(16vw, 90px); }
}

/* ==========================================================================
   Design pass
   ========================================================================== */

/* A soft band of night behind the logo and MENU, so text never slides under them unreadably */
body[data-page="case-night"]::before {
  content: ""; position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: 104px; pointer-events: none;
  background: linear-gradient(rgba(5, 7, 11, .92) 0%, rgba(5, 7, 11, .7) 45%, rgba(5, 7, 11, 0) 100%);
}

/* Bright pictures (white boards, pale app screens) glare on the night page: take the edge off,
   full brightness while you look at one */
.n-case img { filter: brightness(.86); transition: filter .4s var(--ease-out); }
.n-case img:hover { filter: none; }

/* Pictures still to come take less room than real ones and stay quiet */
.n-case .c-ph { aspect-ratio: 3 / 1; border-color: var(--line); background: repeating-linear-gradient(100deg, transparent 0 15px, rgba(122, 162, 255, .045) 15px 16px), rgba(5, 7, 11, .3); }
.n-case .c-ph span { color: var(--text-muted); }

/* The page ends with the next project; no extra empty screen below it */
.c-next { min-height: 62svh; padding-bottom: 12vh; }

@media (max-width: 859px) {
  body[data-page="case-night"]::before { display: none; }   /* the phone top bar has its own backing */
  .n-case .c-ph { aspect-ratio: 2 / 1; }
  .c-next { padding-bottom: 10vh; }
}

/* ---------- Line ends: fade out above the next project (gradient set in js/case-night.js) ---------- */
.n-line { color: var(--accent); }
.n-line__track { opacity: .28; }

/* ---------- Divider: starts in the text column, so the gutter line passes it instead of crossing it ---------- */
.c-divider {
  height: auto; display: flex; align-items: center; gap: 18px;
  margin-left: calc((100% - 11 * clamp(16px, 2vw, 32px)) / 12 * 5 + 5 * clamp(16px, 2vw, 32px));
}
.c-divider::before { position: static; order: 2; flex: 1; top: auto; height: 1px; content: ""; }
.c-divider span { order: 1; padding: 0; background: none; border: 0; color: var(--accent); }
@media (max-width: 1100px) {
  .c-divider { margin-left: calc((100% - 11 * clamp(16px, 2vw, 32px)) / 12 * 4 + 4 * clamp(16px, 2vw, 32px)); }
}
@media (max-width: 859px) { .c-divider { margin-left: 0; } }

/* ---------- A wide cover cropped around the subject (Chip): no half-empty screen ---------- */
.c-cover--wide > img { aspect-ratio: 2 / 1; object-fit: cover; object-position: 50% 62%; }
@media (max-width: 859px) { .c-cover--wide > img { aspect-ratio: 4 / 3; } }

/* ---------- Word lists (About: skills and tools) ---------- */
.c-words { display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 12px; }
.c-words li { font: 400 clamp(19px, 1.7vw, 24px)/1.35 var(--font-display); color: var(--paper); }
.c-words li:not(:last-child)::after { content: "/"; margin: 0 .5em; color: var(--accent); opacity: .7; }
.c-sec__body .c-words + h3 { margin-top: 36px; }
.c-facts a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.c-sec__body p a { color: var(--paper); text-decoration-color: var(--accent); text-underline-offset: 4px; }
.c-sec__body p a:hover, .c-sec__body p a:focus-visible { color: var(--accent); }

/* ==========================================================================
   Lab gallery (lab.html)
   ========================================================================== */
.g-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); align-items: start; }
.g-grid--one { grid-template-columns: 1fr; }
.g-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-item--wide { grid-column: 1 / -1; }
.g-btn {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: rgba(5, 7, 11, .5);
  border-radius: 2px; cursor: zoom-in; overflow: hidden; transition: border-color .3s, box-shadow .3s;
}
.g-btn img { display: block; width: 100%; height: auto; transition: transform .6s var(--ease-out); }
.g-btn:hover, .g-btn:focus-visible { border-color: var(--accent); box-shadow: var(--glow); }
.g-btn:hover img, .g-btn:focus-visible img { transform: scale(1.025); }
.g-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.n-case .g-btn img { filter: none; }                                   /* the works keep their own colours and brightness */
.g-pixel img { image-rendering: pixelated; }                           /* hard pixel edges when a picture is shown larger than its pixels */

/* A work shown large */
.g-dialog {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0;
  background: rgba(5, 7, 11, .94); color: var(--text); overflow: hidden;
}
.g-dialog::backdrop { background: rgba(5, 7, 11, .9); }
.g-dialog[open] { display: grid; place-items: center; }
.g-dialog__fig { margin: 0; display: grid; justify-items: center; gap: 14px; padding: 64px clamp(16px, 7vw, 120px) 56px; max-width: 100%; max-height: 100%; }
.g-dialog__fig img { max-width: 100%; max-height: calc(100dvh - 150px); width: auto; height: auto; object-fit: contain; border: 1px solid var(--line); border-radius: 2px; }
.g-dialog__fig figcaption { color: var(--text-muted); }
.g-dialog__btn {
  position: absolute; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(5, 7, 11, .7); color: var(--text); cursor: pointer; min-height: 44px; min-width: 44px;
  font-size: var(--fs-mono); letter-spacing: var(--track-mono); text-transform: uppercase; transition: border-color .25s, color .25s;
}
.g-dialog__btn:hover, .g-dialog__btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.g-dialog__btn--close { top: 18px; right: 18px; }
.g-dialog__btn--prev { left: 16px; top: 50%; transform: translateY(-50%); }
.g-dialog__btn--next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 859px) {
  .g-grid, .g-grid--three { grid-template-columns: 1fr 1fr; }
  .g-grid--one { grid-template-columns: 1fr; }
  .g-dialog__fig { padding: 70px 14px 64px; }
  .g-dialog__btn--prev, .g-dialog__btn--next { top: auto; bottom: 14px; transform: none; }
  .g-dialog__btn--prev { left: 14px; }
  .g-dialog__btn--next { right: 14px; }
}

/* ---------- Lab: works scattered down the page, a blue line winding between them ---------- */
.g-cats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.g-cats a { padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; transition: border-color .25s, color .25s; }
.g-cats a:hover, .g-cats a:focus-visible { border-color: var(--accent); color: var(--accent); }
.g-scatter { position: relative; display: flex; flex-direction: column; gap: clamp(36px, 6vw, 80px); padding-bottom: 20px; }
.g-scatter .g-item { position: relative; z-index: 1; width: var(--w, 46%); margin-left: var(--x, 0%); }
.g-scatter .g-item:nth-child(6n+1) { --w: 46%; --x: 4%; }
.g-scatter .g-item:nth-child(6n+2) { --w: 38%; --x: 54%; margin-top: -34px; z-index: 2; }
.g-scatter .g-item:nth-child(6n+3) { --w: 52%; --x: 14%; }
.g-scatter .g-item:nth-child(6n+4) { --w: 40%; --x: 56%; margin-top: -20px; }
.g-scatter .g-item:nth-child(6n+5) { --w: 44%; --x: 2%; }
.g-scatter .g-item:nth-child(6n)   { --w: 50%; --x: 42%; margin-top: -26px; z-index: 2; }
.g-scatter .g-item--wide { --w: 78% !important; --x: 12% !important; }
.g-btn { box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.g-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: visible; pointer-events: none; color: var(--accent); }
.g-lines path { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--accent)); }
.c-sec__body > .c-ph { margin-top: 0; }
@media (max-width: 859px) {
  .g-scatter .g-item { width: calc(var(--w) + 20%); margin-left: min(var(--x), calc(100% - var(--w) - 20%)); }
  .g-scatter .g-item--wide { --w: 80% !important; --x: 6% !important; width: 90%; margin-left: 5%; }
}

/* Lab: the one winding line replaces the straight line down the gutter */
.n-case:has(.g-scatter) > .n-line { display: none; }

/* Lab: the works use the full width; each heading sits above its group */
.n-case:has(.g-scatter) .c-sec { row-gap: 28px; }
.n-case:has(.g-scatter) .c-sec__head { grid-column: 1 / -1; position: static; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 22px; }
.n-case:has(.g-scatter) .c-sec__head .c-sec__label, .n-case:has(.g-scatter) .c-sec__head .c-sec__title { margin-top: 0; }
.n-case:has(.g-scatter) .c-sec__head .c-sec__no .wet--sm { font-size: clamp(48px, 5vw, 72px); }
.n-case:has(.g-scatter) .c-sec__title { max-width: none; }
.n-case:has(.g-scatter) .c-sec__body { grid-column: 1 / -1; }
.n-case:has(.g-scatter) .g-scatter { gap: clamp(36px, 5vw, 70px); }
.n-case:has(.g-scatter) .g-scatter .g-item:nth-child(6n+1) { --w: 44%; --x: 3%; }
.n-case:has(.g-scatter) .g-scatter .g-item:nth-child(6n+2) { --w: 36%; --x: 58%; }
.n-case:has(.g-scatter) .g-scatter .g-item:nth-child(6n+3) { --w: 48%; --x: 16%; }
.n-case:has(.g-scatter) .g-scatter .g-item:nth-child(6n+4) { --w: 38%; --x: 60%; }
.n-case:has(.g-scatter) .g-scatter .g-item:nth-child(6n+5) { --w: 42%; --x: 4%; }
.n-case:has(.g-scatter) .g-scatter .g-item:nth-child(6n)   { --w: 46%; --x: 46%; }
.n-case:has(.g-scatter) .g-pixel .g-item { --w: 34% !important; }
.n-case:has(.g-scatter) .g-scatter .g-item--wide { --w: 74% !important; --x: 13% !important; }

/* ==========================================================================
   No hairlines: lists, cards and the facts table are separated by space only
   ========================================================================== */
.c-facts, .c-facts div { border: 0 !important; }
.c-facts div { padding: 7px 0; }
.c-list li, .c-list li:last-child { border: 0 !important; padding: 9px 0; }
.c-cards li { border: 0 !important; padding-top: 0; }
.c-cards { gap: 34px clamp(24px, 3vw, 44px); }

/* ---------- About: photos ---------- */
.a-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 26px); margin-top: 34px; }
.a-pair img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 2px; }
.a-photos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: clamp(170px, 20vw, 290px); gap: clamp(12px, 1.6vw, 22px); margin-top: 40px; }
.a-photos img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.a-photos__wide { grid-column: span 6; grid-row: span 2; }
.a-photos__s { grid-column: span 2; }
.a-photos__l { grid-column: span 4; }
.n-case .a-pair img, .n-case .a-photos img { filter: none; }
.c-sec__body a { text-underline-offset: 4px; }

/* ==========================================================================
   About: the portrait in an arch, and photos inside their hobbies
   ========================================================================== */
.a-hero .c-hero__lead { grid-column: 1 / 5; }
.a-hero .a-portrait { grid-column: 5 / 9; grid-row: 3 / span 2; margin: clamp(10px, 3vh, 30px) 0 0; justify-self: center; width: min(100%, 340px); position: relative; }
/* a small television: bezel, screen with scanlines, a light and two knobs */
.a-portrait {
  padding: 14px 14px 40px; border-radius: 26px; border: 1px solid rgba(122, 162, 255, .55);
  background:
    radial-gradient(circle at 24px calc(100% - 20px), #dbe5ff 0 2.4px, rgba(122, 162, 255, .75) 3px, transparent 7px),
    radial-gradient(circle at calc(100% - 26px) calc(100% - 20px), #0a0e18 0 5px, rgba(122, 162, 255, .8) 5.5px 6.5px, transparent 7px),
    radial-gradient(circle at calc(100% - 52px) calc(100% - 20px), #0a0e18 0 5px, rgba(122, 162, 255, .8) 5.5px 6.5px, transparent 7px),
    linear-gradient(#10141f, #070a11);
  box-shadow: 0 0 46px rgba(122, 162, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.a-portrait__arch { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: #05070b; box-shadow: inset 0 0 40px rgba(0, 0, 0, .6); }
.a-portrait__arch::after {   /* scanlines and a soft glare */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .16) 2px 3px), radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, .09), transparent 55%);
}
.a-portrait__arch img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: none; }
.a-portrait__arch img.is-on { opacity: 1; }
.a-portrait__arch img:first-child { opacity: 1; }   /* shown even before the script runs */
.a-portrait__arch:has(img.is-on) img:first-child:not(.is-on) { opacity: 0; }
/* the blink: flicker, sideways jumps, colour shifts, a cut slice (the swap happens in the middle) */
.a-portrait__arch.is-glitch { animation: a-blink .64s steps(1, end) both; }
@keyframes a-blink {
  0%   { opacity: 1; transform: none; filter: none; clip-path: none; }
  8%   { opacity: .25; transform: translateX(-7px); filter: hue-rotate(40deg) saturate(2) contrast(1.3); }
  16%  { opacity: 1; transform: translateX(6px) skewX(-3deg); filter: hue-rotate(-50deg) brightness(1.6); clip-path: inset(0 0 55% 0); }
  26%  { opacity: .1; transform: translateX(-4px); filter: none; clip-path: none; }
  36%  { opacity: 1; transform: translateX(9px); filter: saturate(0) contrast(1.6); clip-path: inset(48% 0 0 0); }
  48%  { opacity: .4; transform: translateX(-6px) skewX(2deg); filter: hue-rotate(90deg) brightness(1.4); clip-path: none; }
  60%  { opacity: 1; transform: translateX(4px); filter: contrast(1.4); }
  74%  { opacity: .55; transform: translateX(-3px); filter: hue-rotate(-30deg); clip-path: inset(0 0 30% 0); }
  88%  { opacity: 1; transform: translateX(1px); filter: none; clip-path: none; }
  100% { opacity: 1; transform: none; filter: none; clip-path: none; }
}

/* photos scattered in the empty space beside the sections */
.a-side { display: block; margin-top: 34px; width: min(78%, 250px); transform: rotate(-2.2deg); position: relative; }
.a-side:nth-of-type(even) { transform: rotate(1.8deg); }
.a-side img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px var(--accent), 0 18px 46px rgba(0, 0, 0, .5); filter: none; }
.a-side--wide img { aspect-ratio: 4 / 3; }
@media (max-width: 859px) { .a-side { width: 62%; margin-top: 22px; } }

.a-hobbies { display: grid; gap: 44px; }
.a-hobby h3 { display: flex; align-items: baseline; gap: 14px; margin: 0 !important; font: 500 20px/1.25 var(--font-body) !important; letter-spacing: -.005em !important; text-transform: none !important; color: var(--paper) !important; }
.a-hobby h3 .mono { color: var(--accent); font-size: var(--fs-mono); letter-spacing: var(--track-mono); }
.a-hobby p { margin-top: 8px !important; }
.a-hobby__ph { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 1.6vw, 20px); margin-top: 18px; }
.a-hobby__ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; filter: none; }
.a-hobby__ph--one { grid-template-columns: 1fr; }
.a-hobby__ph--one img { aspect-ratio: 16 / 9; }

@media (max-width: 859px) {
  .a-hero .a-portrait { margin: 30px 0 0; width: min(78%, 300px); justify-self: start; }
  .a-hero .c-facts { margin-top: 30px; }
}

/* wires from the television down the page */
.n-line__wire { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: .5; stroke-linecap: round; }
.n-line__plug { fill: #0a0e18; stroke: var(--accent); stroke-width: 1.4; filter: drop-shadow(0 0 4px var(--accent)); }

/* ==========================================================================
   About as a stage: a lamp above, the photo in its beam, the name in the
   pool of light on the floor, two columns of text, glowing cords everywhere
   ========================================================================== */
.a-page { position: relative; z-index: 1; padding-top: clamp(70px, 9vh, 110px); }
.a-cords { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; z-index: 0; }
.a-cords path { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.a-cords .a-cord__end { fill: var(--accent); }
.a-cords g { filter: drop-shadow(0 0 5px rgba(122, 162, 255, .85)) drop-shadow(0 0 16px rgba(122, 162, 255, .35)); }
.a-cords.is-drawing path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.a-cords.is-drawn path { stroke-dashoffset: 0; transition: stroke-dashoffset 2.6s cubic-bezier(.45, 0, .2, 1); transition-delay: var(--d, 0s); }

.a-stage { position: relative; z-index: 1; display: flex; justify-content: center; }
.a-stage__box {
  position: relative; width: min(48%, 600px); padding: clamp(96px, 12vh, 130px) 0 clamp(150px, 16vh, 200px);
  display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(70% 60% at 50% 62%, #0c0d10 0%, #020203 70%), #020203;
}
.a-stage__lamp {   /* the fixture with a bright bulb */
  position: absolute; top: clamp(50px, 7vh, 74px); left: 50%; width: 26px; height: 15px; transform: translateX(-50%);
  border-radius: 8px 8px 3px 3px; background: linear-gradient(#2a2e38, #0d0f14);
  box-shadow: 0 9px 0 -4px #fff, 0 10px 12px 0 rgba(255, 255, 255, .9), 0 12px 40px 6px rgba(255, 255, 255, .35);
}
.a-stage__beam {   /* the cone of light, from the bulb down to the floor */
  position: absolute; top: calc(clamp(50px, 7vh, 74px) + 18px); bottom: clamp(120px, 13vh, 160px); left: 50%; width: 96%; transform: translateX(-50%);
  clip-path: polygon(48% 0, 52% 0, 100% 100%, 0 100%);
  background: linear-gradient(rgba(255, 255, 255, .34), rgba(255, 255, 255, .07) 55%, rgba(255, 255, 255, .02));
  filter: blur(7px); pointer-events: none;
}
.a-photo { position: relative; z-index: 1; width: 58%; margin: 0; }
.a-photo .a-portrait__arch { aspect-ratio: 3 / 4; border-radius: 2px; box-shadow: 0 30px 60px rgba(0, 0, 0, .7); }
.a-photo .a-portrait__arch::after { background: linear-gradient(rgba(255, 255, 255, .12), transparent 35%); }   /* lit from above */
.a-stage__floor { position: relative; width: 100%; display: grid; place-items: center; margin-top: 18px; height: 110px; }
.a-stage__pool {
  position: absolute; inset: 0 2%; border-radius: 50%;
  background: radial-gradient(closest-side, #fff 0%, rgba(240, 244, 255, .92) 38%, rgba(200, 212, 240, .35) 72%, transparent 100%);
  filter: blur(4px);
}
.a-stage__name {
  position: relative; margin: 0; font: 500 clamp(19px, 1.9vw, 26px)/1 var(--font-display, 'Space Grotesk', sans-serif);
  letter-spacing: .01em; color: #07090e; text-align: center;
}
.a-stage__role { position: relative; margin: 10px 0 0; color: var(--paper-dim, rgba(230, 234, 245, .7)); text-align: center; max-width: 30ch; line-height: 1.6; }

.a-cols {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 9vw, 120px);
  width: min(82%, 1180px); margin: calc(-1 * clamp(100px, 12vh, 140px)) auto 0;
}
.a-col {
  padding: clamp(30px, 3.6vw, 54px); background: rgba(14, 18, 27, .66); border-radius: 4px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.a-block + .a-block { margin-top: clamp(48px, 6vw, 72px); }
.a-block__no { color: var(--accent); margin: 0 0 10px; }
.a-block h2 { margin: 0 0 18px; font: 400 clamp(24px, 2.2vw, 32px)/1.15 var(--font-display, 'Space Grotesk', sans-serif); letter-spacing: -.01em; color: var(--paper); }
.a-block h3 { margin: 26px 0 10px; }
.a-block > p + p { margin-top: 14px; }
.a-block .a-hobbies { gap: 22px; }
.a-block .a-hobby h3 { margin: 0 !important; font-size: 17px !important; }
.a-block .a-hobby p { margin-top: 4px !important; }
.a-page .c-next { margin-top: clamp(110px, 16vh, 180px); position: relative; z-index: 2; }

@media (max-width: 859px) {
  .a-stage__box { width: min(88%, 420px); }
  .a-cols { grid-template-columns: 1fr; width: calc(100% - 32px); gap: 28px; }
}
@media (prefers-reduced-motion: reduce) { .a-cords.is-drawn path { transition: none; } }

/* About, plain: no block behind the photo, no light, no panels behind the text */
.a-stage__box { background: none; padding: clamp(40px, 6vh, 70px) 0 0; }
.a-photo .a-portrait__arch { box-shadow: none; background: none; }
.a-photo .a-portrait__arch::after { display: none; }
.a-stage__floor { height: auto; margin-top: 26px; }
.a-stage__name { color: var(--paper); text-shadow: none; filter: none; }
.a-cols { margin-top: clamp(80px, 11vh, 130px); }
.a-col { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; padding: 0; }
@media (max-width: 859px) { .a-cols { gap: clamp(48px, 6vw, 72px); } }

/* About cords as water: thin links, drops of light */
.a-cords .a-cord--link { stroke-width: 1.5; opacity: .85; }
.a-cords .a-drop { fill: #eef3ff; }
.a-cords.is-drawn path { transition-duration: 3.2s; }

/* the hanging end of the middle cord drips */
.a-cords .a-drip__drop { fill: #eef3ff; transform-box: fill-box; transform-origin: 50% 0; animation: a-drip 4.2s cubic-bezier(.5, 0, .9, .6) 4s infinite both; }
@keyframes a-drip {
  0%   { transform: translateY(0) scale(.15); opacity: 0; }
  12%  { opacity: 1; }
  55%  { transform: translateY(0) scale(1); opacity: 1; }
  62%  { transform: translateY(4px) scale(1, 1.08); opacity: 1; }
  90%  { transform: translateY(90px) scale(.9); opacity: 0; }
  100% { transform: translateY(90px) scale(.9); opacity: 0; }
}

/* the closing "Work" block lines up with the columns */
.a-page .c-next { display: block; width: min(82%, 1180px); margin-inline: auto; padding-left: 0; padding-right: 0; }
.a-page .c-next__inner { grid-column: auto; }
@media (max-width: 859px) { .a-page .c-next { width: calc(100% - 32px); } }

/* the hand-drawn process loop (Solis, section 02) */
.c-fig--process { margin: 44px 0; }
.process-fig { display: block; width: 100%; height: auto; }


/* About: the photo card that follows the pointer over a line of text (js/about-hover.js) */
.a-peek { position: fixed; left: 0; top: 0; z-index: 70; width: clamp(170px, 15vw, 240px); aspect-ratio: 3 / 4; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease-out, ease); box-shadow: 0 0 0 1px var(--accent), 0 22px 50px rgba(0, 0, 0, .55); background: #0b0f17; overflow: hidden; }
.a-peek.is-on { opacity: 1; }
.a-peek img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; }
.a-peek img.is-on { opacity: 1; }
.a-research h3 { margin-top: 26px; }
[data-photos] { cursor: default; }
.a-hobby[data-photos] { cursor: default; outline-offset: 6px; }
.a-hobby[data-photos]:focus-visible { outline: 1px dashed var(--accent); }
