/* Dark Lego: Bricolage Grotesque + Geist */

:root {
  --bg: #0f0f0e;
  --bg-elevated: #1a1917;
  --ink: #ece8df;
  --ink-muted: #9a958c;
  --ink-faint: #5e5a53;
  --accent: #8a9aa8;
  --accent-soft: rgba(138, 154, 168, 0.12);
  --rule: rgba(236, 232, 223, 0.1);
  --focus: #8a9aa8;

  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;

  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 8rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 380ms;

  --max: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --nav-h: 3.25rem;
}

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

html {
  scroll-behavior: smooth;
  /* guard: nothing may widen the page sideways (clip, not hidden, so sticky nav keeps working) */
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .walker-body,
  .leg-l,
  .leg-r,
  .walkers-svg {
    animation: none !important;
  }

}

body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 180ms var(--ease);
}

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

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border-radius: 2px;
}

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

/* --- Header / nav --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: visible;
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  pointer-events: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.55rem var(--gutter);
  min-height: var(--nav-h);
}

.nav-links {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 2.5vw, 1.75rem);
  justify-content: flex-end;
  align-items: center;
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-muted);
  transition: color 180ms var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link[aria-current="true"] {
  color: var(--ink);
}

/* Scroll-spy marker: a tiny Lego plate that slides under the active link */
.nav-plate {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--plate-w, 0px);
  height: 4px;
  border-radius: 1px;
  background: var(--plate-c, #f1c232);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  transform: translate(var(--plate-x, 0px), var(--plate-y, 0px));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 460ms var(--ease),
    width 460ms var(--ease),
    background-color 460ms ease,
    opacity 240ms ease;
}

/* studs on top, like a 1xN plate */
.nav-plate::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 1px;
  bottom: 100%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--plate-c, #f1c232) 0 4px, transparent 4px 10px);
  transition: background 460ms ease;
}

.nav-plate.is-on {
  opacity: 1;
}

.nav-plate.no-slide {
  transition: opacity 240ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .nav-plate {
    transition: opacity 160ms ease;
  }
}

/* --- Walking M + B (nav logo) --- */

.walkers {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.15rem 0.2rem;
  margin: -0.15rem -0.2rem;
  border-radius: 4px;
  line-height: 0;
  /* room for waving hands + bubble above the mark */
  overflow: visible;
}

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

.walkers-svg {
  display: block;
  overflow: visible;
  width: 86px;
  height: 36px;
}

.walker {
  transform-box: fill-box;
  transform-origin: center bottom;
}

.walker-body {
  transform-origin: 16px 28px;
  animation: bob 0.72s ease-in-out infinite;
}

.walker-b .walker-body {
  transform-origin: 51px 28px;
  animation-delay: -0.36s;
}

.leg-l {
  transform-origin: 12px 28px;
  animation: stride-l 0.72s ease-in-out infinite;
}

.walker-b .leg-l {
  transform-origin: 49px 28px;
  animation-delay: -0.36s;
}

.leg-r {
  transform-origin: 20px 28px;
  animation: stride-r 0.72s ease-in-out infinite;
}

.walker-b .leg-r {
  transform-origin: 55px 28px;
  animation-delay: -0.36s;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes stride-l {
  0%,
  100% {
    transform: rotate(16deg);
  }
  50% {
    transform: rotate(-16deg);
  }
}

@keyframes stride-r {
  0%,
  100% {
    transform: rotate(-16deg);
  }
  50% {
    transform: rotate(16deg);
  }
}

/* Desktop: JS drives the stride from scrolling (idle = standing), so the loop is off */
.walkers--driven .walker-body,
.walkers--driven .leg-l,
.walkers--driven .leg-r {
  animation: none;
}

/* hop / swap */
.walkers.is-hopping .walker-body {
  animation: hop 0.55s var(--ease) 1;
}

.walkers.is-swapped .walker-m {
  transform: translateX(36px);
  transition: transform 420ms var(--ease);
}

.walkers.is-swapped .walker-b {
  transform: translateX(-36px);
  transition: transform 420ms var(--ease);
}

.walkers:not(.is-swapped) .walker-m,
.walkers:not(.is-swapped) .walker-b {
  transition: transform 420ms var(--ease);
}

@keyframes hop {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-7px);
  }
  70% {
    transform: translateY(-1px);
  }
}

