:root {
  --project-rule: 1px;
  --project-tab-width: clamp(44px, 4.25vw, 64px);
  --project-ease: cubic-bezier(.22, 1, .36, 1);
  --project-icon-circle-size: 28px;
  --project-active-icon-circle-size: 18px;
  --surface-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
  --page-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.64' numOctaves='4' seed='37' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.3'/%3E%3C/svg%3E");
}

.projects-showcase {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 98;
  width: 100%;
  height: max(
    12rem,
    calc(
      var(--ascii-cover-height, 60vh) - 2.6vh -
      (100vw - clamp(4px, .56vw, 10px)) * 395.88 / 2351.93 - 5px
    )
  );
  display: flex;
  overflow: hidden;
  perspective: 1200px;
  color: rgba(250, 252, 252, .9);
  background: var(--content-emboss-bg);
  border-top: var(--project-rule) solid var(--site-frame);
  border-bottom: var(--project-rule) solid var(--site-frame);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 420ms var(--project-ease),
    transform 420ms var(--project-ease),
    background-color 260ms ease,
    border-color 260ms ease,
    color 260ms ease;
}

body.blank-active::after,
body.hole-transition::after {
  display: none;
}

body.blank-active::before,
body.hole-transition::before {
  border-width: var(--project-rule);
  box-shadow: none !important;
}

body.blank-active .screen,
body.hole-transition .screen {
  box-shadow: none !important;
}

body.blank-active .r4miel-center,
body.hole-transition .r4miel-center {
  --wordmark-morph-color: #e6e1d8;
  border-bottom: var(--project-rule) solid var(--site-frame) !important;
}

body.blank-active .r4miel-center::after,
body.hole-transition .r4miel-center::after {
  content: none !important;
  display: none !important;
}

body.blank-active .r4miel-center > .ramiel-wordmark-morph,
body.hole-transition .r4miel-center > .ramiel-wordmark-morph {
  position: absolute;
  left: clamp(2px, .28vw, 5px);
  right: clamp(2px, .28vw, 5px);
  bottom: 1px;
  z-index: 1;
  display: block !important;
  width: calc(100% - clamp(4px, .56vw, 10px));
  height: auto;
  aspect-ratio: 2351.93 / 395.45;
  overflow: visible;
  color: var(--wordmark-morph-color);
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
}

.ramiel-wordmark-morph-raster {
  display: none;
}

@media (min-width: 761px) and (orientation: landscape) and (prefers-reduced-motion: no-preference) {
  body.blank-active .r4miel-center > .ramiel-wordmark-morph-raster,
  body.hole-transition .r4miel-center > .ramiel-wordmark-morph-raster {
    position: absolute;
    left: clamp(2px, .28vw, 5px);
    right: clamp(2px, .28vw, 5px);
    bottom: 1px;
    z-index: 2;
    display: block !important;
    width: calc(100% - clamp(4px, .56vw, 10px));
    height: auto;
    opacity: 0 !important;
    visibility: visible !important;
    pointer-events: none !important;
  }

  body.blank-active .ramiel-wordmark-morph-raster.is-ready,
  body.hole-transition .ramiel-wordmark-morph-raster.is-ready {
    opacity: 1 !important;
  }

  .ramiel-wordmark-morph.uses-raster-morph .ramiel-wordmark-shape .ramiel-four-morph {
    opacity: 0 !important;
  }

  body.blank-active .r4miel-center:hover > .ramiel-wordmark-morph-raster,
  body.blank-active .r4miel-center:active > .ramiel-wordmark-morph-raster,
  body.hole-transition .r4miel-center:hover > .ramiel-wordmark-morph-raster,
  body.hole-transition .r4miel-center:active > .ramiel-wordmark-morph-raster {
    opacity: 0 !important;
  }

  body.blank-active .r4miel-center:hover > .ramiel-wordmark-morph.uses-raster-morph .ramiel-wordmark-shape .ramiel-four-morph,
  body.blank-active .r4miel-center:active > .ramiel-wordmark-morph.uses-raster-morph .ramiel-wordmark-shape .ramiel-four-morph,
  body.hole-transition .r4miel-center:hover > .ramiel-wordmark-morph.uses-raster-morph .ramiel-wordmark-shape .ramiel-four-morph,
  body.hole-transition .r4miel-center:active > .ramiel-wordmark-morph.uses-raster-morph .ramiel-wordmark-shape .ramiel-four-morph {
    opacity: 1 !important;
  }
}

