:root {
  --bg: #0a0a0a;
  --ink: #ededed;
  --ink-2: #b4b4b4;
  --ink-3: #555;
  --line: rgba(237, 237, 237, 0.08);
  --line-fade: linear-gradient(90deg, transparent 0%, rgba(237, 237, 237, 0.08) 14%, rgba(237, 237, 237, 0.08) 86%, transparent 100%);
  --sans: 'Satoshi', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Page transitions — browser-native crossfade via View Transitions API */
::view-transition-old(root),
::view-transition-new(root) {
  animation-fill-mode: both;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  animation: vt-fade-out 280ms cubic-bezier(0.4, 0, 1, 1) forwards;
}
::view-transition-new(root) {
  animation: vt-fade-in 520ms cubic-bezier(0.22, 1, 0.36, 1) 80ms both;
}
@keyframes vt-fade-out {
  to { opacity: 0; transform: translateY(-6px); filter: blur(2px); }
}
@keyframes vt-fade-in {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* Fallback for browsers / contexts without VT API or fetch */
main {
  transition: opacity 320ms cubic-bezier(0.4, 0, 1, 1),
              transform 320ms cubic-bezier(0.4, 0, 1, 1),
              filter   320ms cubic-bezier(0.4, 0, 1, 1);
  will-change: opacity, transform;
}
main.is-leaving  { opacity: 0; transform: translateY(-6px); filter: blur(2px); }
main.is-entering {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(4px);
  transition: none;
}
body.is-leaving  { opacity: 0; transition: opacity 360ms cubic-bezier(0.4, 0, 1, 1); }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 1ms !important;
  }
  main { transition: none; }
  main.is-leaving, main.is-entering { transform: none; filter: none; }
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; position: relative; }

#shader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

main { position: relative; z-index: 1; }

/* ----------------------------------------------------------
   Global site header — fixed, hairline-thin, mono nav.
   Sits above the shader, blurs what scrolls under it.
   ---------------------------------------------------------- */
.site-header {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 40px);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-header .brand,
.site-header .brand-avatar,
.site-header nav a {
  pointer-events: auto;
}
.site-header .brand-avatar {
  display: inline-block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(237, 237, 237, 0.18);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
  transition: border-color 0.3s var(--ease), opacity 0.3s var(--ease);
  flex-shrink: 0;
}
.site-header .brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.site-header .brand-avatar:hover {
  border-color: rgba(237, 237, 237, 0.25);
  opacity: 0.85;
}
.site-header .brand {
  color: var(--ink);
  transition: opacity 0.3s var(--ease);
}
.site-header .brand:hover { opacity: 0.6; }
.site-header .brand .status-dot { display: none; }
.site-header nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-header nav a {
  color: var(--ink-2);
  transition: color 0.3s var(--ease);
}
.site-header nav a:hover { color: var(--ink); }

.lang-switch {
  pointer-events: auto;
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  margin-left: 14px;
  align-items: center;
}
.lang-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active {
  background: rgba(237, 237, 237, 0.08);
  color: var(--ink);
}

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

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

main {
  max-width: 816px;
  margin: 0 auto;
  padding: 60px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 96px;
}

.meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 24px;
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.3s var(--ease), gap 0.3s var(--ease);
  width: fit-content;
}
.case-back:hover {
  color: var(--ink);
  gap: 12px;
}
.case-back .arrow {
  transition: transform 0.3s var(--ease);
}
.case-back:hover .arrow {
  transform: translateX(-3px);
}

/* Intro */
.intro h1 {
  font-size: 52px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  color: var(--ink);
}
.intro .bio {
  font-size: 21px;
  line-height: 1.45;
  letter-spacing: -0.018em;
  color: var(--ink-2);
  max-width: 50ch;
}

.about .about-h {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin-bottom: 22px;
  max-width: 22ch;
  text-wrap: balance;
}
.about .about-tagline {
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 56ch;
  margin-bottom: 18px;
}
.about .about-p {
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 14px;
}
.about-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 28px;
}
.about-links a {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid rgba(237, 237, 237, 0.25);
  padding-bottom: 2px;
  transition: border-color 0.3s var(--ease), opacity 0.3s var(--ease);
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.about-links a span {
  font-size: 0.85em;
  color: var(--ink-2);
}
.about-links a:hover {
  border-bottom-color: var(--ink);
  opacity: 0.85;
}

/* Status dot — soft pulsing LED next to "Carlos Borghes — London" */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6fcf97;
  box-shadow: 0 0 6px rgba(111, 207, 151, 0.5);
  margin-right: 8px;
  vertical-align: 1px;
  animation: status-pulse 2.4s var(--ease) infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 0.55; box-shadow: 0 0 6px rgba(111, 207, 151, 0.4); }
  50%      { opacity: 1;    box-shadow: 0 0 10px rgba(111, 207, 151, 0.7); }
}


