/* ==========================================================================
   Portfolio — Cinematic Editorial
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- 1. Design Tokens --------------------------------------------------- */
:root {
  --canvas: #E7E7E7;
  --paper: #FFFFFF;
  --ink: #0A0A0A;
  --meta: #7A7A7A;
  --rule: #E6E6E6;
  --soft-rule: rgba(0, 0, 0, 0.10);
  --splash-dark: #0A0A0A;
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 200ms;
  --duration-normal: 400ms;
  --duration-slow: 600ms;
  --duration-page: 500ms;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  --header-height: 58px;
  --footer-height: 44px;
  --carousel-gap: 24px;
  --card-width: min(clamp(220px, 19.5vw, 280px), calc(75vh - 112.5px));
  --selected-width: min(clamp(280px, 25vw, 360px), calc(75vh - 112.5px));
  --poster-aspect: 4000 / 5333;
  --label-size: 12px;
  --frost-blur: 4px;
  --frost-spread: 18px;
  --frost-grain-size: 72px;
}

/* --- 2. Reset & Base ---------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--canvas);
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* --- 3. Screen System --------------------------------------------------- */
.screen {
  position: fixed;
  inset: 0;
  background: var(--canvas);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-page) var(--ease-soft), visibility 0s var(--duration-page);
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--duration-page) var(--ease-soft), visibility 0s 0s;
  z-index: 2;
}

.screen--leaving {
  opacity: 0 !important;
  transition: opacity 300ms cubic-bezier(0.4, 0, 1, 1) !important;
}

/* --- 4. SPLASH — Dark Cinematic (spicy-hot-pot style) -------------------- */
.screen--splash {
  background: var(--splash-dark);
  overflow: hidden;
}

.splash__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.splash__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35) saturate(0.8);
  transform: scale(1.08);
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.splash__vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 0%, rgba(10,10,10,0.3) 50%, rgba(10,10,10,0.85) 100%);
  pointer-events: none;
}

.splash__grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 150px 150px;
  pointer-events: none;
  animation: grain-shift 0.5s steps(1) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 2px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(-2px, -2px); }
  100% { transform: translate(2px, 2px); }
}

.splash__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  gap: 48px;
}

.splash__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.splash__title {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: #FFFFFF;
  line-height: 1;
  opacity: 0;
  transform: translateY(40px);
  animation: splash-title-in 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}

.splash__title::after {
  content: '';
  display: block;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  margin: 18px auto 0;
  animation: splash-line-expand 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

@keyframes splash-line-expand {
  to { width: 64px; }
}

.splash__subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  opacity: 0;
  animation: splash-sub-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

/* CTA — circular button with gradient border */
.enter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  opacity: 0;
  animation: splash-sub-in 1s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

.enter-btn__circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.enter-btn__circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2), rgba(255,255,255,0.03));
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

.enter-btn__circle::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.3), transparent, rgba(255,255,255,0.3), transparent);
  opacity: 0;
  animation: circle-rotate 4s linear infinite;
  transition: opacity var(--duration-normal) ease;
}

@keyframes circle-rotate {
  to { transform: rotate(360deg); }
}

.enter-btn:hover .enter-btn__circle {
  border-color: rgba(255,255,255,0.6);
  transform: scale(1.15);
  box-shadow: 0 0 60px rgba(255,255,255,0.12), 0 0 20px rgba(255,255,255,0.06) inset;
}

.enter-btn:hover .enter-btn__circle::before {
  opacity: 1;
}

.enter-btn:hover .enter-btn__circle::after {
  opacity: 1;
}

.enter-btn:active .enter-btn__circle {
  transform: scale(0.93);
  transition-duration: 120ms;
}

.enter-btn__circle svg {
  width: 16px;
  height: 16px;
  stroke: rgba(255,255,255,0.7);
  fill: none;
  stroke-width: 1.5;
  position: relative;
  z-index: 1;
  transition: stroke var(--duration-fast), transform var(--duration-normal) cubic-bezier(0.16, 1, 0.3, 1);
}

.enter-btn:hover .enter-btn__circle svg {
  stroke: #FFFFFF;
  transform: translateX(2px);
}

.enter-btn__text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  transition: color var(--duration-normal), letter-spacing var(--duration-normal);
}

.enter-btn:hover {
  color: rgba(255,255,255,0.95);
}

.enter-btn:hover .enter-btn__text {
  letter-spacing: 0.35em;
}