@media (min-width: 761px) and (orientation: landscape) and (prefers-reduced-motion: no-preference) and (max-resolution: 1.49dppx) {
  body.blank-active .ramiel-wordmark-morph-raster.is-ready,
  body.hole-transition .ramiel-wordmark-morph-raster.is-ready {
    opacity: .9 !important;
  }
}

.ramiel-wordmark-shape,
.ramiel-wordmark-fill-sweep,
.ramiel-wordmark-solid-fill {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ramiel-wordmark-shape {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.15;
  opacity: 1;
  transition:
    stroke-width 760ms cubic-bezier(.2, .72, .16, 1),
    opacity 240ms ease;
}

/* This copy is clipped to the glyph silhouettes. Widening its stroke paints
   inward from every exterior and counter edge instead of cross-fading a fill. */
.ramiel-wordmark-fill-sweep {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 0;
  opacity: 1;
  transition: stroke-width 920ms cubic-bezier(.38, 0, .14, 1);
}

/* The A/4 geometry is authored at roughly half scale inside its slot. Give
   its clipped fill stroke the exact inverse scale so its visible edge travels
   at the same rate as every full-size letter. */
.ramiel-wordmark-fill-sweep .ramiel-four-morph {
  stroke-width: 0;
  transition: stroke-width 920ms cubic-bezier(.38, 0, .14, 1);
}

/* Locks the final few interior pixels to a perfectly solid finish after the
   edge-driven sweep has visually completed. It clears immediately on exit so
   the same geometry can reverse cleanly back to an outline. */
.ramiel-wordmark-solid-fill {
  fill: currentColor;
  stroke: none;
  opacity: 0;
  transition: opacity 120ms ease 0s;
}

body.blank-active .r4miel-center:hover .ramiel-wordmark-fill-sweep,
body.blank-active .r4miel-center:active .ramiel-wordmark-fill-sweep,
body.blank-active .r4miel-center.is-touch-filling .ramiel-wordmark-fill-sweep,
body.hole-transition .r4miel-center:hover .ramiel-wordmark-fill-sweep,
body.hole-transition .r4miel-center:active .ramiel-wordmark-fill-sweep,
body.hole-transition .r4miel-center.is-touch-filling .ramiel-wordmark-fill-sweep {
  stroke-width: 124;
}

body.blank-active .r4miel-center:hover .ramiel-wordmark-fill-sweep .ramiel-four-morph,
body.blank-active .r4miel-center:active .ramiel-wordmark-fill-sweep .ramiel-four-morph,
body.blank-active .r4miel-center.is-touch-filling .ramiel-wordmark-fill-sweep .ramiel-four-morph,
body.hole-transition .r4miel-center:hover .ramiel-wordmark-fill-sweep .ramiel-four-morph,
body.hole-transition .r4miel-center:active .ramiel-wordmark-fill-sweep .ramiel-four-morph,
body.hole-transition .r4miel-center.is-touch-filling .ramiel-wordmark-fill-sweep .ramiel-four-morph {
  stroke-width: 243.2;
}

body.blank-active .r4miel-center:hover .ramiel-wordmark-solid-fill,
body.blank-active .r4miel-center:active .ramiel-wordmark-solid-fill,
body.blank-active .r4miel-center.is-touch-filling .ramiel-wordmark-solid-fill,
body.hole-transition .r4miel-center:hover .ramiel-wordmark-solid-fill,
body.hole-transition .r4miel-center:active .ramiel-wordmark-solid-fill,
body.hole-transition .r4miel-center.is-touch-filling .ramiel-wordmark-solid-fill {
  opacity: 1;
  transition-delay: 820ms;
}

body.blank-active .r4miel-center:hover .ramiel-wordmark-shape,
body.blank-active .r4miel-center:active .ramiel-wordmark-shape,
body.blank-active .r4miel-center.is-touch-filling .ramiel-wordmark-shape,
body.hole-transition .r4miel-center:hover .ramiel-wordmark-shape,
body.hole-transition .r4miel-center:active .ramiel-wordmark-shape,
body.hole-transition .r4miel-center.is-touch-filling .ramiel-wordmark-shape {
  stroke-width: .72;
  opacity: .82;
}

/* Static fallback while the external symbol is loading or unavailable. */
.ramiel-wordmark-morph:not(.is-layered) .ramiel-wordmark-shape {
  transition: fill 760ms cubic-bezier(.2, .72, .16, 1);
}

body.blank-active .r4miel-center:hover .ramiel-wordmark-morph:not(.is-layered) .ramiel-wordmark-shape,
body.blank-active .r4miel-center:active .ramiel-wordmark-morph:not(.is-layered) .ramiel-wordmark-shape,
body.blank-active .r4miel-center.is-touch-filling .ramiel-wordmark-morph:not(.is-layered) .ramiel-wordmark-shape,
body.hole-transition .r4miel-center:hover .ramiel-wordmark-morph:not(.is-layered) .ramiel-wordmark-shape,
body.hole-transition .r4miel-center:active .ramiel-wordmark-morph:not(.is-layered) .ramiel-wordmark-shape,
body.hole-transition .r4miel-center.is-touch-filling .ramiel-wordmark-morph:not(.is-layered) .ramiel-wordmark-shape {
  fill: currentColor;
}

body.blank-active .projects-showcase,
body.hole-transition .projects-showcase {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* The dark field continues beyond the ASCII image as one tactile surface.
   The logo header uses the same grain coordinates so the texture does not
   restart at its edge. */
body.blank-active,
body.hole-transition,
body.blank-active .stage-wrap,
body.hole-transition .stage-wrap,
body.blank-active .r4miel-center,
body.hole-transition .r4miel-center,
body.blank-active .r4miel-center::before,
body.hole-transition .r4miel-center::before,
body.blank-active .projects-showcase,
body.hole-transition .projects-showcase {
  background-color: var(--content-emboss-bg);
  background-image:
    var(--page-grain),
    radial-gradient(110% 75% at 18% 0%, rgba(255, 255, 255, .035), transparent 58%),
    linear-gradient(var(--content-emboss-bg), var(--content-emboss-bg));
  background-position: 0 0, center, center;
  background-size: 220px 220px, 100% 100%, 100% 100%;
  background-blend-mode: soft-light, screen, normal;
}

.project-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint style;
  background-color: var(--project-fill);
  transition:
    flex-grow 420ms var(--project-ease),
    flex-basis 420ms var(--project-ease),
    background-color 260ms ease;
}

.project-card:nth-child(1) { --project-fill: #183b68; --project-accent: #2f78c7; --project-icon-ink: #fff; }
.project-card:nth-child(2) { --project-fill: #253f78; --project-accent: #456fd1; --project-icon-ink: #fff; }
.project-card:nth-child(3) { --project-fill: #44376f; --project-accent: #7556bd; --project-icon-ink: #fff; }
.project-card:nth-child(4) { --project-fill: #663963; --project-accent: #a34fa6; --project-icon-ink: #fff; }
.project-card:nth-child(5) { --project-fill: #843b62; --project-accent: #d34f91; --project-icon-ink: #fff; }
.project-card:nth-child(6) { --project-fill: #8d472f; --project-accent: #e06b32; --project-icon-ink: #fff; }
.project-card:nth-child(7) { --project-fill: #7d5b29; --project-accent: #e5a42d; --project-icon-ink: #171006; }
.project-card:nth-child(8) { --project-fill: #285b78; --project-accent: #367db2; --project-icon-ink: #fff; }
.project-card:nth-child(9) { --project-fill: #1e6068; --project-accent: #39a9b4; --project-icon-ink: #071211; }

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 20;
  width: max(100%, 100vw);
  pointer-events: none;
  visibility: visible;
  contain: strict;
  background-image:
    var(--surface-grain),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 4px);
  background-size: 150px 150px, 100% 4px;
  background-position: calc(var(--grain-x, 0px)) calc(var(--grain-y, 0px)), 0 0;
  background-blend-mode: soft-light;
  mix-blend-mode: screen;
  opacity: .13;
  transition: none;
}

.project-card:nth-child(3n+1) { --grain-x: 19px; --grain-y: -31px; }
.project-card:nth-child(3n+2) { --grain-x: -43px; --grain-y: 17px; }
.project-card:nth-child(3n) { --grain-x: 37px; --grain-y: 49px; }

.projects-showcase.has-active-project .project-card {
  flex: 0 0 var(--project-tab-width);
}

.projects-showcase.has-active-project .project-card.is-active {
  flex: 1 1 var(--project-tab-width);
}

.project-tab {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: 700 clamp(.78rem, .82vw, .95rem)/1 "Averia Serif Libre", Georgia, serif;
  letter-spacing: -.02em;
  text-transform: uppercase;
  transition: background-color 180ms ease, color 180ms ease;
}

.project-tab:hover,
.project-tab:focus-visible {
  background: transparent;
}

.project-tab:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .92);
  outline-offset: -3px;
}

.project-tab-label {
  position: absolute;
  top: 50%;
  left: 50%;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transform-origin: center;
  width: var(--project-icon-circle-size);
  height: var(--project-icon-circle-size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 var(--project-icon-circle-size);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  color: var(--project-icon-ink, #fff);
  background: var(--project-accent);
  will-change: transform, opacity, filter;
  transition: opacity 100ms ease, filter 160ms ease;
}

.project-tab-label,
.project-panel-title {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .18),
    0 3px 8px rgba(0, 0, 0, .10),
    inset 0 1px 0 rgba(255, 255, 255, .10);
}

.project-tab-label::before,
.project-panel-title::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: var(--project-rule);
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg,
    rgba(255,255,255,.96) 0%,
    rgba(255,255,255,.30) 27%,
    transparent 46% 54%,
    rgba(255,255,255,.24) 73%,
    rgba(255,255,255,.88) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.project-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(16px, 1.35vw, 21px);
  height: clamp(16px, 1.35vw, 21px);
  overflow: visible;
  filter:
    drop-shadow(0 1px 1px rgba(0,0,0,.20))
    drop-shadow(0 -.5px .6px rgba(255,255,255,.18));
}

.project-tab-label .project-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62%;
  height: 62%;
  margin: 0;
  transform: translate(-50%, -50%);
}

img.project-icon {
  object-fit: contain;
  object-position: 50% 50%;
}

.project-icon--asset {
  filter:
    grayscale(1)
    saturate(0)
    drop-shadow(0 1px 1px rgba(0,0,0,.20))
    drop-shadow(0 -.5px .6px rgba(255,255,255,.18));
}

.project-panel-title .project-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 60%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.project-card[data-project="am-i"] .project-icon {
  transform: translate(-50%, -56%);
}

.project-info {
  position: absolute;
  right: clamp(12px, 1vw, 16px);
  bottom: clamp(15px, 1.25vw, 19px);
  left: clamp(46px, 3.8vw, 58px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: clamp(7px, .7vw, 11px);
  min-width: 0;
  height: var(--project-active-icon-circle-size);
  padding: 0;
  color: rgba(243, 239, 232, .84);
  font: 500 clamp(7px, .56vw, 9px)/1.2 "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  letter-spacing: .08em;
  pointer-events: auto;
  isolation: isolate;
  will-change: transform, opacity;
  transition:
    transform 420ms var(--project-ease),
    opacity 200ms ease;
}

.project-info::before,
.project-shared-footer::before {
  content: "";
  position: absolute;
  inset: -7px -14px -7px -9px;
  z-index: 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 82%, transparent 100%);
}

.project-info > *,
.project-shared-footer > * {
  position: relative;
  z-index: 1;
}

.project-info-meta {
  order: -1;
  display: flex;
  align-items: center;
  gap: clamp(6px, .55vw, 9px);
  flex: 0 0 auto;
  margin: 0;
  color: rgba(243, 239, 232, .58);
  font: inherit;
  white-space: nowrap;
}

.project-info h3 {
  order: -2;
  flex: 0 0 auto;
  margin: 0;
  color: #f3efe8;
  font: 700 clamp(8px, .66vw, 10px)/1.1 "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  letter-spacing: .1em;
  white-space: nowrap;
}

.project-info-description {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(243, 239, 232, .64);
  font: inherit;
  letter-spacing: .025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-shared-footer {
  position: absolute;
  left: 0;
  bottom: clamp(15px, 1.25vw, 19px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: clamp(10px, .85vw, 14px);
  height: var(--project-active-icon-circle-size);
  min-width: 0;
  color: rgba(243, 239, 232, .84);
  transform: translate3d(var(--project-footer-x, 18px), 0, 0);
  opacity: 1;
  pointer-events: none;
  isolation: isolate;
  transition:
    transform 420ms var(--project-ease),
    opacity 160ms ease;
  will-change: transform, opacity;
}

.project-shared-footer[hidden] {
  display: none;
}

.project-shared-footer.without-transition {
  transition: none;
}

.project-shared-footer.is-closing {
  opacity: 0;
}

.project-shared-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 var(--project-active-icon-circle-size);
  width: var(--project-active-icon-circle-size);
  height: var(--project-active-icon-circle-size);
  overflow: hidden;
  border-radius: 50%;
  background: var(--project-accent);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .18),
    inset 0 1px 0 rgba(255, 255, 255, .10);
}

.project-shared-icon .project-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 60%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.project-shared-footer[data-project="am-i"] .project-icon {
  transform: translate(-50%, -56%);
}

.project-shared-info {
  display: flex;
  align-items: center;
  gap: clamp(7px, .7vw, 11px);
  min-width: 0;
  width: 100%;
  height: 100%;
  font: 500 clamp(7px, .56vw, 9px)/1.2 "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  letter-spacing: .08em;
}

.project-shared-info h3 {
  order: -2;
  flex: 0 0 auto;
  margin: 0;
  color: #f3efe8;
  font: 700 clamp(8px, .66vw, 10px)/1.1 "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  letter-spacing: .1em;
  white-space: nowrap;
}

@media (min-width: 761px) and (orientation: landscape) {
  .project-panel > .project-panel-title,
  .project-panel > .project-info {
    visibility: hidden;
    pointer-events: none;
  }
}

.project-name-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.project-tab:hover .project-tab-label,
.project-tab:focus-visible .project-tab-label {
  filter: brightness(1.08) saturate(1.08);
}

.project-tab:active .project-tab-label {
  filter: brightness(.94);
}

.project-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(calc(var(--project-direction, 1) * 18px));
  clip-path: inset(0);
  transition:
    opacity 220ms ease,
    transform 420ms var(--project-ease),
    clip-path 420ms var(--project-ease),
    visibility 0s linear 420ms;
}

.project-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(70% 100% at 50% 50%, rgba(255, 255, 255, .045), transparent 72%);
}

.project-panel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -48%;
  width: 48%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .11), transparent);
}

