/* ============================================================
   PUSKAL KAFLE — Portfolio 2026
   Design system: dark editorial, Syne display + Space Grotesk
   ============================================================ */

:root {
  /* lifted warm dark — layered surfaces instead of a flat void */
  --bg: #181712;
  --bg-soft: #201f18;
  --surface: #26241c;
  --ink: #ece9e2;
  --ink-body: #c9c5b9;
  --muted: #9b9787;
  --line: rgba(236, 233, 226, 0.12);
  --accent: #d4ec52;
  --accent-soft: #b3bf69;
  --accent-ink: #101206;
  --display: 'Syne', 'Trebuchet MS', Verdana, sans-serif;
  --body: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --pad: clamp(20px, 4vw, 64px);
  --ease: cubic-bezier(0.65, 0.05, 0, 1);
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }
[id] { scroll-margin-top: 90px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed; top: 12px; left: 12px;
  z-index: 9999;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 20px; border-radius: 999px;
  font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

/* visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* --- grain overlay ------------------------------------------------ */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

/* --- nav ------------------------------------------------------------ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 8000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--pad);
  border-bottom: 1px solid transparent;
  transition: transform 0.45s var(--ease), background 0.4s var(--ease),
    -webkit-backdrop-filter 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
    padding 0.4s var(--ease), border-color 0.4s var(--ease);
}
.nav.scrolled {
  padding-top: 13px; padding-bottom: 13px;
  background: rgba(24, 23, 18, 0.65);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__logo {
  font-family: var(--display); font-weight: 800;
  font-size: 1.25rem; letter-spacing: -0.02em;
  position: relative; z-index: 2;
}
.nav__logo sup { color: var(--accent-soft); font-size: 0.75rem; }
.nav__links { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav__links a {
  font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase;
  position: relative; padding: 4px 0;
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__time { font-size: 0.8125rem; letter-spacing: 0.08em; color: var(--ink); font-variant-numeric: tabular-nums; }

/* mobile menu */
.nav__toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px;
  align-items: center;
  position: relative; z-index: 2;
}
.nav__toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.nav.open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav__toggle { display: flex; }
  .nav__time { display: none; }
  .nav__links {
    /* explicit geometry: .nav.scrolled's backdrop-filter turns .nav into the
       containing block for fixed descendants, so inset: 0 would collapse the
       overlay to the nav bar's box after scrolling */
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    z-index: 1;
    flex-direction: column; justify-content: flex-start; align-items: flex-start;
    gap: 8px;
    padding: 100px var(--pad) 40px;
    background: var(--bg);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s;
  }
  .nav.open .nav__links { opacity: 1; visibility: visible; }
  /* auto margins center the links when they fit, yet keep the first/last
     reachable when the list overflows (justify-content: center would not) */
  .nav__links a:first-child { margin-top: auto; }
  .nav__links a:last-child { margin-bottom: auto; }
  .nav__links a {
    font-family: var(--display); font-weight: 700;
    font-size: clamp(1.75rem, 8vw, 2.75rem);
    text-transform: none; letter-spacing: -0.02em;
    padding: 6px 0;
    opacity: 0; transform: translateY(14px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  }
  .nav.open .nav__links a { opacity: 1; transform: translateY(0); }
  .nav.open .nav__links a:nth-child(2) { transition-delay: 0.04s; }
  .nav.open .nav__links a:nth-child(3) { transition-delay: 0.08s; }
  .nav.open .nav__links a:nth-child(4) { transition-delay: 0.12s; }
  .nav.open .nav__links a:nth-child(5) { transition-delay: 0.16s; }
  .nav.open .nav__links a:nth-child(6) { transition-delay: 0.2s; }
  .nav.open .nav__links a:nth-child(7) { transition-delay: 0.24s; }
  .nav.open .nav__links a:nth-child(8) { transition-delay: 0.28s; }
  .nav.open .nav__links a:nth-child(9) { transition-delay: 0.32s; }
}

