/* Use the settled viewport so a transient tab resize cannot recenter the shell. */
html[data-desk-preview] body { width: var(--desk-viewport-width, 100%); }

/* Keep the pixel treatment on states and functional objects. */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  height: 90px;
  border: 0;
  box-shadow: inset 0 -1px var(--line);
}
.site-header .brand { justify-self: start; align-self: center; font-size: 24px; }
.site-header .contact-link { justify-self: end; align-self: center; min-height: 44px; }
.site-header .mail-drawing { width: 20px; height: 20px; }
.site-header nav { display: flex; align-items: stretch; margin: 0; height: auto; gap: clamp(14px, 2.5vw, 36px); }
.site-header nav a, .site-header nav a[aria-current=page] {
  min-height: 44px;
  position: relative;
  padding: 0 2px;
  background: none;
  box-shadow: none;
  border: 0;
}
.site-header nav a[aria-current=page] { color: var(--ink); font-weight: 700; }
.site-header nav a[aria-current=page]::after {
  display: block;
  content: "";
  position: absolute;
  inset: auto 0 0;
  width: auto;
  height: 5px;
  background: var(--teal);
  box-shadow: none;
  clip-path: polygon(0 100%,0 3px,3px 3px,3px 0,calc(100% - 3px) 0,calc(100% - 3px) 3px,100% 3px,100% 100%);
}
.site-header nav a:hover, .site-header .contact-link:hover { color: var(--teal); }
.site-header nav a:focus-visible { outline-offset: -4px; }

