/* COET — page heads, the work index and "How can we help?". The case study pages themselves are in case-study.css. */

:root { --serif: "Instrument Serif", "Times New Roman", Georgia, serif; --plate: #1a1a1a; --plate-2: #0e0e0e; }

.cs-wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.is-sub .nav { background: rgb(0 0 0 / .72); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); border-color: var(--hair); }

/* ── page head ── */
.cs-hero { padding-top: calc(72px + clamp(var(--s7), 8vw, var(--s10))); }
.cs-title { font: 400 clamp(56px, 10.5vw, 184px)/.92 var(--serif); letter-spacing: -.025em; color: #fff; text-wrap: balance; }

/* the Go2 system diagram (home page) */
.dg { width: 100%; height: auto; display: block; }
.dg-node rect { fill: #0f0f0f; stroke: rgb(255 255 255 / .18); }
.dg-t { font: 500 17px var(--display); fill: #fff; }
.dg-s { font: 300 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; fill: #8b8b8b; }
.dg-link { fill: none; stroke: var(--signal); stroke-width: 1.4; stroke-dasharray: 5 7; animation: dgFlow 1.6s linear infinite; opacity: .9; }
.dg-back { stroke: #8a8a8a; }
@keyframes dgFlow { to { stroke-dashoffset: -24; } }

/* ── page head intro line ── */
.cs-aside { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); max-width: 40ch; }

/* "How can we help?" */
.cs-help { padding-block: clamp(var(--s9), 12vw, var(--s11)); border-top: 1px solid var(--hair); }
.cs-help__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); align-items: start; }
.cs-help__title { font: 400 clamp(56px, 8vw, 128px)/.95 var(--serif); color: #fff; letter-spacing: -.02em; }
.cs-help__rows { border-top: 1px solid var(--hair); }
.cs-help__rows a { display: flex; justify-content: space-between; align-items: center; min-height: 64px; border-bottom: 1px solid var(--hair); color: var(--ink-2); transition: color .25s; }
.cs-help__rows a:hover { color: var(--ink); }

/* ── work index ── */
.wi-title { font-size: clamp(56px, 8vw, 132px); max-width: 12ch; }
.wi-sub { margin: var(--s5) 0 clamp(var(--s7), 6vw, var(--s9)); font-size: clamp(16px, 1.3vw, 19px); }
.wi-list { border-top: 1px solid var(--hair); }
.wi-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 2fr); gap: var(--s4) var(--s7); padding: var(--s7) 0; border-bottom: 1px solid var(--hair); transition: background-color .3s; }
.wi-row:hover { background: rgb(255 255 255 / .025); }
.wi-name { font: 400 clamp(28px, 2.6vw, 40px)/1 var(--serif); color: #fff; }
.wi-desc { color: var(--ink-2); max-width: 46ch; }
.wi-del { color: var(--muted); line-height: 1.9; }

/* ── responsive ── */
@media (max-width: 900px) {
  .cs-help__in { grid-template-columns: 1fr; }
  .wi-row { grid-template-columns: 1fr; gap: var(--s2); padding: var(--s6) 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dg-link { animation: none; }
}

/* ── work index: the row opens to show the project ──
   A row is only as tall as its text. Pointing at it opens the preview cell downward (grid rows 0fr → 1fr, so the
   row grows from its bottom edge) and the picture is drawn on from its top edge down. The cell sits between the
   description and the deliverables, so it never covers text. Decoration only: aria-hidden, no pointer. */
@media (min-width: 901px) {
  .wi-row { grid-template-columns: minmax(0, 3fr) minmax(0, 4.4fr) minmax(0, 2.6fr) minmax(0, 2fr); align-items: start; }
}
/* The hover tint runs edge to edge of the window while the row's content keeps the page margins: a wide spread
   shadow fills sideways, and the clip trims it to the row's own height. */
.wi-row { padding-block: var(--s6); box-shadow: 0 0 0 100vmax rgb(255 255 255 / 0); clip-path: inset(0 -100vmax);
  transition: background-color .3s, box-shadow .3s; }
.wi-row:hover { background: rgb(255 255 255 / .06); box-shadow: 0 0 0 100vmax rgb(255 255 255 / .06); }
.wi-prev { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); pointer-events: none; }
.wi-prev__clip { min-height: 0; overflow: hidden; }
.wi-prev__frame { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 4px; }
.wi-prev__in { position: absolute; inset: 0; display: block; clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease); }
.wi-prev img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.wi-prev__in--type { display: grid; place-items: center; padding: var(--s4); background: radial-gradient(80% 80% at 50% 40%, color-mix(in srgb, var(--tone, #111) 70%, #2a2a2a), #050505); }
.wi-prev__in--type span { font: 400 clamp(15px, 1.3vw, 19px)/1.15 var(--serif); color: #fff; text-align: center; max-width: 14ch; }
.wi-row:hover .wi-prev, .wi-row:focus-visible .wi-prev { grid-template-rows: 1fr; }
.wi-row:hover .wi-prev__in, .wi-row:focus-visible .wi-prev__in { clip-path: inset(0 0 0 0); }
/* the picture inside the shade settles from 1.1 to 1 as it is drawn down */
.wi-prev__in > * { transform: scale(1.1); transition: transform .6s var(--ease); }
.wi-row:hover .wi-prev__in > *, .wi-row:focus-visible .wi-prev__in > * { transform: scale(1); }
/* the rows stack on a phone; there is no hover to open them */
@media (max-width: 900px) { .wi-prev { display: none; } }
@media (prefers-reduced-motion: reduce) { .wi-prev, .wi-prev__in, .wi-prev__in > * { transition: none; } }

/* ── work index → case study: the picture takes the screen, then drops away ──
   Clicking a row lifts its preview into a fixed cover that grows to fill the window (site.js), then the browser
   goes to the case study. That page opens under the same cover (html.has-cover, set by the inline script in
   app.html before first paint, so there is no flash between the two), which then slides down off the bottom
   while the title rises into its line. */
.wi-cover { position: fixed; z-index: 10000; overflow: hidden; border-radius: 4px; pointer-events: none;
  transition: top .7s cubic-bezier(.7, 0, .2, 1), left .7s cubic-bezier(.7, 0, .2, 1), width .7s cubic-bezier(.7, 0, .2, 1), height .7s cubic-bezier(.7, 0, .2, 1), border-radius .7s cubic-bezier(.7, 0, .2, 1); }
.wi-cover > * { position: absolute; inset: 0; transform: none; clip-path: none; transition: none; }
.wi-cover > * > * { transform: none; transition: none; }
.wi-cover.is-full { top: 0 !important; left: 0 !important; width: 100vw !important; height: 100vh !important; border-radius: 0; }
html.has-cover::after { content: var(--cover-line, ""); position: fixed; inset: 0; z-index: 10000; pointer-events: none;
  display: grid; place-items: center; padding: 10vw; text-align: center; color: #fff; font: 400 clamp(32px, 4vw, 64px)/1.1 var(--serif);
  background: var(--cover-img, none) 50% 0 / cover no-repeat, radial-gradient(80% 80% at 50% 40%, color-mix(in srgb, var(--cover-tone, #111) 70%, #2a2a2a), #050505); }
html.has-cover.is-revealing::after { transform: translateY(100%); transition: transform .9s cubic-bezier(.7, 0, .2, 1); }

/* Concept projects: the tag beside the name in the work list. */
.wi-tag { margin-left: .6em; font-size: .4em; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); vertical-align: middle; }