/* --- generic section scaffolding ------------------------------------ */
.section { padding: clamp(80px, 12vh, 160px) var(--pad); position: relative; }
.section--alt { background: var(--bg-soft); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: clamp(36px, 6vh, 72px);
}
.section__title {
  font-family: var(--display); font-weight: 800;
  /* low floor: "COMPONENTS" in Syne overflows phones at a 2rem minimum */
  font-size: clamp(1.25rem, 6vw, 5rem);
  letter-spacing: -0.03em; line-height: 1;
  text-transform: uppercase;
}
.section__count {
  font-size: 0.8125rem; color: var(--muted); letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  /* long counts ("01 product · 3 platforms") drop to their own line
     instead of being crushed into a multi-line sliver */
  .section__head { flex-wrap: wrap; }
  .section__count { white-space: nowrap; }
}
.label {
  display: inline-block;
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}

/* reveal */
.reveal { overflow: hidden; }
.reveal > * {
  transform: translateY(110%);
  transition: transform 0.7s var(--ease);
  will-change: transform;
}
.in-view .reveal > *, .reveal.in-view > * { transform: translateY(0); }
.fade {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.fade.in-view, .in-view .fade { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.06s; } .d2 { transition-delay: 0.12s; }
.d3 { transition-delay: 0.18s; } .d4 { transition-delay: 0.24s; }

/* --- hero ------------------------------------------------------------ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--pad) 40px;
  position: relative;
}
.hero::before {
  /* grounds the composition — kills the floating-in-a-void feel */
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 55% at 30% 75%, rgba(212, 236, 82, 0.05), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero__gl {
  /* after .hero > * so absolute wins; content stacks above in DOM order.
     explicit size: inset alone doesn't stretch a replaced element */
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.hero__meta {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px;
  margin-bottom: clamp(24px, 4vh, 48px);
  font-size: clamp(0.875rem, 1.4vw, 1.125rem);
  color: var(--muted);
  max-width: 1500px;
}
.hero__meta strong { color: var(--ink); font-weight: 500; }
.hero__status {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.hero__status i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }
.hero__title {
  font-family: var(--display);
  font-weight: 800;
  /* low floor: Syne is extra-wide — a bigger minimum clips "INTERFACES," on phones */
  font-size: clamp(1.5rem, 7.2vw, 8rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  max-width: 1300px;
}
.hero__title .alt { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.hero__title .accent { color: var(--accent); }
.hero__proof {
  margin-top: clamp(20px, 3.5vh, 36px);
  font-size: clamp(0.875rem, 1.4vw, 1.0625rem);
  color: var(--ink-body);
  max-width: 720px;
}
.hero__proof b { color: var(--ink); font-weight: 500; }
.hero__cta {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: clamp(22px, 4vh, 40px);
}
.hero__bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: clamp(28px, 5vh, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 860px) {
  .hero__meta { flex-direction: column; align-items: flex-start; }
  .hero__bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* --- worked-with logos -------------------------------------------------- */
.logos {
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(20px, 3.5vh, 36px) var(--pad);
  border-top: 1px solid var(--line);
}
.logos__label {
  flex-shrink: 0;
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
}
.logos img {
  height: clamp(26px, 3.6vw, 44px);
  width: auto;
  max-width: min(72vw, 980px);
  object-fit: contain;
  filter: grayscale(1) invert(1) opacity(0.75);
  transition: filter 0.45s var(--ease);
}
.logos img:hover { filter: none; }
@media (max-width: 700px) {
  .logos { flex-direction: column; align-items: flex-start; }
  .logos img { max-width: 100%; height: auto; }
}

/* --- marquee ---------------------------------------------------------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex; align-items: center; gap: 0;
  animation: marquee 40s linear infinite;
}
.marquee span {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.125rem, 2.6vw, 2rem);
  text-transform: uppercase; letter-spacing: 0.02em;
  padding-right: 28px;
}
.marquee em { color: var(--muted); font-style: normal; padding-right: 28px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --- work list ---------------------------------------------------------- */
.work-list { counter-reset: work; }
.work-item {
  display: block;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.work-item a {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  padding: clamp(24px, 4.5vh, 48px) 8px;
  transition: padding 0.5s var(--ease);
}
.work-item a:hover { padding-left: clamp(16px, 2vw, 32px); }
.work-item__num {
  font-size: 0.8125rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.work-item__thumb {
  width: clamp(88px, 10vw, 148px);
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.work-item__thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  filter: grayscale(0.6);
  transform: scale(1.01);
  transition: filter 0.45s var(--ease), transform 0.6s var(--ease);
}
.work-item a:hover .work-item__thumb img { filter: grayscale(0); transform: scale(1.06); }
.work-item__name {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.5rem, 4.2vw, 3.375rem);
  letter-spacing: -0.02em; line-height: 1.05;
  transition: color 0.4s;
}
.work-item a:hover .work-item__name { color: var(--accent); }
.work-item__desc {
  display: block;
  font-family: var(--body); font-weight: 400;
  font-size: clamp(0.8125rem, 1.2vw, 0.9375rem);
  color: var(--ink-body);
  letter-spacing: 0;
  margin-top: 10px;
  max-width: 56ch;
}
.work-item__tags { font-size: 0.8125rem; color: var(--muted); text-align: right; }
.work-item__year { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.work-item__arrow {
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center;
  transition: background 0.4s, color 0.4s, transform 0.5s var(--ease);
}
.work-item a:hover .work-item__arrow {
  background: var(--accent); color: var(--accent-ink);
  transform: translateX(4px);
}
@media (max-width: 860px) {
  .work-item a { grid-template-columns: auto 1fr auto; }
  .work-item__tags, .work-item__num { display: none; }
}
@media (max-width: 600px) {
  /* the arrow is decorative (the row itself is the link); reclaiming its
     column plus a vw-scaled size keeps one-word names like
     "ProductImageUpscale" from clipping */
  .work-item__arrow { display: none; }
  .work-item__name { font-size: clamp(0.875rem, 4.5vw, 1.5rem); }
}

/* --- product spotlight --------------------------------------------------- */
.product { background: var(--bg-soft); }
.product__intro { max-width: 760px; margin-bottom: clamp(36px, 7vh, 80px); }
.product__intro h3 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.625rem, 4vw, 3rem); letter-spacing: -0.02em;
  line-height: 1.1; margin: 18px 0;
}
.product__intro h3 em { font-style: normal; color: var(--accent-soft); }
@media (max-width: 355px) {
  /* "ProductImageUpscale" is one unbreakable word — step down before it clips */
  .product__intro h3 { font-size: 1.25rem; }
}
.product__intro p { color: var(--ink-body); font-size: clamp(0.9375rem, 1.4vw, 1.125rem); }
.product__intro p strong { color: var(--ink); font-weight: 500; } /* Space Grotesk ships 400/500 only — avoids faux bold */

.compare {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 8;
  max-height: 70vh;
  user-select: none;
  touch-action: pan-y;
  margin-bottom: clamp(36px, 7vh, 80px);
  cursor: ew-resize;
}
.compare:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.compare img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.compare__before { image-rendering: auto; }
.compare__after-wrap {
  position: absolute; inset: 0;
  overflow: hidden;
  clip-path: inset(0 0 0 50%);
}
.compare__handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: var(--accent);
  z-index: 3;
}
.compare__handle::after {
  content: '◂ ▸';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent); color: var(--accent-ink);
  font-size: 0.8125rem; letter-spacing: 2px;
  padding: 12px 14px; border-radius: 999px;
  white-space: nowrap;
}
.compare__tag {
  position: absolute; top: 16px;
  font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  background: rgba(24, 23, 18, 0.75); backdrop-filter: blur(8px);
  padding: 8px 14px; border-radius: 999px;
  z-index: 2;
}
.compare__tag--before { left: 16px; }
.compare__tag--after { right: 16px; background: var(--accent); color: var(--accent-ink); }

.eco-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.eco-card {
  background: var(--surface);
  padding: clamp(24px, 3vw, 44px);
  display: flex; flex-direction: column; gap: 16px;
  min-height: 320px;
  position: relative;
  transition: background 0.45s var(--ease);
}
.eco-card:hover { background: #2c2a20; }
.eco-card__plat { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-soft); }
.eco-card h4 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.25rem, 1.9vw, 1.625rem); letter-spacing: -0.01em; line-height: 1.15;
}
.eco-card p { color: var(--ink-body); font-size: 0.9375rem; flex: 1; }
.eco-card__cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.eco-card__cta svg { transition: transform 0.4s var(--ease); }
.eco-card:hover .eco-card__cta svg { transform: translate(4px, -4px); }
.product__stats {
  display: flex; flex-wrap: wrap; gap: clamp(24px, 6vw, 96px);
  margin-top: clamp(36px, 7vh, 72px);
}
.stat b {
  display: block;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.125rem, 5vw, 4rem); letter-spacing: -0.02em;
  color: var(--ink); line-height: 1;
  /* optical alignment: Syne digits carry ~0.03em left side bearing */
  margin-left: -0.035em;
}
.stat span { font-size: 0.8125rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 860px) {
  .eco-grid { grid-template-columns: 1fr; }
  .eco-card { min-height: 0; }
  .compare { aspect-ratio: 4/3; }
}

