/* ── Eduardo Castro — minimal portfolio ─────────────────────────────────── */

:root {
  --spot:      rgba(0, 0, 0, .05);
  --stack-sh:  rgba(15, 23, 42, .18);
  --phone-bezel: #16181d;
  --bg:        #ffffff;
  --surface:   #fafafa;
  --surface-2: #f2f2f2;
  --line:      rgba(0, 0, 0, .11);
  --line-soft: rgba(0, 0, 0, .06);
  --tx:        #111111;
  --tx-mid:    #4b5563;
  --tx-dim:    #9ca3af;
  --shadow:    0 1px 2px rgba(0, 0, 0, .05);
  --nav-bg:    rgba(255, 255, 255, .82);
  --ring:      #e5e7eb;
  --line-dash: #d1d5db;
  --chip-line: #e5e7eb;
  --chip-tx:   #4b5563;
  --tx-soft:   #364153;
}

html[data-theme="dark"] {
  --spot:      rgba(255, 255, 255, .16);
  --stack-sh:  rgba(0, 0, 0, .45);
  --phone-bezel: #0b0c0f;
  --bg:        #121212;
  --surface:   #181818;
  --surface-2: #1f1f1f;
  --line:      rgba(255, 255, 255, .11);
  --line-soft: rgba(255, 255, 255, .06);
  --tx:        #f4f4f5;
  --tx-mid:    #9ca3af;
  --tx-dim:    #6a7282;
  --shadow:    none;
  --nav-bg:    rgba(18, 18, 18, .82);
  --ring:      #6a7282;
  --line-dash: #364153;
  --chip-line: #364153;
  --chip-tx:   #d1d5dc;
  --tx-soft:   #d1d5dc;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: 768px; margin: 0 auto; padding: 0 24px; }

/* ── Nav ────────────────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: 768px; margin: 0 auto; padding: 0 24px;
  height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.mono { font-weight: 700; letter-spacing: .06em; font-size: 14px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--tx-mid); font-size: 14px; transition: color .18s ease; }
.nav-links a:hover { color: var(--tx); }
.nav-tools { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--line); }
.icon-btn {
  background: none; border: none; color: var(--tx-mid); cursor: pointer;
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  transition: background .18s ease, color .18s ease; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--tx); }
.lang-btn { width: auto; padding: 0 9px; font: 600 11.5px/1 inherit; letter-spacing: .06em; }

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero { padding: 56px 0 8px; }
.hero-id { display: flex; align-items: center; gap: 24px; margin-bottom: 30px; }
.avatar-frame {
  width: 160px; height: 160px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  border: 2px solid var(--ring); background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
  position: relative; cursor: pointer;
}
.avatar-frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
}
.avatar-frame .pixel-default { image-rendering: pixelated; }
/* second photo, revealed once the pixel sweep has covered the frame */
.avatar-frame .pixel-active { display: none; z-index: 2; }
/* the sweeping squares sit on top of both photos */
.pixel-grid { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pixel-grid span { position: absolute; display: none; background: var(--tx); }
.hero-name {
  font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px;
  display: flex; align-items: center; gap: 8px;
}
.verified { width: 22px; height: 22px; flex-shrink: 0; }
.socials { display: flex; gap: 12px; }
.socials a {
  color: var(--tx); opacity: .7;
  display: grid; place-items: center;
  transition: opacity .15s cubic-bezier(.4, 0, .2, 1), transform .15s cubic-bezier(.4, 0, .2, 1);
}
.socials a:hover { opacity: 1; transform: translateY(-2px); color: var(--brand, var(--tx)); }
.socials a { transition: opacity .15s cubic-bezier(.4, 0, .2, 1), transform .15s cubic-bezier(.4, 0, .2, 1), color .15s ease; }
.socials svg { width: 20px; height: 20px; }

.hero-role {
  font-size: clamp(26px, 5.4vw, 34.4px); font-weight: 400; letter-spacing: -.025em;
  line-height: 1.25; margin: 0 0 24px;
}
.hero-role .dim { color: var(--tx-dim); font-weight: 400; }

.hero-bio { color: var(--tx-mid); font-size: 18px; font-weight: 300; line-height: 1.78; margin: 0 0 24px; }
.hero-bio strong { color: var(--tx); font-weight: 500; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--chip-line); border-radius: 999px;
  padding: 4px 10px; font-size: 11px; font-weight: 500; color: var(--chip-tx);
  background: transparent; white-space: nowrap;
  vertical-align: baseline; line-height: 1.5;
}

/* Inline mention inside running text: dashed outline + brand mark */
.chip-i {
  border: 1px dashed var(--line-dash); border-radius: 6px;
  padding: 2px 9px; font-size: 14px; font-weight: 400;
  color: var(--tx); background: var(--bg);
  margin: 0 1px;
}
.chip-i svg { width: 14px; height: 14px; flex-shrink: 0; display: block; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 8px;
  padding: 12px 24px; font-size: 16px; font-weight: 500;
  background: var(--tx); color: var(--bg);
  transition: transform .15s cubic-bezier(.4, 0, .2, 1);
}
.btn:hover  { transform: scale(1.03); }
.btn:active { transform: scale(.99); }
.btn svg { width: 15px; height: 15px; transition: transform .2s cubic-bezier(.4, 0, .2, 1); }
.btn:hover svg { transform: translateX(4px); }

.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-sm svg { width: 13px; height: 13px; }

/* ── Sections ───────────────────────────────────────────────────────────── */

section { padding: 46px 0; }
.sec-title { font-size: clamp(24px, 4vw, 30px); font-weight: 300; line-height: 1.2; letter-spacing: -.025em; margin: 0 0 24px; }
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.sec-head .sec-title { margin: 0; }
.sec-head-tools { display: flex; align-items: center; gap: 10px; }
.sec-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; color: var(--tx-mid); white-space: nowrap;
  transition: color .18s ease;
}
.sec-link:hover { color: var(--tx); }
.sec-link svg { width: 15px; height: 15px; transition: transform .2s cubic-bezier(.4, 0, .2, 1); }
.sec-link:hover svg { transform: translateX(4px); }
.label {
  font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--tx-dim); margin: 0 0 9px;
}

