/* Jhonattan Rivera, portfolio */

:root {
  --bg: #0b0b0a;
  --bg-raise: #141412;
  --ink: #f1ede4;
  --ink-2: #bdb8ac;
  --dim: #8a857c;
  --dim-deco: #6f6b63; /* large decorative text only */
  --faint: #34322e;
  --line: rgba(241, 237, 228, 0.12);
  --yellow: #ffc636;
  --yellow-deep: #e9a915;

  --f-sans: "Host Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

html.intro, html.intro body { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--yellow); color: #0b0b0a; }

/* Skip link: hidden until focused from the keyboard */
.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 120;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--yellow);
  color: #0b0b0a;
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform .4s var(--ease);
}

.skip:focus-visible { transform: none; }
main:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.mono { font-family: var(--f-mono); }

.h2 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(40px, 6.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

/* Word and char pieces produced by the splitter */
.w { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; }

/* Film grain */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 110;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: var(--bg);
  clip-path: inset(0 0 0 0);
}

.intro .loader { display: grid; }

.loader-inner {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.loader-logo { width: 84px; height: 84px; }

.loader-line {
  position: relative;
  margin: 0;
  height: 1.5em;
  min-width: 260px;
  font-size: 15px;
  color: var(--ink-2);
}

.loader-line > span {
  position: absolute;
  inset: 0;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}

.loader-line .mono { font-size: 13px; color: var(--dim); }
.loader-line .res { opacity: 0; transform: translateY(8px); color: var(--yellow); }
.loader-line .res .mono { color: var(--yellow); }
.loader.ok .req { opacity: 0; transform: translateY(-8px); }
.loader.ok .res { opacity: 1; transform: none; }

.loader-bar {
  position: relative;
  display: block;
  width: 140px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.loader-bar span {
  position: absolute;
  inset: 0;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 18px var(--pad);
  transition: transform .6s var(--ease), background-color .4s ease;
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(11, 11, 10, .96);
  border-bottom: 1px solid transparent;
  opacity: 0;
  transition: opacity .4s ease, border-color .4s ease;
}

.nav.is-scrolled::before {
  opacity: 1;
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-110%); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  letter-spacing: -0.01em;
  justify-self: start;
}

.brand img {
  width: 34px;
  height: 34px;
  transition: transform .8s var(--ease);
}

.brand:hover img { transform: rotate(-24deg) scale(1.06); }

.nav-links {
  display: flex;
  gap: 34px;
}

.nav-links a,
.lang button,
.menu-btn {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color .3s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 22px;
}

.lang { display: flex; gap: 2px; }

.lang button {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 6px;
  cursor: pointer;
  color: var(--dim);
  transition: color .3s ease;
}

.lang button[aria-pressed="true"] { color: var(--ink); }
.lang button:hover { color: var(--ink); }

.nav-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  isolation: isolate;
  transition: color .45s var(--ease), border-color .45s var(--ease);
}

.nav-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--yellow);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform .5s var(--ease);
}

.nav-cta:hover { color: #0b0b0a; border-color: var(--yellow); }
.nav-cta:hover::before { transform: none; }

.menu-btn {
  display: none;
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--ink);
}

/* Mobile menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 110px var(--pad) 36px;
  background: var(--bg);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path .7s var(--ease), visibility 0s linear .7s;
}

.menu.open {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition: clip-path .7s var(--ease), visibility 0s;
}

.menu nav { display: grid; gap: 6px; }

.menu nav a {
  font-size: clamp(44px, 13vw, 72px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.05;
  transform: translateY(30px);
  opacity: 0;
  transition: transform .8s var(--ease), opacity .8s var(--ease);
}

.menu.open nav a { transform: none; opacity: 1; }
.menu.open nav a:nth-child(2) { transition-delay: .05s; }
.menu.open nav a:nth-child(3) { transition-delay: .1s; }
.menu.open nav a:nth-child(4) { transition-delay: .15s; }

.menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

@media (max-width: 900px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-links, .nav .lang, .nav-cta { display: none; }
  .menu-btn { display: inline-flex; }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 120px;
  padding-bottom: 36px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  right: -18vmax;
  top: -10vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 198, 54, .13), rgba(255, 198, 54, 0) 70%);
  pointer-events: none;
}

.hero-main {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}

.hero-copy {
  min-width: 0;
  container-type: inline-size;
}

.kicker {
  margin: 0 0 22px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Role and specialties wrap as two units, never mid-phrase */