.home-with-cable > .home-content { box-shadow: none; padding-top: 0; }
.home-content .section-heading, .home-content > .demos > .section-heading {
  height: 60px;
  align-items: center;
  margin: 0;
  border-top: 1px solid var(--line);
}
.home-content .section-heading a { color: var(--teal); padding: 12px 0; }
.home-content .home-map-link, .home-content .demo-photo { outline: 0; }
.home-events .next-event, .featured-caption {
  background: none;
  outline: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  height: 90px;
  padding: 0;
}
.featured-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.home-content .featured-caption h3 { margin: 0 0 5px; }
.home-content .featured-caption p { margin: 0; }
.watch-label { color: var(--teal); font-size: 12px; white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; }
.home-content .workshop-link { border: 0; margin: 0; padding: 18px 0 0; }
.home-content .play-mark { left: 15px; bottom: 15px; box-shadow: 3px 3px 0 #14232e; }
.home-content .home-map-link:focus-visible { outline: 3px solid var(--teal); }
.home-content a:hover h3, .home-content .next-event:hover strong { color: var(--teal); }
@media (min-width: 1200px) {
  .home-with-cable > .home-content {
    grid-template-columns: minmax(0, calc(var(--home-map-column) - 30px)) minmax(0, 1fr);
  }
  .home-events .cell-map, .home-content .demo-photo { height: 300px; }
  .home-content .demo-photo > img { object-position: left center; }
}

.site-footer, .home-footer {
  outline: 0;
  border-top: 1px solid var(--line);
  background: none;
  box-shadow: none;
  padding-inline: 0;
}
.site-footer .footer-brand { justify-self: start; }
.site-footer .footer-icon { display: none; }
.site-footer nav.footer-links { gap: 24px; }
.site-footer .footer-links a { min-height: 44px; color: var(--muted); }
.site-footer .footer-links a:hover { color: var(--teal); }
.site-footer .theme-utility.footer-power {
  background: none;
  box-shadow: none;
  border: 0;
  padding-right: 0;
}
.site-footer .footer-power .power-key {
  border: 1px solid var(--ui-edge);
  box-shadow: 2px 2px 0 var(--ui-shadow);
  background: var(--ui-fill);
  color: var(--teal);
}
[data-theme=dark] .site-footer .footer-power .power-key { color: var(--gold); }
.site-footer .footer-power:hover .power-key { background: var(--selected); }
.site-footer .footer-power:active { transform: none; }
.site-footer .footer-power .power-status { display: none; }
.power-socket { background: var(--paper); }

@media (max-width: 760px) {
  .site-header {height: 120px; grid-template-columns: 1fr auto; align-content: stretch; gap: 0;}
  .site-header nav { justify-content: space-between; gap: 8px; }
  .site-header .brand { font-size: 22px; }
  .site-header nav a, .site-header nav a[aria-current=page] { padding-inline: 6px; }
  .home-content .featured-caption h3 { font-size: 17px; }
  .home-content .watch-label { display: none; }
  .home-with-cable > .home-content {padding-top: 30px;}
  .site-footer nav.footer-links { justify-self: stretch; }
}

/* Small utility lettering and a stepped route cursor share the artwork's scale. */
.site-header nav a, .site-header nav a[aria-current=page] {
  font-family: var(--label-font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .045em;
  text-transform: uppercase;
  padding-inline: 15px 0;
}
.site-header nav a[aria-current=page] { font-weight: 700; }
.site-header nav a[aria-current=page]::after {
  inset: 0 auto 0 0;
  margin-block: auto;
  width: 8px;
  height: 9px;
  background: #a4472f;
  clip-path: polygon(0 0, 30% 0, 30% 22%, 63% 22%, 63% 38%, 100% 38%, 100% 62%, 63% 62%, 63% 78%, 30% 78%, 30% 100%, 0 100%);
}
[data-theme=dark] .site-header nav a[aria-current=page]::after { background: var(--coral); }
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.site-header .contact-link, .site-footer .footer-links a {
  font-family: var(--label-font);
  font-size: 12px;
}
@media (max-width: 760px) {
  .site-header nav a, .site-header nav a[aria-current=page] { font-size: 12px; }
}
@media (max-width: 375px) {
  .site-header nav { column-gap: 4px; }
  .site-header nav a, .site-header nav a[aria-current=page] {
    font-size: 11px;
    padding-left: 10px;
    letter-spacing: 0;
    white-space: nowrap;
  }
}

/* Match the grid script before it runs, including on a cold page load. */
html[data-desk-preview] {
  --desk-viewport-width: 100vw;
  --desk-gutter: 60px;
  --desk-max: 1200px;
  --content-width: min(var(--desk-max), round(down, calc(var(--desk-viewport-width) - var(--desk-gutter)), 30px));
  --page-grid-x: calc((var(--desk-viewport-width) - var(--content-width)) / 2);
  --hero-copy: round(down, calc((var(--content-width) - 30px) * .45), 30px);
  --home-map-column: round(down, calc((var(--content-width) - 60px) * .6), 30px);
  --home-demo-height: round(nearest, calc((var(--content-width) - 60px - var(--home-map-column)) * 9 / 16), 30px);
  --event-column: round(down, calc((var(--content-width) - 30px) * .4), 30px);
}
html[data-desk-preview]:has(.events-page) { --desk-max: 1440px; }
@media (max-width: 760px) { html[data-desk-preview] { --desk-gutter: 30px; } }

.recent-recording {
  display: grid;
  grid-template-columns: clamp(64px, 16vw, 96px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.recent-recording:hover strong { color: var(--teal); }
.recent-kind { display: block; margin-top: 3px; color: var(--muted); font: 12px/1.5 var(--label-font); }
.more-recordings { display: inline-block; padding-block: 12px; color: var(--teal); font-size: 14px; }

.site-footer .footer-brand, .site-footer .footer-links a, .site-footer .theme-utility.footer-power {
  font: 500 12px/1.4 var(--label-font) !important;
}
.site-footer .footer-power .power-key {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  box-shadow: none;
  background: var(--paper);
}
.site-footer .footer-power .power-key svg { width: 16px; height: 16px; fill: currentColor; stroke: none; shape-rendering: crispEdges; }
.site-footer .footer-power:hover .power-key { background: var(--selected); }

.dev-posts { margin-top: 60px; }
.dev-posts .page-heading { height: auto; min-height: 60px; }
.dev-posts ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dev-posts li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; padding: 15px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dev-posts li a { color: var(--ink); font-weight: 600; text-underline-offset: 4px; }
.dev-posts time { color: var(--muted); font: 12px/1.5 var(--label-font); white-space: nowrap; }

/* Writing precedes the video archive on Demos. */
.demos-page > .dev-posts { margin: 0 0 30px; }
.demos-page .dev-posts .page-heading { justify-content: space-between; }
@media (max-width: 480px) {
  .dev-posts li { display: grid; grid-template-columns: 1fr; gap: 4px; }
}

.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: var(--ui-fill);
}
.recent-visual img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.recent-visual::before { content: ""; width: 12px; height: 12px; background: var(--teal); }
.recent-visual.is-video::before {
  clip-path: polygon(0 0, 33% 0, 33% 16%, 67% 16%, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 84%, 33% 84%, 33% 100%, 0 100%);
}
.recent-visual.is-article::before {
  clip-path: polygon(0 0, 70% 0, 70% 16%, 86% 16%, 86% 32%, 100% 32%, 100% 100%, 0 100%, 0 82%, 80% 82%, 80% 48%, 20% 48%, 20% 82%, 0 82%);
}
.recent-visual.is-video:has(img)::before {
  z-index: 1;
  background: var(--gold);
  filter: drop-shadow(0 0 1px #14232e);
}

.home-content > .recent-archive { grid-column: 1 / -1; }
.recent-archive .recent-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; }
.recent-archive li:nth-child(-n+2) { border-top: 1px solid var(--line); }
.recent-archive .recent-recording { height: 100%; }
@media (max-width: 760px) {
  .home-with-cable > .home-content > .recent-archive { margin-top: -15px; }
  .recent-archive .recent-list { grid-template-columns: minmax(0, 1fr); }
  .recent-archive li:nth-child(-n+2) { border-top: 0; }
}
@media (min-width: 761px) {
  @supports (grid-template-columns: subgrid) {
    .home-content > .recent-archive, .recent-archive .recent-list { display: grid; grid-template-columns: subgrid; }
    .recent-archive .recent-list, .recent-archive .more-recordings { grid-column: 1 / -1; }
    .recent-archive .more-recordings { justify-self: start; }
  }
}

.demos-page .recording-heading { min-height: 60px; height: auto; justify-content: space-between; margin-bottom: 15px; }
.demos-page .dev-posts li { display: block; padding: 0; }
.demos-page .dev-posts li > a {
  display: grid;
  grid-template-columns: clamp(84px, 16vw, 144px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding-block: 12px;
  text-decoration: none;
}
.dev-posts li > a:hover > span:not(.post-cover) { text-decoration: underline; }
.dev-posts .post-cover { aspect-ratio: 16 / 9; }
.dev-posts .post-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dev-posts .post-cover[hidden] + span { grid-column: 1 / 3; }
@media (max-width: 600px) {
  .demos-page .dev-posts li > a { grid-template-columns: 84px minmax(0, 1fr); gap: 4px 12px; }
  .dev-posts .post-cover { grid-row: span 2; }
  .dev-posts time { grid-column: 2; }
  .dev-posts .post-cover[hidden] ~ time { grid-column: 1 / -1; }
}
