/*
  v0.5 "unitylht". Three inks on paper.
  blue pencil (dashed) = plan · black ink (solid) = actual, real · hatch = replan, revision
  Archivo for the human voice (expressive widths), IBM Plex Mono for the system layer.
*/

:root {
  --paper: #f2f1ec;
  --paper-2: #e8e6de;
  --ink: #0e0e0d;
  --ink-2: #5f5e58;
  --rule: #d3d1c8;
  --plan: #2a55e8;
  --plan-soft: rgba(42, 85, 232, 0.09);
  --hatch: repeating-linear-gradient(135deg, var(--ink) 0 1.4px, transparent 1.4px 6px);
  --f-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --m: clamp(1.25rem, 4.5vw, 4.5rem);
  --g: clamp(1rem, 2vw, 2rem);
  --ease: cubic-bezier(0.2, 0.75, 0.15, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f0f0e;
    --paper-2: #191917;
    --ink: #ecebe4;
    --ink-2: #9e9c94;
    --rule: #2e2d29;
    --plan: #7f9dff;
    --plan-soft: rgba(127, 157, 255, 0.12);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--plan);
  color: var(--paper);
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px dashed var(--plan);
  outline-offset: 4px;
}

.mono {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

/* ---------- Tags: the three inks as labels ---------- */
.tag {
  display: inline-block;
  padding: 0.28em 0.6em 0.3em;
  border: 1.5px solid var(--ink);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  vertical-align: middle;
}

.tag-planned {
  border-style: dashed;
  border-color: var(--plan);
  color: var(--plan);
}

.tag-actual,
.tag-ink {
  background: var(--ink);
  color: var(--paper);
}

.ver,
.tag-rev {
  text-transform: none;
}

.tag-replanned,
.tag-rev {
  padding-left: 1.35em;
  background: var(--hatch) left / 0.85em 100% no-repeat, var(--paper);
}

.swatch {
  display: inline-block;
  flex: none;
  width: 1.15rem;
  height: 0.8rem;
  border: 1.5px solid var(--ink);
}

.swatch-planned,
.swatch-plan {
  border-style: dashed;
  border-color: var(--plan);
}

.swatch-actual,
.swatch-ink {
  background: var(--ink);
}

.swatch-replanned {
  background: var(--hatch);
}

/* ---------- Links: ink draws over the blue plan line ---------- */
.link {
  padding-bottom: 0.2em;
  background:
    linear-gradient(var(--ink), var(--ink)) left bottom / 0% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--plan) 0 6px, transparent 6px 10px) left bottom / 100% 1.5px no-repeat;
  font-weight: 600;
  text-decoration: none;
  transition: background-size 0.5s var(--ease);
}

.link:hover,
.link:focus-visible {
  background-size: 100% 2px, 100% 1.5px;
}

.link-big {
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Reading progress: the page is the plan, how far you have read is the ink ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--plan) 0 8px, transparent 8px 13px) 0 0 / 100% 1.5px no-repeat;
  pointer-events: none;
}

.progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