/* ----------------------------------------------------------
   Rich list — shared by Work and Experience
   ---------------------------------------------------------- */
.rich-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.rich-list > li,
.rich-list > li > a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: baseline;
  padding: 20px 0;
  color: inherit;
}
.rich-list > li {
  border-bottom: 1px solid transparent;
  border-image: var(--line-fade) 1;
}
.rich-list > li:first-child {
  border-top: 1px solid transparent;
  border-image: var(--line-fade) 1;
}
/* When the row is a link, the link itself owns the layout */
.rich-list > li:has(> a) {
  display: block;
  padding: 0;
}
.rich-list > li > a {
  text-decoration: none;
  position: relative;
  padding: 20px 0;
}

.rl-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rl-title {
  color: var(--ink);
  font-size: 20px;
  letter-spacing: -0.012em;
  line-height: 1.3;
}
.rl-sub {
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  max-width: 34ch;
}
.rl-side {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  white-space: nowrap;
  padding-top: 3px;
}

/* Work list — refined typographic rhythm */
.work .rich-list > li > a {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 28px 0;
  align-items: start;
  align-content: center;
  height: 240px;
}
.experience .rich-list > li > .rl-side {
  align-self: center;
}
.work .rl-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.018em;
}
.work .rich-list > li > a .rl-title,
.work .rich-list > li > a .rl-sub,
.work .rich-list > li > a .rl-num,
.work .rich-list > li > a .rl-side {
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.95),
    0 2px 14px rgba(0, 0, 0, 0.85);
  transition: color 0.4s var(--ease), opacity 0.4s var(--ease);
}
.work .rich-list > li > a:hover .rl-title,
.work .rich-list > li > a:hover .rl-sub,
.work .rich-list > li > a:hover .rl-num,
.work .rich-list > li > a:hover .rl-side {
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 1),
    0 2px 18px rgba(0, 0, 0, 0.95);
}
.work .rl-sub {
  opacity: 1;
}


.rl-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  padding-top: 7px;
  align-self: start;
  opacity: 1;
  color: var(--ink);
}

/* Right column — year and category tag inline */
.work .rl-side {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 14px;
  padding-top: 7px;
}
.rl-year {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.rl-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0.85;
}

/* ----------------------------------------------------------
   Per-row ambient preview — image lives inside the hovered
   row, fades in low-opacity with a horizontal vignette so it
   bleeds into the row edges instead of cropping hard.
   ---------------------------------------------------------- */
.work .rich-list > li > a {
  overflow: hidden;
}
.work .rich-list > li > a .rl-bg {
  position: absolute;
  inset: 0;
  background-image: var(--preview-url);
  background-size: cover;
  background-position: right center;
  opacity: 0.5;
  filter: grayscale(0) brightness(0.92) saturate(1) contrast(1);
  transform: scale(1.01);
  transition: opacity 0.8s var(--ease), filter 0.9s var(--ease);
  pointer-events: none;
  z-index: -2;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, transparent 30%, #000 62%, #000 70%, transparent 95%),
    linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%),
    radial-gradient(ellipse 45% 75% at 72% 50%, #000 0%, transparent 100%);
          mask-image:
    linear-gradient(to right, transparent 0%, transparent 30%, #000 62%, #000 70%, transparent 95%),
    linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%),
    radial-gradient(ellipse 45% 75% at 72% 50%, #000 0%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}

@media (max-width: 650px) {
  .work .rich-list > li > a .rl-bg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .work .rich-list > li > a .rl-bg { transition: opacity 0.2s linear; }
}

/* Subtle hover only on linked rows */
.rich-list > li > a .rl-title,
.rich-list > li > a .rl-side {
  transition: color 0.4s var(--ease);
}
.rich-list > li > a:hover .rl-title { color: var(--ink); }
.rich-list > li > a:hover .rl-side  { color: var(--ink-2); }
.rich-list > li > a .rl-side { transition: color 0.4s var(--ease); }
.work .rich-list > li > a:hover .rl-bg {
  opacity: 1;
  filter: grayscale(0) brightness(1) saturate(1.05) contrast(1);
}

@media (max-width: 540px) {
  .rich-list > li,
  .rich-list > li > a,
  .work .rich-list > li > a {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .rl-side { padding-top: 0; }
  .rl-num { padding-top: 0; }
  .work .rl-side {
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }
}

/* Contact */
.contact .email {
  display: inline-block;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.3s var(--ease);
}
.contact .email:hover { border-bottom-color: var(--ink); }
.contact .links {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-2);
}
.contact .links a {
  transition: color 0.3s var(--ease);
}
.contact .links a:hover { color: var(--ink); }

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 32px;
  border-top: 1px solid transparent;
  border-image: var(--line-fade) 1;
}

/* ==========================================================
   Case study page
   ========================================================== */

main.case {
  max-width: 816px;
  gap: 80px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: -40px;
  width: fit-content;
  transition: color 0.3s var(--ease);
}
.back .arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}
.back:hover { color: var(--ink); }
.back:hover .arrow { transform: translateX(-3px); }