.project-card.is-active .project-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 260ms ease 60ms,
    transform 420ms var(--project-ease),
    visibility 0s;
}

.projects-showcase.is-forward .project-card.is-entering .project-panel {
  clip-path: inset(0 0 0 100%);
}

.projects-showcase.is-backward .project-card.is-entering .project-panel {
  clip-path: inset(0 100% 0 0);
}

.project-card.is-entering .project-panel {
  opacity: 0;
  transform: translateX(calc(var(--project-direction, 1) * 18px));
}

.project-card.is-leaving .project-panel {
  visibility: visible;
  transform: translateX(calc(var(--project-direction, 1) * -18px));
}

.project-card.is-active .project-tab {
  /* The full-card tab used to sit above the nested showcase and steal every
     tap from its sibling containers. The panel owns input while expanded. */
  pointer-events: none;
}

.project-card.is-active .project-tab-label {
  opacity: 0;
}

.project-panel-title {
  position: absolute;
  left: clamp(18px, 1.45vw, 24px);
  bottom: clamp(15px, 1.25vw, 19px);
  z-index: 5;
  margin: 0;
  font: 700 clamp(.54rem, .58vw, .68rem)/1 "Averia Serif Libre", Georgia, serif;
  letter-spacing: .01em;
  text-transform: uppercase;
  width: var(--project-active-icon-circle-size);
  height: var(--project-active-icon-circle-size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  color: var(--project-icon-ink, #fff);
  background: var(--project-accent);
  white-space: nowrap;
  will-change: transform, opacity;
  transition:
    transform 420ms var(--project-ease),
    opacity 200ms ease;
}

.project-elements {
  --element-rule-color: var(--site-frame);
  position: absolute;
  inset: clamp(9px, .9vw, 14px) clamp(10px, 1vw, 16px) clamp(7px, .7vw, 10px);
  z-index: 4;
  display: flex;
  min-height: 42px;
  overflow: hidden;
  border: var(--project-rule) solid var(--element-rule-color);
  border-radius: 0;
}

.project-elements::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 3;
  width: max(100%, 100vw);
  pointer-events: none;
  visibility: visible;
  contain: strict;
  background-image: var(--surface-grain);
  background-size: 132px 132px;
  background-position: -27px 41px;
  mix-blend-mode: screen;
  opacity: .11;
  transition: none;
}

.project-elements.has-media {
  background: #08090a;
}

.project-element {
  position: relative;
  flex: 0 0 clamp(34px, 3.4vw, 52px);
  min-width: 0;
  overflow: hidden;
  contain: layout paint style;
  border-left: var(--project-rule) solid var(--element-rule-color);
  background: rgba(255, 255, 255, .012);
  transition:
    flex-grow 420ms var(--project-ease),
    flex-basis 420ms var(--project-ease),
    background-color 180ms ease;
}

.project-element:first-child {
  border-left: 0;
}

.project-element.is-active {
  flex: 1 1 clamp(34px, 3.4vw, 52px);
  background: rgba(255, 255, 255, .025);
}

.project-element-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: .72;
  pointer-events: none;
  transform: scale(1.015);
  transition: opacity 240ms ease, transform 420ms var(--project-ease);
}