/* ── Featured ───────────────────────────────────────────────────────────── */

.featured {
  border: 1px dashed var(--line-dash); border-radius: 12px; overflow: hidden;
  display: grid; grid-template-columns: 300px 1fr; align-items: stretch;
  background: var(--bg); box-shadow: var(--shadow);
}
.featured-media { background: var(--surface-2); overflow: hidden; }
.featured-media video,
.featured-media img {
  width: 100%; height: 100%; object-fit: cover; min-height: 230px;
  display: block; background: var(--surface-2);
}
/* Chrome gives a playing <video> its own video layer. Transforming that
   element directly makes it re-raster every frame — a visible judder. So
   the zoom is applied to this wrapper instead, and the video rides along
   untouched. The layer is created at rest, not when the hover starts. */
.media-zoom {
  width: 100%; height: 100%;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  transition: transform .5s ease-out;
}
.featured-media:hover .media-zoom { transform: translateZ(0) scale(1.05); }
.featured-body {
  padding: 24px; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start; gap: 12px;
}
.featured-body > * { margin: 0; }
.featured-body h3 { font-size: 24px; font-weight: 300; line-height: 1.333; letter-spacing: -.025em; }
.featured-body p { color: var(--tx-mid); font-size: 14px; line-height: 1.714; }
.featured-body .label { letter-spacing: .22em; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 17px; }
.featured-body .tags { margin-bottom: 0; }