@keyframes splash-title-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes splash-sub-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 5. Screen Header --------------------------------------------------- */
.screen-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
  z-index: 10;
}

.nav-link {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--meta);
  text-decoration: none;
  position: relative;
  transition: color var(--duration-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width var(--duration-normal) cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }

.nav-link--spacer {
  visibility: hidden;
  pointer-events: none;
}

.screen-header__title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
}

/* --- 6. Screen Footer --------------------------------------------------- */
.screen-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--rule);
  z-index: 10;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  color: var(--meta);
}

/* --- 7. Categories — Text Buttons with Rich Hover ----------------------- */
.screen--categories {
  background: var(--paper);
}

.categories-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - var(--header-height) - var(--footer-height));
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
}

.categories-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 800px;
  padding: 0 48px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 36px 0;
  cursor: pointer;
  position: relative;
  border-bottom: 1px solid var(--rule);
  transition: padding 500ms cubic-bezier(0.16, 1, 0.3, 1), background 500ms cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateY(30px);
  animation: category-enter 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.category-btn:first-child {
  border-top: 1px solid var(--rule);
}

.category-btn:nth-child(1) { animation-delay: 0.15s; }
.category-btn:nth-child(2) { animation-delay: 0.28s; }
.category-btn:nth-child(3) { animation-delay: 0.41s; }

/* Hover: gradient reveal from left */
.category-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  left: 0;
  background: linear-gradient(90deg, rgba(10,10,10,0.03) 0%, rgba(10,10,10,0.01) 60%, transparent 100%);
  opacity: 0;
  transition: opacity 500ms ease;
}

.category-btn:hover {
  padding-left: 20px;
}

.category-btn:hover::before {
  opacity: 1;
}

.category-btn__number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--meta);
  letter-spacing: 0.05em;
  min-width: 24px;
  transition: color var(--duration-normal), transform var(--duration-normal) cubic-bezier(0.16, 1, 0.3, 1), opacity var(--duration-normal);
}

.category-btn__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
  transition: all var(--duration-normal) cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.category-btn:hover .category-btn__dot {
  background: var(--ink);
  transform: scale(1.8);
  box-shadow: 0 0 12px rgba(10,10,10,0.15);
}

.category-btn:active .category-btn__dot {
  transform: scale(0.6);
  transition-duration: 120ms;
}

.category-btn__label {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  flex: 1;
  transition: letter-spacing var(--duration-normal) cubic-bezier(0.16, 1, 0.3, 1);
}

.category-btn__line {
  height: 2px;
  background: var(--ink);
  width: 0;
  transition: width var(--duration-slow) cubic-bezier(0.16, 1, 0.3, 1);
  position: absolute;
  bottom: -1px;
  left: 48px;
  right: 48px;
  border-radius: 1px;
}

.category-btn__arrow {
  font-size: 22px;
  color: var(--meta);
  transform: translateX(-16px);
  opacity: 0;
  transition: all var(--duration-normal) cubic-bezier(0.16, 1, 0.3, 1);
}

.category-btn:hover .category-btn__number {
  color: var(--ink);
  transform: translateX(6px);
}

.category-btn:hover .category-btn__label {
  letter-spacing: -0.01em;
}

.category-btn:hover .category-btn__line {
  width: calc(100% - 96px);
}

.category-btn:hover .category-btn__arrow {
  transform: translateX(0) rotate(-45deg);
  opacity: 1;
  color: var(--ink);
}

.category-btn:active {
  padding-left: 10px;
  transition-duration: 120ms;
}

.category-btn:active .category-btn__label {
  font-weight: 400;
}

@keyframes category-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* --- 8. Works Carousel — RIIZE Poster Pattern ---------------------------- */
.screen--works {
  background: var(--canvas);
  overflow-x: visible;
}