/* Wave: each letter raises its own stick arm and waves; the hi! bubble appears */
.walkers .resting-arm {
  transform-box: view-box;
  transition: transform 0.2s ease;
}

.walker-m .resting-arm {
  transform-origin: 24px 18px;
}

.walker-b .resting-arm {
  transform-origin: 58px 18px;
}

.walkers.is-waving .resting-arm {
  animation: arm-wave 0.4s ease-in-out 4 alternate;
}

.walkers.is-waving .walker-b .resting-arm {
  animation-delay: 0.1s;
}

@keyframes arm-wave {
  from {
    transform: rotate(-70deg);
  }
  to {
    transform: rotate(-115deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .walkers.is-waving .resting-arm {
    animation: none;
    transform: rotate(-90deg);
  }
}

/* --- Layout --- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-2xl);
}

.section {
  padding-top: var(--space-xl);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--rule);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.section-hint {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 0;
  flex-shrink: 0;
}

/* --- Hero --- */

.hero {
  padding-top: clamp(3.5rem, 12vw, 7rem);
  padding-bottom: var(--space-lg);
  display: grid;
  grid-template-columns: minmax(0, 42rem) auto;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md) var(--space-lg);
  margin-left: clamp(0rem, 8vw, 6rem);
  scroll-margin-top: 4rem;
}

.hero-text {
  display: grid;
  gap: var(--space-md);
}

.hero-photo {
  margin: 0;
  width: clamp(9rem, 17vw, 14rem);
  aspect-ratio: 1;
  position: relative;
  border-radius: 1.4rem;
  transform: rotate(2.5deg);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(236, 232, 223, 0.08);
  transition: transform 520ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.hero-photo:hover {
  transform: rotate(0deg) translateY(-4px);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.photo-bubble {
  position: absolute;
  z-index: 2;
  top: -1.5rem;
  left: -1.9rem;
  padding: 0.45rem 1rem 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #1a1917;
  background: var(--ink);
  border-radius: 1rem;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
  transform-origin: 80% 110%;
  transform: rotate(-6deg) scale(0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 420ms cubic-bezier(0.34, 1.6, 0.64, 1);
}

.photo-bubble::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  bottom: -0.45rem;
  width: 0.9rem;
  height: 0.9rem;
  background: inherit;
  border-radius: 0 0 0.25rem 0;
  transform: rotate(45deg) skew(8deg, 8deg);
}

.hero-photo:hover .photo-bubble,
.hero-photo.is-saying-hi .photo-bubble {
  opacity: 1;
  transform: rotate(-6deg) scale(1);
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    order: -1;
    width: 6.5rem;
    border-radius: 1rem;
    transform: rotate(-2deg);
  }

  .photo-bubble {
    left: auto;
    right: -1.7rem;
    top: -1.1rem;
    font-size: 1rem;
    transform-origin: 20% 110%;
    transform: rotate(6deg) scale(0.4);
  }

  .photo-bubble::after {
    right: auto;
    left: 0.8rem;
    transform: rotate(45deg) skew(8deg, 8deg);
  }

  .hero-photo:hover .photo-bubble,
  .hero-photo.is-saying-hi .photo-bubble,
  .hero-photo.is-hi-default .photo-bubble {
    opacity: 1;
    transform: rotate(6deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo,
  .photo-bubble {
    transition: none;
  }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 10.5vw, 5.75rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0;
  color: var(--ink);
}

.hero-line {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: var(--ink-muted);
  margin: 0;
  max-width: 36rem;
}

/* --- Now --- */

.now-body {
  max-width: 38rem;
  margin-left: clamp(0rem, 6vw, 4rem);
}

.now-lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
}

/* --- Lego bricks ---
   Walls are grids where one column = one stud pitch, so studs line up
   across rows. Studs are CSS masks tiled once per pitch, so a brick
   spanning N columns always shows N studs. */

:root {
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --snap: cubic-bezier(0.25, 1.35, 0.5, 1);
  --stud-side: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M22 20 A28 20 0 0 1 78 20 V100 H22 Z'/%3E%3C/svg%3E");
  --stud-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cellipse cx='50' cy='20' rx='28' ry='20'/%3E%3C/svg%3E");
}

.wall-wrap {
  container-type: inline-size;
}

.wall {
  --cols: 12;
  --pitch: calc(100cqi / var(--cols));
  --stud-h: calc(var(--pitch) * 0.26);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: var(--row-h);
  list-style: none;
  margin: 0;
  padding: calc(var(--stud-h) + 0.25rem) 0 0;
}

.wall--work {
  /* sized from measured open-state text height; see README */
  --row-h: 13rem;
}

.wall--exp {
  --row-h: 6.75rem;
}

.brick {
  position: relative;
  grid-column: var(--c) / span var(--s);
  grid-row: var(--r);
  /* upper rows cover the studs of the rows below */
  z-index: calc(40 - var(--i));
  --b-light: color-mix(in srgb, var(--b) 72%, #fff);
  --b-dark: color-mix(in srgb, var(--b) 72%, #000);
  --tilt: -1.6deg;
}

.brick:nth-child(even) {
  --tilt: 1.4deg;
}

.brick--exp {
  --tilt: -3deg;
}

.brick--exp:nth-child(even) {
  --tilt: 2.6deg;
}

.brick.is-open {
  z-index: 60;
}

/* Soft ground shadow: its own layer so only opacity/transform animate */
.brick-shadow {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 4px;
  height: 55%;
  border-radius: 10px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 360ms ease, transform 520ms var(--spring);
  pointer-events: none;
}

.brick-body {
  position: absolute;
  inset: 0 1px 2px;
  border-radius: 6px 6px 5px 5px;
  background-color: var(--b);
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.1));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.38),
    inset 2px 0 0 rgba(255, 255, 255, 0.12),
    inset -2px 0 0 rgba(0, 0, 0, 0.16),
    inset 0 -7px 0 rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 3px 0 rgba(0, 0, 0, 0.35);
  color: var(--t);
  transform: translate3d(0, 0, 0);
  transform-origin: 50% 100%;
  transition: transform 520ms var(--spring);
  will-change: transform;
}

/* Studs */
.studs,
.studs::before {
  position: absolute;
  left: -1px;
  right: -1px;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: var(--pitch) 100%;
  mask-size: var(--pitch) 100%;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  pointer-events: none;
}

.studs {
  top: calc(var(--stud-h) * -1 + 1px);
  height: var(--stud-h);
  background-color: var(--b);
  background-image: linear-gradient(
    90deg,
    var(--b-dark) 22%,
    var(--b) 34%,
    var(--b-light) 44%,
    var(--b) 58%,
    var(--b-dark) 78%
  );
  background-size: var(--pitch) 100%;
  background-repeat: repeat-x;
  -webkit-mask-image: var(--stud-side);
  mask-image: var(--stud-side);
}

.studs::before {
  content: "";
  top: 0;
  height: 100%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--b) 55%, #fff), var(--b-light));
  -webkit-mask-image: var(--stud-top);
  mask-image: var(--stud-top);
}

/* The whole face is the toggle */
.brick-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.brick-hit:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.brick-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.15rem 1.35rem 1.1rem;
  transition: opacity 240ms ease, transform 420ms var(--spring);
}