@supports (animation-timeline: scroll()) {
  .progress::after {
    animation: read linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes read {
  to {
    transform: scaleX(1);
  }
}

/* ---------- Page to page: the title carries over ---------- */
@view-transition {
  navigation: auto;
}

.aos-word {
  view-transition-name: aos-title;
}

.jas-word {
  view-transition-name: jas-title;
}

.mc-word {
  view-transition-name: mc-title;
}

::view-transition-group(*) {
  animation-duration: 0.55s;
  animation-timing-function: var(--ease);
}

::view-transition-old(root) {
  animation: vt-out 0.2s ease both;
}

::view-transition-new(root) {
  animation: vt-in 0.35s ease 0.18s both;
}

@keyframes vt-out {
  to {
    opacity: 0;
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
  }
}

/* ---------- Header ---------- */
.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.35rem var(--m) 0;
}

.head-clock {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.head-clock .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.head-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-head ul {
  display: flex;
  gap: 1.75rem;
}

.site-head nav a {
  font-weight: 600;
  text-decoration: none;
}

.site-head nav a:hover {
  text-decoration: underline dashed 1.5px var(--plan);
  text-underline-offset: 0.3em;
}

/* ================= Hero: who ================= */
.hero {
  padding: clamp(2.5rem, 9vh, 6.5rem) var(--m) 0;
}

.hero-name {
  margin-left: -0.045em;
  font-size: min(calc((100vw - 2 * var(--m)) / 3.36), 26rem);
  font-weight: 760;
  letter-spacing: -0.052em;
  line-height: 0.82;
}

.hn-line {
  display: inline-block;
}

.is-ready .hn-line {
  animation: rise 1s var(--ease) backwards;
}

@keyframes rise {
  from {
    clip-path: inset(0 0 100% 0);
    transform: translateY(0.25em);
  }
}

.hero-copy {
  max-width: 37rem;
  margin: clamp(2.5rem, 6vw, 5.5rem) 0 0 auto;
}

.is-ready .hero-copy {
  animation: fade 0.9s ease 0.35s backwards;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.hero-intro {
  font-size: clamp(1.35rem, 2.1vw, 1.95rem);
  letter-spacing: -0.015em;
  line-height: 1.22;
}

.kind-link {
  text-decoration: underline dashed 0.06em var(--plan);
  text-decoration-skip-ink: none;
  text-underline-offset: 0.17em;
  transition: text-decoration-color 0.25s ease;
}

.kind-link:hover,
.kind-link:focus-visible {
  text-decoration-style: solid;
  text-decoration-color: var(--ink);
}

.hero-line {
  max-width: 30em;
  margin-top: 1.1rem;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  line-height: 1.5;
}

/* ================= Work: one of each ================= */
.work {
  padding: clamp(6.5rem, 17vh, 12rem) var(--m) 0;
}

.work-title {
  max-width: 16em;
  margin-top: 0.9rem;
  font-size: clamp(1.9rem, 3.8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.work-list {
  margin-top: clamp(2rem, 5vh, 3.5rem);
  border-top: 1.5px solid var(--ink);
}

.work-row {
  display: grid;
  grid-template-columns: 2.5rem 8rem minmax(0, 1fr) auto;
  grid-template-areas:
    "n kind name state"
    ". . line .";
  column-gap: var(--g);
  row-gap: 0.45rem;
  align-items: baseline;
  padding: 1.35rem 0 1.45rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.wr-n {
  grid-area: n;
  color: var(--ink-2);
}

.wr-kind {
  grid-area: kind;
  color: var(--ink-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wr-name {
  grid-area: name;
  font-size: clamp(1.8rem, 4.3vw, 4.1rem);
  font-weight: 740;
  letter-spacing: -0.04em;
  line-height: 0.95;
  transition: transform 0.4s var(--ease);
}

.wr-line {
  grid-area: line;
  max-width: 34em;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
}

.wr-state {
  grid-area: state;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-2);
}

.work-row:hover .wr-name,
.work-row:focus-visible .wr-name {
  transform: translateX(0.4rem);
}

.work-row:hover .wr-name {
  text-decoration: underline dashed 0.045em var(--plan);
  text-underline-offset: 0.12em;
}

.peek {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: min(24rem, 32vw);
  aspect-ratio: 16 / 10;
  background: var(--paper-2) center top / cover no-repeat;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 1.2rem 2.5rem rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.peek.is-on {
  opacity: 1;
}

/* ================= AcademicOS ================= */
.aos,
.pg-hero,
.pg-sec {
  padding-inline: var(--m);
}

.aos {
  margin-top: clamp(9rem, 22vh, 16rem);
}

.aos-head,
.pg-hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  align-items: start;
}

.aos-head .kicker,
.pg-hero .kicker {
  grid-column: 1 / -1;
}

.aos-word {
  grid-column: 1 / -1;
  margin: 0.6rem 0 0 -0.045em;
  font-size: min(calc((100vw - 2 * var(--m)) / 4.42), 26rem);
  font-stretch: 62%;
  font-weight: 820;
  letter-spacing: -0.012em;
  line-height: 0.78;
}

.aos-word a,
.jas-word a,
.mc-word a {
  text-decoration: none;
}

/* On the homepage the wordmark is drawn as the plan (a blue outline), then inked from left to right. */
.aos .aos-word a {
  color: transparent;
  background: linear-gradient(var(--ink), var(--ink)) left center / 0% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0.014em var(--plan);
  transition:
    background-size 1.25s var(--ease) 0.2s,
    -webkit-text-stroke-color 0.6s ease 1.2s;
}

.aos .aos-word.is-in a {
  background-size: 100% 100%;
  -webkit-text-stroke-color: transparent;
}

/* Leaving view resets the ink at once, so the next visit draws it again from the start. */
.no-anim,
.no-anim * {
  transition: none !important;
}

.aos-word a:hover,
.jas-word a:hover,
.mc-word a:hover {
  text-decoration: underline dashed 3px var(--plan);
  text-underline-offset: 0.1em;
}

.aos-meta {
  grid-column: 1 / 7;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.4rem;
  margin-top: 1.6rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aos-lead {
  grid-column: 7 / 13;
  margin-top: 1.5rem;
  font-size: clamp(1.15rem, 1.55vw, 1.45rem);
  letter-spacing: -0.008em;
  line-height: 1.33;
}

/* The idea, stated once, its three words inked as it comes into view. */
.thesis-text {
  max-width: 14.5em;
  margin: clamp(6rem, 15vh, 10rem) 0 0 16.6%;
  font-size: clamp(2.1rem, 5vw, 5rem);
  font-weight: 680;
  letter-spacing: -0.038em;
  line-height: 1.02;
}

.w-plan,
.w-real,
.w-var {
  background-repeat: no-repeat;
  background-position: left 92%;
  background-size: 0% 0.07em;
  transition: background-size 0.9s var(--ease);
}

.w-plan {
  color: var(--plan);
  background-image: repeating-linear-gradient(90deg, var(--plan) 0 0.16em, transparent 0.16em 0.26em);
}

.w-real {
  background-image: linear-gradient(var(--ink), var(--ink));
  transition-delay: 0.45s;
}

.w-var {
  background-image: var(--hatch);
  transition-delay: 0.9s;
}

.is-in .w-plan,
.is-in .w-real {
  background-size: 100% 0.07em;
}

.is-in .w-var {
  background-size: 100% 0.2em;
}

/* Story: scrolling through the three steps drives the week. */
.story {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  margin-top: clamp(3rem, 8vh, 6rem);
}

.story-steps {
  grid-column: 1 / 5;
}

.story-stage {
  grid-column: 5 / 13;
  position: sticky;
  top: 14vh;
  align-self: start;
  display: flex;
  align-items: center;
  min-height: 72vh;
}

/* A step's text starts just below the line where it takes over, so it is read as it switches. */
.story-step {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 80vh;
  padding-top: 6vh;
  opacity: 0.22;
  cursor: pointer;
  transition: opacity 0.45s var(--ease);
}

.story-step.is-on {
  opacity: 1;
}

.story-step .tag {
  align-self: flex-start;
}

.story-t {
  max-width: 12em;
  margin-top: 1rem;
  font-size: clamp(1.45rem, 2.5vw, 2.4rem);
  font-weight: 640;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.st-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 2.6rem;
}

.st-tabs button,
.live-sizes button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1.5px solid var(--rule);
  color: var(--ink-2);
  cursor: pointer;
}

.st-tabs .mono,
.live-sizes .mono {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.st-tabs button[aria-pressed="true"],
.live-sizes button[aria-pressed="true"] {
  border-color: var(--ink);
  color: var(--ink);
}

/* The week: the same blocks move from the plan to what happened, then the rest is replanned. */
.week {
  width: 100%;
}

.wk-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.week .st-tabs {
  margin-bottom: 0;
}

.wk-week {
  color: var(--ink-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wk-body {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  grid-template-rows: 1.9rem minmax(0, 1fr);
  height: clamp(22rem, 58vh, 36rem);
}

.wk-days {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.wk-days span,
.wk-hours span {
  color: var(--ink-2);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wk-days span {
  padding-left: 0.45rem;
}

.wk-hours {
  position: relative;
  grid-column: 1;
  grid-row: 2;
}

.wk-hours span {
  position: absolute;
  top: calc((var(--h) - 8) / 11 * 100%);
  transform: translateY(-50%);
}

.wk-grid {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% calc(100% / 11);
}

.wk-col {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--d) * 20%);
  width: 20%;
  border-left: 1px solid var(--rule);
}

.wk-b,
.wk-g {
  position: absolute;
  left: calc(var(--d) * 20% + 5px);
  width: calc(20% - 10px);
}

.wk-b {
  top: calc((var(--ps) - 8) / 11 * 100%);
  height: calc((var(--pe) - var(--ps)) / 11 * 100%);
  background-color: var(--plan-soft);
  border: 1.5px dashed var(--plan);
  transition:
    top 0.9s var(--ease),
    height 0.9s var(--ease),
    background-color 0.5s ease,
    border-color 0.5s ease,
    opacity 0.5s ease,
    transform 0.6s var(--ease);
  transition-delay: calc(var(--d) * 70ms);
}

.wk-g {
  top: calc((var(--s) - 8) / 11 * 100%);
  height: calc((var(--e) - var(--s)) / 11 * 100%);
  border: 1.5px dashed var(--plan);
  opacity: 0;
  transition: opacity 0.5s ease 0.45s;
}

.week:is([data-state="actual"], [data-state="replanned"]) .wk-past {
  top: calc((var(--as) - 8) / 11 * 100%);
  height: calc((var(--ae) - var(--as)) / 11 * 100%);
  background-color: var(--ink);
  border: 1.5px solid var(--ink);
}

.week:is([data-state="actual"], [data-state="replanned"]) .wk-g-past {
  opacity: 0.5;
}

.week:is([data-state="actual"], [data-state="replanned"]) .wk-skipped {
  opacity: 0.32;
  background-color: transparent;
}

.wk-extra {
  top: calc((var(--as) - 8) / 11 * 100%);
  height: calc((var(--ae) - var(--as)) / 11 * 100%);
  background-color: var(--ink);
  border: 1.5px solid var(--ink);
  opacity: 0;
  transform: scaleY(0.2);
}

.week:is([data-state="actual"], [data-state="replanned"]) .wk-extra {
  opacity: 1;
  transform: none;
}

.week[data-state="replanned"] .wk-future {
  top: calc((var(--rs) - 8) / 11 * 100%);
  height: calc((var(--re) - var(--rs)) / 11 * 100%);
  background: var(--hatch), var(--paper);
  border: 1.5px solid var(--ink);
}

.week[data-state="replanned"] .wk-g-future {
  opacity: 0.5;
}

.wk-now {
  position: absolute;
  top: calc((var(--h) - 8) / 11 * 100%);
  left: calc(var(--d) * 20%);
  width: 20%;
  border-top: 2px solid var(--ink);
  z-index: 2;
}

.wk-now i {
  position: absolute;
  top: 0.3rem;
  right: 0.35rem;
  padding: 0 0.3rem;
  background: var(--paper);
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wk-cap {
  margin-top: 0.9rem;
  color: var(--ink-2);
}

/* Real screenshots are real things: drawn in ink. */
.shot img,
.real-img img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
}

.shot figcaption {
  max-width: 60em;
  margin-top: 0.8rem;
  color: var(--ink-2);
}

.aos-foot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  margin-top: clamp(3rem, 9vh, 6rem);
}

.aos-foot p {
  grid-column: 5 / 10;
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  line-height: 1.35;
}

.aos-foot .link {
  grid-column: 5 / 10;
  justify-self: start;
  margin-top: 1rem;
}

/* ================= Jason's Website ================= */
.jas,
.mc {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  align-items: center;
  margin-top: clamp(9rem, 22vh, 16rem);
  padding-inline: var(--m);
}

.jas {
  align-items: start;
}

.jas-text {
  padding-top: 2rem;
}

.jas-word {
  margin: 0.9rem 0 1.25rem;
  font-size: clamp(2.6rem, 5.6vw, 5.6rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.jas-p,
.mc-p {
  max-width: 26em;
  margin-bottom: 1.25rem;
  font-size: clamp(1.05rem, 1.25vw, 1.2rem);
  line-height: 1.45;
}

/* Scrolling through the three widths widens the real site: phone, tablet, desktop. */
.jas-story {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
}

.jas-stage {
  grid-column: 1 / 9;
  position: sticky;
  top: 12vh;
  align-self: start;
}

.jas-side {
  grid-column: 9 / 13;
}

.jas-step {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 72vh;
  padding-top: 6vh;
  opacity: 0.25;
  cursor: pointer;
  transition: opacity 0.45s var(--ease);
}

.jas-step.is-on {
  opacity: 1;
}

.jas-step-k {
  color: var(--ink-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jas-step-k span {
  color: var(--plan);
}

.jas-step-t {
  max-width: 14em;
  margin-top: 0.8rem;
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  font-weight: 640;
  letter-spacing: -0.022em;
  line-height: 1.15;
}

/* The live frame: Jason's real site at a width you choose. Its Home capture waits underneath until the site paints over it. */
.live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.9rem;
}

.live-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.live-range {
  flex: 1 1 8rem;
  min-width: 6rem;
  height: 1.6rem;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.live-range::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--ink);
}

.live-range::-webkit-slider-thumb {
  width: 0.95rem;
  height: 0.95rem;
  margin-top: calc(1px - 0.475rem);
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  -webkit-appearance: none;
  appearance: none;
}

.live-range::-moz-range-track {
  height: 2px;
  background: var(--ink);
}

.live-range::-moz-range-thumb {
  width: 0.95rem;
  height: 0.95rem;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
}

.live-w {
  min-width: 5.5em;
  text-align: right;
}

.live-w b {
  font-weight: 500;
}

.live-stage {
  position: relative;
  height: clamp(22rem, 38vw, 36rem);
  overflow: hidden;
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
}

.live-view {
  position: absolute;
  top: 0;
  left: 50%;
  box-shadow: 0 0 0 1px var(--rule);
  transform-origin: 50% 0;
}

/* A tweened width lets the real page reflow on the way; the slider follows the hand directly. */
.live-view.is-tween {
  transition:
    width 0.85s var(--ease),
    height 0.85s var(--ease),
    transform 0.85s var(--ease);
}

.live-view iframe {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.live-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
}

.live-cap {
  margin-top: 0.9rem;
  color: var(--ink-2);
}

.live-cap .link {
  font-family: var(--f-mono);
  font-weight: 500;
}

/* ================= Minecraft ================= */
.mc {
  align-items: end;
}

.mc-text {
  grid-column: 1 / 5;
}

.mc-word {
  margin: 0.9rem 0 1.1rem;
  font-size: clamp(2rem, 3.7vw, 3.6rem);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.run {
  padding: 1rem 0 0.95rem;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.run-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.run-step {
  display: grid;
  gap: 0.4rem;
  padding: 0.15rem 0.75rem 0.85rem;
  border-left: 1px solid var(--rule);
}

.run-step:first-child {
  padding-left: 0;
  border-left: 0;
}

.run-n {
  color: var(--ink-2);
  font-size: 0.75rem;
}

.run-name {
  color: var(--plan);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.run-bar {
  position: relative;
  height: 0.5rem;
  border: 1.5px dashed var(--plan);
}

.run-bar i {
  position: absolute;
  inset: -1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

.run-step:is([data-st="active"], [data-st="done"]) .run-name {
  color: var(--ink);
}

.run-step[data-st="done"] .run-bar {
  border-style: solid;
  border-color: var(--ink);
}

.run-go {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.run-total {
  height: 2px;
  margin-top: 0.5rem;
  background: var(--rule);
}

.run-total i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

/* The Minecraft story: the run stays pinned while the page scrolls through its six steps. */
.mc-story {
  grid-column: 1 / -1;
  height: calc(100vh + 6 * 42vh);
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.mc-pin {
  position: sticky;
  top: 26vh;
}

.run-story .run-bar {
  height: 0.7rem;
}

.mc-story-k {
  margin-bottom: 1rem;
  color: var(--ink-2);
}

.mc-now {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  align-items: baseline;
  margin-top: clamp(2rem, 5vh, 3.5rem);
}

.mc-now-n {
  grid-column: 1 / 3;
  color: var(--ink-2);
}

.mc-now-n b {
  color: var(--ink);
  font-weight: 500;
}

.mc-now-name {
  grid-column: 3 / 7;
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.mc-now-text {
  grid-column: 7 / 12;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  line-height: 1.38;
}

.mc-now.is-on > * {
  animation: now-in 0.5s var(--ease) backwards;
}

.mc-now.is-on .mc-now-text {
  animation-delay: 0.06s;
}

@keyframes now-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

.run-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 0.8rem;
}

.run-status {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.run-note {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* ================= About ================= */
.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  margin-top: clamp(10rem, 24vh, 17rem);
  padding-inline: var(--m);
}

.about .kicker {
  grid-column: 1 / -1;
}

.about-title {
  grid-column: 1 / 7;
  margin-top: 0.9rem;
  font-size: clamp(2.6rem, 6.2vw, 6rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.about-body {
  grid-column: 7 / 12;
  margin-top: 1.4rem;
  font-size: clamp(1.1rem, 1.35vw, 1.3rem);
  line-height: 1.45;
}

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

.about-quote {
  grid-column: 2 / 11;
  margin-top: clamp(3.5rem, 8vh, 5.5rem);
  padding: 0.3rem 0 0.3rem 1.3rem;
  background: var(--hatch) left / 0.55rem 100% no-repeat;
  font-size: clamp(1.45rem, 2.7vw, 2.5rem);
  font-weight: 640;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.about-quote p {
  padding-left: 0.4rem;
}

.about-facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem var(--g);
  margin-top: clamp(3rem, 7vh, 4.5rem);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.about-facts dt,
.facts dt {
  margin-bottom: 0.4rem;
  color: var(--ink-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ================= Contact ================= */
.contact {
  margin-top: clamp(8rem, 18vh, 12rem);
  padding-inline: var(--m);
}

.contact-title {
  margin-top: 0.9rem;
  font-size: clamp(2.6rem, 6.2vw, 6rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.contact-email {
  margin-top: 1.4rem;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* Copy: dashed blue until it has happened, then ink. */
.copy {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.4rem;
  padding: 0.7rem 1rem;
  background: transparent;
  border: 1.5px dashed var(--plan);
  color: var(--plan);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.copy:hover {
  background: var(--plan-soft);
}

.copy-label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-mark {
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px dashed currentColor;
}

.copy.is-copied {
  background: var(--ink);
  border: 1.5px solid var(--ink);
  color: var(--paper);
}

.copy.is-copied .copy-mark {
  background: currentColor;
  border-style: solid;
}

.copy-sm {
  margin-top: 0.6rem;
  padding: 0.45rem 0.7rem;
}

.foot-email {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ================= Footer ================= */
.site-foot {
  margin-top: clamp(9rem, 22vh, 16rem);
  padding: 0 var(--m) 2.75rem;
}

.foot-mark {
  margin-left: -0.045em;
  padding-bottom: 0.2em; /* room for the descender of the y above the rule */
  color: transparent;
  font-size: min(calc((100vw - 2 * var(--m)) / 3.36), 26rem);
  font-weight: 760;
  letter-spacing: -0.052em;
  line-height: 0.82;
  -webkit-text-stroke: 1.5px var(--plan);
  user-select: none;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem var(--g);
  padding-top: 1.25rem;
  border-top: 1.5px solid var(--ink);
}

.foot-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.foot-k {
  margin-bottom: 0.55rem;
  color: var(--ink-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foot-grid li + li {
  margin-top: 0.35rem;
}

.visit {
  display: grid;
  gap: 0.35rem;
  max-width: 16rem;
}

.visit-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.visit b {
  margin-left: auto;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ================= Project pages ================= */
.pg-hero {
  padding-top: clamp(1.5rem, 4vh, 3rem);
}

.back {
  grid-column: 1 / -1;
  justify-self: start;
  margin-bottom: clamp(2.5rem, 7vh, 5rem);
}

.pg-hero .aos-lead {
  margin-top: 1.75rem;
}

.pg-word.jas-word,
.pg-word.mc-word {
  grid-column: 1 / -1;
  margin-top: 0.8rem;
  font-size: clamp(2.8rem, 8vw, 8rem);
}

.pg-run {
  grid-column: 1 / -1;
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.sec-k {
  margin-bottom: 1.5rem;
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pg-sec {
  margin-top: clamp(6rem, 14vh, 10rem);
}

.reals {
  display: grid;
  gap: clamp(3.5rem, 9vh, 6rem);
}

.real {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  align-items: start;
}

.real-head {
  grid-column: 1 / 4;
  position: sticky;
  top: 2rem;
  display: grid;
  justify-items: start;
  gap: 0.8rem;
}

.real-title {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.real-text {
  color: var(--ink-2);
  line-height: 1.45;
}

.real-img {
  grid-column: 4 / 13;
  display: block;
}

.real-note {
  margin-top: 1.5rem;
  color: var(--ink-2);
}

.pg-quote {
  max-width: 15em;
  margin: clamp(4rem, 10vh, 7rem) 0 0 16.6%;
  font-size: clamp(1.7rem, 3.4vw, 3.2rem);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.areas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem var(--g);
  max-width: 64rem;
}

.area h3 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.area p {
  max-width: 26em;
  margin-top: 0.6rem;
}

.area-n,
.apart-k,
.st-k {
  color: var(--ink-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.apart {
  max-width: 64rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.apart-k {
  margin-bottom: 0.9rem;
}

.apart ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--g);
}

.apart li {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
}

.ai {
  max-width: 64rem;
}

.ai-p {
  max-width: 22em;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.ai-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.rel {
  max-width: 72rem;
}

.strip {
  margin-bottom: 2.5rem;
}

.st-k {
  margin-bottom: 0.75rem;
}

.st-days,
.st-lanes {
  position: relative;
}

.st-days {
  height: 1.6rem;
  border-bottom: 1px solid var(--rule);
}

.st-day {
  position: absolute;
  bottom: 0.3rem;
  color: var(--ink-2);
  font-size: 0.6875rem;
  text-align: center;
}

.st-lanes {
  height: calc(var(--rows) * 2.4rem + 0.6rem);
  margin-top: 0.6rem;
}

.st-v {
  position: absolute;
  top: calc(var(--row) * 2.4rem);
  height: 2rem;
  display: flex;
  align-items: center;
  padding-inline: 0.4rem;
  overflow: hidden;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}

.st-v b {
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.st-v.is-current {
  background: var(--ink);
  color: var(--paper);
}

.vlist li {
  display: grid;
  grid-template-columns: minmax(7rem, 1.2fr) minmax(5rem, 0.8fr) minmax(0, 5fr);
  gap: 0.25rem var(--g);
  align-items: baseline;
  padding-block: 0.7rem;
  border-top: 1px solid var(--rule);
}

.vl-v {
  font-weight: 500;
}

.vl-d {
  color: var(--ink-2);
}

.vlist .is-current .vl-v::after {
  content: "current";
  margin-left: 0.6rem;
  padding: 0.1em 0.45em;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stack {
  margin-top: 1.5rem;
}

.stack .mono {
  margin-right: 0.8rem;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pg-sec-wide {
  margin-top: clamp(4rem, 10vh, 7rem);
}

.pg-jas .live-stage {
  height: clamp(24rem, 46vw, 44rem);
}

.why {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  align-items: start;
  max-width: 80rem;
}

.why-p {
  font-size: clamp(1.2rem, 1.7vw, 1.55rem);
  letter-spacing: -0.01em;
  line-height: 1.38;
}

.mc-shots {
  max-width: 64rem;
  margin-bottom: 3rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem var(--g);
  max-width: 72rem;
}

.visit-link {
  margin-top: 2.5rem;
}

/* Headlines and quotes break into balanced lines, never a lone last word. */
.work-title,
.thesis-text,
.story-t,
.jas-step-t,
.mc-now-text,
.about-title,
.about-quote p,
.real-title,
.pg-quote {
  text-wrap: balance;
}

/* ================= Wide screens only ================= */
@media (min-width: 1000px) {
  .mc-text {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--g);
    align-items: end;
  }

  .mc-text .kicker {
    grid-column: 1 / -1;
  }

  .mc-word {
    grid-column: 1 / 7;
    margin-bottom: 0;
  }

  .mc-p {
    grid-column: 7 / 12;
    margin-bottom: 0.2rem;
  }

  .mc-text .link {
    grid-column: 7 / 12;
    justify-self: start;
    margin-top: 1rem;
  }

}

/* ================= Medium screens ================= */
@media (max-width: 999px) {
  /* Each stage stays pinned at the top while its steps scroll beneath it. */
  .story {
    display: flex;
    flex-direction: column;
  }

  .story-stage {
    order: -1;
    top: 0;
    z-index: 3;
    display: block;
    min-height: 0;
    margin-inline: calc(-1 * var(--m));
    padding: 0.9rem var(--m) 0.7rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }

  .wk-top {
    margin-bottom: 0.6rem;
  }

  .week .wk-body {
    height: min(15rem, 34vh);
  }

  .wk-cap {
    margin-top: 0.5rem;
    font-size: 0.75rem;
  }

  .story-step,
  .jas-step {
    min-height: 58vh;
    opacity: 0.3;
  }

  .story-t {
    max-width: 16em;
  }

  .mc-text {
    grid-column: 1 / -1;
  }

  .jas-story {
    display: flex;
    flex-direction: column;
  }

  .jas-side {
    display: contents;
  }

  .jas-text {
    order: -2;
    padding-top: 0;
  }

  .jas-stage {
    order: -1;
    top: 0;
    z-index: 3;
    margin: 2rem calc(-1 * var(--m)) 0;
    padding: 0.8rem var(--m) 0.6rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }

  .jas-stage .live-stage {
    height: min(17rem, 38vh);
  }

  .jas-stage .live-range {
    display: none;
  }

  .jas-stage .live-cap {
    margin-top: 0.5rem;
  }

  .mc-story {
    height: calc(100vh + 6 * 36vh);
  }

  .mc-pin {
    top: 0;
    z-index: 3;
    margin-inline: calc(-1 * var(--m));
    padding: 0.8rem var(--m) 1rem;
    background: var(--paper);
  }

  .mc-now {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.5rem;
  }

  .mc-now-n,
  .mc-now-name,
  .mc-now-text {
    grid-column: 1 / -1;
  }

  .foot-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .real-head,
  .real-img {
    grid-column: 1 / -1;
  }

  .real-head {
    position: static;
    margin-bottom: 1.1rem;
  }
}

/* ================= Phones ================= */
@media (max-width: 720px) {
  .hero-name,
  .foot-mark {
    font-size: calc((100vw - 2 * var(--m)) / 3.4);
  }

  .hero-copy {
    margin-left: 10%;
  }

  .site-head ul {
    gap: 1.2rem;
  }

  .work-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "n kind state"
      "name name name"
      "line line line";
    row-gap: 0.55rem;
  }

  .thesis-text {
    margin-left: 0;
  }

  .aos-meta,
  .aos-lead {
    grid-column: 1 / -1;
  }

  .aos-lead {
    margin-left: 10%;
  }

  .st-tabs button {
    padding: 0.4rem 0.55rem;
  }

  .aos-foot p,
  .aos-foot .link {
    grid-column: 1 / -1;
  }

  .live-stage {
    height: 26rem;
  }

  .live-range {
    order: 3;
    flex-basis: 100%;
  }

  .run-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 0.9rem;
  }

  .run-step:nth-child(4) {
    padding-left: 0;
    border-left: 0;
  }

  .about-title,
  .about-body,
  .about-quote {
    grid-column: 1 / -1;
  }

  .about-facts,
  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .areas,
  .why {
    grid-template-columns: minmax(0, 1fr);
  }

  .apart ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pg-quote {
    margin-left: 0;
  }

  .strip {
    display: none;
  }

  .vlist li {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 0.9rem;
  }

  .vl-t {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  .progress::after {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