.tech-icons { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tech-icon {
  display: block; width: 16px; height: 16px; color: var(--tx); opacity: .7;
  transition: opacity .15s cubic-bezier(.4, 0, .2, 1), transform .15s cubic-bezier(.4, 0, .2, 1);
}
.tech-icon:hover { opacity: 1; transform: translateY(-2px); }
.tech-icon svg { width: 100%; height: 100%; display: block; }
.card-mini .tech-icons { margin-bottom: 17px; }
.tags .chip { background: transparent; }

/* ── Timeline ───────────────────────────────────────────────────────────── */

.tl-row { display: grid; grid-template-columns: 160px 1fr; gap: 24px; }
.tl-row + .tl-row { margin-top: 28px; }
.tl-when {
  color: var(--tx-dim); font-size: 12px; font-weight: 500;
  white-space: nowrap; padding-top: 4px;
}
.tl-role { font-size: 17px; font-weight: 600; line-height: 1.25; margin: 0; }
.tl-role em { color: var(--tx-dim); font-style: normal; font-weight: 400; }
.tl-org { font-size: 14px; font-weight: 500; color: var(--tx-soft); margin: 4px 0 0; }
.tl-where { color: var(--tx-mid); font-size: 14px; margin: 2px 0 0; }
.tl-body { color: var(--tx-mid); font-size: 14px; line-height: 1.714; margin: 10px 0 0; }

/* ── Project cards ──────────────────────────────────────────────────────── */

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-1 .card-media { aspect-ratio: 2.4 / 1; }

.card {
  border: 1px dashed var(--line-dash); border-radius: 12px; background: var(--bg);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
  position: relative; isolation: isolate;
  --mouse-x: 50%; --mouse-y: 50%;
}
.card:hover { border-color: var(--tx-dim); transform: translateY(-2px); }
/* light that follows the cursor — coordinates are set by home.js */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
  background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), var(--spot), transparent 72%);
}
.card:hover::before,
.card:focus-within::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card-media { display: block; background: var(--surface-2); aspect-ratio: 16 / 10; overflow: hidden; }
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease-out;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.card-media:hover img { transform: translateZ(0) scale(1.05); }
.card-body { padding: 16px 17px 0; flex: 1; }
.card-body h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 2px; }
.card-role { font-size: 12.5px; font-weight: 500; color: var(--tx); margin: 0 0 7px; }
.card-desc {
  font-size: 13px; color: var(--tx-mid); margin: 0 0 13px;
  line-height: 1.43;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  margin-top: auto; padding: 11px 17px; border-top: 1px solid var(--line-dash);
  display: flex; justify-content: flex-end; gap: 16px;
}
.card-link {
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tx-mid); display: inline-flex; align-items: center; gap: 6px;
  transition: color .18s ease;
}
.card-link:hover { color: var(--tx); }
.card-link svg { width: 11px; height: 11px; transition: transform .2s cubic-bezier(.4, 0, .2, 1); }
.card-link:hover svg { transform: translate(2px, -2px); }

.badge {
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--chip-tx); border: 1px solid var(--chip-line); border-radius: 4px;
  padding: 1px 6px; vertical-align: 1px; margin-left: 7px;
}

/* compact card (apps, no cover) */
.card-mini { padding: 17px; }
.card-mini .card-foot { margin: auto -17px -17px; }
.card-mini .mini-head { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.card-mini .mini-head img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; }
.card-mini .mini-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.card-mini .mini-head span { font-size: 12px; color: var(--tx-dim); display: block; }

/* ── Outside the IDE ────────────────────────────────────────────────────── */

.outside { display: grid; grid-template-columns: 1.05fr .95fr; gap: 26px; align-items: center; }
.outside-text p { color: var(--tx-mid); font-size: 15px; line-height: 1.72; margin: 0 0 18px; max-width: 44ch; }
.outside-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.outside-tags .chip { padding: 5px 12px; font-size: 12px; }

/* the photo pile — cards shrink and fan from their bottom-right corner */
.stack { position: relative; width: 224px; height: 224px; perspective: 600px; justify-self: end; }
.stack-card {
  position: absolute; inset: 0;
  border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--chip-line);
  box-shadow: 0 18px 40px var(--stack-sh);
  transform-origin: 90% 90%; touch-action: none; cursor: grab;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.stack-card.dragging { transition: none; cursor: grabbing; }
.stack-card:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.stack-card img {
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}

/* ── Marquee ────────────────────────────────────────────────────────────── */

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee + .marquee { margin-top: 10px; }
.marquee-track { display: flex; gap: 10px; width: max-content; animation: slide 42s linear infinite; }
.marquee.rev .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee .chip { padding: 5px 13px; font-size: 13px; }

