/* Linu Teresa portfolio: tokens, type, layout, components */

:root {
  --paper: #eef1f6;
  --ink: #1b2033;
  --ink-soft: #4a5168;
  --cobalt: #2446f0;
  --mist: #d5dbe8;
  --flash: #f5c84b;

  --display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 74rem;
  --measure: 38rem;

  /* wipe transition */
  --wipe-accent: var(--cobalt);
  --wipe-base: 90px;
  --wipe-full: 520px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--cobalt);
}

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 200;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
}

.brand {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 500;
}

.nav a {
  display: inline-block;
  padding: 0.25rem 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  border-bottom-color: var(--mist);
  color: var(--ink);
}

.nav a[aria-current="page"] {
  border-bottom-color: var(--cobalt);
}

/* ---------- page frame ---------- */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) var(--gutter) clamp(3rem, 8vw, 7rem);
}

.page-title,
.intro h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: "wdth" 88;
  font-size: clamp(2.5rem, 7.2vw, 5.75rem);
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 17ch;
}

.lede {
  max-width: var(--measure);
  margin: 1.75rem 0 0;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-soft);
}

.lede a {
  color: var(--ink);
}

.section-title {
  margin: clamp(4rem, 9vw, 7rem) 0 1.25rem;
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: "wdth" 90;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* ---------- projects ---------- */

.projects {
  margin-top: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--ink);
}

.project {
  display: grid;
  gap: 1rem 3rem;
  padding: clamp(1.75rem, 4vw, 2.75rem) 0;
  border-bottom: 1px solid var(--mist);
}