.project-card.is-active .project-element-media {
  will-change: opacity, transform;
}

.project-element.is-active .project-element-media {
  opacity: 1;
  transform: scale(1);
}

.project-element-trigger {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  padding: 0;
  appearance: none;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: 700 clamp(.62rem, .68vw, .76rem)/1 "Averia Serif Libre", Georgia, serif;
  letter-spacing: .02em;
}

.project-element.has-media .project-element-trigger {
  color: #fff;
}

.project-element-trigger:hover {
  background: rgba(255, 255, 255, .075);
}

.project-element-trigger:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: -3px;
}

.project-element-number,
.project-element-title {
  display: none;
}

.project-elements.has-media .project-element.is-active .project-element-number,
.project-elements.has-media .project-element.is-active .project-element-title {
  position: absolute;
  top: 12px;
  display: block;
  padding: 5px 7px;
  color: rgba(255, 255, 255, .9);
  background: rgba(3, 4, 5, .72);
  border: 1px solid rgba(255, 255, 255, .2);
  font: 600 9px/1 "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  letter-spacing: .1em;
  pointer-events: none;
}

.project-elements.has-media .project-element.is-active .project-element-number {
  right: 12px;
}

.project-elements.has-media .project-element.is-active .project-element-title {
  right: 48px;
}