/* ── Certifications & education ─────────────────────────────────────────── */

.certs,
.edu { display: flex; flex-direction: column; gap: 30px; }
/* same two-column rhythm as the experience timeline */
.cert-row,
.edu-row { display: grid; grid-template-columns: 160px 1fr; gap: 24px; }
.cert-title,
.edu-title { font-size: 16px; font-weight: 600; line-height: 1.3; margin: 0; }
.cert-org,
.edu-org { font-size: 14px; font-weight: 500; color: var(--tx-soft); margin: 4px 0 0; }
.edu-where { font-size: 14px; color: var(--tx-mid); margin: 2px 0 0; }
.cert-note,
.edu-note { font-size: 13px; color: var(--tx-mid); margin: 3px 0 0; }
.edu-note { margin-top: 9px; line-height: 1.6; }
.cert-id { font-size: 12px; color: var(--tx-dim); margin: 5px 0 0; }
.cert-id a { text-decoration: underline; text-underline-offset: 2px; transition: color .18s ease; }
.cert-id a:hover { color: var(--tx); }

.cert-thumb {
  display: block; margin: 13px 0 0; padding: 0;
  width: 96px; height: 66px; overflow: hidden;
  border: 1px solid var(--chip-line); border-radius: 8px;
  background: var(--surface-2); cursor: zoom-in;
  transition: transform .2s cubic-bezier(.4, 0, .2, 1), border-color .2s ease;
}
.cert-thumb:hover { transform: scale(1.05); border-color: var(--tx-dim); }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* full-size scan */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(880px, 100%); max-height: 82vh;
  width: auto; height: auto; object-fit: contain;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .55);
  cursor: default;
}
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; padding: 0;
  font: 300 34px/1 inherit; color: #fff; opacity: .75; cursor: pointer;
  transition: opacity .18s ease;
}
.lightbox-close:hover { opacity: 1; }

/* ── Contact ────────────────────────────────────────────────────────────── */

.contact h2 { font-size: clamp(24px, 4vw, 30px); font-weight: 300; line-height: 1.2; letter-spacing: -.025em; margin: 0 0 12px; }
.contact p { color: var(--tx-mid); margin: 0 0 26px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-card {
  display: flex; align-items: center; gap: 13px;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  background: var(--surface);
  transition: border-color .18s ease, transform .18s cubic-bezier(.4, 0, .2, 1), box-shadow .18s ease;
}
.contact-card:hover {
  border-color: var(--tx-dim); transform: scale(1.03);
  box-shadow: 0 4px 12px var(--stack-sh);
}
.contact-card:active { transform: scale(.99); }

.cc-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface-2); color: var(--tx);
  transition: background .18s ease;
}
.contact-card:hover .cc-icon { background: var(--chip-line); }
.cc-icon svg { width: 17px; height: 17px; display: block; }

.cc-body { min-width: 0; flex: 1; }
.contact-card .label { display: block; margin: 0 0 2px; }
.contact-card .val { display: block; font-size: 14px; font-weight: 500; word-break: break-word; }

.cc-arrow {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--tx-dim);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1), color .18s ease;
}
.contact-card:hover .cc-arrow { transform: translateX(4px); color: var(--tx); }

footer {
  border-top: 1px solid var(--line-soft); padding: 22px 0 40px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--tx-dim); font-size: 12.5px;
}

/* ── Theme switch ───────────────────────────────────────────────────────── */

/* The new theme sweeps in over the old one as a diagonal band: the old
   snapshot holds still and the new one is revealed by a moving clip path. */
@supports (view-transition-name: root) {
  ::view-transition-old(root) { animation: none; }
  ::view-transition-new(root) { animation: theme-reveal .95s cubic-bezier(.65, 0, .35, 1); }
}

@keyframes theme-reveal {
  from { clip-path: polygon(-45% -20%, -15% -20%, -60% 120%, -90% 120%); }
  to   { clip-path: polygon(-45% -20%, 145% -20%,  110% 120%, -90% 120%); }
}

/* body fades its own colours, which would smear underneath the wipe */
html.theming body { transition: none; }

/* ── Reveal ─────────────────────────────────────────────────────────────── */