.brick-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.brick--work .brick-title {
  font-size: clamp(1.75rem, 2.9vw, 2.6rem);
}

.brick--exp .brick-title {
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.025em;
  padding-right: 1.4rem;
}

.brick-meta {
  display: table;
  margin-top: 0.7rem;
  padding: 0.34rem 0.7rem 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.64rem;
  font-weight: 600;
  font-style: normal;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: none;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent);
  opacity: 0.92;
}

.brick-hint {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* + knob that turns into × when detached */
.brick-knob {
  position: absolute;
  right: 0.9rem;
  bottom: 1rem;
  z-index: 2;
  width: 1.35rem;
  height: 1.35rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 420ms var(--spring);
}

.brick--exp .brick-knob {
  right: 0.6rem;
  bottom: 0.75rem;
  width: 1.1rem;
  height: 1.1rem;
}

.brick-knob::before,
.brick-knob::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.brick-knob::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Work detail: lives inside the brick, cross-fades with the face */
.brick-detail {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.05rem 3rem 1.1rem 1.35rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 420ms var(--spring), visibility 0s linear 200ms;
}

.brick-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brick-text {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.5;
}

.brick-link {
  align-self: flex-start;
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  pointer-events: auto;
}

.brick-link:hover {
  color: inherit;
  text-decoration-thickness: 2.5px;
}

.brick-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Experiment detail: a small instruction card that unfolds under the brick */
.brick-flap {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 3;
  width: max(100%, 17rem);
  max-width: calc(100cqi);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.95rem 1.05rem 1rem;
  border-radius: 6px;
  background: #f3efe6;
  color: #1a1917;
  border-top: 5px solid var(--b);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: 20% 0;
  transition: opacity 180ms ease, transform 420ms var(--spring), visibility 0s linear 180ms;
}

.brick-flap.flap-right {
  left: auto;
  right: 0;
  transform-origin: 80% 0;
}

.brick-flap .brick-text {
  font-size: 0.86rem;
}

.brick-flap .brick-link {
  margin-top: 0;
  font-size: 0.8rem;
}

/* Hover: lift (only on devices that really hover) */
@media (hover: hover) {
  .brick:not(.is-open):hover .brick-body {
    transform: translate3d(0, -5px, 0);
  }

  .brick:not(.is-open):hover .brick-shadow {
    opacity: 0.55;
    transform: scale(1);
  }

  .brick:not(.is-open):hover .brick-knob {
    transform: rotate(90deg);
  }
}

.brick-hit:focus-visible ~ .brick-knob {
  transform: rotate(90deg);
}

/* Detached / open */
.brick.is-open .brick-body {
  transform: translate3d(0, -16px, 0) rotate(var(--tilt));
}

.brick--exp.is-open .brick-body {
  transform: translate3d(0, -12px, 0) rotate(var(--tilt));
}

.brick.is-open .brick-shadow {
  opacity: 1;
  transform: scale(1.02);
}

.brick.is-open .brick-knob {
  transform: rotate(45deg);
}

.brick--work.is-open .brick-face {
  opacity: 0;
  transform: translateY(-8px);
}

.brick.is-open .brick-detail,
.brick.is-open .brick-flap {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 260ms ease 60ms, transform 480ms var(--spring), visibility 0s;
}

/* Stack-up on first view (JS adds .is-built; order bottom row → top) */
.js .wall:not(.is-built) .brick {
  opacity: 0;
}

.wall.is-built .brick {
  animation: brick-drop 640ms var(--snap) backwards;
  animation-delay: var(--d, 0ms);
}

@keyframes brick-drop {
  0% {
    opacity: 0;
    transform: translate3d(0, -72px, 0);
  }
  45% {
    opacity: 1;
  }
  70% {
    transform: translate3d(0, 3px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

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

/* Medium: towers of offset bricks */
@media (max-width: 1023px) {
  .wall--work {
    --cols: 8;
    --row-h: clamp(10rem, calc(16.95rem - 11.25vw), 13rem);
  }

  .wall--work .brick {
    grid-row: auto;
    grid-column: 1 / span 6;
  }

  .wall--work .brick:nth-child(even) {
    grid-column: 3 / span 6;
  }

  .wall--exp {
    --cols: 10;
    --row-h: 6.25rem;
  }

  /* same 2-3-3 pyramid as desktop (rows from --r) on 10 studs: 6 / 8 / 10 wide */
  .wall--exp .brick:nth-child(1) { grid-column: 3 / span 3; }
  .wall--exp .brick:nth-child(2) { grid-column: 6 / span 3; }
  .wall--exp .brick:nth-child(3) { grid-column: 2 / span 3; }
  .wall--exp .brick:nth-child(4) { grid-column: 5 / span 3; }
  .wall--exp .brick:nth-child(5) { grid-column: 8 / span 2; }
  .wall--exp .brick:nth-child(6) { grid-column: 1 / span 3; }
  .wall--exp .brick:nth-child(7) { grid-column: 4 / span 5; }
  .wall--exp .brick:nth-child(8) { grid-column: 9 / span 2; }
}

/* Small phones */
@media (max-width: 599px) {
  /* keep titles on one line; the quiet hint wraps instead */
  .section-title {
    white-space: nowrap;
  }

  .section-hint {
    max-width: 6rem;
    text-align: right;
    line-height: 1.35;
  }

  .wall--work {
    --cols: 6;
    --row-h: clamp(10.5rem, calc(25rem - 38vw), 18rem);
  }

  .wall--work .brick {
    grid-column: 1 / span 5;
  }

  .wall--work .brick:nth-child(even) {
    grid-column: 2 / span 5;
  }

  .brick--work .brick-title {
    font-size: 1.75rem;
  }

  .brick-face {
    padding: 1rem 1.1rem 0.95rem;
  }

  .brick-detail {
    padding: 0.95rem 2.6rem 1rem 1.1rem;
    gap: 0.45rem;
  }

  .brick-text {
    font-size: 0.875rem;
  }

  .wall--exp {
    --cols: 7;
    --row-h: 5.75rem;
  }

  /* two per row, alternating offset: 4 rows of staggered pairs */
  .wall--exp .brick {
    grid-row: auto;
  }

  .wall--exp .brick:nth-child(4n + 1) { grid-column: 1 / span 3; }
  .wall--exp .brick:nth-child(4n + 2) { grid-column: 4 / span 3; }
  .wall--exp .brick:nth-child(4n + 3) { grid-column: 2 / span 3; }
  .wall--exp .brick:nth-child(4n + 4) { grid-column: 5 / span 3; }

  .brick--exp .brick-face {
    padding: 0.8rem 0.85rem;
  }

  .brick--exp .brick-title {
    font-size: 0.98rem;
  }

  .brick-flap {
    width: min(19rem, 100cqi);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brick,
  .brick-body,
  .brick-shadow,
  .brick-face,
  .brick-detail,
  .brick-flap,
  .brick-knob {
    animation: none !important;
    transition: none !important;
  }

  .brick.is-open .brick-body {
    transform: translate3d(0, -10px, 0);
  }
}

/* --- About --- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: var(--space-md) var(--space-lg);
  align-items: start;
  margin-left: clamp(0rem, 4vw, 2.5rem);
}

.about-body {
  margin: 0;
  color: var(--ink-muted);
  max-width: 36rem;
  font-size: 1.05rem;
}

.about-body p {
  margin: 0;
}

.about-body p + p {
  margin-top: 1rem;
}

.about-link-wrap {
  margin: 0;
  padding-top: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.about-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

@media (max-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .hero,
  .now-body {
    margin-left: 0;
  }

  .nav-link {
    font-size: 0.75rem;
  }

  .walkers-svg {
    width: 70px;
    height: 30px;
  }
}

@media (max-width: 420px) {
  .nav-links {
    gap: 0.55rem;
  }
}

/* --- Footer --- */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-lg) var(--gutter) var(--space-xl);
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.site-footer p {
  margin: 0;
}
