/* ==========================================================================
   Ken Grier — Portfolio
   Display: Instrument Serif (italics for emphasis) · Body: Helvetica
   ========================================================================== */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
}

:root {
  --bg: #ede6da;          /* light tan */
  --bg-deep: #e2d8c8;     /* placeholder / card fill */
  --ink: #1d1b18;
  --muted: #5a5348;
  --line: rgba(29, 27, 24, 0.16);

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Type ---------- */

.display,
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
}

.display {
  font-size: clamp(3.25rem, 9vw, 8.5rem);
  line-height: 0.95;
}

h1 {
  font-size: clamp(3rem, 7.5vw, 7rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  line-height: 1;
}

h3 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  line-height: 1.1;
}

.display em,
h1 em,
h2 em,
h3 em {
  font-style: italic;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.lede {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.5;
  max-width: 38ch;
}

.muted {
  color: var(--muted);
}

.link {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity 0.2s;
}

.link:hover {
  opacity: 0.6;
}

/* ---------- Header ---------- */

.site-header {
  padding: 28px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  line-height: 1.2;
}

.logo__mark {
  width: 34px;
  height: auto;
  flex: none;
  fill: currentColor;
}

.logo__text {
  display: flex;
  flex-direction: column;
}

.logo__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo__sub {
  font-size: 13px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  font-size: 15px;
}

.nav a {
  position: relative;
  transition: opacity 0.2s;
}

.nav a:hover {
  opacity: 0.6;
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px; /* 12px tap padding minus 4px offset */
  height: 1px;
  background: currentColor;
}

/* ---------- Sections ---------- */

.hero {
  padding: clamp(64px, 12vw, 160px) 0 clamp(56px, 8vw, 112px);
}

.hero .lede {
  margin-top: clamp(28px, 4vw, 48px);
}

.section {
  padding: clamp(56px, 8vw, 112px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
}

/* ---------- Placeholder imagery ---------- */

.ph {
  background: var(--bg-deep);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
}

.ph--wide {
  aspect-ratio: 16 / 9;
}

.ph--tall {
  aspect-ratio: 4 / 5;
}

/* ---------- Project cards ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(40px, 5vw, 72px) clamp(20px, 3vw, 40px);
}

/* Cover tilt toward the cursor (driven by atmosphere.js) */

.project-card {
  perspective: 1100px;
}

.project-card .ph {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}

.project-card .ph::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%);
  opacity: 0;
  transition: opacity 0.5s;
}

.project-card.is-tilting .ph {
  transition: transform 0.15s ease-out, box-shadow 0.4s ease-out;
  box-shadow: 0 30px 60px -30px rgba(29, 27, 24, 0.35);
}

.project-card.is-tilting .ph::after {
  opacity: 1;
}

.project-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-top: 18px;
}

.project-card h3 {
  transition: font-style 0.2s;
}

.project-card:hover h3 {
  font-style: italic;
}