.works-carousel {
  display: flex;
  align-items: center;
  gap: var(--carousel-gap);
  height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Use padding to ensure first and last cards can center */
  padding-left: max(28px, calc(50vw - var(--selected-width) / 2));
  padding-right: max(28px, calc(50vw - var(--selected-width) / 2));
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.works-carousel::-webkit-scrollbar { display: none; }

.work-card-wrapper {
  flex: 0 0 var(--card-width);
  width: var(--card-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  scroll-snap-align: center;
  transition: flex var(--duration-slow) var(--ease-spring), width var(--duration-slow) var(--ease-spring);
  will-change: flex, width;
  opacity: 0;
  transform: translateY(24px) scale(0.94);
  animation: card-slide-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.work-card-wrapper:nth-child(1) { animation-delay: 0s; }
.work-card-wrapper:nth-child(2) { animation-delay: 0.08s; }
.work-card-wrapper:nth-child(3) { animation-delay: 0.16s; }
.work-card-wrapper:nth-child(4) { animation-delay: 0.24s; }
.work-card-wrapper:nth-child(5) { animation-delay: 0.32s; }
.work-card-wrapper:nth-child(6) { animation-delay: 0.40s; }

.work-card-wrapper.selected {
  flex: 0 0 var(--selected-width);
  width: var(--selected-width);
}

.work-card-wrapper.active:active {
  cursor: pointer;
}

@keyframes card-slide-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.work-card {
  position: relative;
  width: 100%;
  aspect-ratio: var(--poster-aspect);
  overflow: hidden;
  border-radius: 8px;
  transition: box-shadow var(--duration-normal) var(--ease-soft), border-radius var(--duration-normal) var(--ease-soft);
}

.work-card-wrapper.selected .work-card {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
}

.work-card-wrapper.selected:hover .work-card {
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.work-card__image {
  position: absolute;
  inset: 0;
}

.work-card__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: filter var(--duration-slow) var(--ease-soft), transform var(--duration-slow) var(--ease-soft);
  will-change: filter;
}

.work-card-wrapper:not(.selected) .work-card__image img {
  filter: blur(var(--frost-blur));
}

.work-card-wrapper.selected .work-card__image img {
  filter: none;
}

/* Frost on non-selected */
.work-card__frost {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-soft);
}

.work-card__frost--fill {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
  transition: opacity var(--duration-slow);
}

.work-card-wrapper.selected .work-card__frost--fill { opacity: 0; }

.work-card__frost--grain {
  position: absolute;
  inset: calc(-1 * var(--frost-spread));
  opacity: 0.52;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.28), rgba(255,255,255,0.02) 48%, rgba(0,0,0,0.13)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 100% 100%, var(--frost-grain-size) var(--frost-grain-size);
  background-blend-mode: soft-light, overlay;
  mix-blend-mode: screen;
  transition: opacity var(--duration-slow);
}

.work-card-wrapper.selected .work-card__frost--grain { opacity: 0; }

.work-card__label {
  text-align: center;
  padding-top: 14px;
  font-size: var(--label-size);
  font-weight: 700;
  letter-spacing: 0px;
  line-height: 1.12;
  color: var(--ink);
  transition: color var(--duration-slow) var(--ease-soft), filter var(--duration-slow) var(--ease-soft), opacity var(--duration-slow) var(--ease-soft), transform var(--duration-slow) cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card-wrapper:not(.selected) .work-card__label {
  color: rgb(203, 203, 203);
  filter: blur(1px);
  opacity: 0.6;
}

.work-card-wrapper.selected .work-card__label {
  opacity: 1;
}

.work-card-wrapper.selected:hover .work-card__label {
  transform: translateY(-2px);
}

/* --- 9. Detail — Video + 2 Images ---------------------------------------- */
.screen--detail {
  background: var(--paper);
}

.detail-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  padding-top: var(--header-height);
}

.detail-info {
  width: 35%;
  padding: 40px 32px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}

.detail-media {
  width: 65%;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  overflow-y: auto;
}

.detail-media__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  flex-shrink: 0;
  opacity: 0;
  animation: detail-media-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.detail-media__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-media__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  animation: detail-media-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.detail-media__img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--canvas);
  position: relative;
  border-radius: 8px;
}

.detail-media__img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.05) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.detail-media__img:hover::after {
  opacity: 1;
}

.detail-media__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-media__img:hover img {
  transform: scale(1.04);
}

.detail-info__title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--ink);
  opacity: 0;
  transform: translateY(14px);
  animation: detail-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.detail-info__desc {
  font-size: 14px;
  line-height: 1.75;
  color: var(--meta);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(14px);
  animation: detail-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.detail-info__meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transform: translateY(14px);
  animation: detail-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meta);
}

.meta-value {
  font-size: 13px;
  color: var(--ink);
  text-align: right;
}