/* --- framer components ----------------------------------------------------- */
.comp-list { border-top: 1px solid var(--line); }
.comp-item { border-bottom: 1px solid var(--line); }
.comp-item a {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  padding: clamp(18px, 3vh, 30px) 8px;
  position: relative;
  z-index: 1;
  transition: color 0.35s, padding 0.45s var(--ease);
}
.comp-item a::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.45s var(--ease);
  z-index: -1;
}
.comp-item a:hover { color: var(--accent-ink); padding-left: clamp(14px, 2vw, 28px); padding-right: clamp(14px, 2vw, 28px); }
.comp-item a:hover::before { transform: scaleY(1); }
.comp-item__num { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.comp-item a:hover .comp-item__num { color: inherit; }
.comp-item__name {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.25rem, 3.4vw, 2.5rem); letter-spacing: -0.015em;
}
.comp-item__type { font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.comp-item a:hover .comp-item__type { color: inherit; }
.components__foot { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* big pill button */
.btn-pill {
  display: inline-flex; align-items: center; gap: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 16px 30px;
  font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase;
  position: relative; overflow: hidden;
  transition: color 0.4s, border-color 0.4s;
  z-index: 1;
}
.btn-pill::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--accent);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.45s var(--ease);
  z-index: -1;
}
.btn-pill:hover { color: var(--accent-ink); border-color: var(--accent); }
.btn-pill:hover::before { transform: translateY(0); }
.btn-pill--solid {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-pill--solid::before { background: var(--ink); }
.btn-pill--solid:hover { border-color: var(--ink); }

/* --- archive ----------------------------------------------------------------- */
.chips {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: clamp(24px, 4vh, 40px);
}
.chip {
  font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 18px;
  color: var(--muted);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.chip:hover { border-color: var(--accent-soft); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink);
}
.archive-card.hidden { display: none; }

.archive__rail {
  display: flex; gap: clamp(16px, 2vw, 28px);
  overflow-x: auto;
  padding-bottom: 20px;
  scrollbar-width: none;
  cursor: grab;
}
.archive__rail::-webkit-scrollbar { display: none; }
.archive__rail.dragging { cursor: grabbing; scroll-snap-type: none; }
.archive-card {
  flex: 0 0 clamp(240px, 26vw, 380px);
  scroll-snap-align: start;
}
.archive-card figure {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-soft);
}
.archive-card img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.9) contrast(1.02);
  transform: scale(1.01);
  transition: filter 0.6s var(--ease), transform 0.8s var(--ease);
}
.archive-card:hover img { filter: grayscale(0); transform: scale(1.06); }
.archive-card figcaption {
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: 12px;
  font-size: 0.8125rem;
}
.archive-card figcaption i { font-style: normal; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; }
.archive__hint { margin-top: 8px; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }

