/* ==========================================================================
   Main CSS — Richard Forero Theme
   All component styles matching the Stitch "Portfolio Home" design.
   ========================================================================== */

html {
  scroll-padding-top: 6rem;
  scrollbar-gutter: stable;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Sections focused after an in-page jump are not interactive: no ring */
section[tabindex="-1"]:focus {
  outline: none;
}

.kc-projects :focus-visible,
.kc-contact :focus-visible,
.kc-lightbox :focus-visible,
.kc-nav.is-sticky :focus-visible,
.kc-mobile-menu :focus-visible {
  outline-color: var(--color-primary-container);
}

/* Honeypot: off-screen, 1px, never focusable */
.kc-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Off-screen stage that warms reel videos (see animations.js) */
.kc-warm-stage {
  position: absolute;
  left: -99999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   Skip link (first focusable element on the page)
   ========================================================================== */

/* Parked above the viewport until keyboard focus slides it in. */
.kc-skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-lg);
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
  font-family: var(--font-headline);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  transform: translateY(calc(-100% - 1.5rem));
  transition: transform 0.2s ease;
}

.kc-skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* The skip target shouldn't show a ring when focused programmatically. */
.kc-main:focus {
  outline: none;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.kc-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(245, 245, 245, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* ── Sticky state ── */
.kc-nav.is-sticky {
  background: #1a1c1c;
  box-shadow: 0 1px 24px rgba(26, 28, 28, 0.12);
}

.kc-nav.is-sticky .kc-nav__logo {
  color: #ffffff;
}

.kc-nav.is-sticky .kc-nav__logo img {
  filter: brightness(0) invert(1);
}

.kc-nav.is-sticky .kc-nav__link {
  color: rgba(200, 200, 200, 1);
}

.kc-nav.is-sticky .kc-nav__link:hover {
  color: #ffffff;
}

.kc-nav.is-sticky .kc-nav__link--active {
  color: var(--color-primary-container);
}

.kc-nav.is-sticky .kc-nav__mobile-toggle {
  color: #ffffff;
}

.kc-nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.kc-nav__logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--color-on-background);
  text-transform: uppercase;
  transition: color 0.4s ease;
}

.kc-nav__logo img {
  max-height: 40px;
  width: auto;
}

.kc-nav__logo-text {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  animation: kc-logo-reveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

@keyframes kc-logo-reveal {
  to {
    clip-path: inset(0 0% 0 0);
  }
}

.kc-nav__links {
  display: none;
  align-items: center;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .kc-nav__links {
    display: flex;
  }
}

.kc-nav__link {
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-on-surface-variant);
  transition: color 0.3s ease;
}

.kc-nav__link:hover {
  color: var(--color-primary);
}

.kc-nav__link--active {
  color: var(--color-primary);
  font-weight: 800;
}

/* ── Staggered nav-item reveal (fires after logo finishes at 1.7s) ── */
@keyframes kc-nav-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kc-nav__links .kc-nav__link {
  animation: kc-nav-fade 0.7s ease both;
}

.kc-nav__links .kc-nav__link:nth-child(1) { animation-delay: 0.70s; }
.kc-nav__links .kc-nav__link:nth-child(2) { animation-delay: 0.85s; }
.kc-nav__links .kc-nav__link:nth-child(3) { animation-delay: 1.00s; }
.kc-nav__links .kc-nav__link:nth-child(4) { animation-delay: 1.15s; }
.kc-nav__links .kc-nav__link:nth-child(5) { animation-delay: 1.30s; }
.kc-nav__links .kc-nav__link:nth-child(6) { animation-delay: 1.45s; }

.kc-nav__mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-on-background);
  transition: color 0.4s ease;
}

@media (min-width: 768px) {
  .kc-nav__mobile-toggle {
    display: none;
  }
}

@media (max-width: 767px) {
  .kc-nav__inner {
    padding: 1rem 1.25rem;
  }

  .kc-nav__inner .kc-btn--primary {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }

  .kc-nav__mobile-toggle {
    margin-left: 0.75rem;
  }
}

/* Mobile Menu */
.kc-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(249, 249, 249, 0.98);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  /* visibility (not just opacity/pointer-events) keeps the menu links out of
     the keyboard tab order while closed — same pattern as .kc-lightbox. */
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.kc-mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kc-mobile-menu__inner {
  text-align: center;
}

.kc-mobile-menu__links {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.kc-mobile-menu__links li {
  margin-bottom: 1.5rem;
}

.kc-mobile-menu__links a {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-on-background);
  transition: color 0.3s;
}

.kc-mobile-menu__links a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.kc-btn {
  display: inline-block;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  cursor: pointer;
  border: none;
  transition: filter 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.kc-btn--primary {
  background-color: rgba(160, 200, 215, 0.95);
  color: #1a2e36;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-lg);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.kc-btn--primary:hover {
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
  transform: scale(1.08);
}

.kc-btn--primary:active {
  transform: scale(0.9);
}

.kc-btn--full {
  display: block;
  width: 100%;
  text-align: center;
}

.kc-btn--submit {
  width: 100%;
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-fixed);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 1.125rem;
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  transition: filter 0.2s;
}

.kc-btn--submit[aria-disabled="true"] {
  opacity: 0.6;
  cursor: wait;
}

.kc-btn--submit:hover {
  filter: brightness(1.1);
}

.kc-btn--submit:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Hero / Reels
   ========================================================================== */