.kicker > span { display: inline-block; }
.kicker > span:first-child { color: var(--ink-2); margin-right: .35em; }

.hero-name {
  margin: 0;
  font-weight: 300;
  font-size: clamp(56px, 9vw, 160px);
  font-size: min(21cqi, 184px);
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.hero-name .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}

.hero-name .line-in { display: block; white-space: nowrap; }
.hero-name .dim { color: var(--dim-deco); }

.hero-sub {
  max-width: 470px;
  margin: 34px 0 0;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
}

/* Portrait */
.face {
  justify-self: center;
  width: 100%;
  max-width: 500px;
}

.face-move {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring text {
  font-family: var(--f-sans);
  font-size: 13px;
  letter-spacing: .16em;
  fill: var(--ink-2);
}

.portrait {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--yellow);
  isolation: isolate;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.25) brightness(1.06);
  mix-blend-mode: multiply;
  --px: 0px;
  --py: 0px;
  --ps: 1.08;
  transform: translate3d(var(--px), var(--py), 0) scale(var(--ps));
  object-position: center 46%;
}

/* Hero foot */
.hero-foot {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
}

.worked {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 22px;
}

.worked-k {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.worked-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }

.worked-logos a {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.worked-logos .mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  flex: none;
}

.worked-logos img {
  display: block;
  width: 28px;
  height: 28px;
  max-width: none;
  object-fit: cover;
}

.worked-logos .co {
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color .3s ease;
}

/* The PayU file has a white margin around its black square; crop it out */
.worked-logos .payu img { transform: scale(1.18); }

.worked-logos a:hover .co { color: var(--ink); }

.follow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.follow-track {
  position: relative;
  width: 1px;
  height: 46px;
  background: var(--line);
  overflow: hidden;
}

.follow-track span {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 40%;
  background: var(--yellow);
  animation: follow 2.2s var(--ease) infinite;
}

@keyframes follow {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(260%); }
}

@media (max-width: 900px) {
  .grain { display: none; }
  .hero {
    justify-content: safe center;
    gap: 28px;
    padding-top: 92px;
    padding-bottom: 28px;
  }
  .hero-main { flex: none; grid-template-columns: 1fr; gap: 22px; justify-items: center; }
  .hero-copy { width: 100%; }
  .kicker { margin-bottom: 14px; }
  .hero-sub { margin-top: 16px; max-width: none; }
  .face { max-width: min(232px, 58vw); justify-self: center; }
  .ring { animation: ring-spin 72s linear infinite; }
  .hero-foot { flex-direction: column; align-items: stretch; margin-top: 4px; width: 100%; }
  .follow { display: none; }
  .js .story { filter: none; transition: opacity .4s var(--ease), transform .45s var(--ease); }
}

@keyframes ring-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .kicker { letter-spacing: .1em; line-height: 1.7; }
  .worked { flex-direction: column; align-items: flex-start; gap: 14px; width: 100%; }
  .worked-logos {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }
  .worked-logos a { gap: 6px; }
  .worked-logos a:hover .co { color: var(--ink-2); }
  .worked-logos .mark,
  .worked-logos img { width: 22px; height: 22px; }
  .worked-logos .mark { border-radius: 5px; }
  .worked-logos .co { font-size: 12px; }
}

/* Thesis */
.thesis {
  position: relative;
}

.thesis-pin {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding-top: 80px;
  padding-bottom: 80px;
}

