:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #0f0f0f;
  --surface: #ffffff;
  --muted: #666666;
  --line: rgba(15, 15, 15, 0.12);
  --line-strong: rgba(15, 15, 15, 0.22);
  --accent: #0f0f0f;
  --wash: #f4f4f0;
  --home-max: 1280px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --fg: #f7f7f2;
    --surface: #151515;
    --muted: #a7a7a0;
    --line: rgba(247, 247, 242, 0.13);
    --line-strong: rgba(247, 247, 242, 0.24);
    --accent: #f7f7f2;
    --wash: #191919;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.page {
  display: grid;
  gap: clamp(34px, 4vw, 64px);
  margin: 0 auto;
  max-width: var(--home-max);
  min-height: 100vh;
  padding: clamp(18px, 2.2vw, 28px) clamp(18px, 4.5vw, 56px) clamp(48px, 7vw, 92px);
  width: 100%;
}

.topline {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 38px;
}

.brand,
.topline a {
  text-decoration: none;
}

.brand {
  font-family: inherit;
  font-size: 18px;
  font-weight: 650;
}

.topline nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
}

.topline nav a {
  color: var(--muted);
  font-size: 15px;
}

.topline nav a:hover,
.work-card:hover strong {
  color: var(--accent);
}

.hero {
  align-content: center;
  display: grid;
  justify-items: center;
  min-height: clamp(390px, calc(100svh - 230px), 620px);
  padding: clamp(30px, 6vw, 76px) 0 clamp(18px, 4vw, 42px);
  position: relative;
}

.chat-stage {
  align-items: center;
  display: grid;
  gap: 22px;
  justify-items: center;
  position: relative;
  width: min(940px, 100%);
  z-index: 2;
}

