/* Project page template. Section ids, in order: head, hero, problem, lineup, built, bento, beat, underneath, layers, next. */

.wrap { padding: 0 40px; }
a { color: inherit; }

/* Head */
.p-head {
  padding: 200px 0 70px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 80px;
  align-items: center;
}
.p-title { margin: 0; font-size: 96px; }
.p-lede { margin: 28px 0 0; max-width: 620px; font-size: 30px; line-height: 1.3; font-weight: 400; }
.meta { border-top: 1px solid #ddd; }
.meta div {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding: 18px 0;
  border-bottom: 1px solid #ddd;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.meta span:first-child { color: #6b6b6b; }
.meta span:last-child { font-weight: 600; text-align: right; max-width: 60%; }
.meta a { color: var(--cobalt); text-decoration: none; }
.meta a + a { margin-left: 14px; }

/* Full-bleed hero with the scene centred */
.full {
  position: relative;
  margin: 0 24px;
  height: 84vh;
  border-radius: 6px;
  overflow: hidden;
  background: #0B1F3F;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}
.full .scene { position: relative; display: flex; justify-content: center; }

/* Thursday: the constellation is the hero ground, the phone stands in front of it. */
.full.thursday { background: #07100C; }
.full .constellation { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.constellation-tip {
  position: absolute;
  transform: translate(14px, -50%);
  padding: 6px 10px;
  border: 1px solid rgba(159, 255, 184, .45);
  background: rgba(7, 16, 12, .85);
  color: #9FFFB8;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.constellation-tip[hidden] { display: none; }

/* Discreet caption under a figure */
.caption { margin: 14px 24px 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #6b6b6b; }
@media (max-width: 900px) { .caption { margin: 12px 12px 0; } }

/* Text sections */
.sec {
  padding-top: 150px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
}
.sec-k {
  margin: 0;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cobalt);
  font-weight: 700;
}
.sec h2 { margin: 14px 0 0; font-size: 54px; line-height: 1.02; letter-spacing: -.02em; font-weight: 500; }
.sec p { margin: 0; max-width: 620px; font-size: 21px; line-height: 1.45; }
.sec p + p { margin-top: 18px; }
.sec p a { color: var(--cobalt); }

/* Figures */
.fig { margin: 60px 24px 0; border-radius: 6px; overflow: hidden; position: relative; }

.lineup {
  background: #EEF0F3;
  height: 760px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
}
/* Each lineup device is a device-sized scene (data-fit="device") so a standalone render can replace it. */
.lineup > .scene { flex: none; position: relative; }
.lineup > .scene[data-scene="phone-upright"] { transform: translateY(70px); }
.lineup .phone { box-shadow: 0 40px 80px rgba(0, 0, 0, .25); }
.lineup .phone.small { width: 240px; height: 496px; border-radius: 40px; }
.lineup .phone.small .notch { top: 20px; width: 80px; height: 22px; margin-left: -40px; }
.lineup .phone.small .screen { inset: 11px; width: calc(100% - 22px); height: calc(100% - 22px); border-radius: 30px; }

.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 300px; gap: 16px; }
.tile { position: relative; border-radius: 10px; overflow: hidden; }
.tile img, .tile video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tile.big { grid-column: span 2; grid-row: span 2; }
.tile.wide { grid-column: span 2; }
.tile.text { display: flex; align-items: flex-end; padding: 28px; box-sizing: border-box; font-size: 22px; line-height: 1.05; letter-spacing: -.01em; font-weight: 500; }
.tile.big, .tile.wide { font-size: 34px; }
.tile.navy { background: #0B1F3F; color: #fff; }
.tile.black { background: #111; color: #fff; }
.tile.pale { background: #EEF0F3; color: #111; }
.tile.cobalt { background: #1D4ED8; color: #fff; }
.tile.forest { background: #07100C; color: #fff; }
.tile.night { background: #0D1117; color: #fff; }

/* Beat: the one joke */
.beat { padding: 200px 0; }
.beat h2 { margin: 0; max-width: 1100px; font-size: 76px; line-height: 1.02; letter-spacing: -.025em; font-weight: 500; }
.beat p { margin: 26px 0 0; font-size: 24px; color: #555; }
#underneath { padding-top: 0; }

/* Layers figure */
/* Without JS the rows are static markup in normal flow; js/layers.js adds is-live and positions them. */
.layers { margin: 60px 24px 0; border-radius: 6px; background: #0D1117; position: relative; overflow: hidden; color: #fff; padding: 40px 0; box-sizing: border-box; }
.layers-row { padding: 0 40px; }
.layers-row + .layers-row { margin-top: 28px; }
.layers.is-live { height: 720px; padding: 0; }
.layers.is-live .layers-row { position: absolute; left: 0; right: 0; margin: 0; transition: top .15s linear; }
.layers-rule { border-top: 1px solid rgba(255,255,255,.35); }
.layers-label { margin: 18px 0 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.layers-line { margin: 10px 0 0; font-size: 22px; line-height: 1.3; max-width: 640px; color: rgba(255,255,255,.8); }
@media (prefers-reduced-motion: reduce) { .layers-row { transition: none; } }

/* Next project */
.next {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  margin: 160px 0 0;
  height: 70vh;
  padding: 60px;
  background: #EEF2F8;
  color: #0B1F3F;
  text-decoration: none;
}
.next-k { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.next-name { margin: 0; font-size: clamp(64px, 9.7vw, 140px); }

@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .p-head, .sec { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .p-head { padding-top: 130px; }
  .p-title { font-size: 64px; }
  .p-lede { font-size: 22px; }
  .meta div { font-size: 14px; gap: 16px; }
  .full { margin: 0 12px; }
  .full .scene { transform: scale(.6); }
  .sec { padding-top: 90px; }
  .sec h2 { font-size: 36px; }
  .sec p { font-size: 18px; }
  .fig { margin: 40px 12px 0; }
  .lineup { overflow: hidden; justify-content: flex-start; padding-left: 40px; }
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .beat { padding: 110px 0; }
  .beat h2 { font-size: 40px; }
  .beat p { font-size: 18px; }
  .layers { margin: 40px 12px 0; }
  .layers.is-live { height: 560px; }
  .next { padding: 28px 20px; }
}

/* Code figure (Smaller things hero and items) */
.code {
  margin: 0;
  font: 15px/1.6 ui-monospace, Menlo, monospace;
  color: #9fd1a8;
  background: #0a0a0a;
  padding: 40px 48px;
  border-radius: 12px;
  border: 1px solid #222;
  box-shadow: 0 60px 120px rgba(0, 0, 0, .6);
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}
.code .c { color: #777; }
.code { scrollbar-color: #333 #0a0a0a; }
.sec .code { margin-top: 28px; padding: 28px 32px; font-size: 14px; box-shadow: none; overflow-x: auto; }

/* Still image as a full-bleed hero, and stills in the lineup */
.full .still { display: block; width: 100%; height: 100%; object-fit: cover; }
.full .scene:has(.still) { width: 100%; height: 100%; }
.lineup .laptop { width: 760px; flex: none; }
.lineup.stills { align-items: center; padding: 0 40px; box-sizing: border-box; height: 520px; }
.lineup.stills img { flex: 1; min-width: 0; border-radius: 6px; display: block; }

@media (max-width: 900px) {
  .full .scene:has(.still) { transform: none; }
}
@media (max-width: 767px) {
  .full { height: 70vh; }
  .full .scene:not(:has(.still)):not(:has(.code)) { transform: scale(.72); }
  .full .scene:has(.code) { width: 100%; padding: 0 16px; box-sizing: border-box; }
  .code { font-size: 13px; padding: 24px; }
  .meta div { flex-direction: column; gap: 4px; }
  .meta span:last-child { text-align: left; max-width: 100%; }
  .lineup {
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    gap: 16px;
    padding: 0 20px;
    height: 640px;
    box-sizing: border-box;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .lineup > * { scroll-snap-align: center; }
  .lineup .laptop { width: 480px; }
  .lineup.stills { height: auto; padding: 20px; align-items: center; }
  .lineup.stills img { flex: 0 0 78%; }
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 220px; }
  .tile.big, .tile.wide { font-size: 26px; }
  .sec { grid-template-columns: minmax(0, 1fr); }
  .sec > * { min-width: 0; }
  .next { height: 70vh; margin-top: 100px; }
  /* Fully open on a phone: the rows flow and the figure grows to fit, so the last row is never clipped. */
  .layers.is-live.is-open { height: auto; padding: 0 0 40px; }
  .layers.is-live.is-open .layers-row { position: static; margin-top: 28px; }
}

/* Rendered hero scenes go full-bleed: the render covers the hero box (see renders/README.md).
   Last in the file so it wins over the mobile scale rules. Device-sized scenes keep their size. */
.full .scene.is-rendered:not([data-fit="device"]) {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  transform: none;
}