/* Only hide when JS is running, so the page still reads without it. */
.js .rv { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.js .rv.in { opacity: 1; transform: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .avatar-frame { width: 128px; height: 128px; }
  .featured { grid-template-columns: 1fr; }
  .featured-media video,
  .featured-media img { min-height: 190px; }
  .grid, .contact-grid { grid-template-columns: 1fr; }
  .tl-row,
  .cert-row,
  .edu-row { grid-template-columns: 1fr; gap: 4px; }
  .outside { grid-template-columns: 1fr; gap: 30px; }
  .stack { justify-self: center; }
  .tl-when { padding-top: 0; margin-bottom: 4px; }
  .nav-links { gap: 15px; }
  .nav-links a { font-size: 13px; }
  .hero { padding-top: 40px; }
}

@media (max-width: 470px) {
  .nav-links .hide-xs { display: none; }
  .hero-id { gap: 15px; }
  .avatar-frame { width: 104px; height: 104px; }
  .hero-name { font-size: 24px; }
  .verified { width: 19px; height: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .js .rv { opacity: 1; transform: none; }
}

/* ── Experience detail page (experience.html) ───────────────────────────── */

.page-head { padding: 48px 0 8px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--tx-dim); margin-bottom: 24px;
  transition: color .18s ease;
}
.back-link:hover { color: var(--tx); }
.back-link svg { width: 15px; height: 15px; transition: transform .2s cubic-bezier(.4, 0, .2, 1); }
.back-link:hover svg { transform: translateX(-4px); }
.page-title { font-size: clamp(24px, 4vw, 30px); font-weight: 300; line-height: 1.2; letter-spacing: -.025em; margin: 0 0 8px; }
.page-sub { color: var(--tx-mid); font-size: 15px; margin: 0; }

.xp-list { padding: 32px 0 64px; }
.xp-item { position: relative; padding: 0 0 40px 30px; }
.xp-item::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--tx); box-shadow: 0 0 0 3px var(--bg);
}
/* connecting line, stopping at the last dot */
.xp-item::after {
  content: ""; position: absolute; left: 4.5px; top: 16px; bottom: -6px;
  width: 1px; background: var(--line);
}
.xp-item:last-child { padding-bottom: 0; }
.xp-item:last-child::after { display: none; }

.xp-when { color: var(--tx-dim); font-size: 12px; font-weight: 500; margin: 0 0 2px; }
.xp-role { font-size: 17px; font-weight: 600; line-height: 1.25; margin: 0; }
.xp-role em { color: var(--tx-dim); font-style: normal; font-weight: 400; }
.xp-org { font-size: 14px; font-weight: 500; color: var(--tx-soft); margin: 4px 0 0; }
.xp-where { color: var(--tx-mid); font-size: 14px; margin: 2px 0 0; }
.xp-body { color: var(--tx-mid); font-size: 14px; line-height: 1.714; margin: 12px 0 0; }
.xp-bullets { margin: 12px 0 0; padding-left: 18px; color: var(--tx-mid); font-size: 14px; line-height: 1.714; }
.xp-bullets li + li { margin-top: 8px; }
.xp-bullets::marker { color: var(--tx-dim); }

@media (max-width: 700px) {
  .xp-item { padding-left: 24px; }
}

/* ── Technologies ───────────────────────────────────────────────────────── */

.chip-tech {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--chip-line); border-radius: 8px;
  padding: 7px 13px; font-size: 13.5px; font-weight: 500;
  color: var(--tx); background: var(--surface); white-space: nowrap;
  transition: border-color .18s ease, transform .18s ease;
}
.chip-tech:hover { border-color: var(--tx-dim); transform: translateY(-2px); }
.tc-mark { width: 16px; height: 16px; flex-shrink: 0; display: block; color: var(--tx); }
.tc-mark svg { width: 100%; height: 100%; display: block; }

/* the two views are mutually exclusive */
#tech[data-view="rows"] .tech-grid { display: none; }
#tech[data-view="grid"] .tech-rows { display: none; }
#tech[data-view="grid"] #tech-view-btn { background: var(--surface-2); color: var(--tx); }

