/* Keynote: a project or research entry as a bento of dark glass tiles
   (static/js/keynote.js). Sizes inside the grid are in cqw, hundredths of
   the grid's width, so the whole composition scales as one piece; on phones
   it becomes a column with fixed type sizes. */

.keynote-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  background: radial-gradient(120% 90% at 20% 0%, #141a33 0%, #070912 60%, #05060b 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.keynote-overlay.is-displayed {
  display: block;
}

.keynote-overlay.is-visible {
  opacity: 1;
}

html.has-keynote,
html.has-keynote body {
  overflow: hidden;
}

.keynote {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  color: #f5f5f7;
  font-family: var(--font-system, -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', Arial, sans-serif);
  -webkit-font-smoothing: antialiased;
}

.keynote ::selection {
  background: #fff;
  color: #0f172a;
}

.keynote-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 70px;
  padding: 0 76px 0 28px;
}

.keynote-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-right: auto;
}

.keynote-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.keynote-count {
  font-size: 14px;
  font-weight: 500;
  color: rgba(235, 235, 245, 0.38);
  font-variant-numeric: tabular-nums;
}

.keynote-pager {
  display: flex;
  gap: 8px;
}

.keynote .round {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  color: #f5f5f7;
  cursor: pointer;
  transition: background 0.25s, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.keynote .round:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}

.keynote .round:active {
  transform: scale(0.92);
}

.keynote-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 5;
}

.keynote-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
}

.keynote-footer {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 78px;
  padding: 14px 28px 20px;
}

.keynote-footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.keynote .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  color: #f5f5f7;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.keynote .pill:hover {
  background: rgba(255, 255, 255, 0.22);
}

.keynote .pill.is-solid {
  background: #f5f5f7;
  box-shadow: none;
  color: #0b0d12;
}

.keynote .pill.is-solid:hover {
  background: #fff;
}

.keynote .pill.is-quiet {
  background: none;
  box-shadow: none;
  color: #64d2ff;
}

@media (max-width: 760px) {
  .keynote-bar {
    padding: 0 62px 0 16px;
  }

  .keynote-close {
    right: 12px;
  }

  .keynote-stage {
    display: block;
    padding: 0 14px;
    overflow-y: auto;
  }
}

/* ------------------------------------------------------------------ bento */
.bento {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 0.9cqw;
  width: min(100%, calc((100dvh - 172px) * 16 / 9), 1560px);
  aspect-ratio: 16 / 9;
}

.bento .tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 1.75cqw;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  opacity: 0;
  transform: translateY(3.2cqw) scale(0.93);
  filter: blur(12px);
  transition:
    opacity 0.85s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 1.05s cubic-bezier(0.18, 0.9, 0.24, 1.04),
    filter 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--order, 0) * 60ms);
}

/* A soft light follows the pointer across each tile. */
.bento .tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(34cqw circle at var(--light-x, 50%) var(--light-y, -20%), rgba(255, 255, 255, 0.11), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.bento .tile:hover::after {
  opacity: 1;
}

.bento .tile.is-emphasis {
  background: rgba(255, 255, 255, 0.11);
}

.bento.is-in .tile {
  opacity: 1;
  transform: none;
  filter: none;
}

.bento.is-leaving .tile {
  opacity: 0;
  transform: scale(0.97);
  filter: blur(6px);
  transition-duration: 0.2s;
  transition-delay: 0s;
}

.bento .heading {
  font-size: 1.08cqw;
  font-weight: 600;
  color: rgba(235, 235, 245, 0.38);
}

/* Hero */
.bento .hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.7cqw 2.1cqw;
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    rgba(255, 255, 255, 0.07);
}