.keyword-field {
  color: color-mix(in oklab, var(--fg), transparent 88%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(13px, 1.2vw, 20px);
  inset: 0;
  pointer-events: none;
  position: absolute;
  user-select: none;
  z-index: 0;
}

.keyword-field span {
  position: absolute;
  white-space: nowrap;
}

.keyword-field span:nth-child(1) { left: 7%; top: 16%; }
.keyword-field span:nth-child(2) { left: 24%; top: 26%; }
.keyword-field span:nth-child(3) { right: 15%; top: 18%; }
.keyword-field span:nth-child(4) { left: 13%; top: 57%; }
.keyword-field span:nth-child(5) { right: 8%; top: 49%; }
.keyword-field span:nth-child(6) { left: 47%; top: 12%; }
.keyword-field span:nth-child(7) { right: 31%; top: 66%; }
.keyword-field span:nth-child(8) { left: 31%; top: 74%; }
.keyword-field span:nth-child(9) { right: 23%; top: 34%; }
.keyword-field span:nth-child(10) { left: 3%; top: 39%; }
.keyword-field span:nth-child(11) { right: 4%; top: 74%; }
.keyword-field span:nth-child(12) { left: 55%; top: 84%; }
.keyword-field span:nth-child(13) { left: 72%; top: 8%; }
.keyword-field span:nth-child(14) { left: 18%; top: 88%; }
.keyword-field span:nth-child(15) { right: 42%; top: 52%; }
.keyword-field span:nth-child(16) { left: 2%; top: 77%; }

@media (prefers-color-scheme: dark) {
  .keyword-field {
    color: color-mix(in oklab, var(--fg), transparent 91%);
  }
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 10px;
}

h1 {
  font-family: inherit;
  font-size: clamp(31px, 4.1vw, 48px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
  max-width: 32ch;
  text-align: center;
}

.summary {
  color: var(--muted);
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.35;
  margin: 0;
  max-width: 38ch;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.home-chat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 18px 60px rgba(15, 15, 15, 0.1);
  display: block;
  max-width: min(920px, 100%);
  min-height: 128px;
  padding: 22px 78px 22px 22px;
  position: relative;
  width: min(920px, 100%);
}

.home-chat.is-leaving {
  transform: translateY(-4px) scale(1.01);
  transition: transform 180ms ease, opacity 180ms ease;
}

.home-chat textarea {
  background: transparent;
  border: 0;
  color: var(--fg);
  font: 20px/1.35 "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.35;
  max-height: 116px;
  min-height: 84px;
  outline: 0;
  overflow: auto;
  padding: 0;
  resize: none;
  width: 100%;
}

.home-chat textarea::placeholder {
  color: var(--muted);
}

.home-chat button {
  background: var(--fg);
  border: 0;
  border-radius: 999px;
  color: var(--bg);
  cursor: pointer;
  font: 24px/1 "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  height: 44px;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 18px;
  top: 66px;
  width: 44px;
}

.home-chat button:disabled {
  background: color-mix(in oklab, var(--fg), transparent 88%);
  color: color-mix(in oklab, var(--fg), transparent 52%);
  cursor: default;
  opacity: 1;
}

.home-chat-output {
  color: var(--muted);
  display: block;
  grid-column: 1 / -1;
  line-height: 1.45;
  padding: 0 6px 2px;
  white-space: pre-wrap;
}

.home-chat-output:empty {
  display: none;
}

.home-chat[data-state="leaving"] .home-chat-output {
  color: var(--muted);
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: min(760px, 100%);
}

.chat-suggestions button,
.chat-suggestions a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 3px 14px rgba(15, 15, 15, 0.06);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 12px 17px;
  text-decoration: none;
}

.chat-suggestions button:hover,
.chat-suggestions button:focus-visible,
.chat-suggestions a:hover,
.chat-suggestions a:focus-visible {
  color: var(--fg);
}

.chat-page {
  min-height: 100svh;
}

.chat-room {
  align-content: center;
  display: grid;
  gap: clamp(18px, 3vw, 28px);
  justify-items: center;
  margin: 0 auto;
  min-height: calc(100svh - 100px);
  width: min(960px, 100%);
}

.chat-room-head {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.chat-room-head h1 {
  font-size: clamp(34px, 5.4vw, 64px);
}

.chat-room-head p {
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  margin: 0;
}

.chat-thread {
  display: grid;
  gap: 12px;
  max-height: min(42svh, 420px);
  overflow: auto;
  padding: 2px;
  width: min(820px, 100%);
}

.chat-message {
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--fg);
  max-width: min(680px, 100%);
  padding: 14px 17px;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-message.assistant {
  background: var(--surface);
  justify-self: start;
}

.chat-message.user {
  background: var(--fg);
  color: var(--bg);
  justify-self: end;
}

.chat-message.pending,
.chat-message.error {
  color: var(--muted);
}

.chat-composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 18px 60px rgba(15, 15, 15, 0.1);
  max-width: min(860px, 100%);
  min-height: 128px;
  padding: 22px 78px 22px 22px;
  position: relative;
  width: min(860px, 100%);
}

.chat-composer textarea {
  background: transparent;
  border: 0;
  color: var(--fg);
  font: 20px/1.35 "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  max-height: 160px;
  min-height: 84px;
  outline: 0;
  overflow: auto;
  padding: 0;
  resize: none;
  width: 100%;
}

.chat-composer textarea::placeholder {
  color: var(--muted);
}

.chat-composer button {
  background: var(--fg);
  border: 0;
  border-radius: 999px;
  color: var(--bg);
  cursor: pointer;
  font: 24px/1 "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  height: 44px;
  padding: 0;
  position: absolute;
  right: 18px;
  top: 66px;
  width: 44px;
}

.chat-composer button:disabled {
  background: color-mix(in oklab, var(--fg), transparent 88%);
  color: color-mix(in oklab, var(--fg), transparent 52%);
  cursor: default;
}

.cat-pet {
  align-items: center;
  background: var(--fg);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: clamp(12px, 3vw, 36px);
  box-shadow: 0 12px 32px rgba(15, 15, 15, 0.07);
  display: flex;
  height: 54px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: clamp(0px, 3vw, 34px);
  width: 54px;
  z-index: 1;
}

.cat-pet[hidden] {
  display: none;
}

.cat-avatar {
  align-items: center;
  border-radius: 999px;
  color: var(--bg);
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.cat-icon {
  display: block;
  height: 34px;
  width: 34px;
}

.cat-icon path:first-child {
  fill: currentColor;
  stroke: none;
}

.cat-icon path:not(:first-child) {
  fill: none;
  stroke: var(--fg);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.6px;
}

.featured,
.notes-feature,
.project-index {
  display: grid;
  gap: 26px;
}

.featured-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.group-head {
  align-items: baseline;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.group-head .eyebrow {
  margin: 0;
  padding-top: 0;
  text-align: right;
}

.group-head h2 {
  order: -1;
}

h2 {
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 560;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.feature-card {
  color: inherit;
  display: grid;
  gap: 13px;
  min-width: 0;
  text-decoration: none;
}

.feature-card:hover,
.note-feature:hover,
.project-index a:hover,
.index-static:hover {
  color: var(--accent);
}

.feature-card:hover strong,
.note-feature:hover strong,
.project-index a:hover strong {
  color: var(--accent);
}

.feature-card.primary {
  grid-row: auto;
}

.feature-card.primary .work-media {
  min-height: 0;
}

.feature-card.primary .feature-mark {
  min-height: 0;
}

.feature-card strong {
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 650;
  line-height: 1.1;
}

.feature-card span:not(.work-media):not(.feature-mark),
.project-index span {
  color: var(--muted);
}

.feature-mark {
  align-content: center;
  aspect-ratio: 1.8;
  background: transparent;
  display: grid;
  font-family: inherit;
  font-size: clamp(30px, 5vw, 62px);
  font-weight: 560;
  justify-content: center;
  margin-bottom: 10px;
}

.notes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.note-feature {
  color: inherit;
  display: grid;
  gap: 6px;
  text-decoration: none;
}

.note-feature strong {
  font-size: 24px;
  font-weight: 650;
  line-height: 1.1;
}

.note-feature span {
  color: var(--muted);
}

.project-index {
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.index-group {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 0;
}

.index-group .eyebrow {
  align-self: start;
  grid-column: 1;
  grid-row: 1 / -1;
  justify-self: center;
  margin: 10px 0 0;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: 0.72;
  text-orientation: upright;
  transform: none;
  writing-mode: vertical-rl;
}

.project-index a,
.index-static {
  grid-column: 2;
}

.project-index a,
.index-static {
  color: inherit;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 0;
  text-decoration: none;
}

.project-index strong {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.15;
}

.project-index span {
  line-height: 1.35;
}

.showcase {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-card {
  border-top: 1px solid var(--line);
  color: inherit;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding-top: 16px;
  text-decoration: none;
}

.work-card-large {
  grid-column: span 2;
}

.work-card:hover {
  border-color: var(--line-strong);
}

.work-media {
  align-items: center;
  aspect-ratio: 1.45;
  background: transparent;
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.work-media picture,
.work-media img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.keyboard-media picture,
.keyboard-media img {
  height: 78%;
  object-fit: contain;
  width: 88%;
}

.geologic-media {
  padding: 18px;
}

.geologic-media img {
  height: 88%;
  object-fit: contain;
  width: 88%;
}

.cad-media {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
}

.cad-plate {
  border: 2px solid var(--fg);
  display: block;
  height: 44%;
  position: relative;
  transform: skewY(-9deg) rotate(-2deg);
  width: 66%;
}

.cad-plate span {
  border: 1px solid var(--accent);
  border-radius: 999px;
  height: 18%;
  position: absolute;
  width: 11%;
}

.cad-plate span:nth-child(1) { left: 13%; top: 18%; }
.cad-plate span:nth-child(2) { right: 13%; top: 18%; }
.cad-plate span:nth-child(3) { left: 13%; bottom: 18%; }
.cad-plate span:nth-child(4) { right: 13%; bottom: 18%; }
.cad-plate span:nth-child(5) {
  height: 30%;
  left: 42%;
  top: 35%;
  width: 16%;
}

.cad-dim {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  position: absolute;
}

.cad-dim-x {
  bottom: 12%;
  left: 45%;
}

.cad-dim-y {
  right: 11%;
  top: 45%;
}

.weshop-media,
.hardware-media {
  gap: 18px;
  padding: 18px;
}

.shop-phone {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  height: 82%;
  padding: 14px;
  width: 42%;
}

.shop-phone > span:first-child {
  align-content: end;
  background: color-mix(in oklab, var(--accent), transparent 84%);
  display: grid;
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px;
}

.shop-phone > span:not(:first-child),
.shop-api span,
.board-tags span {
  border: 1px solid var(--line);
}

.shop-phone > span:not(:first-child) {
  min-height: 22px;
}

.shop-api,
.board-tags {
  display: grid;
  gap: 8px;
}

.shop-api span,
.board-tags span {
  font-family: var(--mono);
  font-size: 13px;
  padding: 7px 9px;
}

.hardware-media {
  justify-content: space-around;
}

.board-preview {
  background:
    radial-gradient(circle at 18% 25%, rgba(255,255,255,0.72) 0 5px, transparent 6px),
    radial-gradient(circle at 82% 25%, rgba(255,255,255,0.72) 0 5px, transparent 6px),
    radial-gradient(circle at 18% 75%, rgba(255,255,255,0.72) 0 5px, transparent 6px),
    radial-gradient(circle at 82% 75%, rgba(255,255,255,0.72) 0 5px, transparent 6px),
    #416e5b;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 20px;
  width: 58%;
}

.board-preview span {
  background: rgba(255, 255, 255, 0.7);
  min-height: 34px;
}

.show-media {
  gap: 18px;
  padding: 18px;
}

.show-lanes {
  display: grid;
  gap: 8px;
  width: 62%;
}

.show-lanes span {
  display: block;
  height: 20px;
}

.show-lanes span:nth-child(1) { background: #3f5f73; width: 100%; }
.show-lanes span:nth-child(2) { background: #9b6f43; width: 52%; }
.show-lanes span:nth-child(3) { background: #4e7771; margin-left: 28%; width: 46%; }
.show-lanes span:nth-child(4) { background: #6d5f85; margin-left: 48%; width: 42%; }

.show-marks {
  display: grid;
  gap: 6px;
}

.show-marks span {
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 7px;
}

.photos-media {
  gap: 18px;
  padding: 18px;
}

.photo-mosaic {
  display: grid;
  gap: 4px;
  grid-template-columns: 1.3fr 0.8fr 1fr;
  grid-template-rows: 1fr 0.8fr 1.1fr;
  width: 60%;
}

.photo-mosaic span {
  background: color-mix(in oklab, var(--accent), var(--surface) 58%);
  min-height: 28px;
}

.photo-mosaic span:nth-child(1) { grid-row: span 2; }
.photo-mosaic span:nth-child(2) { background: #4e7771; }
.photo-mosaic span:nth-child(3) { background: #9b6f43; }
.photo-mosaic span:nth-child(5) { grid-column: span 2; background: #3f5f73; }

.photo-meta {
  display: grid;
  gap: 7px;
}

.photo-meta span {
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 8px;
}

.periodic-media {
  align-content: center;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  padding: 18px;
}

.periodic-media span {
  align-items: center;
  background: #8bc0da;
  color: #17120f;
  display: flex;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  min-height: 34px;
}

.periodic-media span:nth-child(1),
.periodic-media span:nth-child(6),
.periodic-media span:nth-child(7),
.periodic-media span:nth-child(8),
.periodic-media span:nth-child(16) { background: #b4ddb4; }
.periodic-media span:nth-child(2),
.periodic-media span:nth-child(10),
.periodic-media span:nth-child(18) { background: #a9b5e5; }
.periodic-media span:nth-child(3),
.periodic-media span:nth-child(11) { background: #f5a485; }
.periodic-media span:nth-child(4),
.periodic-media span:nth-child(12) { background: #f7cd7a; }
.periodic-media span:nth-child(5),
.periodic-media span:nth-child(14) { background: #acd28d; }
.periodic-media span:nth-child(9),
.periodic-media span:nth-child(17) { background: #88d2c9; }

.origami-media {
  gap: 18px;
  padding: 18px;
}

.paper-fold {
  background: color-mix(in oklab, var(--surface), white 12%);
  border: 2px solid var(--fg);
  display: block;
  height: 62%;
  position: relative;
  transform: rotate(-4deg);
  width: 48%;
}

.paper-fold span {
  display: block;
  position: absolute;
}

.paper-fold span:nth-child(1),
.paper-fold span:nth-child(2) {
  border-top: 2px dashed #2563eb;
  left: 0;
  top: 50%;
  width: 142%;
}

.paper-fold span:nth-child(1) { transform: rotate(45deg); transform-origin: left center; }
.paper-fold span:nth-child(2) { transform: rotate(-45deg); transform-origin: left center; }

.paper-fold span:nth-child(3),
.paper-fold span:nth-child(4) {
  border-top: 2px dotted #dc2626;
  width: 100%;
}

.paper-fold span:nth-child(3) { left: 0; top: 50%; }
.paper-fold span:nth-child(4) { left: 0; top: 50%; transform: rotate(90deg); }

.fold-key {
  display: grid;
  gap: 7px;
}

.fold-key span {
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 8px;
}

.milk-media {
  gap: 18px;
  padding: 18px;
}

.mouth-preview {
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, 1fr);
  padding: 18px 14px;
  width: 62%;
}

.mouth-preview span {
  background: #fffdf7;
  border: 1px solid #718983;
  border-radius: 45% 45% 55% 55%;
  min-height: 24px;
}

.mouth-preview span:nth-child(n + 6) {
  transform: rotate(180deg);
}

.milk-months {
  display: grid;
  gap: 7px;
}

.milk-months span {
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 8px;
}

.gridpaper-media {
  gap: 18px;
  padding: 18px;
}

.paper-grid {
  background: #fff;
  box-shadow: 0 12px 26px rgba(16, 22, 26, 0.14);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  height: 72%;
  width: 52%;
}

.paper-grid span {
  border-bottom: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
}

.gridpaper-tags {
  display: grid;
  gap: 7px;
}

.gridpaper-tags span {
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 8px;
}

.utility-card {
  cursor: default;
}

.starflash-media {
  padding: 18px;
}

.terminal-preview {
  background: #171513;
  color: #f2ece5;
  display: grid;
  font-family: var(--mono);
  font-size: 12px;
  gap: 8px;
  padding: 18px;
  width: 82%;
}

.terminal-preview span::before {
  color: #ddb39c;
  content: "$ ";
}

.work-copy {
  display: grid;
  gap: 4px;
}

.work-copy strong {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.1;
}

.work-copy span {
  color: var(--muted);
  line-height: 1.4;
}

.hanzi-grid,
.ipa-media,
.unicode-media {
  display: grid;
  gap: 1px;
}

.hanzi-grid {
  grid-template-columns: repeat(4, 1fr);
}

.hanzi-grid span {
  align-items: center;
  display: flex;
  font-family: ui-serif, "Songti SC", STSong, "Noto Serif CJK SC", "Noto Serif CJK TC", serif;
  font-size: clamp(24px, 4vw, 46px);
  justify-content: center;
}

.hanzi-grid span:nth-child(11) {
  font-size: clamp(14px, 2vw, 22px);
}

.ipa-media,
.unicode-media {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px;
}

.ipa-media span,
.unicode-media span {
  align-items: center;
  background: color-mix(in oklab, var(--surface), transparent 12%);
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 10px 6px;
}

.ipa-media span {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(20px, 3vw, 34px);
}

.unicode-media span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(12px, 1.6vw, 17px);
}

.infra-media {
  align-content: center;
  display: grid;
  gap: 8px;
  padding: 22px;
}

.infra-media span {
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 8px 10px;
}

.note-media {
  align-content: center;
  display: grid;
  gap: 10px;
  justify-content: stretch;
  padding: 22px;
}

.note-media span {
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 7px 0;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .featured-grid,
  .project-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .showcase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card-large {
    grid-column: span 2;
  }

}

@media (max-width: 620px) {
  .topline {
    align-items: flex-start;
  }

  .topline nav {
    gap: 10px;
  }

  .hero {
    min-height: clamp(360px, calc(100svh - 330px), 500px);
    padding: 20px 0 14px;
  }

  h1 {
    max-width: 14ch;
  }

  .cat-pet {
    display: none;
  }

  .keyword-field {
    color: color-mix(in oklab, var(--fg), transparent 93%);
    font-size: 12px;
  }

  .keyword-field span:nth-child(2),
  .keyword-field span:nth-child(6),
  .keyword-field span:nth-child(7),
  .keyword-field span:nth-child(8),
  .keyword-field span:nth-child(11),
  .keyword-field span:nth-child(13),
  .keyword-field span:nth-child(14),
  .keyword-field span:nth-child(15),
  .keyword-field span:nth-child(16) {
    display: none;
  }

  .keyword-field span:nth-child(1) { left: 7%; top: 12%; }
  .keyword-field span:nth-child(3) { right: 6%; top: 18%; }
  .keyword-field span:nth-child(4) { left: 4%; top: 61%; }
  .keyword-field span:nth-child(5) { right: 4%; top: 55%; }
  .keyword-field span:nth-child(9) { right: 14%; top: 31%; }
  .keyword-field span:nth-child(10) { left: 5%; top: 39%; }
  .keyword-field span:nth-child(12) { left: 46%; top: 89%; }

  .group-head {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .group-head .eyebrow {
    margin: 0 0 10px;
    padding-top: 0;
    text-align: left;
  }

  .featured-grid,
  .project-index,
  .showcase,
  .work-card-large {
    grid-template-columns: 1fr;
  }

  .feature-card.primary {
    grid-row: auto;
  }

  .feature-card.primary .work-media {
    min-height: 0;
  }

  .work-card-large {
    grid-column: auto;
  }

  .work-media {
    aspect-ratio: 1.35;
  }

  .index-group {
    grid-template-columns: 1fr;
  }

  .index-group .eyebrow {
    grid-column: auto;
    grid-row: auto;
    margin-bottom: 8px;
    transform: none;
    writing-mode: horizontal-tb;
  }

  .project-index a,
  .index-static {
    grid-column: auto;
  }
}