.thesis-text {
  max-width: 1180px;
  margin: 0;
  font-weight: 300;
  font-size: clamp(30px, 4.5vw, 70px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}

/* "integradas": letters start apart and snap together on scroll */
.thesis-text .int {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.thesis-text .int .ch { display: inline-block; transition: color .45s ease, text-shadow .6s ease; }

.thesis-text .int::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.16em;
  height: 0.26em;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'><path d='M3 13 C 45 5, 120 3, 197 9' fill='none' stroke='%23ffc636' stroke-width='3.4' stroke-linecap='round'/></svg>") center / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0);
  transition: clip-path .9s cubic-bezier(.65, 0, .35, 1) .12s;
  pointer-events: none;
}

.thesis-text .int.locked { animation: snap .6s var(--ease); }
.thesis-text .int.locked .ch { color: var(--yellow); text-shadow: 0 0 30px rgba(255, 198, 54, .35); }
.thesis-text .int.locked::after { clip-path: inset(0 0 0 0); }

@keyframes snap {
  0% { transform: scale(1); }
  35% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

html:not(.js) .thesis-text .int { color: var(--yellow); }
html:not(.js) .thesis-text .int::after { clip-path: none; }

/* Journey */
.route { position: relative; }

.route-pin {
  position: relative;
  padding: 120px 0 80px;
  display: grid;
  gap: 56px;
}

.route-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}

.route-sub {
  margin: 20px 0 0;
  max-width: 420px;
  color: var(--ink-2);
}

.clock {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex-shrink: 0;
}

.clock-k {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.clock-n {
  font-weight: 300;
  font-size: clamp(56px, 8vw, 128px);
  line-height: .9;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  transition: color .5s ease;
}

.clock-s {
  position: relative;
  font-size: 13px;
  color: var(--ink-2);
}

.clock-s .s-req { display: none; }
.js .clock-s .s-req { display: inline; }
.js .clock-s .s-res { display: none; }
.js .route.is-back .clock-s .s-req,
.js .route.is-done .clock-s .s-req { display: none; }
.js .route.is-back .clock-s .s-res,
.js .route.is-done .clock-s .s-res { display: inline; }

.route.is-back .clock-n,
.route.is-done .clock-n,
html:not(.js) .clock-n { color: var(--yellow); }

.clock-n > span { display: inline-block; }

/* Rail */
.rail-wrap { padding-top: 46px; }

.rail {
  position: relative;
  margin: 0 3%;
}

.rail-base,
.rail-out,
.rail-back {
  position: absolute;
  top: 7px;
  height: 1px;
}

.rail-base { left: 0; right: 0; background: var(--line); }
.rail-out { left: 0; width: 100%; background: var(--ink-2); }
.rail-back { right: 0; width: 100%; height: 2px; top: 6.5px; background: var(--yellow); }

.packet {
  display: none;
  position: absolute;
  top: 7px;
  left: 0;
  width: 0;
  height: 0;
  z-index: 3;
}

.packet::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: -7px;
  top: -7px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 6px rgba(241, 237, 228, .08), 0 0 24px rgba(241, 237, 228, .5);
  transition: background .3s ease, box-shadow .3s ease;
}

.packet.is-back::before {
  background: var(--yellow);
  box-shadow: 0 0 0 6px rgba(255, 198, 54, .12), 0 0 28px rgba(255, 198, 54, .6);
}


.nodes {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 110px;
}

.node {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  width: 170px;
}

.node[data-i="0"] { left: 0; }
.node[data-i="1"] { left: 25%; }
.node[data-i="2"] { left: 50%; }
.node[data-i="3"] { left: 75%; }
.node[data-i="4"] { left: 100%; }

.node .dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--ink-2);
  margin-bottom: 10px;
  transition: background .4s ease, border-color .4s ease, transform .5s var(--ease);
}

.node-name {
  font-size: clamp(16px, 1.5vw, 22px);
  letter-spacing: -0.01em;
  transition: color .4s ease;
}

.node-role {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.35;
}

.node.is-reached .dot { background: var(--ink); border-color: var(--ink); }
.node.is-active .dot { transform: scale(1.5); }
.route.is-back .node .dot,
.route.is-done .node .dot,
html:not(.js) .node .dot { background: var(--yellow); border-color: var(--yellow); }

/* Yellow "I worked here" sticker */
.tag {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  display: grid;
  gap: 1px;
  padding: 6px 10px 7px;
  background: var(--yellow);
  color: #0b0b0a;
  border-radius: 6px;
  text-align: left;
  white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(255, 198, 54, .5);
  transform: translateX(-30%) rotate(var(--tilt, -5deg));
  transform-origin: 30% 100%;
}

.tag.tilt-l { --tilt: -6deg; }
.tag.tilt-r { --tilt: 5deg; }

.tag-k {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .7;
}

.tag-co { font-size: 13px; letter-spacing: -0.01em; }

/* Stories and ISO panel */
.route-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.stories {
  position: relative;
  display: grid;
  gap: 40px;
}