.tech-grid { display: flex; flex-direction: column; gap: 22px; }
.tech-cat .label { margin-bottom: 10px; }
.tech-cat-items { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Full stack page (stack.html) ───────────────────────────────────────── */

.stack-list { padding: 32px 0 64px; }
.stack-cat { padding-bottom: 26px; }
.stack-cat + .stack-cat { border-top: 1px dashed var(--line-dash); padding-top: 26px; }
.stack-cat h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.stack-cat-items { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Case study (foodquest.html) ────────────────────────────────────────── */

.case-title {
  font-size: clamp(24px, 4.4vw, 32px); font-weight: 700; letter-spacing: -.025em;
  line-height: 1.2; margin: 0 0 12px;
}
.case-lead { color: var(--tx-mid); font-size: 15px; line-height: 1.72; margin: 0; max-width: 62ch; }
.case-note {
  margin-top: 20px; padding: 15px 18px;
  border: 1px dashed var(--line-dash); border-radius: 12px;
  color: var(--tx-mid); font-size: 14px; line-height: 1.7;
}
.page-head .label { margin-bottom: 10px; letter-spacing: .24em; }

/* every section of the case study shares one rhythm */
.case-gallery,
.panel-grid { padding: 0; margin-top: 34px; }

.panel {
  border: 1px dashed var(--line-dash); border-radius: 16px;
  background: var(--bg); padding: 26px; margin-top: 34px;
}
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel-grid .panel { margin: 0; }
.panel-h {
  font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tx-mid); margin: 0 0 13px;
}
.panel p { color: var(--tx-mid); font-size: 14px; line-height: 1.75; margin: 0; }

/* overview table */
.ov-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 22px; margin: 0; }
.ov-grid dt { font-size: 12px; color: var(--tx-dim); margin: 0; }
.ov-grid dd { font-size: 13px; font-weight: 600; color: var(--tx); margin: 4px 0 0; }
.ov-divider { border-top: 1px dashed var(--line-dash); margin-top: 26px; padding-top: 26px; }
.ov-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 30px; }
.ov-item { display: flex; gap: 9px; color: var(--tx-mid); font-size: 14px; line-height: 1.6; }
.ov-item svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 4px; color: var(--tx-dim); }

/* ── Carousel ───────────────────────────────────────────────────────────── */

.shot-shell { position: relative; }
.shot-stage {
  border-radius: 14px; overflow: hidden; background: var(--surface-2);
  /* phone screenshots are tall, so those cases override the ratio */
  aspect-ratio: var(--stage-ratio, 16 / 9); position: relative;
}
.slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: none; background: var(--surface-2);
  display: none; cursor: zoom-in;
}
.slide.on { display: block; }
.slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* A video IS the slide, so never set `display` here: `video.slide` outranks
   `.slide`, and setting it would leave every video stacked and visible at
   once — the top one swallowing the clicks meant for the current slide. */
video.slide { object-fit: contain; cursor: default; }

/* portrait phone captures get a device frame so they read as a phone
   instead of a tall sliver floating in the middle of the stage */
.phone-slide.on { display: grid; place-items: center; padding: 14px 0; }
.phone-shell {
  height: 100%; aspect-ratio: 723 / 1600;
  border: 7px solid var(--phone-bezel); border-radius: 26px;
  background: var(--phone-bezel); overflow: hidden;
  box-shadow: 0 14px 34px var(--stack-sh);
}
.phone-shell img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* screen recordings aren't always the screenshots' ratio, so fit rather
   than crop and let the bezel colour fill whatever is left */
.phone-shell video { width: 100%; height: 100%; object-fit: contain; display: block; }

/* with a device frame the stage panel behind it just looks like a stray box */
.shot.framed .shot-stage,
.shot.framed .slide { background: transparent; }

.shot-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 36px; height: 36px; border-radius: 999px;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: var(--nav-bg); color: var(--tx);
  border: 1px solid var(--line); box-shadow: 0 10px 30px var(--stack-sh);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .18s cubic-bezier(.4, 0, .2, 1), background .18s ease;
}
.shot-nav:hover { transform: translateY(-50%) scale(1.06); background: var(--surface); }
.shot-nav svg { width: 16px; height: 16px; }
.shot-nav.prev { left: -15px; }
.shot-nav.next { right: -15px; }