/* --- about ---------------------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 460px);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.about__portrait {
  position: relative;
  border-radius: 999px; /* capsule — same shape family as labels, tags and buttons */
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.about__portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}

/* curtain reveal — the image stays put and is uncovered bottom-to-top
   while settling from a zoom. The container itself stays unclipped:
   IntersectionObserver ignores elements whose own clip-path hides them,
   so the child is animated instead. */
.clip-reveal img {
  clip-path: inset(100% 0 0 0);
  transform: scale(1.25);
  transition: clip-path 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.clip-reveal.in-view img {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}
.about__body p.lead {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.375rem, 2.8vw, 2.25rem);
  line-height: 1.25; letter-spacing: -0.01em;
  margin-bottom: 28px;
}
.about__body p.lead em { font-style: normal; color: var(--accent-soft); }
.about__body > p { color: var(--ink-body); max-width: 640px; margin-bottom: 18px; }
.about__skills {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 32px 0;
}
.about__skills li {
  font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px;
  color: var(--muted);
  transition: border-color 0.3s, color 0.3s;
}
.about__skills li:hover { border-color: var(--accent-soft); color: var(--accent-soft); }
@media (max-width: 920px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 420px; }
}

/* --- recommendations ("Kind Words") ------------------------------------------------ */
.reco-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 36px);
}
.reco {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(24px, 2.6vw, 34px);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.reco:hover { border-color: var(--accent-soft); transform: translateY(-4px); }
.reco__mark {
  font-family: var(--display); font-weight: 800;
  font-size: 3.75rem; line-height: 0.6;
  color: var(--accent-soft); opacity: 0.35;
  height: 0.44em; margin-bottom: 6px;
  user-select: none;
}
.reco__quote p {
  font-size: clamp(1rem, 1.3vw, 1.1875rem);
  line-height: 1.5; color: var(--ink);
  letter-spacing: -0.01em;
}
.reco__by {
  display: flex; align-items: center; gap: 13px;
  margin-top: auto; padding-top: 22px;
}
.reco__avatar {
  flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--accent-soft);
  font-family: var(--display); font-weight: 700; font-size: 0.9375rem;
  letter-spacing: 0.02em;
  object-fit: cover;
}
.reco__avatar--img { filter: grayscale(1); transition: filter 0.4s var(--ease); }
.reco:hover .reco__avatar--img { filter: grayscale(0); }
.reco__id { display: flex; flex-direction: column; line-height: 1.35; }
.reco__id b { font-weight: 500; color: var(--ink); font-size: 0.9375rem; }
.reco__id i { font-style: normal; color: var(--muted); font-size: 0.8125rem; }
.reco__foot { margin-top: clamp(28px, 4vh, 44px); }
@media (max-width: 720px) {
  .reco-grid { grid-template-columns: 1fr; }
}