.story-k {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.story-t {
  margin: 0;
  max-width: 640px;
  font-weight: 300;
  font-size: clamp(22px, 2.3vw, 34px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.story-w {
  margin: 16px 0 0;
  font-size: 15px;
  color: var(--yellow);
}

.stamp {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 6px;
  border: 1px solid var(--yellow);
  border-radius: 4px;
  color: var(--yellow);
  font-family: var(--f-mono);
  letter-spacing: .04em;
}

.story-end .story-k { color: var(--yellow); }

.iso {
  font-family: var(--f-mono);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.iso-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 14px;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

.iso-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.iso-lines li {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(241, 237, 228, .06);
  white-space: nowrap;
}

.iso-c { color: var(--dim); }
.iso-wait { color: var(--dim); }
.iso-wait .iso-v { color: var(--dim); }
html:not(.js) .iso-wait { display: none; }
.iso-v { color: var(--ink); letter-spacing: .04em; }
.iso-n { color: var(--dim); text-align: right; font-size: 12px; }
.iso-lines .is-res .iso-v { color: var(--yellow); }
.iso-lines .is-ok .iso-n { color: var(--yellow); }

@media (max-width: 900px) {
  .route-pin { padding-top: 100px; gap: 40px; }
  .route-head { flex-direction: column; align-items: flex-start; }
  .clock { justify-items: start; }
  .route-body { grid-template-columns: 1fr; }
  .node { width: 90px; }
  .node-role { display: none; }
  .rail { margin: 0 8%; }
  .nodes { height: 64px; }
  .node-name { font-size: 13px; }
  .rail-wrap { padding-top: 58px; }

  /* Hide desktop-style always-on tags: they overlap on a narrow rail.
     In animated mode, one sticker pops in on the current step instead.
     Without JS, the story line below becomes the sticker. */
  .tag { display: none; }
  .js .tag {
    display: grid;
    z-index: 4;
    left: 50%;
    padding: 6px 10px 7px;
    pointer-events: none;
  }
  .js .tag .tag-k { font-size: 11px; letter-spacing: .12em; }
  .js .tag .tag-co { font-size: 13px; }

  /* Reached-but-not-current nodes keep a yellow pin so the map stays readable. */
  .js .node.worked::before {
    content: "";
    position: absolute;
    top: -14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 0 10px rgba(255, 198, 54, .6);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .35s ease, transform .45s var(--ease);
  }
  .js .node.worked.is-reached::before {
    opacity: 1;
    transform: none;
  }
  .js .node.worked.is-current::before { opacity: 0; }

  /* Override the desktop "stay once reached" behavior: only the active step shows a tag. */
  .js .node.is-reached .tag,
  .js .node .tag {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) rotate(0deg) scale(.86);
    transition: opacity .3s ease, transform .5s cubic-bezier(.3, 1.6, .5, 1);
  }
  .js .node.is-current .tag {
    opacity: 1;
    transform: translateX(-50%) rotate(var(--tilt, -5deg));
  }

  /* Issuer sits on the right edge; keep the sticker inside the viewport. */
  .js .node[data-i="4"] .tag,
  .js .node[data-i="4"].is-reached .tag {
    transform: translateX(calc(-100% + 28px)) translateY(8px) rotate(0deg) scale(.86);
  }
  .js .node[data-i="4"].is-current .tag {
    transform: translateX(calc(-100% + 28px)) rotate(var(--tilt, 5deg));
  }

  /* Static / reduced-motion fallback: the story line itself is the sticker. */
  .story-w {
    display: inline-grid;
    width: max-content;
    max-width: 100%;
    margin-top: 16px;
    padding: 6px 10px 7px;
    background: var(--yellow);
    color: #0b0b0a;
    border-radius: 6px;
    box-shadow: 0 10px 24px -10px rgba(255, 198, 54, .5);
    font-size: 13px;
    white-space: normal;
  }
  .js .story-w { display: none; }
}

@media (max-width: 520px) {
  .node { width: 68px; }
  .node-name { font-size: 11px; line-height: 1.15; }
  .iso { font-size: 12px; }
  .iso-lines li { grid-template-columns: 48px 1fr auto; gap: 10px; }
  .iso-n { font-size: 12px; }
}

/* Journey, animated mode: pinned stage */
.js .route-pin {
  height: 100vh;
  height: 100svh;
  padding: 0;
  grid-template-rows: auto auto 1fr;
  gap: clamp(20px, 4.5vh, 56px);
  padding-top: clamp(84px, 13vh, 130px);
  padding-bottom: clamp(20px, 4vh, 40px);
  overflow: hidden;
}

.js .packet { display: block; }

.js .rail-out { width: 0; }
.js .rail-back { width: 0; }

@media (min-width: 901px) {
  .js .tag {
    opacity: 0;
    transform: translateX(-30%) translateY(10px) rotate(0deg) scale(.8);
    transition: opacity .35s ease, transform .6s cubic-bezier(.3, 1.6, .5, 1);
  }

  .js .node.is-reached .tag {
    opacity: 1;
    transform: translateX(-30%) rotate(var(--tilt, -5deg));
  }
}

.js .stories { display: block; min-height: 220px; }

.js .story {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition: opacity .55s var(--ease), transform .7s var(--ease), filter .55s var(--ease);
  pointer-events: none;
}

.js .story.is-active {
  opacity: 1;
  transform: none;
  filter: none;
  pointer-events: auto;
}

.js .route-body { min-height: 0; align-self: center; align-items: center; }
.js .iso-lines {
  height: 216px;
  overflow: hidden;
  justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 42%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 42%);
}
.js .iso-lines li { display: none; flex-shrink: 0; }
.js .iso-lines li.is-on { display: grid; }
.js .iso-n { transition: opacity .4s ease; }

@media (max-width: 900px) {
  .js .route-pin { gap: 22px; }
  .js .rail-wrap { padding-top: 56px; }
  .js .route-sub { display: none; }
  .js .clock { position: absolute; right: var(--pad); top: clamp(84px, 13vh, 130px); justify-items: end; }
  .js .clock-n { font-size: clamp(36px, 11vw, 56px); }
  .js .clock-s { display: none; }
  .js .route-head .h2 { font-size: clamp(34px, 10vw, 52px); max-width: 60%; }
  .js .stories { min-height: 170px; }
  .js .route-body { gap: 18px; align-self: start; }
  .js .iso-lines { height: min(190px, 24vh); }
}

@media (max-height: 760px) and (min-width: 901px) {
  .js .story-t { font-size: 24px; }
  .js .iso-lines { height: 168px; }
}

/* Figures */
.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding-top: clamp(80px, 12vw, 160px);
  padding-bottom: clamp(80px, 12vw, 160px);
}

.fig {
  display: grid;
  gap: 14px;
  align-content: start;
}

.fig-n {
  font-weight: 300;
  font-size: clamp(64px, 8.6vw, 148px);
  line-height: .85;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.fig-of { color: var(--dim-deco); }

.fig-l {
  max-width: 240px;
  color: var(--ink-2);
  font-size: 16px;
}

.fig:first-child .fig-n { color: var(--yellow); }

@media (max-width: 1000px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 32px; }
  .fig-n { font-size: clamp(64px, 14vw, 132px); }
}

@media (max-width: 420px) {
  .figures { gap: 44px 20px; }
  .fig-l { font-size: 15px; }
}

/* What I do */
.craft { padding-bottom: clamp(80px, 10vw, 140px); }

.craft-title { margin-bottom: clamp(40px, 6vw, 80px); }

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(18px, 3vw, 40px);
  padding: clamp(28px, 3.4vw, 48px) 0;
  isolation: isolate;
  transition: color .5s var(--ease);
}