.dot-row { display: flex; justify-content: center; gap: 7px; margin-top: 15px; flex-wrap: wrap; }
.dot {
  width: 7px; height: 7px; border-radius: 999px; padding: 0; border: none;
  background: var(--line-dash); cursor: pointer;
  transition: width .18s ease, background .18s ease;
}
.dot.on { width: 22px; background: var(--tx); }

/* ── Client review ──────────────────────────────────────────────────────── */

.case-visit { margin-top: 20px; }

.stars { display: inline-flex; align-items: center; gap: 3px; color: var(--line-dash); }
.star { width: 15px; height: 15px; display: block; }
.star.on { color: #f5b301; }

/* sits directly on the panel: it already has a border, a second box around
   the quote would just be another frame inside a frame */
.rcard { display: flex; gap: 16px; align-items: flex-start; }
.rcard-avatar {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--tx);
  font-size: 19px; font-weight: 600; line-height: 1;
  text-transform: uppercase;
}
.rcard-body { min-width: 0; flex: 1; }
.rcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.rcard-name { margin: 0; font-size: 15px; font-weight: 600; color: var(--tx); }
.rcard-date { margin: 2px 0 0; font-size: 12px; color: var(--tx-dim); }
.rcard-rate { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rcard-score { font-size: 13px; font-weight: 600; color: var(--tx); }
.panel .rcard-quote {
  margin: 12px 0 0; font-size: 14.5px; line-height: 1.7; color: var(--tx-soft);
}

@media (max-width: 560px) {
  .rcard-top { flex-direction: column; gap: 8px; }
}

.stack-chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* beats `.panel p { margin: 0 }` */
.panel .stack-note { color: var(--tx-mid); font-size: 14px; line-height: 1.75; margin: 18px 0 0; }
.panel p a, .ov-item a { color: var(--tx); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .18s ease, text-decoration-color .18s ease; }
.panel p a:hover, .ov-item a:hover { text-decoration-color: var(--tx-dim); }

@media (max-width: 700px) {
  .panel-grid,
  .ov-list { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 20px; }
  /* the arrows would hang off the screen, so bring them inside */
  .shot-nav.prev { left: 8px; }
  .shot-nav.next { right: 8px; }
}

/* ── GitHub activity ────────────────────────────────────────────────────── */

:root {
  --gh-0: #ebedf0;
  --gh-1: #9be9a8;
  --gh-2: #40c463;
  --gh-3: #30a14e;
  --gh-4: #216e39;
}
html[data-theme="dark"] {
  --gh-0: #26303d;
  --gh-1: #0e4429;
  --gh-2: #006d32;
  --gh-3: #26a641;
  --gh-4: #39d353;
}

.gh-card {
  border: 1px dashed var(--line-dash); border-radius: 12px;
  background: var(--bg); box-shadow: var(--shadow); padding: 20px;
}
.gh-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.gh-scroll::-webkit-scrollbar { height: 6px; }
.gh-scroll::-webkit-scrollbar-thumb { background: var(--line-dash); border-radius: 3px; }
.gh-scroll::-webkit-scrollbar-track { background: transparent; }

.gh-months,
.gh-grid {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: 10px; gap: 2.5px;
  width: max-content; min-width: 100%;
}
.gh-months {
  margin-bottom: 6px;
  font-size: 11px; color: var(--tx-dim);
  overflow: visible; white-space: nowrap;
}
.gh-months span { line-height: 1; }

.gh-grid { grid-template-rows: repeat(7, 10px); }
.gh-cell {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gh-0);
}
.gh-cell[data-level="1"] { background: var(--gh-1); }
.gh-cell[data-level="2"] { background: var(--gh-2); }
.gh-cell[data-level="3"] { background: var(--gh-3); }
.gh-cell[data-level="4"] { background: var(--gh-4); }
.gh-pad { background: transparent; }

.gh-total { margin: 16px 0 0; font-size: 13.5px; color: var(--tx-mid); }
