/* About, work and next-build sections, carried over from the earlier portfolio and the Builders.mu page.
   Their tokens are scoped to .content: hero.css and footer.css use the same names for other values. */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 36px;
}

::selection {
  background: #e9d2c6;
}

.skip {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 30;
  padding: 12px;
  font: 500 12px/1.65 var(--font-mono);
  text-transform: uppercase;
  color: #fff;
  background: #35414f;
}

.skip:focus {
  top: 12px;
}

.content {
  --paper: #F9F8F6;
  --ink: #35414f;
  --muted: #7d8792;
  --line: #dfe3e7;
  --accent: #de552e;
  --serif: "My Font", Georgia, serif;
  --sans: "Inter", Arial, sans-serif;

  position: relative;
  padding-bottom: 32px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
}

.content a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.content a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 6px;
}

.wrap {
  width: calc(100% - 96px);
  max-width: 1392px;
  margin: auto;
}

/* Type */

.content h2 em,
.stopper-line em {
  font-family: "My Font", var(--serif);
  font-style: italic;
  font-weight: 400;
}

.kicker,
.micro,
.beats b {
  margin: 0;
  font: 600 .75rem/1.4 var(--sans);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
}

.section {
  padding: 72px 0 108px;
  border-top: 1px solid var(--line);
}

.section-title,
.story h2 {
  max-width: 920px;
  margin: 18px 0 0;
  font: 400 clamp(2.6rem, 4.6vw, 4.4rem)/1.08 var(--serif);
  letter-spacing: -.02em;
}

.story h2 {
  font-size: clamp(2.4rem, 3.6vw, 3.5rem);
}

.prose {
  max-width: 720px;
  font-size: 1.125rem;
  line-height: 1.7;
}

.prose p { margin: 0 0 20px; }
.prose p:last-child { margin: 0; }

/* Who I am */

.story {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: start;
}

/* The left column runs longer (roles and the snapshot), so the prose sits on its baseline. */
.story .prose {
  align-self: end;
}

.experience {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  margin-top: 44px;
  line-height: 1.6;
}

.experience p { margin: 0; }
.experience .dates { color: var(--muted); font-variant-numeric: tabular-nums; }
.experience .role { margin-top: 4px; color: var(--muted); }

/* Photos and memes sit on the page like the hero's cards: tilted, white-bordered, and they straighten on hover.
   --ease-hover is the spring hero.js puts on :root. */

.snapshot,
.meme {
  margin: 0;
  padding: 8px 8px 10px;
  background: #fff;
  box-shadow: 0 10px 30px #35414f1f;
  rotate: var(--tilt, 0deg);
  transition: rotate .45s var(--ease-hover), scale .45s var(--ease-hover);
}

.snapshot:hover,
.meme:hover {
  rotate: 0deg;
  scale: 1.04;
}

.snapshot img,
.meme video {
  display: block;
  width: 100%;
  height: auto;
}

.snapshot figcaption,
.meme figcaption {
  margin-top: 8px;
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--muted);
}

.snapshot {
  width: min(260px, 70%);
  margin-top: 48px;
}

.snapshot img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
}

.meme {
  width: 170px;
  margin-top: 20px;
  padding: 6px 6px 8px;
}

/* Four hats: the hero's palette, one colour per discipline */

.hats {
  margin-top: 88px;
}

.hats h3 {
  margin: 12px 0 32px;
  font: 400 clamp(1.8rem, 3vw, 2.55rem)/1.15 var(--serif);
  letter-spacing: -.012em;
}

.hats h3 em {
  font-family: "My Font", var(--serif);
  font-style: italic;
}

.hat-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hat {
  min-height: 236px;
  padding: 22px 22px 26px;
  color: #35414f;
  rotate: var(--tilt, 0deg);
  transition: rotate .45s var(--ease-hover), scale .45s var(--ease-hover);
}

.hat:hover {
  rotate: 0deg;
  scale: 1.03;
}

