/* /built/: everything the studio has built, live. Layered on
   /insights/article.css, so it keeps the pastel paper and ink type.
   A wall in three columns where every tile keeps the shape of its medium:
   websites in a browser frame that scrolls the real page on hover, apps
   as a phone on the product's own ground, hardware as the photograph.
   Copied to public/built/. */

.is-built main { overflow-x: clip; }

.b-head,
.b-filter,
.b-grid {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

/* ------------------------------------------------------------------ head */

.b-head { padding-top: clamp(4rem, 9vw, 7.5rem); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.b-head h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.75rem, 7.2vw, 6rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
html[lang='ja'] .b-head h1 { max-width: 12em; font-size: clamp(2.25rem, 5.6vw, 4.75rem); letter-spacing: -0.02em; line-height: 1.12; word-break: auto-phrase; }
.b-lede {
  max-width: 40rem;
  margin: 1.5rem 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- filter */

.b-filter {
  position: sticky;
  top: var(--nav-h, 72px);
  z-index: 20;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}
.b-filter::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, var(--paper) 70%, rgba(251, 243, 234, 0));
}
.b-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.b-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  height: 2.5rem;
  padding: 0 1rem;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: 500 0.92rem/1 var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.25s var(--e-out), color 0.25s var(--e-out), box-shadow 0.25s var(--e-out);
  -webkit-tap-highlight-color: transparent;
}
.b-chip:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.b-chip[aria-pressed='true'] { background: var(--ink); color: var(--paper); box-shadow: none; }
.b-n { font: 400 0.78rem/1 var(--mono); font-variant-numeric: tabular-nums; opacity: 0.6; }

/* ------------------------------------------------------------------ wall */

.b-grid {
  list-style: none;
  margin-top: 0;
  margin-bottom: 0;
  columns: 3 300px;
  column-gap: clamp(1rem, 2.2vw, 2rem);
  padding-bottom: clamp(4rem, 9vw, 7rem);
}
.b-tile {
  break-inside: avoid;
  margin: 0 0 clamp(2rem, 3.6vw, 3rem);
}
.b-tile[hidden] { display: none; }
/* Filtered to one kind, a few tiles would leave a column empty, so the wall
   becomes a plain grid that fills left to right. */
.b-grid[data-k]:not([data-k='all']) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  column-gap: clamp(1rem, 2.2vw, 2rem);
  align-items: start;
}
.b-link { display: block; color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent; }

/* every medium sits on a plate with the site's soft lift */
.b-frame,
.b-panel {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.4s var(--e-out), translate 0.5s var(--e-out);
}
.b-link:hover .b-frame,
.b-link:hover .b-panel,
.b-link:focus-visible .b-frame,
.b-link:focus-visible .b-panel {
  translate: 0 -4px;
  box-shadow: 0 2px 4px rgba(11, 13, 20, 0.05), 0 24px 48px -12px rgba(40, 20, 60, 0.26);
}

/* websites: a browser, and the live page scrolls inside it on hover */
.b-frame { background: var(--paper-2); }
.b-chrome {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line-soft);
}
.b-chrome i { width: 8px; height: 8px; border-radius: 50%; background: rgba(11, 13, 20, 0.14); }
.b-url {
  flex: 1;
  margin: 0 22px 0 8px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(11, 13, 20, 0.05);
  color: var(--ink-3);
  font: 400 0.7rem/1.2 var(--mono);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.b-screen {
  display: block;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  container-type: size;
}
.b-screen img {
  display: block;
  width: 100%;
  height: auto;
  translate: 0 0;
  transition: translate 1.2s var(--e-out);
}
.is-still .b-screen { aspect-ratio: 16 / 10; }
.b-link:hover .b-frame:not(.is-still) img,
.b-link:focus-visible .b-frame:not(.is-still) img,
.b-tile.is-live .b-frame:not(.is-still) img {
  translate: 0 calc(-100% + 100cqh);
  transition: translate 7s cubic-bezier(0.45, 0, 0.55, 1) 0.15s;
}

/* apps: the real screen in a phone, rising out of the product's ground */
.b-panel { background: var(--g); }
.b-panel-phone { aspect-ratio: 4 / 4.6; }
.b-phone {
  position: absolute;
  left: 50%;
  top: 11%;
  width: 54%;
  translate: -50% 0;
  padding: 2.4%;
  background: #0a0a0b;
  border-radius: 13% / 6%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  transition: translate 0.7s var(--e-out);
}
.b-phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: 50% 0;
  border-radius: 11% / 5.2%;
}
.b-link:hover .b-phone,
.b-link:focus-visible .b-phone { translate: -50% -5%; }

.b-panel-art { aspect-ratio: 4 / 4.2; display: grid; place-items: end center; box-shadow: var(--shadow), inset 0 0 0 1px var(--line-soft); }
.b-panel-art img { display: block; width: auto; height: 92%; transition: scale 0.8s var(--e-out); transform-origin: 50% 100%; }
.b-link:hover .b-panel-art img { scale: 1.03; }

.b-panel-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: scale 0.9s var(--e-out); }
.b-link:hover .b-panel-photo img { scale: 1.035; }

/* ---------------------------------------------------------------- caption */

.b-cap { display: grid; gap: 0.3rem; padding: 0.9rem 0.1rem 0; }
.b-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.b-name { font-size: 1.15rem; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
.b-host {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: none;
  color: var(--ink-3);
  font: 400 0.74rem/1.2 var(--mono);
  transition: color 0.25s var(--e-out);
}
.b-link:hover .b-host { color: var(--ink); }
.b-arrow { width: 12px; height: 12px; transition: translate 0.3s var(--e-out); }
.b-link:hover .b-host .b-arrow { translate: 2px -2px; }
.b-meta { color: var(--ink-3); font: 400 0.72rem/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.b-meta i { font-style: normal; }
.b-line { max-width: 34em; color: var(--ink-2); font-size: 0.95rem; line-height: 1.42; text-wrap: pretty; }
html[lang='ja'] .b-line { font-size: 0.9rem; line-height: 1.6; word-break: auto-phrase; }
.b-case {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.25s var(--e-out);
}
.b-case:hover { text-decoration-color: var(--ink); }

/* ------------------------------------------------------- filter motion */

::view-transition-group(*) { animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }

@media (max-width: 720px) {
  .b-filter { margin-left: 0; margin-right: 0; padding-right: 0; }
  .b-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: var(--gut); }
  .b-chips::-webkit-scrollbar { display: none; }
  .b-chip { flex: none; }
}

/* Five links, the language switch and the button do not fit a phone's bar.
   The footer carries the links, so the bar keeps the mark and the button. */
@media (max-width: 720px) {
  .is-built .a-links { display: none; }
  .is-built .a-right { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .b-screen img, .b-phone, .b-frame, .b-panel, .b-panel-photo img, .b-panel-art img { transition: none !important; }
  .b-link:hover .b-frame img, .b-tile.is-live .b-frame img { translate: 0 0 !important; }
  ::view-transition-group(*) { animation: none; }
}