/* A fixed grain pass breaks up the perfectly clean digital surfaces without
   softening the ASCII glyph edges or competing with their original color. */
body.blank-active .ascii-megacity-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    var(--surface-grain),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px);
  background-size: 128px 128px, 3px 100%;
  mix-blend-mode: soft-light;
  opacity: .18;
}

body.blank-active .ascii-megacity-text {
  filter: contrast(1.045) saturate(.96);
}

body.blank-active .ascii-megacity-text span {
  text-shadow:
    .24px 0 rgba(255, 242, 222, .18),
    -.24px 0 rgba(0, 18, 24, .22);
}

@media (prefers-reduced-motion: reduce) {
  .projects-showcase,
  .project-card,
  .project-panel,
  .project-tab-label,
  .ramiel-wordmark-shape,
  .ramiel-wordmark-fill-sweep,
  .ramiel-wordmark-fill-sweep .ramiel-four-morph,
  .ramiel-wordmark-solid-fill,
  .ascii-megacity-art {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}

@media (max-width: 760px), (orientation: portrait) {
  :root {
    --project-tab-width: clamp(29px, 4.4vh, 38px);
    --project-icon-circle-size: 24px;
    --project-active-icon-circle-size: 16px;
    /* The mobile artwork is fitted to one viewport, so only the header-clear
       phase contributes scroll. Avoid a temporary 80vh jump before JS fits it. */
    --ascii-pan-height: 0px;
  }

  .project-shared-footer {
    display: none;
  }

  html {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: pan-y !important;
  }

  body.blank-active {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    touch-action: pan-y !important;
  }

  /* The stage provides scroll distance; the actual header/screen remains exactly
     one viewport tall so mobile never stretches the content composition. */
  body.blank-active .stage-wrap {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: calc(100dvh + var(--ascii-cover-height, 50vh) + var(--ascii-pan-height, 0px) + max(8px, env(safe-area-inset-bottom))) !important;
    min-height: calc(100dvh + var(--ascii-cover-height, 50vh) + var(--ascii-pan-height, 0px) + max(8px, env(safe-area-inset-bottom))) !important;
    overflow: visible !important;
  }

  body.blank-active .screen {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.blank-active .ascii-megacity-bg {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.blank-active .ascii-megacity-raster {
    display: none !important;
  }

  body.blank-active .ascii-megacity-text {
    display: block !important;
    visibility: visible !important;
    opacity: 0 !important;
    transition: opacity 220ms ease;
  }

  body.blank-active .ascii-megacity-bg.is-ready .ascii-megacity-text {
    opacity: 1 !important;
  }

  body.blank-active .r4miel-center,
  body.hole-transition .r4miel-center {
    position: absolute !important;
    inset: 0 0 auto !important;
    width: 100% !important;
    height: var(--ascii-cover-height, 50vh) !important;
    transform: translate3d(0, calc(-1 * var(--mobile-header-scroll, 0px)), 0) !important;
    overflow: clip !important;
    clip-path: inset(0);
    background-color: var(--content-emboss-bg) !important;
    background-image:
      var(--page-grain),
      radial-gradient(110% 75% at 18% 0%, rgba(255, 255, 255, .035), transparent 58%),
      linear-gradient(var(--content-emboss-bg), var(--content-emboss-bg)) !important;
    background-position: 0 0, center, center !important;
    background-size: 220px 220px, 100% 100%, 100% 100% !important;
    background-blend-mode: soft-light, screen, normal !important;
    will-change: transform;
  }

  body.blank-active .r4miel-center::after,
  body.hole-transition .r4miel-center::after {
    left: clamp(2px, .28vw, 5px) !important;
    right: clamp(2px, .28vw, 5px) !important;
    bottom: 0 !important;
    width: auto !important;
    transform: none !important;
  }

  body.blank-active .mobile-ramiel-wordmark,
  body.hole-transition .mobile-ramiel-wordmark {
    display: none !important;
  }

  /* Touch browsers often keep :hover latched after a tap. The explicit press
     class owns the mobile morph so release can animate back to outline. */
  .r4miel-center:not(.is-touch-filling) .ramiel-wordmark-fill-sweep,
  .r4miel-center:not(.is-touch-filling) .ramiel-wordmark-fill-sweep .ramiel-four-morph {
    stroke-width: 0 !important;
  }

  .r4miel-center:not(.is-touch-filling) .ramiel-wordmark-solid-fill {
    opacity: 0 !important;
    transition-delay: 0s !important;
  }

  .r4miel-center:not(.is-touch-filling) .ramiel-wordmark-shape {
    stroke-width: 1.15 !important;
    opacity: 1 !important;
  }

  .projects-showcase {
    position: absolute;
    bottom: auto;
    height: calc(
      var(--ascii-cover-height, 50vh) -
      (100vw - clamp(4px, .56vw, 10px)) * 395.88 / 2351.93 - 5px
    );
    flex-direction: column;
  }

  .project-card {
    flex: 1 1 0;
    width: 100%;
    height: auto;
    border: 0;
  }

  .projects-showcase.has-active-project .project-card {
    flex: 0 0 var(--project-tab-width);
  }

  .projects-showcase.has-active-project .project-card.is-active {
    flex: 1 1 var(--project-tab-width);
    min-width: 0;
  }

  .project-tab {
    font-size: clamp(.68rem, 2.5vw, .82rem);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .project-tab-label {
    transform: translate(-50%, -50%);
  }

  .project-panel-title {
    top: auto;
    left: 15px;
    bottom: 15px;
    padding: 2px 4px;
    font-size: .5rem;
  }

  .project-info {
    right: auto;
    bottom: 15px;
    left: 42px;
    gap: 6px;
    font-size: 9px;
  }

  .project-info-meta {
    gap: 5px;
  }

  .project-info-meta span:nth-child(2),
  .project-info-description {
    display: none;
  }

  .project-info h3 {
    font-size: 9px;
  }

  .project-elements {
    inset: 7px;
    min-height: 38px;
    border-radius: 0;
  }

  .project-element {
    flex-basis: 44px;
  }

  .project-element.is-active {
    flex-basis: 44px;
  }

  .project-element-trigger {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .project-panel {
    transform: translateY(calc(var(--project-direction, 1) * 12px));
  }

  .projects-showcase.is-forward .project-card.is-entering .project-panel {
    clip-path: inset(100% 0 0);
  }

  .projects-showcase.is-backward .project-card.is-entering .project-panel {
    clip-path: inset(0 0 100%);
  }

  .project-card.is-entering .project-panel {
    transform: translateY(calc(var(--project-direction, 1) * 12px));
  }

  .project-card.is-leaving .project-panel {
    transform: translateY(calc(var(--project-direction, 1) * -12px));
  }

  /* Mobile mirrors the desktop scroll architecture: the ASCII is a fixed,
     viewport-contained backdrop while the header/content section scrolls away. */
  body.blank-active .ascii-megacity-bg {
    position: fixed !important;
    inset: 0 0 auto !important;
    width: 100% !important;
    height: 100svh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    transform: translate3d(0, 0, 0) !important;
    backface-visibility: hidden;
    will-change: transform;
    contain: layout paint size;
  }

  body.blank-active .ascii-megacity-art {
    position: absolute !important;
    top: 0 !important;
    bottom: auto !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(calc(-1 * var(--ascii-art-lift, 0px))) !important;
  }

  /* An expanded mobile project is a self-contained viewport. There is no
     hidden ASCII page underneath it and no residual document scroll. */
  html:has(body.blank-active.project-expanded),
  body.blank-active.project-expanded {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: manipulation !important;
  }

  body.blank-active.project-expanded .stage-wrap,
  body.blank-active.project-expanded .screen {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.blank-active.project-expanded .ascii-megacity-bg,
  body.blank-active.project-expanded .ascii-megacity-art {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  body.blank-active.project-expanded .r4miel-center {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    transform: none !important;
  }

  body.blank-active .r4miel-center::after,
  body.hole-transition .r4miel-center::after {
    left: clamp(2px, .28vw, 5px) !important;
    right: clamp(2px, .28vw, 5px) !important;
    bottom: 1px !important;
    width: auto !important;
    transform: none !important;
  }

  body.blank-active.project-expanded .projects-showcase {
    top: 0;
    height: calc(
      100dvh -
      (100vw - clamp(4px, .56vw, 10px)) * 395.88 / 2351.93 - 5px
    );
  }
}

/* Compact landscape phones cannot fit nine fixed-height rows. Restore the
   horizontal card architecture so expansion always leaves a usable panel. */
@media (max-width: 760px) and (orientation: landscape) and (max-height: 420px) {
  :root {
    --project-tab-width: 44px;
  }

  .projects-showcase,
  body.blank-active.project-expanded .projects-showcase {
    top: 0;
    height: calc(100dvh - (100vw - clamp(4px, .56vw, 10px)) * 395.88 / 2351.93 - 5px);
    flex-direction: row;
  }

  .project-card {
    flex: 1 1 0;
    width: auto;
    height: 100%;
  }

  .projects-showcase.has-active-project .project-card {
    flex: 0 0 var(--project-tab-width);
  }

  .projects-showcase.has-active-project .project-card.is-active {
    flex: 1 1 var(--project-tab-width);
  }
}