.kc-hero {
  padding: 3rem 1rem 0.5rem;
  background-color: var(--color-surface-bright);
}

@media (min-width: 768px) {
  .kc-hero {
    padding: 3rem 2rem 0.5rem;
  }
}

.kc-hero__container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kc-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .kc-hero__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.kc-reel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container-low);
  box-shadow: 0 25px 50px -12px rgba(26, 28, 28, 0.05);
  cursor: pointer;
  animation: kc-fade-up 0.8s ease both;
}

@keyframes kc-fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

.kc-reel--half {
  aspect-ratio: 16 / 9;
}

.kc-reel--wide {
  aspect-ratio: 21 / 9;
}

.kc-reel__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.7s ease;
}

.kc-reel:hover .kc-reel__image {
  scale: 1.05;
}

.kc-reel__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-surface-container-low), var(--color-surface-container-high));
}

.kc-reel__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 28, 28, 0.88) 0%, rgba(26, 28, 28, 0.88) 20%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
}

.kc-reel__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-primary-container);
  margin-bottom: 0.5rem;
}

.kc-reel__title {
  font-size: 1.875rem;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .kc-reel__title {
    font-size: 2.25rem;
  }
}

/* Reserve room for the bottom-right play button so a long title
   (e.g. "Personal Animation Showcase") wraps above it instead of
   running underneath in the 2×2 grid. */
.kc-hero__grid .kc-reel__title {
  padding-right: 4.5rem;
}

/* Reel Buttons (Orange & Blue pill, bottom-right) */
.kc-reel__btn {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg, 0.75rem);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 5;
}

.kc-reel__btn--orange {
  background: rgba(252, 162, 82, 0.95);
  color: #2e1500;
}

.kc-reel__btn--orange:hover {
  background: rgba(252, 162, 82, 1);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(252, 162, 82, 0.45);
}

.kc-reel__btn--blue {
  background: rgba(160, 200, 215, 0.95);
  color: #1a2e36;
}

.kc-reel__btn--blue:hover {
  background: rgba(160, 200, 215, 1);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(160, 200, 215, 0.45);
}

.kc-reel__btn .material-symbols-outlined {
  font-size: 1.375rem;
}

/* Coming-soon reel: keep the tile alive (hover zoom stays) but signal
   there is nothing to play. The pause pill is a static badge, not a
   click target, so it drops the hover pop/cursor. */
.kc-reel--soon {
  cursor: default;
}

.kc-reel__btn--soon,
.kc-reel__btn--soon:hover {
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* "Coming soon" pop-up: a small pill that floats in above the badge on
   hover. The cover's own hover zoom is untouched. */
.kc-reel__soon-tip {
  position: absolute;
  right: 2rem;
  bottom: 5.75rem;
  z-index: 2;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-lg, 0.75rem);
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.kc-reel--soon:hover .kc-reel__soon-tip {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Video Lightbox
   ========================================================================== */

.kc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.kc-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.kc-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.kc-lightbox__content {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #000;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.kc-lightbox.is-open .kc-lightbox__content {
  transform: scale(1) translateY(0);
}

.kc-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.kc-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.kc-lightbox__close .material-symbols-outlined {
  font-size: 1.25rem;
  color: #ffffff;
}

.kc-lightbox__video-wrap {
  width: 100%;
  height: 100%;
}

.kc-lightbox__video-wrap iframe,
.kc-lightbox__video-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

.kc-lightbox__video-wrap video {
  object-fit: contain;
  background-color: #000;
}

/* ==========================================================================
   Résumé Modal (page preview + download)
   ========================================================================== */

.kc-resume {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.kc-resume.is-open {
  opacity: 1;
  visibility: visible;
}

.kc-resume__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.kc-resume__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 880px;
  max-height: 92vh;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--color-surface-container-low);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.kc-resume.is-open .kc-resume__dialog {
  transform: scale(1) translateY(0);
}

/* Sticky top bar holds the title, Download and Close. */
.kc-resume__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface-container-lowest);
}

.kc-resume__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: var(--color-primary);
}

.kc-resume__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kc-resume__download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.kc-resume__download .material-symbols-outlined {
  font-size: 1.125rem;
}

.kc-resume__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  background: var(--color-surface-container-highest);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-on-background);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.kc-resume__close:hover {
  background: var(--color-outline-variant);
  transform: scale(1.1);
}

.kc-resume__close .material-symbols-outlined {
  font-size: 1.25rem;
}

/* Scrollable page stack. */
.kc-resume__pages:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.kc-resume__pages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kc-resume__page {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-default);
  background: #fff;
  box-shadow: 0 10px 30px -12px rgba(26, 28, 28, 0.25);
}

@media (max-width: 600px) {
  .kc-resume__title {
    display: none; /* keep room for the actions on small screens */
  }

  .kc-resume__pages {
    padding: 1rem;
  }
}

/* ==========================================================================
   Trusted By — Client Logo Marquee
   ========================================================================== */

.kc-trusted {
  /* Space is the divider — breathing room between the reels and the
     dark Featured Projects block. */
  padding: var(--space-10) 1rem;
}

@media (min-width: 768px) {
  .kc-trusted {
    padding: var(--space-12) 2rem;
  }
}

.kc-trusted__container {
  max-width: 1600px;
  margin: 0 auto;
}

.kc-trusted__heading {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: var(--color-primary);
  margin-bottom: var(--space-10);
}

