/*
 * What lives in each place of the universe.
 *
 * Type is the architecture here: no cards, no framed images, no filled
 * surfaces. Hierarchy comes from size, weight, tracking and space, and the
 * text is deliberately set large because the camera reads it from a distance.
 */

/* ── Entrance ───────────────────────────────────────────────── */
/*
 * The landing screen is composed against the viewport, not against its own
 * content height. The section fills the frame and splits it into three rows:
 * the composition sits in the middle one and is therefore centred no matter
 * how tall it grows, while the scroll cue rides the bottom row without ever
 * pulling the centre line upward.
 *
 * `svh` is used ahead of `vh` so a mobile browser's collapsing address bar
 * does not push the composition off centre.
 */
.place--entrance .place__inner {
  text-align: center;
}

[data-section="hero"] {
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
}

.entrance__composition {
  grid-row: 2;
  align-self: center;
}

.entrance__status {
  font-size: var(--t-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

/*
 * The name.
 *
 * Not white: the palette's own orange runs through a warm gold into the
 * violet, clipped to the letterforms. The gradient is wider than the word
 * and drifts slowly across it, so the light appears to move through the
 * letters rather than sit behind them.
 */
.entrance__name {
  margin-top: clamp(1.2rem, 4vh, 2.4rem);
  font-size: clamp(3.2rem, 11vw, 9rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  line-height: 1;
}

.entrance__name-ink {
  display: inline-block;
  background: var(--blend);
  background-size: 220% 100%;
  background-position: 12% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  /* The glow has to come from a drop-shadow: the text itself has no colour
     for a text-shadow to pick up. Two passes, warm then cool, so the light
     around the word carries the same blend the word does. */
  filter:
    drop-shadow(0 0 26px rgba(232, 129, 58, 0.28))
    drop-shadow(0 0 54px rgba(168, 136, 255, 0.3));
  animation: name-light 14s var(--ease-in-out) infinite alternate;
}

@keyframes name-light {
  to {
    background-position: 88% 50%;
  }
}

.entrance__role {
  margin-top: clamp(0.9rem, 2.2vh, 1.5rem);
  font-size: var(--t-subtitle);
  font-weight: 300;
  color: var(--text);
}

.entrance__disciplines {
  margin-top: clamp(0.8rem, 1.8vh, 1.2rem);
  font-size: var(--t-label);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.entrance__disciplines span + span::before {
  content: "·";
  margin: 0 0.9em;
  color: var(--violet);
}

.entrance__links {
  margin-top: clamp(1.8rem, 4.4vh, 2.8rem);
  display: flex;
  justify-content: center;
  gap: 1.8rem;
  font-size: var(--t-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.entrance__link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding-bottom: 0.3rem;
  color: var(--text);
  border-bottom: 1px solid var(--hairline-strong);
  transition: color var(--speed-fast) ease, border-color var(--speed-fast) ease;
}

/* LinkedIn and the CV lead; the repository is offered more quietly. */
.entrance__link--quiet {
  color: var(--text-faint);
  border-bottom-color: transparent;
}

.entrance__link-mark {
  font-size: 0.9em;
  color: var(--text-accent);
  transition: transform var(--speed) var(--ease-out);
}

.entrance__link:hover {
  color: var(--text-strong);
  border-bottom-color: var(--violet);
}

.entrance__link:hover .entrance__link-mark {
  transform: translate(2px, -2px);
}

.entrance__link--quiet:hover .entrance__link-mark {
  transform: translate(2px, -2px);
}

/* The bottom row of the entrance grid: the cue rides the foot of the frame. */
.entrance__enter {
  grid-row: 3;
  align-self: end;
  padding-bottom: clamp(1.2rem, 4vh, 2.8rem);
  display: inline-grid;
  justify-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color var(--speed-fast) ease;
}

.entrance__enter:hover {
  color: var(--text);
}

.entrance__enter-line {
  width: 1px;
  height: 54px;
  background: linear-gradient(to bottom, var(--violet), transparent);
  animation: enter-pulse 2.8s var(--ease-in-out) infinite;
  transform-origin: 50% 0;
}

@keyframes enter-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scaleY(0.6);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ── About ──────────────────────────────────────────────────── */
[data-section="about"] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "eyebrow eyebrow"
    "figure  lead"
    "figure  interests"
    "figure  body"
    "figure  meta";
  align-items: center;
  column-gap: clamp(2rem, 5vw, 4.5rem);
}

[data-section="about"] .region__eyebrow { grid-area: eyebrow; }
[data-section="about"] .about__figure { grid-area: figure; }
[data-section="about"] .about__lead { grid-area: lead; }
[data-section="about"] .about__interests { grid-area: interests; }
[data-section="about"] .about__body { grid-area: body; }
[data-section="about"] .about__meta { grid-area: meta; }

.about__figure {
  width: clamp(230px, 25vw, 400px);
  margin: clamp(1rem, 3vh, 2rem) 0 0;
  /*
   * Unframed: the portrait dissolves into the void rather than sitting in a
   * box. The opaque core is held wide enough that the figure itself stays
   * whole and only its white ground is eaten away.
   */
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 54%, transparent 84%);
  mask-image: radial-gradient(circle at 50% 46%, #000 54%, transparent 84%);
  filter: saturate(0.82) contrast(1.05) brightness(1);
  opacity: 0.96;
}

.about__lead {
  max-width: 17ch;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.4vw, 5.1rem);
  line-height: 0.92;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--poster);
  text-shadow: none;
  transition:
    letter-spacing 1.4s var(--ease-out),
    opacity 0.75s var(--ease-out),
    transform 0.95s var(--ease-out);
}

.place.is-arrived .about__lead {
  letter-spacing: -0.005em;
}

/* The lit words inside the headline take the warm accent already in use. */
.about__lead .spark {
  color: var(--poster-bright);
  background-image: none;
}

.about__interests {
  margin-top: clamp(0.9rem, 2.4vh, 1.6rem);
  max-width: 42ch;
  font-size: var(--t-lead);
  color: var(--text);
}

.about__body {
  margin-top: clamp(1.2rem, 3vh, 2rem);
  max-width: 46ch;
  font-size: var(--t-body);
  color: var(--text-muted);
}

.about__meta {
  margin-top: clamp(1.6rem, 4vh, 2.6rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.2rem;
  font-size: var(--t-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── A place in the universe: project or event ──────────────── */
/*
 * One voice for every title past the entrance: the display face, the warm
 * ink, and a glow of the same colour. The entrance keeps its own formal
 * lettering — see .entrance__name.
 */
.place__name,
.about__lead,
.exit__title,
.worklist__title,
.record__title,
.waypoint__title,
.orbits__core-label {
  font-family: var(--font-title);
  font-weight: 400;
  color: var(--title-ink);
  /* A little tracking and a softer ink take the weight out of the face
     without changing it. */
  letter-spacing: 0.035em;
  opacity: 0.94;
}

.place__name {
  margin-top: clamp(1rem, 3vh, 2rem);
  display: grid;
  font-size: var(--t-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.94;
  text-transform: uppercase;
}

/*
 * A name is given the full display size only when it is short enough to hold
 * it. Every extra line costs a whole row of vertical space, and a place that
 * runs out of vertical space has to scale *all* of its content down to fit
 * the frame - so the title steps back rather than making the paragraph under
 * it unreadable.
 */
.place__name[data-lines="2"] {
  font-size: clamp(2.7rem, 6vw, 5.4rem);
}

.place__name[data-lines="3"] {
  font-size: clamp(2.4rem, 4.6vw, 4.2rem);
}

.place__name[data-lines="4"] {
  font-size: clamp(2.1rem, 4.1vw, 3.7rem);
}

.place__name[data-lines="5"],
.place__name[data-lines="6"] {
  font-size: clamp(1.9rem, 3.5vw, 3.1rem);
}

.place__name--event {
  max-width: 16ch;
}

.place__line {
  margin-top: clamp(1rem, 2.4vh, 1.6rem);
  font-size: var(--t-subtitle);
  color: var(--violet-pale);
}

.place__summary {
  margin-top: clamp(0.9rem, 2vh, 1.4rem);
  max-width: 44ch;
  font-size: var(--t-lead);
  line-height: 1.5;
  color: var(--text-muted);
}

.place__tech {
  margin-top: clamp(0.9rem, 2.2vh, 1.6rem);
  max-width: 56ch;
  font-size: var(--t-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.place__actions,
.record__actions,
.waypoint__actions {
  margin-top: clamp(1.2rem, 3vh, 2.2rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1.8rem;
}

/* ── Independent web work ───────────────────────────────────── */
.worklist {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  display: grid;
  gap: clamp(1.6rem, 4vh, 2.8rem);
}

.worklist__item {
  padding-top: clamp(1.2rem, 3vh, 2rem);
  border-top: 1px solid var(--hairline);
}

.worklist__title {
  font-size: var(--t-title);
  font-weight: 600;
}

.worklist__tech {
  margin-top: 0.55rem;
  font-size: var(--t-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.worklist__actions {
  margin-top: 1rem;
  display: flex;
  gap: 1.6rem;
}

/* ── Skills: an orbital system ──────────────────────────────── */
/*
 * A core with three tilted rings around it. The rings and the technologies on
 * them are real 3D objects inside the place's perspective, so a body on the
 * near side of its orbit stands in front of the core and one on the far side
 * passes behind it. Positions come from js/sections/skills.js; everything
 * here is appearance.
 */
.orbits {
  position: relative;
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
  display: grid;
  justify-items: center;
}

.orbits__field {
  position: relative;
  width: 100%;
  /*
   * The orbital system is the content of this place, not decoration inside
   * it: it is given the height of a section rather than the height of an
   * illustration, so the technologies on the outer ring are readable from
   * the distance the place is read at.
   */
  height: clamp(430px, 62vh, 700px);
  transform-style: preserve-3d;
}

/* The orbits themselves: thin ellipses, lit only when their ring is chosen. */
.orbits__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ring-w);
  height: var(--ring-h);
  translate: -50% -50%;
  border: 1px solid rgba(168, 136, 255, 0.16);
  border-radius: 50%;
  opacity: 0;
  transition:
    opacity 0.5s var(--ease-out),
    border-color 0.6s ease,
    box-shadow 0.6s ease;
}

.place.is-arrived .orbits__ring {
  opacity: 1;
}

.orbits__ring.is-lit {
  border-color: rgba(201, 182, 255, 0.62);
  box-shadow: 0 0 40px -8px rgba(168, 136, 255, 0.45);
}

/* The core. */
.orbits__core {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  opacity: 0;
  scale: 0.6;
  transition: opacity 1s var(--ease-out), scale 1.4s var(--ease-out);
}

.place.is-arrived .orbits__core {
  opacity: 1;
  scale: 1;
}

.orbits__core-glow {
  position: absolute;
  width: clamp(120px, 15vw, 215px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 136, 255, 0.42), transparent 68%);
  animation: core-pulse 7s var(--ease-in-out) infinite alternate;
}

@keyframes core-pulse {
  to {
    transform: scale(1.16);
    opacity: 0.72;
  }
}

.orbits__core-label {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.92rem, 1.35vw, 1.3rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--title-ink);
}

/* The technologies in orbit. */
.orbits__bodies {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.orbit-body {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -0.7em 0 0 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transform-style: preserve-3d;
  cursor: default;
  opacity: 0;
  /* No stagger: the system appears as one object. */
  transition: opacity 0.5s var(--ease-out);
}

.place.is-arrived .orbit-body {
  /* --front is written per frame: 1 on the near side of the orbit, 0 behind. */
  opacity: calc(0.42 + var(--front, 0.5) * 0.58);
}

.orbit-body__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 14px 2px rgba(168, 136, 255, calc(0.2 + var(--front, 0.5) * 0.5));
  transition: background-color var(--speed) ease, box-shadow var(--speed) ease;
}

.orbit-body__name {
  font-size: clamp(1.02rem, 1.3vw, 1.42rem);
  color: var(--text);
  transform: translateX(calc(var(--side, 1) * 0.9rem - 50% + var(--side, 1) * 50%));
  transition: color var(--speed-fast) ease, text-shadow var(--speed-fast) ease;
}

/* Focus: the held technology brightens, everything else steps back. */
.orbits.is-focused .orbit-body {
  opacity: calc(0.16 + var(--front, 0.5) * 0.18);
}

.orbits.is-focused .orbit-body.is-active {
  opacity: 1;
}

.orbit-body.is-active .orbit-body__name {
  color: var(--text-strong);
  text-shadow: var(--glow-soft);
}

.orbit-body.is-active .orbit-body__dot {
  background: #fff;
  box-shadow: 0 0 22px 4px rgba(201, 182, 255, 0.85);
}

/* The readout names the discipline, in place of a tooltip. */
.orbits__readout {
  margin-top: clamp(0.5rem, 2vh, 1.2rem);
  min-height: 2.6em;
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  text-align: center;
}

.orbits__readout strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-subtitle);
  color: var(--text-strong);
}

.orbits__readout span {
  font-size: var(--t-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Experience waypoints ───────────────────────────────────── */
.waypoints {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}

/*
 * A waypoint keeps its words and its photographs side by side. Stacking them
 * would put a photograph directly under a paragraph, which is the one
 * arrangement this composition is built to avoid.
 */
.waypoint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(150px, 13vw, 210px);
  column-gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}

.waypoint__text {
  grid-column: 1;
}

/* Years and periods are information, not fine print: they read at the same
   size as the metadata everywhere else in the universe. */
.waypoint__period,
.record__period {
  font-size: var(--t-meta);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.waypoint__title,
.record__title {
  margin-top: 0.75rem;
  font-size: var(--t-title);
  font-weight: 600;
}

.waypoint__org {
  margin-top: 0.5rem;
  color: var(--violet-pale);
  font-size: var(--t-lead);
}

.waypoint__body,
.record__detail {
  margin-top: 0.75rem;
  max-width: 46ch;
  color: var(--text-muted);
  font-size: var(--t-body);
}

/* ── Education & certifications ───────────────────── */
.record {
  margin-top: clamp(1.2rem, 3vh, 2rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: clamp(1rem, 2.4vh, 1.8rem) clamp(2rem, 5vw, 4rem);
}

.record__entry {
  padding-top: clamp(0.85rem, 1.8vh, 1.3rem);
  border-top: 1px solid var(--hairline);
}

.record__actions {
  margin-top: 1rem;
}

/*
 * The certificate ledger.
 *
 * One entry per row, the year leading each line. A record is read by year
 * first, so the year is given the size and the warmth to be found at a
 * glance instead of being set as fine print beside the award.
 *
 *   2024   FRONT-END WEB DEVELOPMENT
 *          Udacity
 *          HTML, CSS, JS, Webpack, Sass …            Certificate ›
 */
.ledger {
  margin-top: clamp(1rem, 2.5vh, 1.8rem);
  display: grid;
  gap: clamp(0.9rem, 2.2vh, 1.6rem);
}

.ledger__entry {
  display: grid;
  grid-template-columns: minmax(4.5ch, auto) minmax(0, 1fr);
  column-gap: clamp(1.2rem, 3vw, 2.6rem);
  padding-top: clamp(0.7rem, 1.6vh, 1.1rem);
  border-top: 1px solid var(--hairline);
}

.ledger__year {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-subtitle);
  line-height: 1.05;
  color: var(--text-warm);
  font-variant-numeric: tabular-nums;
}

.ledger__title {
  font-size: var(--t-entry);
  font-weight: 600;
  line-height: 1.08;
}

.ledger__issuer {
  margin-top: 0.35rem;
  font-size: var(--t-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-accent);
}

.ledger__detail {
  margin-top: 0.5rem;
  max-width: 52ch;
  font-size: var(--t-body);
  color: var(--text-muted);
}

.ledger__actions {
  margin-top: 0.7rem;
}

/*
 * The education timeline.
 *
 * The trunk, the fork and the two drops are drawn here in the layer the words
 * live on. The stars of the cosmic path resolve onto exactly these lines as
 * the camera arrives — the numbers below are the constants in
 * js/universe/timeline.js, measured from the centre of the place, and one
 * unit there is one pixel here because both are projected through the same
 * focal length.
 */
.timeline {
  --trunk-top: -250px;
  --joint: 40px;
  --branch-x: 330px;
  --branch-bottom: 186px;

  position: relative;
  height: 520px;
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
}

/* Everything in the timeline is positioned from its centre, which is the
   point the morph is anchored to. */
.timeline__crown,
.timeline__trunk,
.timeline__fork,
.timeline__drop,
.timeline__branches {
  position: absolute;
  left: 50%;
  top: 50%;
}

.timeline__crown {
  transform: translate(-50%, calc(var(--trunk-top) - 2.4em));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-subtitle);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--blend-tight);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.timeline__trunk {
  width: 1px;
  height: calc(var(--joint) - var(--trunk-top));
  transform: translate(-50%, var(--trunk-top));
  background: linear-gradient(to bottom, transparent, var(--hairline-strong) 22%, var(--hairline-strong));
}

.timeline__fork {
  width: calc(var(--branch-x) * 2);
  height: 1px;
  transform: translate(-50%, var(--joint));
  background: linear-gradient(90deg, transparent, var(--hairline-strong) 18%, var(--hairline-strong) 82%, transparent);
}

.timeline__drop {
  width: 1px;
  height: calc(var(--branch-bottom) - var(--joint));
  background: linear-gradient(to bottom, var(--hairline-strong), transparent);
}

.timeline__drop--left {
  transform: translate(calc(-50% - var(--branch-x)), var(--joint));
}

.timeline__drop--right {
  transform: translate(calc(-50% + var(--branch-x)), var(--joint));
}

.timeline__branches {
  transform: translate(-50%, var(--branch-bottom));
  width: calc(var(--branch-x) * 2 + 46ch);
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(2rem, 5vw, 4rem);
}

.timeline__branch {
  position: relative;
  padding-top: 1.9rem;
}

.timeline__branch--left {
  text-align: right;
  justify-self: end;
  max-width: 26ch;
}

.timeline__branch--right {
  text-align: left;
  justify-self: start;
  max-width: 26ch;
}

/* The node where a branch meets its entry, sitting on the foot of the drop. */
.timeline__node {
  position: absolute;
  top: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 18px 3px rgba(168, 136, 255, 0.5);
}

.timeline__branch--left .timeline__node {
  right: calc(50% - 4.5px);
}

.timeline__branch--right .timeline__node {
  left: calc(50% - 4.5px);
}

/* The branch text is centred under its own node, not under the column. */
.timeline__branch--left > :not(.timeline__node) {
  margin-right: 0;
  text-align: right;
}

.timeline__label {
  font-size: var(--t-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

.timeline__period {
  margin-top: 0.5rem;
  font-size: var(--t-subtitle);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-warm);
  font-variant-numeric: tabular-nums;
}

.timeline__title {
  margin-top: 0.4rem;
  font-size: var(--t-entry);
  font-weight: 600;
  line-height: 1.1;
}

.timeline__institution {
  margin-top: 0.5rem;
  font-size: var(--t-body);
  color: var(--text-muted);
}

.timeline__more {
  margin-top: clamp(1rem, 3vh, 2rem);
  display: grid;
  gap: 1rem;
}

/* ── Exit ───────────────────────────────────────────────────── */
.place--exit .place__inner {
  text-align: center;
}

.exit__title {
  font-size: var(--t-display);
  font-weight: 700;
  line-height: 0.96;
}

.exit__intro {
  margin: clamp(1.4rem, 3.5vh, 2.2rem) auto 0;
  max-width: 44ch;
  font-size: var(--t-lead);
  color: var(--text-muted);
}

.exit__links {
  margin: clamp(2.2rem, 6vh, 3.6rem) auto 0;
  display: grid;
  gap: 0;
  width: min(520px, 100%);
  border-top: 1px solid var(--hairline);
}

.exit__links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-md);
  padding: 1.05rem 0.2rem;
  border-bottom: 1px solid var(--hairline);
  transition: padding var(--speed) var(--ease-out), color var(--speed-fast) ease;
}

.exit__links a:hover {
  color: var(--text-strong);
  padding-left: 1rem;
  padding-right: 1rem;
}

.exit__links span {
  font-size: var(--t-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

.exit__links em {
  font-style: normal;
  font-size: var(--t-lead);
}

.exit__foot {
  margin-top: clamp(2rem, 5vh, 3rem);
  font-size: var(--t-label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Floating photographs ───────────────────────────────────── */
/*
 * Every place that holds pictures presents them the same way. Projects and
 * events hang their group in a reserved side column; the waypoints and the
 * written record carry theirs inline, under the entry they belong to.
 */
.waypoint__stack {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: clamp(170px, 23vh, 250px);
  transform-style: preserve-3d;
  pointer-events: none;
}

.record__stack {
  position: relative;
  width: 100%;
  height: clamp(240px, 38vh, 420px);
  transform-style: preserve-3d;
  pointer-events: none;
}

/*
 * The stack occupies a reserved column at the side of the place. The words
 * are given a matching margin, so a photograph never lands on top of a line
 * of text at any width — the two share the frame instead of fighting for it.
 */
/*
 * Two columns: the words on the left, the photographs in a column of their
 * own on the right. They are laid out side by side rather than layered, so a
 * photograph can never sit over a line of text at any width.
 *
 *   ┌───────────────────────────┬─────────────┐
 *   │ TITLE                     │      ▫      │
 *   │ description               │   ▫     ▫   │
 *   │ technologies · details    │             │
 *   └───────────────────────────┴─────────────┘
 */
[data-section="project"],
[data-section="event"],
[data-section="certifications"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(230px, 27vw, 400px);
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

[data-section="project"] > *:not(.place__stack),
[data-section="event"] > *:not(.place__stack),
[data-section="certifications"] > *:not(.record__stack) {
  grid-column: 1;
}

/*
 * The side column spans the whole of the text beside it.
 *
 * `1 / -1` cannot say that here: -1 names the last line of the *explicit*
 * row grid, and these grids declare no rows at all, so it collapses to a
 * single row — which puts the photographs in row one and pushes every line
 * of text underneath them. Spanning a count instead says what was meant, and
 * the empty rows beyond the text cost nothing.
 */
.place__stack,
.record__stack {
  grid-column: 2;
  grid-row: 1 / span 30;
}

/*
 * A few of a place's images hang beside its words: small, faded, turned at
 * their own angles and set at their own depths. They are objects in the
 * universe — no frame, no card, no panel. Approaching them with the pointer
 * opens the group toward the camera; leaving lets it settle again.
 */
.place__inner {
  position: relative;
}

/* The stack belongs to the place: it inherits the arrival and the departure,
   and drifts a little deeper than the words as the camera passes. */
.place__stack {
  position: relative;
  width: 100%;
  height: clamp(260px, 40vh, 460px);
  transform-style: preserve-3d;
  pointer-events: none;
}

.stack {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  pointer-events: auto;
}

.stack__photo {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 86%;
  padding: 0;
  transform-style: preserve-3d;
  transform: translate3d(0, 0, var(--depth)) rotate(var(--rotate)) scale(var(--scale));
  /* Larger but quieter: presence without competing with the words. */
  opacity: 0.52;
  filter: saturate(0.62) brightness(0.78) contrast(1.04);
  transition:
    transform 1s var(--ease-out),
    opacity 0.7s var(--ease-out),
    filter 0.7s ease;
  transition-delay: var(--open-delay, 0ms);
  cursor: pointer;
}

.stack__photo img {
  width: 100%;
  border-radius: 18px;
  /* The only chrome a photograph gets: the shadow that puts it in the room. */
  box-shadow: 0 24px 50px -26px rgba(0, 0, 0, 0.95);
  animation: photo-float var(--float-duration, 18s) ease-in-out infinite alternate;
  animation-delay: var(--float-delay, 0s);
}

/* Zero gravity: a slow drift and a degree of turn, never a bounce. */
@keyframes photo-float {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  to {
    transform: translate3d(4px, -9px, 0) rotate(0.8deg);
  }
}

.stack__count {
  position: absolute;
  left: 0;
  bottom: -1.4rem;
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--speed) ease, transform var(--speed) var(--ease-out);
  pointer-events: none;
}

/* The group wakes: photographs separate, come forward and clear. */
.stack.is-open .stack__photo {
  transform: translate3d(var(--open-x), var(--open-y), var(--open-depth))
    rotate(var(--open-rotate)) scale(1.04);
  opacity: 0.96;
  filter: saturate(1) brightness(1) contrast(1);
}

.stack.is-open .stack__count {
  opacity: 1;
  transform: translateY(0);
}

.stack__photo:hover,
.stack__photo:focus-visible {
  opacity: 1;
  filter: saturate(1.05) brightness(1.08);
  z-index: 3;
}

.stack.is-open .stack__photo:hover,
.stack.is-open .stack__photo:focus-visible {
  transform: translate3d(var(--open-x), var(--open-y), calc(var(--open-depth) + 90px))
    rotate(0deg) scale(1.1);
}

/* While the photographs hold attention, the words beside them step back. */
.place__inner.is-photo-focus .region__eyebrow,
.place__inner.is-photo-focus .place__name,
.place__inner.is-photo-focus .place__line,
.place__inner.is-photo-focus .place__summary,
.place__inner.is-photo-focus .place__tech,
.place__inner.is-photo-focus .place__actions {
  opacity: 0.34;
  filter: blur(1.2px);
  transition: opacity 0.6s ease, filter 0.6s ease;
}

.place__inner .region__eyebrow,
.place__inner .place__name,
.place__inner .place__line,
.place__inner .place__summary,
.place__inner .place__tech,
.place__inner .place__actions {
  transition: opacity 0.6s ease, filter 0.6s ease;
}

/* ── The life cycle of a place's content ────────────────────── */
/*
 * Content is not one flat plane of white text. Each part sits at its own
 * depth, carries its own colour role, and arrives in sequence once the camera
 * has reached the place: title first, then the lines that support it, then
 * the metadata. Body text stays almost still — only the title breathes.
 */
.place__inner [data-section] > * {
  --layer: 0px;
  opacity: 0;
  transform: translate3d(0, 18px, var(--layer));
  transition:
    opacity 0.75s var(--ease-out),
    transform 0.95s var(--ease-out);
}

.place.is-arrived .place__inner [data-section] > * {
  opacity: 1;
  transform: translate3d(0, 0, var(--layer));
}

/*
 * A place the camera has not reached yet.
 *
 * Its content is laid out and lit, but the place itself is still far down the
 * flight path, so perspective has it small and the depth-of-field blur has it
 * soft (see the far leg in world.js). What the visitor sees is the shape of a
 * section waiting out in the universe — enough to know it is there, never
 * enough to read or to compete with the place in front of it.
 *
 * No stagger out here: the build order belongs to arriving, not to existing.
 */
.place.is-distant .place__inner [data-section] > * {
  opacity: 0.8;
  transform: translate3d(0, 0, var(--layer));
  transition-delay: 0s;
}

/* Nothing in the distance is clickable — it is scenery until it arrives. */
.place.is-distant .place__inner {
  pointer-events: none;
}

/* The build order. Nothing arrives at once. */
.place__inner [data-section] > *:nth-child(1) { transition-delay: 0.02s; }
.place__inner [data-section] > *:nth-child(2) { transition-delay: 0.12s; }
.place__inner [data-section] > *:nth-child(3) { transition-delay: 0.24s; }
.place__inner [data-section] > *:nth-child(4) { transition-delay: 0.36s; }
.place__inner [data-section] > *:nth-child(5) { transition-delay: 0.48s; }
.place__inner [data-section] > *:nth-child(6) { transition-delay: 0.6s; }

/* Depth inside the content: the name stands in front of its own paragraph. */
.place__name,
.about__lead,
.exit__title {
  --layer: 46px;
}

.place__line { --layer: 16px; }
.place__summary,
.about__body { --layer: -18px; }
.place__tech,
.about__meta { --layer: -44px; }
.region__eyebrow { --layer: -10px; }
.place__actions { --layer: 6px; }

/* ── Titles as light ────────────────────────────────────────── */
/*
 * A title is the luminous object in its scene. It emerges slightly wider than
 * it settles, and its glow tightens as the camera closes in (--nearness is
 * written per frame by world.js).
 */
.place__name,
.exit__title {
  /* The warm title ink, matching the display face they are set in. */
  color: var(--title-ink);
  text-shadow: none;
  transition:
    letter-spacing 1.1s var(--ease-out),
    opacity 0.75s var(--ease-out),
    transform 0.95s var(--ease-out);
}

.place__name {
  letter-spacing: 0.06em;
}

.place.is-arrived .place__name {
  letter-spacing: -0.02em;
  text-shadow: var(--glow-title-near);
}

.place.is-arrived .exit__title {
  text-shadow: var(--glow-title-near);
}

/*
 * The About headline keeps its own colour and its own motion: it is the one
 * line in the portfolio that is allowed to shout.
 */
.about__lead {
  color: var(--poster);
  animation: none;
}

.place.is-arrived .about__lead {
  animation: poster-breathe 9s var(--ease-in-out) infinite alternate;
}

@keyframes poster-breathe {
  to {
    transform: translate3d(0, -5px, var(--layer)) scale(1.012);
  }
}

/* A title is never quite still. */
.place.is-arrived .place__name,
.place.is-arrived .exit__title {
  animation: title-drift 16s var(--ease-in-out) infinite alternate;
}

@keyframes title-drift {
  to {
    transform: translate3d(0, -7px, var(--layer));
  }
}

/* ── Colour roles ───────────────────────────────────────────── */
.place__line {
  color: var(--text-accent);
}

.place__tech {
  color: var(--text-faint);
}

/* The technologies pick up the accent one at a time as the eye travels. */
.place__name .spark,
.record__title .spark,
.waypoint__title .spark {
  color: var(--title-ink-bright);
}

.place__tech .spark,
.place__summary .spark,
.about__body .spark {
  color: var(--text-accent);
  font-style: normal;
  text-shadow: 0 0 18px rgba(168, 136, 255, 0.35);
}

.about__body .spark,
.place__summary .spark {
  /* An underline made of light rather than a rule. */
  background-image: linear-gradient(90deg, transparent, currentColor, transparent);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 1.15em;
}

.worklist__title {
  color: var(--title-ink);
}

.record__title,
.waypoint__title {
  color: var(--title-ink);
}

.waypoint__org,
.record__period {
  color: var(--text-accent);
}

.record__period {
  color: var(--text-faint);
}

/* ── The coordinate tag ─────────────────────────────────────── */
.place__coords {
  position: absolute;
  left: 0;
  bottom: -2.4rem;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 1s ease 0.7s;
  pointer-events: none;
}

.place.is-arrived .place__coords {
  opacity: 0.5;
}

/* ── Asymmetry ──────────────────────────────────────────────── */
/*
 * Not every place is composed the same way: the events alternate which side
 * their photographs hang on, so the rhythm changes as the camera travels
 * along the corridor.
 */
/* Alternate which side the photographs hang on, so the rhythm changes as the
   camera travels along a corridor. */
.place:nth-of-type(even) [data-section="project"],
.place:nth-of-type(even) [data-section="event"] {
  grid-template-columns: clamp(230px, 27vw, 400px) minmax(0, 1fr);
}

.place:nth-of-type(even) [data-section="project"] > *:not(.place__stack),
.place:nth-of-type(even) [data-section="event"] > *:not(.place__stack) {
  grid-column: 2;
}

.place:nth-of-type(even) .place__stack {
  grid-column: 1;
}

/* Technologies read as a row of small lit objects, not a sentence. */
.place__tech span,
.worklist__tech span {
  color: var(--text-accent);
  opacity: 0.72;
  transition: opacity var(--speed) ease, text-shadow var(--speed) ease;
}

.place__tech span + span::before,
.worklist__tech span + span::before {
  content: "·";
  margin: 0 0.7em;
  color: var(--text-faint);
  opacity: 0.6;
}

.place.is-arrived .place__tech span {
  opacity: 0.92;
  text-shadow: 0 0 16px rgba(168, 136, 255, 0.28);
}

/* ───────────────────────────────── The far end ───────────────────────────────── */
/*
 * The end of the journey. Nothing here is a footer: one line of type at the
 * scale of the entrance, the same blend the name carried on the way in, and
 * a single way back to the start.
 */
.place--finale .place__inner {
  text-align: center;
}

.finale__eyebrow {
  font-size: var(--t-label);
  letter-spacing: var(--tracking-label);
  text-indent: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

.finale__title {
  margin-top: clamp(1.4rem, 4vh, 2.6rem);
  display: grid;
  gap: 0.06em;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(2.9rem, 8vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/*
 * The two halves are lit from opposite ends of the blend, so the closing line
 * reads as the same light that opened the journey, arriving from the far side
 * of it.
 */
.finale__line {
  background: var(--blend);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.finale__line--lead {
  background-position: 4% 50%;
}

.finale__line--trail {
  background-position: 96% 50%;
  font-size: 0.62em;
  letter-spacing: 0.12em;
}

.place.is-arrived .finale__title {
  filter: drop-shadow(0 0 40px rgba(232, 129, 58, 0.2))
    drop-shadow(0 0 70px rgba(168, 136, 255, 0.22));
}

.finale__note {
  margin-top: clamp(1.6rem, 4vh, 2.6rem);
  font-size: var(--t-label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.finale__again {
  margin-top: clamp(2rem, 5vh, 3.2rem);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 0.35rem;
  font-size: var(--t-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--hairline);
  transition: color var(--speed-fast) ease, border-color var(--speed-fast) ease,
    gap var(--speed) var(--ease-out);
}

.finale__again:hover,
.finale__again:focus-visible {
  color: var(--text-strong);
  border-color: var(--violet);
  gap: 1.1rem;
}

.finale__again-mark {
  color: var(--text-accent);
}