.project-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.tag {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Case study ---------- */

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 28px 0;
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.case-meta dt {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.case-meta dd {
  margin: 0;
}

.case-block {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(24px, 6vw, 96px);
  padding: clamp(48px, 7vw, 96px) 0;
}

.case-block p {
  margin: 0 0 1em;
  max-width: 62ch;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
}

.gallery .ph--wide {
  grid-column: 1 / -1;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stat__num {
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1;
}

.stat p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.next-project {
  display: block;
  padding: clamp(56px, 8vw, 112px) 0;
  border-top: 1px solid var(--line);
}

.next-project:hover h2 {
  font-style: italic;
}

/* ---------- Lists ---------- */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.rows li {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.rows .muted {
  font-size: 15px;
}

/* ---------- Contact form ---------- */

.form {
  display: grid;
  gap: 28px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  border-radius: 0;
  transition: border-color 0.2s;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.button {
  justify-self: start;
  font: inherit;
  font-size: 15px;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.button:hover {
  background: transparent;
  color: var(--ink);
}

.button--ghost {
  background: transparent;
  color: var(--ink);
}

.button--ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(64px, 10vw, 128px) 0 32px;
}

.footer-cta {
  display: inline-block;
}

.footer-cta:hover em {
  opacity: 0.6;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(56px, 8vw, 112px);
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .projects,
  .split,
  .case-block,
  .gallery,
  .stats {
    grid-template-columns: 1fr;
  }

  .case-meta {
    grid-template-columns: 1fr 1fr;
  }

  .rows li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 480px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- Password gate ---------- */

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: var(--gutter);
}

.gate__inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
}

.gate__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: clamp(32px, 5vw, 56px);
  max-width: 520px;
}

.gate__row input {
  flex: 1 1 220px;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
}

.gate__row input:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.gate__row input::placeholder {
  color: var(--muted);
}

.gate__msg {
  min-height: 1.5em;
  margin: 16px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--muted);
}

.gate--shake .gate__row {
  animation: gate-shake 0.4s;
}

@keyframes gate-shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.project-card--feature {
  grid-column: 1 / -1;
}

/* ---------- Figures & diagrams ---------- */

.figure {
  margin: 0;
  background: var(--bg-deep);
  padding: clamp(20px, 3vw, 40px);
}

.figure__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.figure figcaption {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
  max-width: 70ch;
}

.figure figcaption em {
  font-family: var(--serif);
  font-size: 1.2em;
  color: var(--ink);
}

.diagram {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.dg-node {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 1;
}

.dg-dup {
  fill: var(--ink);
}

.dg-dash {
  fill: none;
  stroke-dasharray: 5 4;
}

.dg-line {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
}

.dg-text {
  fill: var(--ink);
  font: 14px var(--sans);
}

.dg-text--inv {
  fill: var(--bg);
}

.dg-strong {
  font-family: var(--serif);
  font-size: 20px;
}

.dg-label {
  fill: var(--muted);
  font: 11px var(--sans);
  letter-spacing: 0.08em;
}

.dg-small {
  fill: var(--muted);
  font: 13px var(--sans);
}

/* ---------- Atmosphere: glow, crop marks, scroll reveal ---------- */

.site-header,
main,
.site-footer,
.gate {
  position: relative;
  z-index: 1;
}

html {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25'%3E%3Cpath d='M12.5 0v25M0 12.5h25' stroke='%231d1b18' stroke-width='1'/%3E%3C/svg%3E") 12 12, crosshair;
}

a,
button,
label[for] {
  cursor: pointer;
}

input,
textarea {
  cursor: text;
}

.fx-glow {
  position: fixed;
  pointer-events: none;
}

.fx-glow {
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.fx-glow span {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  will-change: transform;
}

.fx-glow span:nth-child(1) {
  top: -30vmax;
  left: -15vmax;
  background: radial-gradient(circle, #f7efe2 0%, rgba(247, 239, 226, 0) 70%);
  animation: drift-a 22s ease-in-out infinite alternate;
}

.fx-glow span:nth-child(2) {
  top: 10vmax;
  right: -30vmax;
  background: radial-gradient(circle, #dcc6a6 0%, rgba(220, 198, 166, 0) 68%);
  animation: drift-b 27s ease-in-out infinite alternate;
}

.fx-glow span:nth-child(3) {
  bottom: -40vmax;
  left: 20vmax;
  background: radial-gradient(circle, #e8cdb4 0%, rgba(232, 205, 180, 0) 70%);
  animation: drift-c 31s ease-in-out infinite alternate;
}

@keyframes drift-a {
  50% { transform: translate(14vmax, 18vmax) scale(1.1); }
  to { transform: translate(30vmax, 6vmax) scale(1.2); }
}

@keyframes drift-b {
  50% { transform: translate(-18vmax, 20vmax) scale(0.92); }
  to { transform: translate(-32vmax, 4vmax) scale(1.05); }
}

@keyframes drift-c {
  50% { transform: translate(-20vmax, -12vmax) scale(1.15); }
  to { transform: translate(6vmax, -26vmax) scale(0.95); }
}

/* Crop marks + index numbers on section rules (added by atmosphere.js) */

.section,
.site-footer {
  position: relative;
}

.fx-tick {
  position: absolute;
  top: 0;
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
  opacity: 0.55;
  pointer-events: none;
}

.fx-tick::before,
.fx-tick::after {
  content: "";
  position: absolute;
  background: var(--ink);
}

.fx-tick::before {
  left: 6px;
  top: 0;
  width: 1px;
  height: 13px;
}

.fx-tick::after {
  top: 6px;
  left: 0;
  width: 13px;
  height: 1px;
}

.fx-index {
  position: absolute;
  top: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  pointer-events: none;
}

/* Hero location line (home) */

.hero {
  position: relative;
}

.fx-coords {
  position: absolute;
  right: calc(max(0px, (100% - var(--max)) / 2) + var(--gutter));
  bottom: 28px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

@media (max-width: 800px) {
  .fx-coords {
    position: static;
    padding: 40px var(--gutter) 0;
  }
}

/* Scroll reveal (classes added by atmosphere.js) */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .fx-glow span {
    animation: none;
  }
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Case study extras: pull quote, note cards, three-up ---------- */

/* Pull quote: a full-bleed dark band, a pause in the story */
.pullquote {
  position: relative;
  margin: clamp(72px, 10vw, 140px) 0;
  padding: clamp(88px, 13vw, 176px) 0;
  text-align: center;
  color: var(--bg);
  background: var(--ink);
  /* extend the band edge to edge without causing horizontal scroll */
  box-shadow: 0 0 0 100vmax var(--ink);
  clip-path: inset(0 -100vmax);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25'%3E%3Cpath d='M12.5 0v25M0 12.5h25' stroke='%23ede6da' stroke-width='1'/%3E%3C/svg%3E") 12 12, crosshair;
}

.pullquote p {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.8vw, 4.4rem);
  line-height: 1.05;
  margin: 0 auto;
  max-width: 21ch;
}

.pullquote em {
  color: #dcc6a6;
}

.pullquote cite {
  display: block;
  margin-top: 32px;
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b9b09f;
}

.pullquote ::selection {
  background: var(--bg);
  color: var(--ink);
}

.three-up {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(32px, 5vw, 64px) 0;
}

.three-up h3 {
  margin: 8px 0 14px;
}

.three-up p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.three-up .eyebrow {
  margin: 0;
}

@media (max-width: 800px) {
  .three-up {
    grid-template-columns: 1fr;
  }
}

.dg-hatch {
  stroke: var(--ink);
  stroke-width: 1;
}

/* Dated lists (Experience): fixed date column so company names line up */
.rows--dated li {
  grid-template-columns: 1fr 1fr 8.5rem;
}

@media (max-width: 800px) {
  .rows--dated li {
    grid-template-columns: 1fr;
  }
}

.rows--risks li {
  grid-template-columns: 7rem 1fr;
}

.rows--single li {
  grid-template-columns: 1fr;
}

.code {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 40px;
  font: 14px/1.7 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--ink);
  white-space: pre;
  overflow-x: auto;
}

.code span {
  color: var(--muted);
}

/* ---------- Accessibility touch-ups ---------- */

/* Comfortable tap targets for nav and footer links */
.nav a,
.footer-links a {
  display: inline-block;
  padding: 12px 0;
  margin: -12px 0;
}

.figure__scroll:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}

/* ---------- Real imagery ---------- */

.ph--img {
  position: relative;
  padding: 0;
}

.ph--img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-deep);
}

.gallery .shot--wide {
  grid-column: 1 / -1;
}

/* ---------- Case study navigation (case-nav.js) ---------- */

.case-block {
  scroll-margin-top: 24px;
}

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.case-nav {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translate(-50%, 16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.3s;
}

.case-nav.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

.case-nav__pill {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  font: 14px var(--sans);
  color: var(--bg);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 0 0 1px rgba(237, 230, 218, 0.18), 0 12px 30px -12px rgba(29, 27, 24, 0.45);
  cursor: pointer;
}

.case-nav__count {
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
  white-space: nowrap;
}

.case-nav__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-nav__chev {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: transform 0.25s;
}

.case-nav.is-open .case-nav__chev {
  transform: rotate(180deg);
}

.case-nav__menu {
  list-style: none;
  margin: 0 0 10px;
  padding: 8px;
  min-width: 280px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 50px -20px rgba(29, 27, 24, 0.35);
}

.case-nav__menu a {
  display: flex;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
}

.case-nav__menu a span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.case-nav__menu a:hover,
.case-nav__menu a[aria-current] {
  background: var(--bg-deep);
}

.case-nav__pill:focus-visible,
.case-nav__menu a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .case-nav {
    transition: none;
  }
}

/* ---------- Interactive journey (journey.js) ---------- */

.journey {
  margin: clamp(32px, 5vw, 56px) 0 clamp(48px, 7vw, 96px);
}

.journey__frame {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
  cursor: grab;
}

.journey__frame.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.journey__frame:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.journey__inner {
  position: relative;
  display: flex;
  width: max-content;
}

.journey__lines {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.journey__path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}

.journey__path--done {
  stroke: var(--ink);
  stroke-width: 2;
}

.journey__labels {
  position: sticky;
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: 104px;
  flex: none;
  background: var(--bg);
}

.journey__labels span {
  display: flex;
  align-items: center;
  padding-left: 4px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
}

.journey__labels span + span,
.journey__cell + .journey__cell {
  border-top: 1px solid var(--line);
}

.journey__track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0 40px 0 8px;
}

.journey__step {
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: 232px;
  flex: none;
}

.journey__cell {
  position: relative;
  height: 210px;
  padding: 28px 14px 16px;
  box-sizing: border-box;
}

.journey__node {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  text-align: left;
  font: 15px/1.35 var(--sans);
  border-radius: 10px;
  padding: 12px 14px 14px;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
}

.journey__node--buyer {
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
}

.journey__node--supplier {
  color: var(--ink);
  background: #f4efe6;
  border: 1px solid var(--ink);
}

.journey__node.is-decision {
  border-style: dashed;
}

.journey__num {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}

.journey__node.is-future {
  opacity: 0.45;
}

.journey__node.is-active {
  transform: translateY(-3px);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink), 0 18px 30px -18px rgba(29, 27, 24, 0.5);
}

.journey__node:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}