/* Viewport — clips the track and fades both edges (the editorial
   equivalent of a progressive blur). Vertical padding gives the hover
   zoom room to grow without being clipped by overflow: hidden. */
.kc-trusted__marquee {
  overflow: hidden;
  padding: 0.6rem 0;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 12%,
    #000 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 12%,
    #000 88%,
    transparent 100%
  );
}

.kc-trusted__track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: var(--space-10);
  list-style: none;
  margin: 0;
  padding: 0;
  animation: kc-trusted-scroll 45s linear infinite;
}

@media (min-width: 768px) {
  .kc-trusted__track {
    gap: var(--space-16);
  }
}

/* No-JS fallback: pause on hover so a visitor can settle on a logo. */
.kc-trusted__marquee:hover .kc-trusted__track {
  animation-play-state: paused;
}

/* When JS takes over, it drives the transform itself (auto-loop + drag). */
.kc-trusted__marquee.is-enhanced {
  cursor: grab;
  touch-action: pan-y;            /* let the page still scroll vertically */
  user-select: none;
}

.kc-trusted__marquee.is-enhanced .kc-trusted__track {
  animation: none;
  will-change: transform;
}

.kc-trusted__marquee.is-dragging {
  cursor: grabbing;
}

.kc-trusted__item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.kc-trusted__logo {
  height: 2.25rem;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  -webkit-user-drag: none;
  pointer-events: none;          /* events fall through to the marquee for dragging */
  /* Unify mixed brand marks into a calm, editorial wall; reveal full
     colour on hover with a weighted transition. */
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter 0.6s ease, opacity 0.6s ease, transform 0.6s ease;
}

@media (min-width: 768px) {
  .kc-trusted__logo {
    height: 3rem;
    max-width: 150px;
  }
}

/* ── Optical size normalisation ──
   Every logo shares one height, so wide wordmarks read far "bigger" than
   compact/icon marks. Trim the wide ones (shorter + narrower) and give the
   small icon marks a touch more height so each logo carries similar weight. */
.kc-trusted__item--bron .kc-trusted__logo            { height: 1.9rem; max-width: 120px; }
.kc-trusted__item--sonypictures .kc-trusted__logo    { height: 2.4rem; max-width: 130px; }
.kc-trusted__item--netflix .kc-trusted__logo         { height: 2.9rem; }
.kc-trusted__item--essentialstudio .kc-trusted__logo { height: 2.4rem; }
.kc-trusted__item--framemachine .kc-trusted__logo    { height: 2.6rem; }

.kc-trusted__item:hover .kc-trusted__logo {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.1);
  /* Snap into the hover state immediately (ease-out starts fast), while the
     base rule keeps a gentle ease when the mouse leaves. */
  transition-timing-function: ease-out;
  transition-duration: 0.45s;
}

/* The track holds two identical passes; shifting by -50% loops seamlessly. */
@keyframes kc-trusted-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ==========================================================================
   Featured Projects
   ========================================================================== */

.kc-projects {
  padding: 0.5rem 1rem 3rem;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  /* The scroll-tilt rotates the (tall) container under perspective, so its
     magnified near edge projects past the viewport → phantom horizontal
     scroll at narrow widths. Clip only the off-screen projected pixels; the
     on-screen tilt is untouched. `clip` (not hidden) doesn't create a scroll
     container, so it won't break the sticky nav. */
  overflow-x: clip;
}

@media (min-width: 768px) {
  .kc-projects {
    padding: 0.5rem 2rem 3rem;
  }
}

.kc-projects__container {
  max-width: 1600px;
  margin: 0 auto;
  background-color: var(--color-on-background);
  color: #ffffff;
  border-radius: 3rem;
  padding: 2rem;
  transform-origin: 50% 50%;
}

@media (min-width: 768px) {
  .kc-projects__container {
    padding: 4rem;
  }
}

.kc-projects__header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .kc-projects__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.kc-projects__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: rgba(253, 190, 135, 0.8);
}

.kc-projects__title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 1rem;
  color: #ffffff;
}

@media (min-width: 768px) {
  .kc-projects__title {
    font-size: 4.5rem;
  }
}

.kc-projects__description {
  color: var(--color-surface-variant);
  max-width: 24rem;
  font-size: 1.125rem;
  line-height: 1.7;
}

.kc-projects__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .kc-projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .kc-projects__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   Project Cards
   ========================================================================== */