/* Case head */
.case-head h1 {
  font-size: 52px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  color: var(--ink);
}
.case-head .lede {
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 50ch;
  margin-bottom: 48px;
  letter-spacing: -0.018em;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
  border-top: 1px solid transparent;
  border-image: var(--line-fade) 1;
  padding-top: 24px;
}
.case-meta div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.case-meta dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.case-meta dd {
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* Visual */
.visual { display: flex; flex-direction: column; gap: 12px; }
.placeholder {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg,
      rgba(237,237,237,0.018) 0 2px,
      transparent 2px 14px),
    radial-gradient(ellipse 70% 50% at 50% 50%, rgba(237,237,237,0.04), transparent);
}

/* ----------------------------------------------------------
   Unified "stage" for all mockups and screenshots.
   The frame is a backdrop. The image floats inside with its
   own subtle border and shadow — consistent across every visual.
   ---------------------------------------------------------- */
.visual-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: zoom-in;
  isolation: isolate;
}
.visual-frame::before { display: none; }

.visual-frame img,
.visual-frame .shot {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  transition: transform 0.8s var(--ease);
}
.visual-frame:hover img,
.visual-frame:hover .shot {
  transform: scale(1.01);
}

/* Placeholder shot — looks like a real screenshot mock so you can see the treatment */
.shot {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shot-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(237,237,237,0.06);
  background: rgba(237,237,237,0.025);
}
.shot-chrome i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(237,237,237,0.16);
}
.shot-chrome span {
  margin-left: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(237,237,237,0.4);
  letter-spacing: 0.04em;
}
.shot-body {
  flex: 1;
  display: grid;
  grid-template-columns: 140px 1fr;
  min-height: 0;
}
.shot-side {
  border-right: 1px solid rgba(237,237,237,0.05);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shot-side-label {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(237,237,237,0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.shot-side-item {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(237,237,237,0.55);
}
.shot-side-item.active { color: var(--ink); }
.shot-canvas {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.shot-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(194,232,255,0.08);
  border: 1px solid rgba(194,232,255,0.25);
  font-family: var(--mono);
  font-size: 11px;
  color: #c2e8ff;
  width: fit-content;
}
.shot-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #c2e8ff;
  box-shadow: 0 0 8px rgba(194,232,255,0.7);
}
.shot-block {
  border: 1px solid rgba(237,237,237,0.07);
  border-radius: 6px;
  padding: 12px 14px;
  background: rgba(237,237,237,0.015);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(237,237,237,0.65);
  line-height: 1.7;
}
.shot-block-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237,237,237,0.35);
  margin-bottom: 6px;
  display: block;
}

/* Placeholder while no image is provided — intentional, not "TODO" */
.visual-placeholder {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  display: grid;
  place-items: center;
}
.visual-placeholder::before {
  content: '';
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(237, 237, 237, 0.06);
  border-radius: 4px;
  pointer-events: none;
}
.visual-placeholder::after {
  content: attr(data-label);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(237, 237, 237, 0.28);
}