.bento .hero .kicker {
  margin: 0 0 0.8cqw;
  font-size: 0.95cqw;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.bento .hero .name {
  font-size: 4.7cqw;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.bento .hero.is-medium .name {
  font-size: 3.7cqw;
}

.bento .hero.is-long .name {
  font-size: 2.7cqw;
}

.bento .hero .line {
  margin-top: 0.75cqw;
  font-size: 1.62cqw;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.22;
  color: rgba(235, 235, 245, 0.62);
}

.bento .hero .meta {
  margin-top: 0.95cqw;
  font-size: 1.06cqw;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(235, 235, 245, 0.38);
}

.bento .tile.hero.is-themed {
  background: var(--hero-bg);
  box-shadow: none;
  color: var(--hero-ink);
}

.bento .tile.hero.is-themed .kicker,
.bento .tile.hero.is-themed .line,
.bento .tile.hero.is-themed .meta {
  color: var(--hero-ink);
}

.bento .tile.hero.is-themed .line {
  opacity: 0.84;
}

.bento .tile.hero.is-themed .kicker,
.bento .tile.hero.is-themed .meta {
  opacity: 0.6;
}

.bento .tile.hero .mark {
  position: absolute;
  top: 1.5cqw;
  right: 1.5cqw;
  width: 3.3cqw;
  height: 3.3cqw;
  overflow: hidden;
  border-radius: 0.85cqw;
  background: #fff;
  box-shadow: 0 0.5cqw 1.4cqw rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.bento .tile.hero .mark img {
  width: 100%;
  height: 100%;
  padding: 12%;
  object-fit: contain;
}

/* Stat */
.bento .stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.9cqw 1.4cqw;
}

.bento .stat .value {
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.bento .stat .label {
  margin-top: 0.5cqw;
  font-size: 1.04cqw;
  font-weight: 500;
  line-height: 1.25;
  color: rgba(235, 235, 245, 0.62);
}

/* Image */
.bento .image {
  background: #000;
}

.bento .image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  transition: transform 7s cubic-bezier(0.1, 0.6, 0.2, 1);
  transition-delay: calc(var(--order, 0) * 60ms);
}

.bento.is-in .image img {
  transform: scale(1);
}

.bento .image .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3.6cqw 1.4cqw 1.1cqw;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  font-size: 1.17cqw;
  font-weight: 600;
  line-height: 1.28;
}

/* The product's first picture sits in the browser window it runs in. */
.bento .tile.image.is-window {
  display: flex;
  padding: 1.5cqw 1.5cqw 0;
  background: color-mix(in srgb, var(--accent) 24%, #0c0e12);
}

.bento .tile.image.is-window .window {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.9cqw 0.9cqw 0 0;
  background: #17181c;
  box-shadow: 0 1.6cqw 3.6cqw rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(128, 128, 128, 0.26);
}

.bento .tile.image.is-window .bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.45cqw;
  height: 2.1cqw;
  padding: 0 0.9cqw;
  background: #1d1e23;
}

.bento .tile.image.is-window .bar i {
  width: 0.62cqw;
  height: 0.62cqw;
  border-radius: 50%;
  background: #ff5f57;
}

.bento .tile.image.is-window .bar i:nth-child(2) {
  background: #febc2e;
}

.bento .tile.image.is-window .bar i:nth-child(3) {
  background: #28c840;
}

.bento .tile.image.is-window .bar span {
  margin-left: 0.8cqw;
  font-size: 0.85cqw;
  font-weight: 500;
  color: rgba(235, 235, 245, 0.45);
}

.bento .tile.image.is-window img {
  position: static;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top;
  transform: none;
}

/* Live */
.bento .live {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(90% 90% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.05);
}

.bento .live canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
}

.bento .live .note {
  padding: 0.4cqw 1.3cqw 0.95cqw;
  font-size: 1.04cqw;
  font-weight: 500;
  line-height: 1.25;
  color: rgba(235, 235, 245, 0.62);
}

/* Steps */
.bento .steps {
  display: flex;
  flex-direction: column;
  padding: 1.25cqw 1.7cqw 1.4cqw;
}

.bento .steps .row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  margin-top: 0.4cqw;
}

.bento .steps .step {
  flex: 1;
  min-width: 0;
  opacity: 0.62;
  transition: opacity 0.6s;
}

.bento .steps .step.is-active,
.bento .steps .step.is-done {
  opacity: 1;
}

.bento .steps .track {
  height: 0.22cqw;
  margin-bottom: 0.85cqw;
  overflow: hidden;
  border-radius: 0.11cqw;
  background: rgba(255, 255, 255, 0.14);
}

.bento .steps .fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.bento .steps .step.is-done .fill {
  transform: scaleX(1);
}