.detail-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
  opacity: 0;
  transform: translateY(14px);
  animation: detail-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.detail-nav__btn {
  flex: 1;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--meta);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.detail-nav__btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  border-radius: 8px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.detail-nav__btn:hover {
  color: var(--paper);
  border-color: var(--ink);
}
.detail-nav__btn:hover::before {
  transform: scaleX(1);
}
.detail-nav__btn:active {
  transform: scale(0.97);
  transition-duration: 100ms;
}

.detail-nav__btn span {
  position: relative;
  z-index: 1;
}

.detail-nav__btn:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

.detail-nav__btn:disabled::before {
  display: none;
}

@keyframes detail-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes detail-media-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* --- 10. About Panel ---------------------------------------------------- */
.about-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.45);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) cubic-bezier(0.16, 1, 0.3, 1);
}

.about-toggle svg {
  width: 15px;
  height: 15px;
  stroke: #FFFFFF;
  fill: none;
  stroke-width: 1.5;
  transition: stroke var(--duration-fast), transform var(--duration-normal);
}

.about-toggle:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.15);
}

.about-toggle:hover svg {
  stroke: #FFFFFF;
  transform: scale(1.1);
}

/* Light background variant */
.about-toggle--light {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.about-toggle--light svg {
  stroke: #0A0A0A;
}

.about-toggle--light:hover {
  background: rgba(0, 0, 0, 0.12);
  transform: scale(1.15);
}

.about-toggle--light:hover svg {
  stroke: #0A0A0A;
}

.about-panel {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms var(--ease-soft), visibility 0s 500ms;
}

.about-panel.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 500ms var(--ease-soft), visibility 0s 0s;
}

.about-panel__content {
  max-width: 520px;
  width: 90%;
  padding: 56px 40px;
  position: relative;
  transform: translateY(24px) scale(0.96);
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.about-panel.active .about-panel__content {
  transform: translateY(0) scale(1);
}

.about-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 18px;
  transition: all var(--duration-fast) ease;
}

.about-panel__close:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
  transform: rotate(90deg);
}

.about-panel__avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 24px;
  display: block;
  border: 2px solid rgba(255,255,255,0.15);
  opacity: 0;
  animation: about-item-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.about-panel__name {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: #FFFFFF;
  opacity: 0;
  animation: about-item-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

.about-panel__bio {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255,255,255,0.55);
  text-align: center;
  margin-bottom: 28px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  animation: about-item-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.about-panel__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
  opacity: 0;
  animation: about-item-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}

.skill-tag {
  padding: 6px 14px;
  background: rgba(255,255,255,0.06);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  transition: all var(--duration-fast) var(--ease-soft);
}

.skill-tag:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}

.about-panel__contact {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  line-height: 2;
  opacity: 0;
  animation: about-item-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}

@keyframes about-item-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 11. Responsive ---------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --header-height: 52px;
    --footer-height: 40px;
    --carousel-gap: 18px;
    --card-width: min(clamp(180px, 60vw, 260px), calc(55vh - 60px));
    --selected-width: min(clamp(220px, 75vw, 320px), calc(55vh - 60px));
    --frost-blur: 3px;
    --frost-spread: 12px;
    --frost-grain-size: 84px;
    --label-size: 10px;
  }

  .screen-header { padding: 0 16px; }
  .screen-footer { padding: 0 16px; }

  .splash__title { font-size: 28px; }

  .categories-list { padding: 0 24px; }
  .category-btn { padding: 24px 0; gap: 16px; }
  .category-btn__label { font-size: 24px; }
  .category-btn__number { font-size: 10px; }
  .category-btn:hover { padding-left: 10px; }

  .works-carousel {
    padding-left: calc(50vw - var(--selected-width) / 2);
    padding-right: calc(50vw - var(--selected-width) / 2);
  }

  .detail-layout { flex-direction: column; }

  .detail-info {
    width: 100%;
    order: 2;
    height: auto;
    position: static;
    border-right: none;
    border-top: 1px solid var(--rule);
    padding: 28px 20px;
  }

  .detail-media {
    width: 100%;
    order: 1;
    min-height: auto;
    overflow-y: visible;
  }

  .detail-media__images { grid-template-columns: 1fr 1fr; }

  .detail-info__title { font-size: 22px; }
  .detail-info__desc { font-size: 13px; margin-bottom: 20px; }

  .about-panel__content {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    padding: 48px 24px;
  }

  .about-toggle {
    width: 28px;
    height: 28px;
    top: 10px;
    right: 10px;
  }
}

/* --- 12. Utility -------------------------------------------------------- */
.no-scroll { overflow: hidden !important; }