/* When the frame holds a placeholder, kill the stage entirely */
.visual-frame:has(.visual-placeholder) {
  background: transparent;
  cursor: default;
  box-shadow: none;
}
.visual-frame:has(.visual-placeholder)::before { display: none; }
.visual-frame:has(.visual-placeholder)::after { display: none; }
.visual-frame:has(.visual-placeholder):hover { border-color: var(--line); }

/* Zoom hint badge — appears centered on hover, subtle */
.visual-frame::after {
  content: '⤢';
  position: absolute;
  top: 50%; left: 50%;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10,10,10,0.55);
  border: 1px solid rgba(237,237,237,0.18);
  color: rgba(237,237,237,0.9);
  font-size: 16px;
  font-family: var(--mono);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.visual-frame:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Wider aspect for product screenshots */
.visual-wide .visual-frame { aspect-ratio: 16 / 9; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 60px);
  background: rgba(8, 8, 10, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, background 0.5s ease, backdrop-filter 0.5s ease;
  cursor: zoom-out;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.lightbox-content {
  width: auto;
  height: auto;
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(237, 237, 237, 0.1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  position: relative;
  display: flex;
  background: #0a0a0a;
}
.lightbox-content > * {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  cursor: default;
  display: block;
}
.lightbox-content > *::after { display: none; }
.lightbox-content img,
.lightbox-content .shot {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  object-fit: contain;
}
.lightbox-content .visual-frame:hover img,
.lightbox-content .visual-frame:hover .shot {
  transform: none;
}
.lightbox-close {
  position: absolute;
  top: 24px; right: 24px;
  z-index: 2;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10,10,10,0.6);
  border: 1px solid rgba(237,237,237,0.2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.lightbox-close:hover {
  background: rgba(237,237,237,0.1);
  border-color: rgba(237,237,237,0.4);
  transform: rotate(90deg);
}
.lightbox-caption {
  position: absolute;
  bottom: 24px; left: 24px; right: 80px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237,237,237,0.5);
  z-index: 2;
}
body.lightbox-open { overflow: hidden; }

.visual figcaption {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ----------------------------------------------------------
   Carousel — scroll-snap track with prev/next + counter.
   Each slide wraps a .visual-frame so lightbox keeps working.
   ---------------------------------------------------------- */
.carousel { gap: 14px; }
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  gap: 12px;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}
.carousel-slide .visual-frame { width: 100%; }
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.08em;
}
.carousel-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.carousel-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.carousel-btn:disabled { opacity: 0.25; cursor: default; }
.carousel-counter { min-width: 4ch; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .carousel-track { scroll-behavior: auto; }
}

/* Prose */
.prose .meta { margin-bottom: 16px; }
.prose h2 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.028em;
  margin-bottom: 22px;
  color: var(--ink);
}
.prose p {
  color: var(--ink-2);
  margin-bottom: 18px;
  max-width: 60ch;
  letter-spacing: -0.005em;
  font-size: 18px;
  line-height: 1.6;
}
.prose p strong {
  color: var(--ink);
  font-weight: 500;
}
.prose code,
.bullets code,
.rl-sub code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--ink);
  background: rgba(237, 237, 237, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0;
}

/* Prompt blocks — system-prompt fragments rendered as codeblocks */
.prose > .prompt {
  margin: 28px 0;
  max-width: 78ch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(237, 237, 237, 0.025);
  overflow: hidden;
}
.prose > .prompt + .prompt {
  margin-top: 16px;
}
.prose > .prompt figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(237, 237, 237, 0.02);
}
.prose > .prompt pre {
  margin: 0;
  padding: 18px 20px;
  background: transparent;
}
.prose > .prompt pre code {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
  background: transparent;
  padding: 0;
  border-radius: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}
/* Token highlighting — gives the prompt blocks a clear hierarchy:
   headings stand out, keywords/labels carry color, comments fade. */