/* --- certificates ------------------------------------------------------------------ */
.cert__lead {
  color: var(--ink-body); max-width: 620px;
  margin: -28px 0 clamp(36px, 5vh, 56px);
  font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
}
/* compact 3-up grid — the tile only signals the credential; the full,
   legible certificate opens in the lightbox on click */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
}
.cert {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.cert:hover { border-color: var(--accent-soft); transform: translateY(-4px); }
.cert__view {
  display: block; position: relative;
  width: 100%; padding: 0; cursor: zoom-in;
  background: #f4f2ec; /* warm paper matting behind the white certificate */
}
.cert__frame {
  display: block;
  /* one uniform shape for both the IxDF (1.36:1) and Coursera (1.9:1)
     certificates — each is contained on the paper matting */
  aspect-ratio: 3 / 2;
  padding: clamp(7px, 0.8vw, 11px);
}
.cert__frame img {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 2px;
}
.cert__zoom {
  position: absolute; right: 9px; bottom: 9px;
  font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(16, 18, 6, 0.82); color: var(--ink);
  padding: 6px 10px; border-radius: 999px;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.cert__view:hover .cert__zoom,
.cert__view:focus-visible .cert__zoom { opacity: 1; transform: translateY(0); }
.cert__meta {
  display: flex; flex-direction: column; gap: 5px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}
.cert__issuer {
  font-size: 0.625rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted);
}
.cert__name {
  font-family: var(--display); font-weight: 700;
  font-size: 1rem;
  line-height: 1.2; letter-spacing: -0.01em;
  color: var(--ink);
}
.cert__foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  margin-top: 8px;
}
.cert__badge {
  font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 3px 8px; border-radius: 999px;
}
.cert__badge--soft {
  color: var(--muted); background: transparent;
  border: 1px solid var(--line);
}
.cert__verify {
  margin-left: auto;
  font-size: 0.75rem; color: var(--muted);
  transition: color 0.3s;
}
.cert__verify:hover { color: var(--accent-soft); }
@media (max-width: 900px) {
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .cert-grid { grid-template-columns: 1fr; }
}