.kc-card {
  position: relative;
  display: block;
  background-color: var(--color-inverse-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transform-origin: center;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

/* Once revealed, use a snappy transition so the hover pop feels immediate (Netflix-style),
   overriding the slow 0.8s reveal transition that .kc-reveal sets. */
.kc-card.is-visible {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Soft pop — whole card lifts on hover (poster stays still inside).
   The .is-visible variants raise specificity so this beats
   `.kc-reveal.is-visible { transform: translateY(0) }`.
   Uses :has(:focus-visible) (keyboard focus) rather than :focus-within so a
   MOUSE click that focuses the card (e.g. opening its modal) doesn't leave the
   card stuck "popped" after the modal restores focus to it on close. */
.kc-card:hover,
.kc-card:focus-visible,
.kc-card:has(:focus-visible),
.kc-card.is-visible:hover,
.kc-card.is-visible:focus-visible,
.kc-card.is-visible:has(:focus-visible) {
  transform: scale(1.08);
  z-index: 2;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
}

/* Homepage cards carry tabindex="0" (they are not links) so sighted
   keyboard users can reveal the info band; give that focus a visible ring. */
.kc-card:focus-visible {
  outline: 2px solid var(--color-primary-container);
  outline-offset: 4px;
}

.kc-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.kc-card__image-wrap {
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.kc-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kc-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3a3a3a, #4a4a4a);
}

/* Hover-reveal frosted band overlaying the bottom of the image */
.kc-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* Reduced top padding lowers where the frosted band begins (sits a bit lower
     on the card / covers a little less). */
  padding: 0.75rem 1.5rem 1.5rem;
  /* 0.82 (not 0.72) keeps the #fdbe87 labels ≥4.5:1 even over a white-hot
     poster region (worst case was 4.13:1 at 0.72). */
  background-color: rgba(26, 28, 28, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* The band carries a backdrop-filter, which Chrome does NOT clip to an
     ancestor's border-radius+overflow, and even the element's own
     border-radius+overflow leaves a thin sharp-image sliver at the rounded
     corners. clip-path reliably clips the whole rendering (filter included) to
     the exact shape: square top, rounded bottom matching the card. */
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  clip-path: inset(0 0 0 0 round 0 0 var(--radius-xl) var(--radius-xl));
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.kc-card:hover .kc-card__body,
.kc-card:focus-visible .kc-card__body,
.kc-card:has(:focus-visible) .kc-card__body {
  transform: translateY(0);
  opacity: 1;
}

/* Touch devices have no hover — keep the band visible so info is never lost */
@media (hover: none) {
  .kc-card__body {
    transform: translateY(0);
    opacity: 1;
  }
}

.kc-card__label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.kc-card__label--primary {
  color: var(--color-primary-container);
}

.kc-card__label--secondary {
  color: var(--color-secondary-container);
}

.kc-card__title {
  font-size: 1.3125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Client / Role meta */
.kc-card__meta {
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.kc-card__meta-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.kc-card__meta-key {
  flex: 0 0 3.25rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-primary-container);
}

.kc-card__meta-val {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Tool / software chips */
.kc-card__tags {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.kc-card__tag {
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background-color: var(--color-secondary-container);
  color: var(--color-on-secondary-container);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Bio / Philosophy
   ========================================================================== */

.kc-bio {
  padding: 8rem 1rem;
  background-color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .kc-bio {
    padding: 8rem 2rem;
  }
}

.kc-bio__container {
  width: 100%;
  max-width: 72rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  justify-items: center;
}

/* Asymmetric split: portrait + Resume hold the left column; the copy column
   stretches to the portrait's height so its skill chips can pin to the bottom
   line of the picture (they appear to stream out of it). */
@media (min-width: 900px) {
  .kc-bio__container {
    grid-template-columns: minmax(280px, 0.85fr) 1.15fr;
    column-gap: 5rem;
    row-gap: 1.75rem;
    justify-items: stretch;
    align-items: stretch;
  }

  .kc-bio__photo {
    grid-column: 1;
    grid-row: 1;
    align-self: start;        /* keep the 4:5 ratio rather than stretching */
  }

  .kc-bio__content {
    grid-column: 2;
    grid-row: 1;              /* same row as the photo → matches its height */
  }

  /* Push the chips to the bottom of the copy column = the photo's bottom line. */
  .kc-bio__content .kc-bio__marquee {
    margin-top: auto;
  }
}

/* Resume button lives in the copy column, between the text and the skill pills.
   Left-aligned, orange primary-container fill (the CTA colour). */
.kc-bio .kc-resume-trigger {
  align-self: flex-start;
  margin-bottom: 2.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-lg);
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
}

.kc-bio .kc-resume-trigger:hover {
  filter: brightness(0.97);
  transform: scale(1.05);
}

.kc-bio .kc-resume-trigger:active {
  transform: scale(0.95);
}

/* Matches the Featured Projects card: 4:5 crop, radius-xl, cover.
   Keeps a soft floating shadow so the white-background portrait reads as a card. */
.kc-bio__photo {
  margin: 0;
  width: 100%;
  max-width: 22rem;
  justify-self: center;
  border-radius: var(--radius-xl);
  background-color: var(--color-inverse-surface);
  /* Soft, diffuse shadow so the card reads as floating (per reference). */
  box-shadow:
    0 30px 60px -18px rgba(26, 28, 28, 0.22),
    0 12px 24px -14px rgba(26, 28, 28, 0.12);
}

/* ── Portrait flip (easter egg) ──
   Click the portrait to flip it, like turning over a playing card, revealing
   the Oscar-winner shot on the back. Click again to flip home. The button is
   the (fixed) perspective + sizing frame; the inner layer does the rotating. */
.kc-bio__flip {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  border-radius: inherit;
  cursor: pointer;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
}

/* Hover affordance: a frosted "Flip" pill drifts up from the bottom-right
   corner so visitors discover the easter egg. Hidden until hover/focus, and
   click-through (pointer-events: none) so it never blocks the flip. It lives
   OUTSIDE the flip button on purpose — a backdrop-filter inside the perspective
   subtree makes Chrome flatten and drop the 3D faces. */
.kc-bio__hint {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem 0.4rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: rgba(26, 28, 28, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-headline);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.75, 0.15, 1);
}

.kc-bio__hint .material-symbols-outlined {
  font-size: 1.05rem;
}

.kc-bio__photo:hover .kc-bio__hint,
.kc-bio__flip:focus-visible ~ .kc-bio__hint {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Anchor the hint pill + give a gentle lift on hover ("it's interactive"):
   the card rises a few px and its floating shadow deepens. The lift uses
   `top` (relative offset), NOT `transform` — a transform on this figure would
   flatten the perspective/preserve-3d subtree below it and cull the flip's
   backface-hidden faces (portrait goes solid dark). */
.kc-bio__photo {
  position: relative;
  top: 0;
  transition: box-shadow 0.4s ease, top 0.4s cubic-bezier(0.2, 0.75, 0.15, 1);
}

.kc-bio__photo:hover {
  top: -8px;
  box-shadow:
    0 44px 72px -18px rgba(26, 28, 28, 0.30),
    0 18px 32px -14px rgba(26, 28, 28, 0.18);
}

.kc-bio__flip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

.kc-bio__flip-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.2, 0.75, 0.15, 1);
}

.kc-bio__photo.is-flipped .kc-bio__flip-inner {
  transform: rotateY(180deg);
}

.kc-bio__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.kc-bio__face--back {
  transform: rotateY(180deg);
}

.kc-bio__face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ── Right column: philosophy copy ── */
.kc-bio__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  color: var(--color-primary);
  margin-bottom: 1.75rem;
  display: block;
}

.kc-bio__content {
  /* 42rem reading measure on desktop, but never wider than its grid cell:
     with justify-self:center + a plain 42rem cap the column overflowed its
     own narrow mobile cell and spilled right (dragging the centred photo with
     it). min() keeps the cap AND respects the cell. */
  max-width: min(42rem, 100%);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kc-bio__text {
  font-size: 1.25rem;
  color: var(--color-on-surface-variant);
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

/* Fact line above the philosophy: darker + heavier so it reads as the headline
   statement, tighter margin so the two paragraphs form one block. */
.kc-bio__text--lead {
  color: var(--color-on-background);
  font-weight: 700; /* 600 renders Manrope capitals heavier than lowercase; 700 is even */
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .kc-bio__text {
    font-size: 1.5rem;
  }
}

/* Skill chips as a two-row marquee — same slow infinite loop, edge fade and
   pause-on-hover as the "Trusted by" wall. The two rows drift in opposite
   directions for a calmer, more editorial motion. */
.kc-bio__marquee {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kc-bio__row {
  overflow: hidden;
  min-width: 0;   /* the max-content track inside must not pin the row's width */
  cursor: grab;
  touch-action: pan-y;   /* horizontal drag scrubs; vertical still scrolls the page */
  user-select: none;
  -webkit-mask-image: linear-gradient(
    to right, transparent 0, #000 8%, #000 92%, transparent 100%
  );
  mask-image: linear-gradient(
    to right, transparent 0, #000 8%, #000 92%, transparent 100%
  );
}

.kc-bio__row.is-dragging {
  cursor: grabbing;
}

.kc-bio__track {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
}

/* Spacing via item margin (not flex gap) so the duplicated pass lines up
   exactly at -50% and the loop is perfectly seamless. */
.kc-bio__track .kc-bio__tag {
  flex: 0 0 auto;
  margin-right: 1rem;
  white-space: nowrap;
}

.kc-bio__track--left {
  animation: kc-bio-scroll-left 45s linear infinite;
}

.kc-bio__track--right {
  animation: kc-bio-scroll-right 45s linear infinite;
}

/* Pause both rows when the visitor hovers the cluster, so a tag can be read. */
.kc-bio__marquee:hover .kc-bio__track {
  animation-play-state: paused;
}

/* When JS takes over, it drives the transform itself (auto-loop + drag). */
.kc-bio__marquee.is-enhanced .kc-bio__track {
  animation: none;
  will-change: transform;
}

@keyframes kc-bio-scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes kc-bio-scroll-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.kc-bio__tag {
  padding: 0.5rem 1rem;
  background-color: var(--color-secondary-container);
  color: var(--color-on-secondary-container);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.kc-contact {
  padding: 0 1rem 2rem;
}

@media (min-width: 768px) {
  .kc-contact {
    padding: 0 2rem 2rem;
  }
}

.kc-contact__container {
  max-width: 1600px;
  margin: 0 auto;
}

.kc-contact__grid {
  background-color: var(--color-on-background);
  color: #ffffff;
  border-radius: 3rem;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .kc-contact__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.kc-contact__info {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .kc-contact__info {
    padding: 5rem;
  }
}

.kc-contact__heading {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

@media (min-width: 768px) {
  .kc-contact__heading {
    font-size: 3.75rem;
  }
}

.kc-contact__heading span {
  color: var(--color-primary-container);
}

.kc-contact__subtext {
  color: var(--color-surface-variant);
  font-size: 1.125rem;
  margin-bottom: 3rem;
  max-width: 28rem;
}

.kc-contact__links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kc-contact__link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  color: #ffffff;
  text-decoration: none;
}

.kc-contact__icon-circle {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid rgba(213, 195, 182, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.kc-contact__link-item:hover .kc-contact__icon-circle {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.kc-contact__icon-circle .material-symbols-outlined {
  font-size: 0.875rem;
}

.kc-contact__brand-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.kc-contact__link-item span:last-child {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Contact Form */
.kc-contact__form-wrap {
  padding: 3rem;
  background-color: rgba(47, 49, 49, 0.5);
}

@media (min-width: 768px) {
  .kc-contact__form-wrap {
    padding: 5rem;
  }
}

.kc-contact__form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.kc-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kc-form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary-container);
}

.kc-form-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(213, 195, 182, 0.3);
  padding: 0.5rem 0;
  font-size: 1.25rem;
  color: #ffffff;
  outline: none;
  transition: border-color 0.3s ease;
}

.kc-form-input::placeholder {
  color: var(--color-outline-variant);
}

.kc-form-input:focus {
  border-bottom-color: var(--color-primary);
}

/* Keyboard focus gets a real ring on top of the underline shift — the 1px
   line change alone is too subtle on the dark contact panel. :focus-visible
   keeps mouse clicks ring-free. */
.kc-form-input:focus-visible {
  outline: 2px solid var(--color-primary-container);
  outline-offset: 3px;
  border-radius: var(--radius-default);
}

.kc-form-select {
  appearance: none;
  cursor: pointer;
}

.kc-form-select option {
  background-color: #171717;
}

.kc-form-textarea {
  resize: none;
  transition: height 0.25s ease;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.kc-footer {
  width: 100%;
  padding: 5rem 2rem;
  background-color: #f5f5f5;
}

.kc-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  max-width: 80rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .kc-footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.kc-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kc-footer__logo {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--color-on-background);
}

.kc-footer__copyright {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.kc-footer__social {
  display: flex;
  gap: 2rem;
}

.kc-footer__social-link {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-outline);
  opacity: 0.8;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.kc-footer__social-link:hover {
  color: var(--color-primary);
  opacity: 1;
}

/* ==========================================================================
   Scroll Reveal Animation
   ========================================================================== */

.kc-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.kc-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.kc-projects__grid .kc-reveal:nth-child(1)  { transition-delay: 0s; }
.kc-projects__grid .kc-reveal:nth-child(2)  { transition-delay: 0.1s; }
.kc-projects__grid .kc-reveal:nth-child(3)  { transition-delay: 0.2s; }
.kc-projects__grid .kc-reveal:nth-child(4)  { transition-delay: 0.3s; }
.kc-projects__grid .kc-reveal:nth-child(5)  { transition-delay: 0.4s; }
.kc-projects__grid .kc-reveal:nth-child(6)  { transition-delay: 0.5s; }
.kc-projects__grid .kc-reveal:nth-child(7)  { transition-delay: 0.6s; }
.kc-projects__grid .kc-reveal:nth-child(8)  { transition-delay: 0.7s; }
.kc-projects__grid .kc-reveal:nth-child(9)  { transition-delay: 0.8s; }
.kc-projects__grid .kc-reveal:nth-child(10) { transition-delay: 0.9s; }
.kc-projects__grid .kc-reveal:nth-child(11) { transition-delay: 1s; }
.kc-projects__grid .kc-reveal:nth-child(12) { transition-delay: 1.1s; }
.kc-projects__grid .kc-reveal:nth-child(13) { transition-delay: 1.2s; }
.kc-projects__grid .kc-reveal:nth-child(14) { transition-delay: 1.3s; }
.kc-projects__grid .kc-reveal:nth-child(15) { transition-delay: 1.4s; }

/* The stagger delay above is ONLY for the scroll-in reveal. Without this reset it
   also delays the hover pop (cards 1-8 waited up to 0.7s before expanding). */
.kc-projects__grid .kc-card:hover,
.kc-projects__grid .kc-card:focus-visible,
.kc-projects__grid .kc-card:has(:focus-visible) {
  transition-delay: 0s;
}

/* Motion is always on (see the motion policy in animations.js) — no
   prefers-reduced-motion overrides. .kc-reveal relies on JS to add .is-visible. */

/* Filled Material Symbol icon */
.kc-icon--filled {
  font-variation-settings: 'FILL' 1;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

/* Offset main content below the fixed nav */
.kc-main {
  padding-top: 6rem;
}

/* Screen reader text */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Contact Form Feedback
   ========================================================================== */

.kc-form-feedback {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-xl);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.kc-form-feedback:empty {
  margin: 0;
  padding: 0;
  min-height: 0;
}

.kc-form-feedback--success {
  background-color: rgba(160, 200, 215, 0.15);
  color: var(--color-secondary-container);
}

.kc-form-feedback--error {
  background-color: rgba(186, 26, 26, 0.15);
  color: var(--color-error-container);
}

/* ==========================================================================
   Scripts Page
   Reuses the Featured Projects shell (.kc-projects__container / __grid /
   __header) and the project card (.kc-card) so cards match exactly in size
   and behaviour. Adds: page intro, per-platform stage spacing, the greyed
   work-in-progress card, the whole-platform "coming soon" tease, and the
   script detail modal (patterned on the résumé modal).
   ========================================================================== */

.kc-scripts-intro {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
  text-align: center;
}

.kc-scripts-intro__label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.kc-scripts-intro__title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-on-background);
}

@media (min-width: 768px) {
  .kc-scripts-intro__title {
    font-size: 3.75rem;
  }
}

.kc-scripts-intro__text {
  margin: 1.25rem auto 0;
  max-width: 34rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-on-surface-variant);
}

.kc-scripts-intro__content {
  margin-top: 1.5rem;
  color: var(--color-on-surface-variant);
}

/* Each platform is its own dark "stage". Space is the divider between them. */
.kc-scripts-stage {
  padding: 0.5rem 1rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .kc-scripts-stage {
    padding: 0.5rem 2rem;
    margin-top: 3rem;
  }
}

/* ── Single scrollable card row ──
   One horizontal line of cards. The native scrollbar is hidden — sliding is
   done by swipe / trackpad / keyboard, or the pill control below. Generous
   vertical padding gives the hover pop room so the scroll container doesn't
   clip it. No transition-delay on the cards, so the pop is instant both ways
   (no "stuck after mouse leaves"). */
.kc-scripts-row {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1.75rem 0.25rem 1.25rem;
  scrollbar-width: none;              /* Firefox: hide the native bar */
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.kc-scripts-row::-webkit-scrollbar {  /* WebKit / Blink: hide the native bar */
  display: none;
}

.kc-scripts-row:focus-visible {
  outline: 2px solid var(--color-primary-container);
  outline-offset: 4px;
  border-radius: var(--radius-lg);
}

/* Fixed card width so the row is a true single line (no wrapping). */
.kc-scripts-row > .kc-card {
  flex: 0 0 clamp(15.5rem, 24vw, 19.5rem);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* ── Pill slide control ──
   Compact by default (just the two pulsing arrows, no text); grows on hover to
   reveal the label and become a clear click target. Shown by JS only when the
   row actually overflows. */
.kc-scripts-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  width: fit-content;
  margin: 0.75rem auto 0;
  padding: 0.35rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: pan-y;   /* let the page scroll vertically; we handle horizontal */
  user-select: none;
  transition: padding 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              gap 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.35s ease,
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When expanded, the pill is grabbable to scrub the row sideways. */
.kc-scripts-nav:hover,
.kc-scripts-nav:focus-within {
  cursor: grab;
}

/* While grabbing, the pill follows the pointer 1:1 (JS sets an inline
   translate), so drop the transform transition; it snaps back with animation
   once released and the class is removed. */
.kc-scripts-nav.is-grabbing {
  transition: background-color 0.35s ease;
}

.kc-scripts-nav.is-grabbing,
.kc-scripts-nav.is-grabbing * {
  cursor: grabbing;
}

.kc-scripts-nav[hidden] {
  display: none;
}

.kc-scripts-nav__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-primary-container);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.kc-scripts-nav__arrow:hover {
  background: rgba(255, 255, 255, 0.15);
}

.kc-scripts-nav__arrow:focus-visible {
  outline: 2px solid var(--color-on-primary-container);
  outline-offset: 2px;
}

.kc-scripts-nav__arrow[disabled] {
  opacity: 0.3;
  cursor: default;
}

.kc-scripts-nav__arrow .material-symbols-outlined {
  font-size: 1.25rem;
}

/* Pulsing "slide sideways" hint on the arrows (only while idle / not hovered). */
.kc-scripts-nav__arrow--prev .material-symbols-outlined {
  animation: kc-nav-nudge-left 1.5s ease-in-out infinite;
}

.kc-scripts-nav__arrow--next .material-symbols-outlined {
  animation: kc-nav-nudge-right 1.5s ease-in-out infinite;
}

@keyframes kc-nav-nudge-left {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50%      { transform: translateX(-3px); opacity: 1; }
}

@keyframes kc-nav-nudge-right {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50%      { transform: translateX(3px); opacity: 1; }
}

/* Collapsed label — no width until the pill is hovered. */
.kc-scripts-nav__label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #ffffff;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease,
              padding 0.4s ease,
              color 0.2s ease;
}

/* ── Hover / grabbing: grow the pill, reveal the label, settle the arrows ── */
.kc-scripts-nav:hover,
.kc-scripts-nav:focus-within,
.kc-scripts-nav.is-grabbing {
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  background: var(--color-primary-container);
}

.kc-scripts-nav:hover .kc-scripts-nav__label,
.kc-scripts-nav:focus-within .kc-scripts-nav__label,
.kc-scripts-nav.is-grabbing .kc-scripts-nav__label {
  max-width: 14rem;
  opacity: 1;
  padding: 0 0.35rem;
  color: var(--color-on-primary-container);
}

.kc-scripts-nav:hover .kc-scripts-nav__arrow,
.kc-scripts-nav:focus-within .kc-scripts-nav__arrow,
.kc-scripts-nav.is-grabbing .kc-scripts-nav__arrow {
  color: var(--color-on-primary-container);
}

.kc-scripts-nav:hover .kc-scripts-nav__arrow:hover,
.kc-scripts-nav:focus-within .kc-scripts-nav__arrow:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* Stop the pulse once engaged, or when an arrow is at its travel limit. */
.kc-scripts-nav:hover .material-symbols-outlined,
.kc-scripts-nav:focus-within .material-symbols-outlined,
.kc-scripts-nav.is-grabbing .material-symbols-outlined,
.kc-scripts-nav__arrow[disabled] .material-symbols-outlined {
  animation: none;
}

/* ── Script card additions (available) ── */
.kc-script-card__trigger {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.kc-script-card__desc {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

.kc-script-card__foot {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.kc-script-card__price {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.kc-script-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary-container);
}

.kc-script-card__cta .material-symbols-outlined {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.kc-script-card:hover .kc-script-card__cta .material-symbols-outlined,
.kc-script-card:has(:focus-visible) .kc-script-card__cta .material-symbols-outlined {
  transform: translateX(3px);
}

/* ── Work-in-progress card (greyed, not selectable) ── */
.kc-script-card--soon {
  filter: grayscale(1);
  opacity: 0.5;
  cursor: default;
}

/* No pop, no lift — it reads as inactive. Overrides the .kc-card hover rules. */
.kc-script-card--soon:hover,
.kc-script-card--soon:has(:focus-visible),
.kc-script-card--soon.is-visible:hover,
.kc-script-card--soon.is-visible:has(:focus-visible) {
  transform: none;
  box-shadow: none;
  z-index: auto;
}

/* Its info band stays pinned open so the "Coming Soon" state is always legible. */
.kc-script-card--soon .kc-card__body {
  transform: translateY(0);
  opacity: 1;
}

.kc-script-card__soon-label {
  color: rgba(255, 255, 255, 0.6);
}

/* ── Whole-platform "coming soon" tease ── */
.kc-scripts-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0 1rem;
  text-align: center;
}

.kc-scripts-soon__ghosts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
  opacity: 0.14;
}

@media (min-width: 1024px) {
  .kc-scripts-soon__ghosts {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kc-scripts-soon__ghost {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #3a3a3a, #565656);
}

.kc-scripts-soon__pill {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
}

.kc-scripts-soon__text {
  max-width: 30rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-surface-variant);
}

.kc-scripts-soon__text a {
  color: var(--color-primary-container);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Script Detail Modal
   ========================================================================== */

/* The container only toggles visibility; the fade + blur are driven by the
   backdrop and dialog themselves, so the blur RAMPS in smoothly with the open
   (rather than the whole layer popping its filter in a frame late). The hide
   delay on visibility keeps children mounted long enough to animate out. */
.kc-script-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  visibility: hidden;
  transition: visibility 0s linear 0.45s;
}

.kc-script-modal.is-open {
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.kc-script-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background-color 0.45s ease,
              backdrop-filter 0.45s ease,
              -webkit-backdrop-filter 0.45s ease;
}

.kc-script-modal.is-open .kc-script-modal__backdrop {
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.kc-script-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1000px;
  max-height: 92vh;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--color-surface-container-low);
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.kc-script-modal.is-open .kc-script-modal__dialog {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.kc-script-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-container-highest);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-on-background);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.kc-script-modal__close:hover {
  background: var(--color-outline-variant);
  transform: scale(1.1);
}

.kc-script-modal__close .material-symbols-outlined {
  font-size: 1.25rem;
}

.kc-script-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 820px) {
  .kc-script-modal__body {
    grid-template-columns: 1.1fr 1fr;
  }
}

/* Media column */
.kc-script-modal__media {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--color-surface-container);
}

.kc-script-modal__media-main {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #3a3a3a, #4a4a4a);
}

.kc-script-modal__media-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kc-script-modal__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kc-script-modal__thumb {
  width: 4.25rem;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-default);
  overflow: hidden;
  background: linear-gradient(135deg, #3a3a3a, #4a4a4a);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.kc-script-modal__thumb.is-active {
  border-color: var(--color-primary);
}

.kc-script-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Info column */
.kc-script-modal__info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0; /* grid item — without this the tag marquee's unwrapped content forces this column (and the media column beside it) wider */
}

.kc-script-modal__label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-primary);
}

.kc-script-modal__title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-on-background);
}

.kc-script-modal__price {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

/* Single-line, draggable tag marquee — same grab-and-scroll behaviour as the
   bio skill-chip marquee (.kc-bio__marquee), just one row instead of two. */
.kc-script-modal__tags-marquee {
  margin: 0.25rem 0 0;
  min-width: 0;
}

.kc-script-modal__tags-row {
  overflow: hidden;
  min-width: 0;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-mask-image: linear-gradient(
    to right, transparent 0, #000 8%, #000 92%, transparent 100%
  );
  mask-image: linear-gradient(
    to right, transparent 0, #000 8%, #000 92%, transparent 100%
  );
}

.kc-script-modal__tags-row.is-dragging {
  cursor: grabbing;
}

.kc-script-modal__tags-track {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  animation: kc-bio-scroll-left 30s linear infinite;
}

.kc-script-modal__tags-track .kc-card__tag {
  flex: 0 0 auto;
  margin-right: 0.375rem;
  white-space: nowrap;
}

.kc-script-modal__tags-marquee:hover .kc-script-modal__tags-track {
  animation-play-state: paused;
}

.kc-script-modal__tags-marquee.is-enhanced .kc-script-modal__tags-track {
  animation: none;
  will-change: transform;
}

.kc-script-modal__desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-on-surface-variant);
}

.kc-script-modal__desc p {
  margin-bottom: 0.75rem;
}

.kc-script-modal__buy {
  margin-top: auto;
  width: 100%;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kc-script-modal__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--color-on-surface-variant);
}

.kc-script-modal__note .material-symbols-outlined {
  font-size: 1rem;
}

@media (max-width: 600px) {
  .kc-script-modal {
    padding: 0.75rem;
  }

  .kc-script-modal__info {
    padding: 1.5rem;
  }

  .kc-script-modal__title {
    font-size: 1.625rem;
  }
}

/* 404 page */
.kc-404 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    text-align: center;
    padding: var(--space-8);
}
.kc-404__code {
    font-size: 6rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--color-on-background);
}
.kc-404__text {
    color: var(--color-on-surface-variant);
    font-size: 1.25rem;
    max-width: 28rem;
}