.prose > .prompt .tok-h,
.prose > .prompt .tok-sub {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.prose > .prompt .tok-sub {
  letter-spacing: 0.02em;
}
.prose > .prompt .tok-k { color: #d8a868; }
.prose > .prompt .tok-v { color: #8db8d6; }
.prose > .prompt .tok-s { color: #b8d29a; }
.prose > .prompt .tok-c { color: #777; }

/* Hanging indent — when a bulleted/key-value line wraps, the
   continuation aligns under the body of the bullet, not at col 0. */
.prose > .prompt .ln {
  display: block;
  padding-left: 5ch;
  text-indent: -5ch;
}
/* Breathing room after a heading or subheading before the first line */
.prose > .prompt .tok-h + .ln,
.prose > .prompt .tok-sub + .ln,
.prose > .prompt :not(.ln) + .ln {
  margin-top: 0.5em;
}
@media (max-width: 540px) {
  .prose > .prompt pre { padding: 14px 14px; }
  .prose > .prompt pre code { font-size: 12px; line-height: 1.65; }
  .prose > .prompt figcaption { padding: 10px 14px; font-size: 10px; }
}

.bullets {
  list-style: none;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.bullets li {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid rgba(111, 207, 151, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(111, 207, 151, 0.05), rgba(111, 207, 151, 0.015)),
    linear-gradient(180deg, rgba(237, 237, 237, 0.02), rgba(237, 237, 237, 0.005));
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.bullets li:hover {
  border-color: rgba(111, 207, 151, 0.32);
  background:
    linear-gradient(180deg, rgba(111, 207, 151, 0.09), rgba(111, 207, 151, 0.02)),
    linear-gradient(180deg, rgba(237, 237, 237, 0.03), rgba(237, 237, 237, 0.01));
}
.bullets li::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background-color: rgba(111, 207, 151, 0.14);
  border: 1px solid rgba(111, 207, 151, 0.45);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236fcf97' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 12px -2px rgba(111, 207, 151, 0.25);
}
@media (max-width: 540px) {
  .bullets { grid-template-columns: 1fr; }
}

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
  border-top: 1px solid transparent;
  border-image: var(--line-fade) 1;
  padding-top: 24px;
}
.stats li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-num {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.4;
}
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr; }
}

/* ==========================================================
   Case study — editorial components
   ========================================================== */

/* Big editorial section marker. The mono number sits above
   the meta label and acts as a visual anchor between sections. */
/* Pull quote — punches a single line out of the prose flow.
   No quote marks; relies on size and a faint side rule. */
.pullquote {
  font-size: 28px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 28ch;
  padding: 12px 0 12px 24px;
  border-left: 1px solid rgba(237, 237, 237, 0.18);
  margin: 32px 0;
}
.pullquote.center {
  text-align: center;
  border-left: 0;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-image: var(--line-fade) 1;
  padding: 32px 0;
  margin: 48px auto;
  max-width: 36ch;
}

/* Architecture diagram — horizontal flow of layered cards
   linked by a hairline. Stacks vertically on mobile. */
.architecture {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 32px 0;
  position: relative;
}
.architecture::before {
  content: '';
  position: absolute;
  top: 38px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(237, 237, 237, 0.18) 12%,
    rgba(237, 237, 237, 0.18) 88%,
    transparent 100%
  );
  z-index: 0;
}
.arch-node {
  position: relative;
  z-index: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}
.arch-node .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(237, 237, 237, 0.3);
  margin-top: 32px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.arch-node:hover .dot {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 0 12px rgba(237, 237, 237, 0.4);
}
.arch-node .name {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 8px;
}
.arch-node .role {
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
@media (max-width: 640px) {
  .architecture {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .architecture::before {
    top: 8%;
    bottom: 8%;
    left: 50%;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(237, 237, 237, 0.18) 12%,
      rgba(237, 237, 237, 0.18) 88%,
      transparent 100%
    );
  }
  .arch-node { padding: 0; }
  .arch-node .dot { margin-top: 0; }
}

/* Commands grid — numbered cards with a soft accent bar that
   fills on hover. Counters keep the 01–08 sequence visible. */
.commands {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 28px 0;
  counter-reset: cmd;
}
.commands li {
  counter-increment: cmd;
  background: var(--bg);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: background 0.5s var(--ease);
}
/* Numeric prefix in the corner — quiet, monospaced */
.commands li::before {
  content: counter(cmd, decimal-leading-zero);
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  opacity: 0.4;
  transition: opacity 0.5s var(--ease), color 0.5s var(--ease);
}
/* Accent bar that grows from the bottom on hover */
.commands li::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 0;
  background: var(--ink);
  transition: height 0.6s var(--ease);
}
.commands li:hover {
  background: rgba(237, 237, 237, 0.03);
}
.commands li:hover::before {
  opacity: 0.85;
  color: var(--ink);
}
.commands li:hover::after {
  height: 100%;
}
.commands code {
  font-family: var(--mono);
  font-size: 17px;
  color: var(--ink);
  background: transparent;
  padding: 0;
  letter-spacing: 0;
  padding-right: 36px; /* avoid overlap with number badge */
}
.commands .desc {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  max-width: 38ch;
}
@media (max-width: 720px) {
  .commands { grid-template-columns: 1fr; }
}

/* Timeline — narrative beats stacked vertically.
   Time stamp on the left, beat on the right, dot in between. */
.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin: 24px 0;
  border-top: 1px solid transparent;
  border-image: var(--line-fade) 1;
}
.timeline li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid transparent;
  border-image: var(--line-fade) 1;
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 80px;
  top: 26px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: background 0.4s var(--ease);
}
.timeline li:hover::before { background: var(--ink); }
.timeline .time {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 2px;
}
.timeline .beat {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  max-width: 56ch;
}
.timeline .beat .quiet {
  color: var(--ink-2);
}
@media (max-width: 540px) {
  .timeline li {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-left: 16px;
  }
  .timeline li::before { left: 0; top: 24px; }
}