/* --- certificate lightbox ---------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 9500;
  display: grid; place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(16, 15, 11, 0.86);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.28s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__stage {
  max-width: min(1100px, 100%); max-height: 100%;
  transform: scale(0.97); transition: transform 0.3s var(--ease);
}
.lightbox.is-open .lightbox__stage { transform: scale(1); }
.lightbox__img {
  width: 100%; height: auto; max-height: 86vh; object-fit: contain;
  background: #fff; border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.lightbox__close {
  position: absolute; top: clamp(14px, 3vw, 28px); right: clamp(14px, 3vw, 28px);
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(236, 233, 226, 0.1); color: var(--ink);
  border: 1px solid var(--line);
  transition: background 0.3s, transform 0.3s var(--ease);
}
.lightbox__close:hover { background: rgba(236, 233, 226, 0.2); transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox__stage { transition: none; }
  .lightbox__stage { transform: none; }
  .reco:hover, .cert:hover { transform: none; }
  .lightbox__close:hover { transform: none; }
}

/* --- footer ------------------------------------------------------------------------- */
.footer {
  padding: clamp(80px, 14vh, 180px) var(--pad) 32px;
  border-top: 1px solid var(--line);
  position: relative;
}
.footer__kicker { color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 18px; }
.footer__avail {
  color: var(--ink-body); font-size: clamp(0.875rem, 1.4vw, 1.0625rem);
  max-width: 620px;
  margin: -20px 0 clamp(40px, 8vh, 90px);
}
.footer__mail {
  display: block;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.5rem, 9.5vw, 9.375rem);
  letter-spacing: -0.04em; line-height: 0.95;
  text-transform: uppercase;
  margin-bottom: clamp(40px, 8vh, 90px);
}
.footer__mail span { transition: color 0.4s; }
.footer__mail .nobr { white-space: nowrap; }
.footer__mail:hover span { color: var(--accent); }
.footer__mail .arrow { display: inline-block; transition: transform 0.5s var(--ease); }
.footer__mail:hover .arrow { transform: translate(0.06em, -0.06em) rotate(45deg); }
.footer__grid {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  font-size: 0.8125rem; color: var(--muted);
}
.footer__col-title {
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 12px; color: var(--ink); font-weight: 500;
}
.footer__col a { display: block; padding: 3px 0; transition: color 0.3s; }
.footer__col a:hover { color: var(--accent-soft); }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  margin-top: 48px;
  font-size: 0.75rem; color: var(--muted);
}
.totop { letter-spacing: 0.12em; text-transform: uppercase; }
.totop:hover { color: var(--accent-soft); }

/* ============================================================
   CASE STUDY PAGES
   ============================================================ */