.bento .steps .step.is-active .fill {
  transform: scaleX(1);
  transition: transform var(--step-duration, 1900ms) linear;
}

.bento .steps .n {
  font-size: 1cqw;
  font-weight: 700;
  color: rgba(235, 235, 245, 0.38);
}

.bento .steps .t {
  margin-top: 0.2cqw;
  font-size: 1.5cqw;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.bento .steps .d {
  margin-top: 0.4cqw;
  font-size: 1.04cqw;
  font-weight: 500;
  line-height: 1.28;
  color: rgba(235, 235, 245, 0.62);
}

.bento .steps.is-compact .row {
  gap: 0.9cqw;
}

.bento .steps.is-compact .t {
  font-size: 1.28cqw;
}

.bento .steps.is-compact .d {
  font-size: 0.96cqw;
}

/* List */
.bento .list {
  display: flex;
  flex-direction: column;
  padding: 1.25cqw 1.7cqw;
}

.bento .list .rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  margin-top: 0.3cqw;
}

.bento .list .item {
  font-size: 1.13cqw;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(235, 235, 245, 0.62);
}

.bento .list .item b {
  font-weight: 700;
  color: #f5f5f7;
}

/* Text */
.bento .text {
  display: flex;
  align-items: center;
  padding: 1.1cqw 1.7cqw;
  font-size: 1.34cqw;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.bento .text.is-small {
  font-size: 1.13cqw;
  font-weight: 500;
  color: rgba(235, 235, 245, 0.62);
}

/* Phones: one column and fixed type sizes */
@media (max-width: 760px) {
  .bento {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    aspect-ratio: auto;
    padding-bottom: 20px;
  }

  .bento .tile {
    flex: none;
    border-radius: 22px;
    transform: translateY(24px) scale(0.97);
  }

  .bento .heading {
    font-size: 13px;
  }

  .bento .hero {
    padding: 22px;
  }

  .bento .hero .kicker {
    font-size: 11px;
  }

  .bento .hero .name,
  .bento .hero.is-medium .name,
  .bento .hero.is-long .name {
    font-size: 34px;
  }

  .bento .hero .line {
    margin-top: 8px;
    font-size: 18px;
  }

  .bento .hero .meta {
    margin-top: 10px;
    font-size: 13.5px;
  }

  .bento .tile.hero .mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .bento .stat {
    padding: 18px 20px;
  }

  .bento .stat .value {
    font-size: 40px !important;
  }

  .bento .stat .label {
    margin-top: 6px;
    font-size: 15px;
  }

  .bento .image {
    aspect-ratio: 16 / 10;
  }

  .bento .image .caption {
    padding: 40px 16px 14px;
    font-size: 14.5px;
  }

  .bento .tile.image.is-window {
    padding: 12px 12px 0;
  }

  .bento .tile.image.is-window .bar {
    height: 22px;
  }

  .bento .tile.image.is-window .bar i {
    width: 8px;
    height: 8px;
  }

  .bento .tile.image.is-window .bar span {
    font-size: 11px;
  }

  .bento .live canvas {
    flex: none;
    aspect-ratio: 16 / 10;
  }

  .bento .live .note {
    padding: 6px 16px 13px;
    font-size: 14px;
  }

  .bento .steps {
    padding: 18px 20px;
  }

  .bento .steps .row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-top: 14px;
  }

  .bento .steps .track {
    height: 3px;
    margin-bottom: 9px;
  }

  .bento .steps .n {
    font-size: 12.5px;
  }

  .bento .steps .t,
  .bento .steps.is-compact .t {
    font-size: 18px;
  }

  .bento .steps .d,
  .bento .steps.is-compact .d {
    margin-top: 4px;
    font-size: 14.5px;
  }

  .bento .list {
    padding: 18px 20px;
  }

  .bento .list .rows {
    gap: 12px;
    margin-top: 12px;
  }

  .bento .list .item {
    font-size: 15px;
  }

  .bento .text {
    padding: 18px 20px;
    font-size: 17px;
  }

  .bento .text.is-small {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bento .tile,
  .bento .image img {
    transition: none;
    transform: none;
    filter: none;
  }
}