/* Two-up comparison — used for "before / after" framing */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 32px 0;
}
.compare > div {
  background: var(--bg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.compare .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.compare .head {
  font-size: 18px;
  letter-spacing: -0.012em;
  color: var(--ink);
  line-height: 1.3;
}
.compare .body {
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.55;
}
.compare .after .head { color: var(--ink); }
.compare .before .head { color: var(--ink-2); }
@media (max-width: 540px) {
  .compare { grid-template-columns: 1fr; }
}

/* Next — mirrors the home work list row exactly so case studies
   end with the same vocabulary the user entered with. */
.next {
  margin-top: 8px;
}
.next .next-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 16px;
  display: block;
}

/* ----------------------------------------------------------
   Scroll reveal — IntersectionObserver-driven entrance.
   Element starts invisible + offset + a touch of blur, lands
   in place with a long ease. Children of grouped components
   (timeline, commands, architecture) get a stagger via JS.
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  transition:
    opacity 1.1s var(--ease),
    transform 1.1s var(--ease),
    filter 1.1s var(--ease);
  will-change: opacity, transform, filter;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
  filter: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* About — editorial two-column layout */
.about-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  column-gap: 56px;
  align-items: center;
  margin-top: 4px;
}
.about-grid .about-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: cover;
  object-position: 50% 28%;
  display: block;
  filter: saturate(0.92);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
.about-grid .about-body > :first-child { margin-top: 0; }

@media (max-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 32px;
  }
  .about-grid .about-portrait {
    width: 200px;
    aspect-ratio: 4 / 5;
  }
}

/* Anchor offset so fixed header doesn't cover scrolled-to sections */
html { scroll-behavior: smooth; }
:target,
#about,
#work {
  scroll-margin-top: 96px;
}

/* Coming-soon disabled card + tooltip */
.rich-list > li > a.is-soon {
  cursor: not-allowed;
  position: relative;
}
.rich-list > li > a.is-soon .rl-title,
.rich-list > li > a.is-soon .rl-sub,
.rich-list > li > a.is-soon .rl-side,
.rich-list > li > a.is-soon .rl-num {
  opacity: 0.55;
  transition: opacity 0.3s var(--ease);
}
.rich-list > li > a.is-soon:hover .rl-title,
.rich-list > li > a.is-soon:hover .rl-sub,
.rich-list > li > a.is-soon:hover .rl-side,
.rich-list > li > a.is-soon:hover .rl-num {
  opacity: 0.85;
}
.work .rich-list > li > a.is-soon .rl-bg { opacity: 0.18; }
.work .rich-list > li > a.is-soon:hover .rl-bg { opacity: 0.3; filter: grayscale(0.4) brightness(0.85); }

.cursor-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(237, 237, 237, 0.14);
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(var(--tt-x, 0), var(--tt-y, 0), 0);
  transition: opacity 0.18s var(--ease);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
}
.cursor-tooltip.is-visible { opacity: 1; }

/* Scroll-to-top floating button */
.scroll-top {
  position: fixed;
  right: clamp(20px, 4vw, 40px);
  bottom: clamp(20px, 4vw, 40px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 30;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              border-color 0.3s var(--ease), color 0.3s var(--ease),
              background 0.3s var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.scroll-top svg { width: 16px; height: 16px; }
.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top:hover {
  color: var(--ink);
  border-color: rgba(237, 237, 237, 0.22);
  background: rgba(30, 30, 30, 0.85);
}
