/* ==========================================================================
   AFTER HOURS ("/after-hours/") — the 5-to-9 projects grid. Night theme.
   ========================================================================== */
body.after main { padding-top: 120px; }
.topbar .home .dot.moon { background: var(--moon); box-shadow: 0 0 0 4px color-mix(in srgb, var(--moon) 20%, transparent); }

/* ---------- Hero ---------- */
.ah-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 5vw, 80px); align-items: end; padding-bottom: clamp(48px, 6vw, 84px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--night-ink-2); margin-bottom: 26px; }
.eyebrow .tick { width: 22px; height: 1px; background: var(--moon); }
.ah-title { font-size: clamp(52px, 8.4vw, 136px); line-height: 1.02; letter-spacing: -.025em; max-width: 11ch; }
.ah-sub { margin-top: 28px; max-width: 54ch; font-size: clamp(17px, 1.35vw, 20px); color: var(--night-ink-2); line-height: 1.55; }

.night-dial { width: clamp(170px, 18vw, 250px); display: grid; gap: 14px; justify-items: center; }
.night-dial svg { width: 100%; height: auto; overflow: visible; }
.night-dial .face { fill: var(--night-raise); stroke: var(--night-line); }
.night-dial .shift { fill: none; stroke: var(--moon); stroke-width: 7; stroke-linecap: round; }
.night-dial .tk { stroke: var(--night-ink-3); }
.night-dial .tk.major { stroke: var(--night-ink); stroke-width: 1.6; }
.night-dial .num { font-family: var(--f-mono); font-size: 9px; fill: var(--night-ink-2); text-anchor: middle; dominant-baseline: middle; }
.night-dial .hh { stroke: var(--night-ink); stroke-width: 4; stroke-linecap: round; }
.night-dial .mh { stroke: var(--night-ink); stroke-width: 2.2; stroke-linecap: round; }
.night-dial .hand-g { transition: transform 1s var(--ease-out); transform-origin: 100px 100px; }
.night-dial figcaption { color: var(--night-ink-2); text-align: center; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 26px; border-bottom: 1px solid var(--night-line); margin-bottom: 30px; }
.filters button { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--night-line); font-size: 14px; font-weight: 550; color: var(--night-ink-2); display: inline-flex; align-items: center; gap: 8px; transition: color .25s, border-color .25s, background-color .25s; }
.filters button .n { font-family: var(--f-mono); font-size: 10px; color: var(--night-ink-3); }
.filters button:hover { color: var(--night-ink); border-color: var(--night-ink-3); }
.filters button[aria-pressed="true"] { background: var(--night-ink); color: var(--night-bg); border-color: var(--night-ink); }
.filters button[aria-pressed="true"] .n { color: var(--night-ink-3); }

/* ---------- Justified grid ----------
   Each row is a flex line. Every tile grows by its aspect ratio and keeps that
   ratio, so all tiles in a row end up exactly the same height. */