.row-n {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--yellow);
  padding-top: .72em;
  transition: color .5s var(--ease);
}

.row::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--pad) * -1);
  z-index: -1;
  background: var(--yellow);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .65s var(--ease);
}

.row-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--line);
  transform-origin: left;
}

.row-end { position: relative; height: 1px; }

.row-t {
  margin: 0;
  font-weight: 300;
  font-size: clamp(28px, 3.4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  transition: transform .65s var(--ease);
}

.row-b p { margin: 0; color: var(--ink-2); max-width: 560px; transition: color .5s var(--ease); }
.row-b p + p:not(.row-tags) { margin-top: 12px; }

.row-b .row-tags {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-2);
}

@media (hover: hover) {
  .row:hover { color: #0b0b0a; }
  .row:hover::before { transform: scaleY(1); transform-origin: top; }
  .row:hover .row-n { color: #0b0b0a; }
  .row:hover .row-t { transform: translateX(14px); }
  .row:hover .row-b p { color: rgba(11, 11, 10, .8); }
  .row:hover .row-b .row-tags { color: rgba(11, 11, 10, .6); }
  .row:hover .row-line { opacity: 0; }
}

@media (max-width: 820px) {
  .row { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; row-gap: 12px; }
  .row-b { grid-column: 2; }
  .row-n { padding-top: .45em; }
}

/* Vocabulary */
.vocab {
  padding: clamp(40px, 6vw, 80px) 0 clamp(80px, 10vw, 140px);
  overflow: hidden;
}

.vocab-k {
  margin: 0 auto 36px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.marquee {
  overflow: hidden;
  white-space: nowrap;
  font-weight: 300;
  font-size: clamp(28px, 4.2vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--ink-2);
}

.marquee.dim { color: var(--dim-deco); }

.marquee-track {
  display: inline-flex;
  will-change: transform;
}

.marquee-set {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.marquee-set span { padding: 0 .32em; transition: color .4s ease; }

.marquee-set i {
  display: inline-block;
  width: .22em;
  height: .22em;
  border-radius: 50%;
  border: 2px solid var(--yellow);
  flex-shrink: 0;
}

.marquee-set span:hover { color: var(--yellow); }

/* Contact */
.contact {
  padding-top: clamp(60px, 8vw, 120px);
  padding-bottom: clamp(60px, 8vw, 100px);
}

.contact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.contact-title {
  margin: 0;
  font-weight: 300;
  font-size: clamp(76px, 15vw, 250px);
  line-height: .86;
  letter-spacing: -0.065em;
}

.seal {
  width: clamp(120px, 15vw, 230px);
  height: auto;
  flex-shrink: 0;
}

.contact-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "mail mail"
    "note else";
  align-items: end;
  gap: 32px 40px;
  margin-top: clamp(40px, 6vw, 80px);
}

.contact-copy { grid-area: note; }

.contact-langs {
  margin: 18px 0 0;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.contact-langs span { display: inline-block; white-space: nowrap; }

.contact-note {
  margin: 0;
  max-width: 460px;
  color: var(--ink-2);
}

.mail {
  grid-area: mail;
  justify-self: start;
  display: inline-block;
  font-weight: 300;
  font-size: clamp(26px, 5vw, 76px);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.mail-in {
  display: inline-block;
  background: linear-gradient(var(--yellow), var(--yellow)) left bottom / 0% 2px no-repeat,
              linear-gradient(var(--line), var(--line)) left bottom / 100% 1px no-repeat;
  padding-bottom: .08em;
  transition: background-size .7s var(--ease), color .4s ease;
}

.mail:hover .mail-in { background-size: 100% 2px, 100% 1px; color: var(--yellow); }

.elsewhere {
  grid-area: else;
  display: flex;
  gap: 28px;
  font-size: 15px;
}

.elsewhere a {
  color: var(--ink-2);
  transition: color .3s ease;
}

.elsewhere a span {
  display: inline-block;
  transition: transform .4s var(--ease);
}

.elsewhere a:hover { color: var(--yellow); }
.elsewhere a:hover span { transform: translate(3px, -3px); }

@media (max-width: 720px) {
  .contact-top { flex-direction: column-reverse; align-items: flex-start; }
  .contact-body { grid-template-columns: 1fr; grid-template-areas: "mail" "note" "else"; }
}

/* Footer */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.to-top { transition: color .3s ease; }
.to-top:hover { color: var(--ink); }

@media (max-width: 560px) {
  .foot { flex-direction: column; align-items: flex-start; }
}

/* Animated mode: hidden start states (the script reveals them) */
.js [data-intro] { opacity: 0; }
.js .hero-name { visibility: hidden; }
.js .hero-sub:not(.is-in) .w { opacity: 0; }
.js .face { opacity: 0; }
.js [data-reveal="words"]:not(.is-in) .w { opacity: 0; }
.js [data-reveal="fade"]:not(.is-in) { opacity: 0; }
.js [data-reveal="line"]:not(.is-in) { transform: scaleX(0); }

@media (prefers-reduced-motion: reduce) {
  .grain, .follow-track span, .ring { animation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Touch targets: at least 44x44 on touch devices */
@media (pointer: coarse), (max-width: 900px) {
  .menu-btn { min-height: 44px; padding: 0 18px; align-items: center; justify-content: center; }
  .lang button { min-width: 44px; min-height: 44px; }
  .worked-logos a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .menu-foot > a, .elsewhere a, .to-top, .skip, .nav .brand, .contact-body .mail { display: inline-flex; align-items: center; min-height: 44px; }
}