.journey__branch,
.journey__echo {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.journey__branch {
  padding-left: 10px;
  border-left: 1px dashed var(--muted);
}

.journey__branch b {
  color: var(--ink);
  font-weight: 600;
}

.journey__echo {
  padding: 10px 12px;
  border: 1px dashed var(--muted);
  border-radius: 10px;
}

.journey__controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.journey__btn {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 18px var(--sans);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.journey__btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg);
}

.journey__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.journey__meter {
  flex: 1;
  height: 2px;
  background: var(--line);
}

.journey__meter span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: 0 50%;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.journey__detail {
  margin-top: 28px;
  max-width: 62ch;
  min-height: 9.5em;
}

.journey__where {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.journey__heading {
  margin: 8px 0 10px;
}

.journey__detail p {
  margin: 0;
}

.journey__notes {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 15px;
}

.journey__notes li + li {
  margin-top: 6px;
}

.journey__notes b {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .journey__node,
  .journey__meter span {
    transition: none;
  }
}

@media (max-width: 800px) {
  .journey__labels {
    width: 30px;
  }

  .journey__labels span {
    justify-content: center;
    padding: 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 1.15rem;
  }

  .journey__step {
    width: 210px;
  }

  .journey__cell {
    height: 190px;
    padding: 22px 10px 12px;
  }
}