.hat span {
  font: 500 12px/1.65 var(--font-mono);
  letter-spacing: .01em;
  text-transform: uppercase;
  opacity: .7;
}

.hat h4 {
  margin: 26px 0 10px;
  font: 400 1.85rem/1.1 var(--serif);
}

.hat p {
  margin: 0;
  font-size: .9375rem;
  line-height: 1.55;
}

.hat--design { color: #F9F8F6; background: #F2511B; }
.hat--code { background: #ADD6F7; }
.hat--wire { background: #C8D665; }
.hat--train { color: #b8400f; background: #FDD1BA; }

/* Work */

.section-head {
  margin-bottom: 56px;
}

.work-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.motion-toggle {
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid #7d879260;
  font: inherit;
  font-size: .875rem;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.motion-toggle:hover { color: var(--accent); }
.motion-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }

.project {
  margin-bottom: 104px;
}

.picture {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1.85;
  overflow: hidden;
  border: 1px solid rgba(53, 65, 79, .08);
}

.picture img {
  display: block;
  width: 76%;
  max-height: 85%;
  object-fit: contain;
  box-shadow: 0 20px 55px #333a4b20;
}

.caption {
  display: flex;
  justify-content: space-between;
  gap: 36px;
  padding: 26px 0 0;
}

.caption h3 {
  max-width: 820px;
  margin: 10px 0 8px;
  font: 400 clamp(1.8rem, 3vw, 2.55rem)/1.15 var(--serif);
  letter-spacing: -.012em;
}

.caption p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.meta {
  padding-top: 30px;
  font-size: .8125rem;
  line-height: 2;
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
}

.text-link {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  transition: color .2s ease, border-color .2s ease;
}

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

.beats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 36px;
}

.beats > div { padding-top: 18px; border-top: 1px solid var(--line); }
.beats b { display: block; margin-bottom: 10px; }
.beats p { margin: 0; line-height: 1.65; }
.stats p { color: var(--muted); }

.stat {
  display: block;
  margin: 0 0 10px;
  font: 400 clamp(2.2rem, 3.4vw, 3rem)/1.05 var(--serif);
  letter-spacing: -.02em;
}

/* Covers: slides that cross-fade, with a status pill naming the current stage */

.cover-frame {
  position: absolute;
  inset: 0;
}

.picture .cover-frame img {
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity .8s ease, transform .55s cubic-bezier(.2, .7, .2, 1);
}

.picture .cover-frame img.active {
  opacity: 1;
}

.cover-status {
  position: absolute;
  bottom: 22px;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: auto;
  padding: 12px 16px;
  border: 1px solid #ffffff80;
  border-radius: 8px;
  font-size: 14px;
  color: #35414f;
  background: #fafbfce8;
  box-shadow: 0 5px 22px #35414f12;
  backdrop-filter: blur(12px);
}

.cover-status-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: #de552e; }
.cover-stage { flex: 1; }
.cover-bars { display: flex; gap: 4px; }
.cover-bars i { width: 16px; height: 3px; border-radius: 2px; background: #35414f24; transition: background .5s; }
.cover-bars i.active { background: #de552e; }

.version {
  background: linear-gradient(120deg, #efc37b 0%, #d6b6c0 52%, #b7b9df 100%);
}

.version img {
  width: 70%;
  max-height: 87%;
}

.review-pointer {
  position: absolute;
  top: 37%;
  left: 62%;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #de552e;
  box-shadow: 0 0 0 5px #de552e30;
  pointer-events: none;
  animation: reviewPath 12s ease-in-out infinite;
}

@keyframes reviewPath {
  0%, 12% { transform: translate(0, 0); opacity: 0; }
  18%, 25% { transform: translate(0, 0); opacity: 1; }
  29%, 35% { transform: translate(38px, 60px); opacity: 1; }
  42%, 52% { transform: translate(-120px, 20px); opacity: 1; }
  60%, 69% { transform: translate(-40px, 80px); opacity: 1; }
  76%, 88% { transform: translate(60px, 40px); opacity: 1; }
  95%, 100% { opacity: 0; transform: translate(60px, 40px); }
}

.sync-orbit {
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 2px solid #35414f25;
  border-top-color: #de552e;
  border-radius: 50%;
  animation: syncTurn 2s linear infinite;
}

@keyframes syncTurn {
  to { transform: rotate(360deg); }
}

.covers-paused .review-pointer,
.covers-paused .sync-orbit {
  animation-play-state: paused;
}

/* The pruning cover: two models drawn layer by layer on a canvas (content.js). */

.prune {
  background: #f4efe8;
}

.prune canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Social posts drifting up in columns */

.social-wall-cover {
  --post-gap: 8px;
  padding: 8px;
  background: #131015;
}

.post-wall {
  position: absolute;
  inset: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--post-gap);
  align-items: start;
  pointer-events: none;
}

.post-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  animation: postDrift 35s linear infinite;
  will-change: transform;
}

.post-group { display: flex; flex-direction: column; gap: var(--post-gap); padding-bottom: var(--post-gap); }
.post-tile { flex-shrink: 0; overflow: hidden; border-radius: 5px; background: #f5f5f5; }

.picture .post-tile img,
.picture .slide-tile img {
  display: block;
  width: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  transition: none;
}

.picture .post-tile img { height: auto; object-fit: contain; }

.column-0 { animation-delay: -2s; }
.column-1 { animation-duration: 42s; animation-delay: -12s; }
.column-2 { animation-duration: 38s; animation-delay: -24s; }
.column-3 { animation-duration: 45s; animation-delay: -7s; }

@keyframes postDrift {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

/* Also on the shelf: two linked tiles */

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 20px;
}

.tile {
  display: block;
}

.tile .picture {
  aspect-ratio: 1.3;
}

.tile .picture::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.tile:hover .picture::after { opacity: .12; }
.tile:hover .picture .cover-frame img { transform: translate(-50%, -51%) scale(1.018); }

.tile .caption {
  display: block;
  padding-top: 20px;
}

.tile .caption h3 {
  margin: 0 0 6px;
  font-size: 1.75rem;
  line-height: 1.2;
  transition: color .25s ease;
}

.tile:hover .caption h3 { color: var(--accent); }
.tile .caption span { display: inline-block; margin-top: 14px; font-size: .8125rem; color: var(--muted); }

.desktop {
  background: #c0ccc4;
}

.desktop img {
  width: 79%;
  border-radius: 4px;
}

.ppt-collage {
  --tile-width: clamp(170px, 17vw, 260px);
  --slide-gap: 16px;
  background: #000;
}

/* Match the social cover's vertical, staggered drift. */
.slide-wall { position: absolute; inset: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--slide-gap); align-items: start; pointer-events: none; }
.slide-row { display: flex; flex-direction: column; min-width: 0; animation: postDrift 35s linear infinite; will-change: transform; }
.slide-group { display: flex; flex-direction: column; gap: var(--slide-gap); padding-bottom: var(--slide-gap); }
.slide-tile { flex-shrink: 0; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; box-shadow: 0 2px 5px #0000000d; }
.picture .slide-tile img { height: 100%; object-fit: contain; }
.row-0 { animation-delay: -2s; }
.row-1 { animation-duration: 42s; animation-delay: -12s; }
.row-2 { animation-duration: 38s; animation-delay: -24s; }
.row-3 { animation-duration: 45s; animation-delay: -7s; }
/* Next build */

.next .section-head { margin-bottom: 0; }
.next .prose { margin-top: 32px; }

.stopper {
  margin-top: 56px;
  padding: 36px 40px;
  border: 1px solid var(--line);
  background: #fff;
}

.stopper-line {
  max-width: 1000px;
  margin: 14px 0 0;
  font: 400 clamp(1.7rem, 2.8vw, 2.5rem)/1.22 var(--serif);
  letter-spacing: -.012em;
}

.stopper-line em { color: var(--accent); }

/* Three wearables for the model, on a drafting grid like the EyeQ drawings (wear.js). Notes follow the parts they name. */

.wear {
  margin-top: 48px;
  background:
    linear-gradient(#35414f0b 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, #35414f0b 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(120% 95% at 50% 30%, #f8f5f0 0%, #eee8df 60%, #e5ddd1 100%);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.wear.is-dragging { cursor: grabbing; }
.wear--off { cursor: default; }

.wear canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .6s ease;
}

.wear--on canvas { opacity: 1; }

.wear-note {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 0 -6px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}

.wear-note.flip { flex-direction: row-reverse; translate: calc(-100% + 12px) 0; }
.wear-note.on { opacity: 1; }

.wear-note::before {
  content: "";
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px #de552e30;
}

.wear-note span {
  padding: 6px 8px;
  border-radius: 4px;
  background: #fafbfce8;
  box-shadow: 0 4px 16px #35414f14;
}

.wear-hint {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 1;
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

/* Sections rise in as they scroll into view (content.js adds .motion-ready). */

.motion-ready [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .75s cubic-bezier(.22, 1, .36, 1), transform .75s cubic-bezier(.22, 1, .36, 1);
}

.motion-ready [data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Tablet and phone */

@media (max-width: 850px) {
  .wrap { width: calc(100% - 48px); }
  .story { grid-template-columns: 1fr; gap: 28px; }
  .hat-list { grid-template-columns: 1fr 1fr; }
  .caption { display: block; }
  .meta { padding-top: 14px; text-align: left; white-space: normal; }
  .beats { grid-template-columns: 1fr; gap: 20px; }
  .picture { aspect-ratio: 1.4; }
  .version img { width: 87%; }
  .desktop img { width: 91%; }
  .post-wall { grid-template-columns: 1fr 1fr; }
  .column-2, .column-3 { display: none; }
  .tiles { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 520px) {
  .wrap { width: calc(100% - 40px); }
  .section { padding: 52px 0 76px; }
  .experience { grid-template-columns: 1fr; gap: 6px; margin-top: 28px; }
  .snapshot { margin-top: 32px; }
  .hats { margin-top: 64px; }
  .hat-list { grid-template-columns: 1fr; }
  .hat { min-height: 0; }
  .hat h4 { margin-top: 14px; }
  .meme { width: 150px; }
  .work-label { flex-direction: column; align-items: flex-start; gap: 10px; }
  .section-head { margin-bottom: 40px; }
  .picture { aspect-ratio: 1.18; }
  .cover-status { bottom: 12px; left: 12px; right: 12px; gap: 8px; padding: 9px 12px; font-size: 12px; }
  .cover-bars i { width: 10px; }
  .review-pointer { width: 10px; height: 10px; }
  .sync-orbit { top: 14px; right: 14px; width: 18px; height: 18px; }
  .ppt-collage { --tile-width: 160px; --slide-gap: 12px; }
  .project { margin-bottom: 72px; }
  .stopper { padding: 26px 22px; }
  .wear { margin-top: 36px; }
  .wear-hint { top: 14px; right: 14px; font-size: 10px; }
  .wear-note { font-size: 10px; }
  .wear-note span { padding: 5px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion-ready [data-reveal] { opacity: 1; transform: none; transition: none; }
  .text-link, .tile .caption h3, .tile .picture::after, .picture .cover-frame img, .cover-bars i, .snapshot, .meme, .hat, .wear canvas, .wear-note { transition: none; }
  .review-pointer, .sync-orbit { display: none; animation: none; }
  .post-column { animation: none; transform: translateY(-30px); }
  .column-1, .column-3 { transform: translateY(-90px); }
  .slide-row { animation: none; transform: translateX(-60px); }
  .motion-toggle { display: none; }
}

/* Project covers are full-area case-study links. */
a.picture { display: block; cursor: pointer; }