.case-hero {
  padding: clamp(130px, 22vh, 220px) var(--pad) clamp(40px, 7vh, 80px);
}
.case-hero__back {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
  transition: color 0.3s;
}
.case-hero__back:hover { color: var(--accent-soft); }
.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}
.crumb a { transition: color 0.3s; }
.crumb a:hover { color: var(--accent-soft); }
.crumb span[aria-current] { color: var(--ink); }
.case-hero h1 {
  font-family: var(--display); font-weight: 800;
  /* low floor: "REDESIGN" in Syne clips small phones at a 2.375rem minimum */
  font-size: clamp(2rem, 8vw, 7.5rem);
  line-height: 0.95; letter-spacing: -0.035em;
  text-transform: uppercase;
  max-width: 1200px;
}
.case-hero h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.case-hero__cta { margin-top: clamp(28px, 5vh, 48px); }
.case-meta {
  display: flex; flex-wrap: wrap; gap: clamp(24px, 6vw, 80px);
  margin-top: clamp(28px, 5vh, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.case-meta div b {
  display: block; font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); font-weight: 400; margin-bottom: 6px;
}
.case-meta div span { font-size: 0.9375rem; }
.case-cover { padding: 0 var(--pad); }
.case-cover img { width: 100%; border-radius: 8px; }
.case-section { padding: clamp(60px, 10vh, 130px) var(--pad); }
.case-section--alt { background: var(--bg-soft); }
.case-grid {
  display: grid;
  grid-template-columns: minmax(180px, 320px) 1fr;
  gap: clamp(24px, 5vw, 80px);
  max-width: 1280px;
}
.case-grid h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.375rem, 2.6vw, 2.125rem); letter-spacing: -0.01em;
  position: sticky; top: 100px;
}
.case-grid h2 small {
  display: block; font-family: var(--body); font-weight: 400;
  font-size: 0.75rem; letter-spacing: 0.18em; color: var(--accent-soft); text-transform: uppercase;
  margin-bottom: 10px;
}
.case-body p { color: var(--ink-body); margin-bottom: 18px; max-width: 70ch; }
.case-body p strong { color: var(--ink); font-weight: 500; }
.case-body ul { margin: 0 0 18px; }
.case-body li {
  padding: 12px 0 12px 26px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--ink-body);
}
.case-body li::before {
  content: '→'; position: absolute; left: 0; color: var(--accent-soft);
}
.case-stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 72px); margin: 28px 0; }
.case-img-grid {
  display: grid; gap: clamp(16px, 2vw, 28px);
  padding: 0 var(--pad);
  max-width: 1500px;
}
.case-img-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.case-img-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.case-img-grid img, .scroll-frame { border-radius: 8px; width: 100%; }
.case-img-grid figure { margin: 0; }
.case-img-grid figcaption { font-size: 0.8125rem; color: var(--muted); padding-top: 10px; }
.scroll-frame {
  overflow-y: auto; max-height: 78vh;
  border: 1px solid var(--line);
  scrollbar-width: thin; scrollbar-color: var(--accent-soft) transparent;
}
.scroll-frame img { width: 100%; border-radius: 0; }
.phone-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: clamp(14px, 2vw, 24px);
  padding: 0 var(--pad);
  max-width: 1500px;
}
.phone-grid img {
  width: 100%; border-radius: 18px;
  border: 1px solid var(--line);
}
.swatches { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0; }
.swatch { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--muted); }
.swatch i { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); }
.case-next {
  display: block;
  text-align: center;
  padding: clamp(80px, 14vh, 160px) var(--pad);
  border-top: 1px solid var(--line);
}
.case-next small {
  display: block;
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 16px;
}
.case-next strong {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.125rem, 7vw, 6rem);
  letter-spacing: -0.03em; text-transform: uppercase; line-height: 1;
  transition: color 0.4s;
}
.case-next:hover strong { color: var(--accent); }
@media (max-width: 600px) {
  /* fits "PRODUCTIMAGEUPSCALE" (with its &#8203; break hints) on phones */
  .case-next strong { font-size: clamp(1.25rem, 6vw, 2.125rem); }
}
@media (max-width: 860px) {
  .case-grid { grid-template-columns: 1fr; }
  .case-grid h2 { position: static; }
  .case-img-grid.cols-2, .case-img-grid.cols-3 { grid-template-columns: 1fr; }
}

/* --- reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal > *, .fade { transform: none; opacity: 1; }
  .clip-reveal img { transform: none; }
  html { scroll-behavior: auto; }
}

/* --- lazy image placeholders (shimmer + fade-in) ------------------------- */
/* Container gets a shimmering placeholder until its media finishes loading. */
.media-ph { position: relative; }
.media-ph::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 50%, transparent 80%),
    var(--bg-soft, #201e18);
  background-size: 220% 100%, 100% 100%;
  animation: ph-shimmer 1.5s ease-in-out infinite;
  transition: opacity 0.5s var(--ease);
}
.media-ph.is-loaded::before { opacity: 0; animation: none; }
@keyframes ph-shimmer {
  0%   { background-position: 160% 0, 0 0; }
  100% { background-position: -160% 0, 0 0; }
}

/* The image/video itself fades in once decoded (only when JS is active, so a
   scripting failure never leaves images invisible). */
.js .ph { opacity: 0; transition: opacity 0.6s var(--ease); }
.js .ph.is-loaded { opacity: 1; }

/* animated GIFs are now looping <video> — mirror the archive-card img styling */
.archive-card figure video {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.9) contrast(1.02);
  transform: scale(1.01);
  transition: filter 0.6s var(--ease), transform 0.8s var(--ease);
}
.archive-card:hover video { filter: grayscale(0); transform: scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  .media-ph::before { animation: none; }
  .js .ph { transition: none; }
}