.grid { display: grid; gap: clamp(28px, 3.4vw, 48px); }
.grow-row { display: flex; gap: clamp(14px, 1.6vw, 24px); align-items: flex-start; }
.tile { flex: var(--ar) 1 0; min-width: 0; display: block; color: inherit; }
.tile .media { position: relative; aspect-ratio: var(--ar); border-radius: 12px; overflow: hidden; background: var(--bg, var(--night-raise)); isolation: isolate; }
.tile .media img, .tile .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), opacity .6s; }
.tile .media video { opacity: 0; transition: opacity .7s var(--ease-out), transform 1.2s var(--ease-out); backface-visibility: hidden; transform: translateZ(0); }
.tile:hover .media img, .tile:focus-visible .media img, .tile:hover .media video { transform: scale(1.035); }
.tile.playing .media video { opacity: 1; }
.tile .media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); pointer-events: none; }
.tile .cap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 14px; padding-top: 16px; }
.tile .t { grid-column: 1 / -1; font-family: var(--f-display); font-size: clamp(24px, 2vw, 30px); line-height: 1.05; letter-spacing: -.01em; margin-top: 2px; }
.tile .s { grid-column: 1 / -1; color: var(--night-ink-2); font-size: 15px; max-width: 52ch; }
.tag { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--night-line); font-family: var(--f-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--night-ink-2); white-space: nowrap; }
.tag.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #5BE0A0; box-shadow: 0 0 8px #5BE0A0; }
.tag.brief { border-color: color-mix(in srgb, var(--sun) 45%, var(--night-line)); color: #F6CD7A; }
.tile .yr { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--night-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .idx { position: absolute; left: 14px; top: 12px; z-index: 2; font-family: var(--f-mono); font-size: 10.5px; padding: 4px 7px; border-radius: 6px; background: rgba(13,12,17,.55); color: #EDE9F2; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transform: translateY(-4px); transition: opacity .4s, transform .5s var(--ease-out); }
.tile:hover .idx { opacity: 1; transform: none; }

/* Grid entrance/filter animation */
.tile.rv { transform: translateY(40px) scale(.985); }
.tile.rv.in { transform: none; }
.grid.swap { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.grid { transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }

/* ---------- Custom cursor over tiles (fine pointers only) ---------- */
.cursor { position: fixed; z-index: 120; left: 0; top: 0; width: 86px; height: 86px; margin: -43px 0 0 -43px; border-radius: 50%; background: var(--night-ink); color: var(--night-bg); display: grid; place-items: center; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; pointer-events: none; transform: translate(var(--cx, -200px), var(--cy, -200px)) scale(var(--cs, 0)); transition: transform .45s var(--ease-out); will-change: transform; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
body.after.has-cursor .tile { cursor: none; }

/* ---------- Hello ---------- */
.hello { padding-block: clamp(90px, 12vw, 180px) clamp(40px, 6vw, 80px); display: grid; gap: 18px; }
.hello .mono { color: var(--night-ink-2); }
.hello h2 { font-size: clamp(64px, 11vw, 180px); line-height: 1.02; letter-spacing: -.03em; }
.hello-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 26px 34px; border-top: 1px solid var(--night-line); color: var(--night-ink-3); }
.back-day { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--night-ink-2); transition: color .3s; }
.back-day i { display: inline-block; width: 16px; height: 16px; }
.back-day:hover { color: var(--night-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .ah-hero { grid-template-columns: 1fr; }
  .night-dial { width: 150px; justify-self: start; justify-items: start; }
  .night-dial figcaption { text-align: left; }
}
@media (max-width: 720px) {
  .grow-row { flex-direction: column; gap: clamp(28px, 6vw, 40px); }
  .tile { flex: none; width: 100%; }
  .tile .media { aspect-ratio: var(--arm, var(--ar)); }
  .topbar .btn.icon { display: none; }
  .night-dial { display: none; }
  body.after main { padding-top: 96px; }
}

/* Dial caption always stays on one line */
.night-dial figcaption { white-space: nowrap; }
@media (max-width: 860px) { .night-dial { width: auto; } .night-dial svg { width: 150px; } }

/* ---------- Groundwork (design courses) ---------- */
.groundwork { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(24px, 5vw, 80px); padding-top: clamp(90px, 11vw, 160px); }
.gw-head .mono { color: var(--night-ink-2); }
.gw-head h2 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1; letter-spacing: -.02em; margin: 14px 0 16px; }
.gw-intro { color: var(--night-ink-2); max-width: 40ch; font-size: 16px; }
.gw-list { border-top: 1px solid var(--night-line); align-self: end; }
.gw-list li { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--night-line); }
.gw-t { display: grid; gap: 4px; font-size: 17px; }
.gw-n { color: var(--night-ink-3); font-size: 13.5px; line-height: 1.45; }
.gw-list .mono { color: var(--night-ink-3); padding-top: 4px; }
@media (max-width: 860px) { .groundwork { grid-template-columns: 1fr; } }