@media (min-width: 56em) {
  .project {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

.project__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 650;
  font-variation-settings: "wdth" 90;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.project__title a {
  text-decoration: none;
}

.project__title a:hover {
  color: var(--cobalt);
}

.project__story {
  margin: 0 0 1rem;
  max-width: var(--measure);
}

.project__tech {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.project__link {
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ---------- definition rows (experience, skills, contact) ---------- */

.rows {
  margin: 0;
  border-top: 1px solid var(--ink);
}

.rows > div {
  display: grid;
  gap: 0.25rem 3rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--mist);
}

@media (min-width: 40em) {
  .rows > div {
    grid-template-columns: minmax(9rem, 1fr) minmax(0, 3fr);
  }
}

.rows dt {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.rows dd {
  margin: 0;
  max-width: var(--measure);
}

.rows dd p {
  margin: 0 0 0.5rem;
}

.rows dd p:last-child {
  margin-bottom: 0;
}

/* ---------- about ---------- */

.about {
  display: grid;
  gap: 2.5rem 4rem;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

@media (min-width: 56em) {
  .about {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
}

.about__photo img {
  width: 100%;
  max-width: 28rem;
  border: 1px solid var(--mist);
}

.prose p {
  margin: 0 0 1.25rem;
  max-width: var(--measure);
}

.prose a {
  color: var(--cobalt);
}

/* ---------- contact ---------- */

.contact-list {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.contact-list a {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---------- photography ---------- */

.gallery {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  columns: 2 14rem;
  column-gap: clamp(0.75rem, 2vw, 1.5rem);
}

@media (min-width: 64em) {
  .gallery {
    columns: 3;
  }
}

.gallery__item {
  display: block;
  width: 100%;
  margin: 0 0 clamp(0.75rem, 2vw, 1.5rem);
  padding: 0;
  border: 0;
  background: var(--mist);
  cursor: zoom-in;
  break-inside: avoid;
}

.gallery__item img {
  width: 100%;
  height: auto;
}

.gallery__item:hover img {
  opacity: 0.92;
}

.gallery__empty {
  margin-top: 2.5rem;
  max-width: var(--measure);
  color: var(--ink-soft);
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(238, 241, 246, 0.97);
  color: var(--ink);
}

.lightbox::backdrop {
  background: rgba(238, 241, 246, 0.97);
}

.lightbox__stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
  padding: clamp(3.5rem, 8vh, 5rem) clamp(1rem, 6vw, 5rem) clamp(1rem, 3vh, 2rem);
}

.lightbox__img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox__caption {
  min-height: 1.5em;
  margin: 0;
  text-align: center;
  font-size: 1rem;
  color: var(--ink-soft);
}

.lightbox__btn {
  position: absolute;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.lightbox__btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev {
  left: 0.75rem;
}

.lightbox__next {
  right: 0.75rem;
}

/* ---------- footer ---------- */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--mist);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-family: var(--display);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------- page-transition wipe ---------- */

.wipe {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1000;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(1.5);
  pointer-events: none;
  visibility: hidden;
}

.wipe svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wipe path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* --len is each path's length in SVG units (measured; keep in sync with the path data) */
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
  stroke-width: var(--wipe-base);
}

.wipe__paper {
  --len: 2413;
  stroke: var(--paper);
}

.wipe__accent {
  --len: 2603;
  stroke: var(--wipe-accent);
}

.wipe.is-active {
  visibility: visible;
}

/* A new page that arrives mid-wipe starts fully covered. */
.wipe-cover .wipe {
  visibility: visible;
  animation: wipe-failsafe 0s linear 3s forwards;
}

.wipe-cover .wipe path {
  stroke-dashoffset: 0;
  stroke-width: var(--wipe-full);
}

.wipe-cover[data-wipe="photo"] {
  --wipe-accent: var(--flash);
}

@keyframes wipe-failsafe {
  to {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wipe {
    display: none;
  }
}

/* ---------- small screens ---------- */

@media (max-width: 36em) {
  body {
    font-size: 1.125rem;
  }

  .nav {
    gap: 0.25rem 1.25rem;
  }

  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: 1rem;
    transform: none;
  }
}

/* =========================================================
   Homepage
   ========================================================= */

:root {
  /* left edge of the content column, used so the reel lines up with the text but bleeds right */
  --edge: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}

.wrap {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.home .site-footer {
  margin-top: 0;
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(2.5rem, 8vw, 6.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.hero__kicker {
  margin: 0 0 1.5rem;
  max-width: 34rem;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-soft);
}

.hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 750;
  font-variation-settings: "wdth" 84;
  font-size: clamp(2.9rem, 7.6vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  max-width: 13ch;
}

/* each word sits in a clipping box so it can rise into view */
.hero__title .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.hero__title .w > span {
  display: inline-block;
}

.hero__squiggle {
  display: block;
  width: min(100%, 60rem);
  height: auto;
  margin: clamp(1rem, 2.5vw, 1.75rem) 0 0;
  overflow: visible;
}

.hero__squiggle path {
  fill: none;
  stroke: var(--cobalt);
  stroke-width: 38;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 40em) {
  .hero__squiggle path {
    stroke-width: 26;
  }
}

.hero__foot {
  display: grid;
  gap: 1.5rem 4rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 56em) {
  .hero__foot {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    align-items: end;
  }
}

.hero__lede {
  margin: 0;
  max-width: var(--measure);
  font-size: clamp(1.2rem, 1.9vw, 1.4rem);
  line-height: 1.5;
}

.hero__cta p {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.button {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.button:hover {
  background: var(--cobalt);
  color: var(--paper);
}

/* hero entrance: hidden only until home.js plays it (or the failsafe shows it) */
.hero-pending .hero__title .w > span {
  transform: translateY(105%);
  animation: hero-failsafe 0s linear 2.5s forwards;
}

.hero-pending .hero__foot {
  opacity: 0;
  animation: hero-failsafe 0s linear 2.5s forwards;
}

.hero-pending .hero__squiggle path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: hero-failsafe 0s linear 2.5s forwards;
}

@keyframes hero-failsafe {
  to {
    transform: none;
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

/* ---------- work reel ---------- */

.work {
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

.reel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.reel-head .section-title {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4rem);
  letter-spacing: -0.035em;
}

.reel-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reel-hint {
  margin: 0 0.75rem 0 0;
  font-family: var(--display);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.reel-count {
  min-width: 3.5em;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.reel-btn {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.reel-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reel-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}

.reel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.reel__track {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--edge);
  padding: 0.25rem var(--edge) 1.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.reel__track::-webkit-scrollbar {
  display: none;
}

.reel__track:focus-visible {
  outline-offset: -3px;
}

@media (pointer: fine) {
  .reel__track {
    cursor: grab;
  }
}

.reel__track.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.reel__track.is-dragging a {
  pointer-events: none;
}

.panel {
  flex: 0 0 min(84vw, 30rem);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.panel__art {
  --art-fg: var(--paper);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--art-bg);
}

.panel__art--light {
  --art-fg: var(--ink);
}

.panel__art svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.panel:hover .panel__art svg {
  transform: scale(1.04);
}

.panel__art .ln {
  fill: none;
  stroke: var(--art-fg);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel__art .ln.thick {
  stroke-width: 9;
}

.panel__art .ln.dashed {
  stroke-width: 4;
  stroke-dasharray: 2 14;
}

.panel__art .ln.track {
  stroke-width: 26;
  opacity: 0.18;
}

.panel__art .hot-ln {
  stroke: var(--flash);
  stroke-width: 10;
}

.panel__art .n {
  fill: var(--art-bg);
}

.panel__art .hot {
  fill: var(--flash);
  stroke: none;
}

.panel__art .cell,
.panel__art .dot,
.panel__art .fill-paper {
  fill: var(--art-fg);
}

.panel__art .eye {
  fill: var(--art-bg);
}

.panel__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 1.25rem;
}

.panel__title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: "wdth" 88;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.panel__story {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.panel__tech {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.panel__link {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 600;
}

.reel-progress {
  position: relative;
  height: 3px;
  margin-top: 0.5rem;
}

.reel-progress::before,
.reel-progress__bar {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 0;
  height: 100%;
}

.reel-progress::before {
  background: var(--mist);
}

.reel-progress__bar {
  background: var(--cobalt);
  transform-origin: left center;
  transform: scaleX(0.14);
  transition: transform 0.15s linear;
}

/* the circle that follows the mouse over the reel */
.reel-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  margin: -2.75rem 0 0 -2.75rem;
  border-radius: 50%;
  background: var(--cobalt);
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-200px, -200px, 0) scale(0.4);
  transition: opacity 0.2s ease, scale 0.2s ease;
}

.reel-cursor.is-visible {
  opacity: 1;
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .reel-cursor {
    display: none;
  }
}

/* ---------- the other side of me band ---------- */

.other-side {
  display: block;
  background: var(--flash);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
}

.other-side:hover {
  color: var(--ink);
}

.other-side__inner {
  display: grid;
  gap: 1rem 3rem;
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

@media (min-width: 56em) {
  .other-side__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    align-items: end;
  }
}

.other-side__title {
  font-family: var(--display);
  font-weight: 750;
  font-variation-settings: "wdth" 84;
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.25s ease;
}

.other-side:hover .other-side__title,
.other-side:focus-visible .other-side__title {
  text-decoration-color: var(--ink);
}

.other-side__text {
  max-width: 24rem;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.45;
}

.other-side:focus-visible {
  outline-offset: -6px;
  outline-color: var(--ink);
}

.closing {
  margin: clamp(3rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  color: var(--ink-soft);
}

.closing a {
  color: var(--ink);
}

@media (max-width: 36em) {
  .reel-hint {
    display: none;
  }

  .reel-btn {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* ---------- pinned reel (desktop: page scroll moves projects sideways) ---------- */

.work.is-pinned {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.reel__track.is-pinned {
  overflow-x: hidden;
  scroll-snap-type: none;
}

/* in a column flexbox, auto side margins would shrink the header to its content */
.work.is-pinned > .reel-head,
.work.is-pinned > .reel {
  width: 100%;
}

/* keep a whole panel, and the progress bar, on screen on shorter laptop screens:
   the illustration gives up height, the text keeps its width */
.reel__track.is-pinned .panel__art {
  aspect-ratio: auto;
  height: clamp(11rem, calc(100vh - 28rem), 22.5rem);
}

#experience {
  scroll-margin-top: 1.5rem;
}

/* =========================================================
   Toolkit (skills) and stamps (certifications)
   ========================================================= */

.toolkit {
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(2rem, 4vw, 3rem);
  /* stamps start oversized before they "land"; don't let them widen the page */
  overflow-x: clip;
}

.toolkit__head {
  display: grid;
  gap: 0.75rem 3rem;
  align-items: end;
}

@media (min-width: 56em) {
  .toolkit__head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  }
}

.toolkit__head .section-title {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4rem);
  letter-spacing: -0.035em;
}

.toolkit__lede {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.toolkit__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* a swatch showing which tile colour belongs to the category */
.chip[class*="chip--"]:not(.chip--shake)::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1.5px var(--swatch-line, transparent);
}

.chip:hover {
  background: var(--mist);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.chip--shake {
  margin-left: auto;
  border-style: dashed;
}

.chip--ai { --swatch: var(--cobalt); }
.chip--ml { --swatch: var(--ink); --swatch-line: var(--paper); }
.chip--data { --swatch: var(--flash); }
.chip--backend { --swatch: var(--mist); --swatch-line: var(--ink); }
.chip--platform { --swatch: #fff; --swatch-line: var(--ink); }
.chip--lang { --swatch: var(--paper); --swatch-line: var(--cobalt); }

/* --- the box of tiles: a wrapped list by default, a physics pile when JS takes over --- */

.toolkit__box {
  position: relative;
}

.toolkit__tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-radius: 4px;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.tile--big {
  padding: 0.75rem 1.15rem;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tile--ai { background: var(--cobalt); color: var(--paper); }
.tile--ml { background: var(--ink); color: var(--paper); }
.tile--data { background: var(--flash); color: var(--ink); }
.tile--backend { background: var(--mist); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.tile--platform { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.tile--lang { background: var(--paper); color: var(--cobalt); box-shadow: inset 0 0 0 2px var(--cobalt); }

.tile.is-dim {
  opacity: 0.16;
  filter: grayscale(1);
}

.toolkit__box.is-physics {
  height: clamp(26rem, 60vh, 32rem);
  overflow: hidden;
  border-bottom: 3px solid var(--ink);
  touch-action: pan-y;
}

.toolkit__box.is-physics .toolkit__tiles {
  display: block;
  height: 100%;
}

.toolkit__box.is-physics .tile {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.toolkit__box.is-physics .tile.is-dropped {
  visibility: visible;
}

@media (pointer: fine) {
  .toolkit__box.is-physics {
    cursor: grab;
  }

  .toolkit__box.is-physics.is-grabbing {
    cursor: grabbing;
  }
}

/* --- stamps --- */

.stamps-head {
  display: grid;
  gap: 0.5rem 3rem;
  align-items: end;
  margin-top: clamp(4rem, 8vw, 6rem);
}

@media (min-width: 56em) {
  .stamps-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  }
}

.stamps-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: "wdth" 90;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.stamps-lede {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.stamps-lede a {
  color: var(--ink);
}

.stamps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 2.5vw, 2rem);
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: clamp(1rem, 2vw, 1.5rem) 0.5rem;
  list-style: none;
}

.stamp {
  --ink-col: var(--cobalt);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 11.5rem;
  padding: 1.4rem 1.25rem;
  border: 3px solid var(--ink-col);
  border-radius: 10px;
  color: var(--ink-col);
  text-align: center;
  transform: rotate(var(--r, 0deg));
  /* a little ink unevenness so they read as rubber stamps, not cards */
  -webkit-mask-image: radial-gradient(circle at 20% 30%, #000 0 55%, rgba(0, 0, 0, 0.82) 75%, #000 100%);
  mask-image: radial-gradient(circle at 20% 30%, #000 0 55%, rgba(0, 0, 0, 0.82) 75%, #000 100%);
}

.stamp::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.5px solid var(--ink-col);
  border-radius: 6px;
  pointer-events: none;
}

.stamp--ibm {
  --ink-col: var(--ink);
}

.stamp--feature {
  --ink-col: var(--ink);
  background: var(--flash);
}

.stamp__issuer {
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stamp__name {
  max-width: 15rem;
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 700;
  font-variation-settings: "wdth" 88;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.stamp__date {
  padding-top: 0.45rem;
  border-top: 1.5px dashed currentColor;
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 600;
}

.stamp__extra {
  font-size: 0.875rem;
  font-style: italic;
}

.chip[hidden] {
  display: none;
}
