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

/* Custom Properties */
:root {
  --bg: #0a0a0a;
  --text: #e0e0e0;
  --muted: #777;
  --link: #c8c8c8;
  --link-hover: #fff;
  --border: #222;
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --text-display: 1.8rem;
  --text-heading: 1.2rem;
  --text-body: 0.95rem;
  --text-caption: 0.8rem;
  --text-label: 0.75rem;
  --image-outline: 1px solid rgba(255, 255, 255, 0.1);
}

/* Base */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Layout */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
}

/* Typography */
h1 {
  font-family: var(--font-heading);
  font-size: var(--text-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  text-wrap: balance;
}

h2 {
  font-family: var(--font-heading);
  font-size: var(--text-heading);
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

h3 {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--text);
}

p {
  margin-bottom: 1rem;
  color: var(--text);
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

@media (hover: hover) {
  a:hover {
    color: var(--link-hover);
  }
}

/* Header / Hero */
header {
  margin-bottom: 3.5rem;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-photo-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.hero-photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 25%;
  background: var(--bg);
  outline: var(--image-outline);
  outline-offset: -1px;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease-out;
}

@media (hover: hover) {
  .hero-photo:hover {
    transform: scale(1.06);
  }
}

.hero-photo:active {
  transform: scale(0.96);
  transition: transform 0.15s ease-out;
}

.hero-photo:focus {
  outline: var(--image-outline);
  outline-offset: -1px;
}

.hero-photo:focus-visible {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16),
              0 0 0 4px rgba(255, 255, 255, 0.1);
}

@keyframes photoPulse {
  0% { transform: scale(0.96); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1.06); }
}

.hero-photo.pulse {
  animation: photoPulse 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo {
    transition: none;
  }

  .hero-photo.pulse {
    animation: none;
  }
}

/* Photo click particles */
.photo-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  pointer-events: none;
  font-size: 1.6rem;
  line-height: 1;
  will-change: transform, opacity;
  animation: photoParticleFly 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes photoParticleFly {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  55% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--px)), calc(-50% + var(--py))) scale(0.7) rotate(var(--pr));
    opacity: 0;
  }
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, var(--text-display));
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Hero contacts */
.hero-contacts {
  display: flex;
  gap: 0.25rem;
  margin-top: 1rem;
}

.hero-contacts a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--muted);
  opacity: 0.6;
  transition: color 0.2s ease-out, opacity 0.2s ease-out, transform 0.2s ease-out;
}

.hero-contacts a svg {
  width: 0.95rem;
  height: 0.95rem;
}

@media (hover: hover) {
  .hero-contacts a:hover {
    color: var(--link-hover);
    opacity: 1;
    transform: translateY(-1px);
  }
}

.hero-contacts a:active {
  transform: scale(0.96);
}

.hero-contacts a:focus-visible {
  outline: none;
  color: var(--link-hover);
  opacity: 1;
}

/* Sections */
section {
  margin-bottom: 3.5rem;
}

section:last-of-type {
  margin-bottom: 2rem;
}

/* Bold highlights */
strong {
  color: var(--text);
  font-weight: 600;
}

/* Bio */
.bio p {
  color: #999;
  font-size: var(--text-body);
  line-height: 1.75;
}

.bio-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Genesys logo */
.genesys-logo {
  display: block;
  height: 2rem;
  width: auto;
  margin-bottom: 1.5rem;
  opacity: 0.85;
}

/* Section intro (used in Genesys) */
.section-intro {
  font-size: var(--text-body);
  color: #999;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

/* Bio CTAs */
.copy-email,
.download-cv {
  background: none;
  border: none;
  border-radius: 5px;
  padding: 0.4rem 0.8rem;
  font-family: var(--font-body);
  font-size: var(--text-caption);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-width: 6.5rem;
  min-height: 2.5rem;
  justify-content: center;
  text-decoration: none;
  line-height: 1.2;
  outline: none;
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.08);
}

.copy-email {
  cursor: pointer;
  transition: color 0.2s ease-out, box-shadow 0.2s ease-out,
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.download-cv {
  transition: color 0.2s ease-out, box-shadow 0.2s ease-out,
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.download-cv:active {
  transform: scale(0.96);
  transition: color 0.2s ease-out, box-shadow 0.2s ease-out,
              transform 0.07s ease-in;
}

.copy-email:active {
  transform: scale(0.96);
  transition: color 0.2s ease-out, box-shadow 0.2s ease-out,
              transform 0.07s ease-in;
}

.copy-email.copied {
  color: var(--text);
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.13);
}

.copy-email:focus-visible {
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.13);
  color: var(--link-hover);
}

.download-cv:focus-visible {
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.13);
  color: var(--link-hover);
}

.copy-label {
  transition: opacity 0.15s ease-out, filter 0.15s ease-out;
}

.copy-label.fade {
  opacity: 0;
  filter: blur(4px);
}

@media (hover: hover) {
  .copy-email:hover,
  .download-cv:hover {
    color: var(--link-hover);
    box-shadow: 0 0 0 1px oklch(1 0 0 / 0.13);
  }
}

@media (prefers-reduced-motion: reduce) {
  .copy-email,
  .download-cv,
  .copy-label {
    transition: none;
  }

  .copy-email:active,
  .download-cv:active {
    transition: none;
  }
}

/* Experience */
.experience-list {
  list-style: none;
}

.experience-item {
  margin-bottom: 1.5rem;
}

.experience-item h3 {
  margin-bottom: 0.15rem;
}

.experience-item h3 a {
  color: inherit;
  text-decoration: none;
}

.experience-item h3 a::after {
  content: '↗';
  font-size: 0.6em;
  font-weight: 400;
  margin-left: 0.3em;
  opacity: 0.3;
  vertical-align: super;
  display: inline-block;
  transition: opacity 0.15s ease-out;
}

@media (hover: hover) {
  .experience-item h3 a:hover {
    color: var(--link-hover);
  }

  .experience-item h3 a:hover::after {
    opacity: 0.7;
  }
}

.experience-role {
  font-size: var(--text-body);
  color: var(--muted);
}

.experience-detail {
  font-size: var(--text-body);
  color: #999;
  margin-top: 0.25rem;
}

/* Project gallery
   Icon centers share a vertical spine; titles share a leading edge.
   The featured card bleeds by --hl-inset so its padded caption lands on that grid. */
.project-gallery {
  --hl-icon-lg: 3.7rem;
  --hl-icon-sm: 3rem;
  --hl-icon-col: var(--hl-icon-lg);
  --hl-gap: 0.85rem;
  --hl-inset: 1.1rem;
  --hl-caption-block-start: 1.15rem;
  --hl-caption-block-end: 1.1rem;
  --hl-chevron-col: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.project-card {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  width: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.project-card--featured {
  width: calc(100% + (2 * var(--hl-inset)));
  margin-inline: calc(-1 * var(--hl-inset));
}

.project-card:focus {
  outline: none;
}

.project-card:focus-visible {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16),
              0 0 0 4px rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.project-card-media {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  aspect-ratio: 1 / 1;
  width: 100%;
}

.project-card--featured .project-card-media {
  aspect-ratio: 3 / 2;
}

.project-card--featured .project-card-media img:not(.project-card-icon) {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  transform: none;
  transform-origin: center 50%;
}

.project-card-media img:not(.project-card-icon) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: inherit;
  outline: var(--image-outline);
  outline-offset: -1px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease-out;
}

.project-card-icon {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 22%;
  outline: var(--image-outline);
  outline-offset: -1px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease-out, filter 0.25s ease-out;
}

.project-card--featured .project-card-media::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  z-index: 1;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  mask-image: linear-gradient(to top, black 0%, black 22%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 0%, black 22%, transparent 100%);
}

.project-card--featured .project-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.14) 0%,
      rgba(0, 0, 0, 0.02) 22%,
      rgba(0, 0, 0, 0.1) 48%,
      rgba(0, 0, 0, 0.4) 72%,
      rgba(0, 0, 0, 0.7) 100%
    );
}

.project-card-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--hl-icon-col) minmax(0, 1fr);
  column-gap: var(--hl-gap);
  align-items: center;
  padding: var(--hl-caption-block-start) var(--hl-inset) var(--hl-caption-block-end);
  pointer-events: none;
}

.project-card--featured .project-card-icon {
  position: static;
  justify-self: center;
  flex: none;
  width: var(--hl-icon-lg);
  height: var(--hl-icon-lg);
  z-index: auto;
  transition: none;
}

.award-badge {
  position: absolute;
  top: 0.85rem;
  inset-inline-end: 0.85rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem 0.4rem 0.42rem;
  border-radius: 999px;
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 8px 20px rgba(0, 0, 0, 0.45);
  color: #f4f4f4;
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.award-badge-seal {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
  aspect-ratio: 1;
}

.project-card--icon {
  display: grid;
  grid-template-columns: var(--hl-icon-col) minmax(0, 1fr) var(--hl-chevron-col);
  column-gap: var(--hl-gap);
  align-items: center;
  min-height: 44px;
}

.project-card--icon .project-card-icon {
  position: static;
  justify-self: center;
  flex: none;
  width: var(--hl-icon-sm);
  height: var(--hl-icon-sm);
  filter: brightness(0.86);
}

.project-card--icon .project-card-info {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.project-card--icon .project-card-info h3 {
  display: block;
  line-height: 1.15;
}

.project-card--icon .project-card-tag {
  line-height: 1.3;
  margin-top: 0.12rem;
}

.project-card-info {
  display: block;
  margin-top: 0.85rem;
}

.project-card--featured .project-card-info {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.project-card-info h3 {
  display: block;
}

.project-card--featured .project-card-info h3 {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-heading);
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.project-card-chevron {
  justify-self: center;
  width: 13px;
  height: 13px;
  color: var(--muted);
  opacity: 0.4;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.project-card-tag {
  display: block;
  font-size: var(--text-caption);
  color: var(--muted);
  margin-top: 0.2rem;
  text-wrap: pretty;
}

.project-card--featured .project-card-tag {
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.4;
  margin-top: 0.15rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

@media (hover: hover) and (pointer: fine) {
  .project-card--featured:hover .project-card-media img:not(.project-card-icon) {
    transform: scale(1.045);
  }

  .project-card--icon:hover .project-card-icon {
    filter: brightness(1);
  }

  .project-card:hover .project-card-chevron {
    opacity: 0.85;
    color: var(--link-hover);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card-media img:not(.project-card-icon),
  .project-card-icon {
    transition: none;
  }
}

@media (max-width: 480px) {
  .project-gallery {
    --hl-icon-lg: 3.35rem;
    --hl-gap: 0.75rem;
    --hl-inset: 0.9rem;
    --hl-caption-block-start: 1rem;
    --hl-caption-block-end: 0.95rem;
    gap: 1.25rem;
  }

  .project-gallery-grid {
    gap: 1rem;
  }

  .project-card-info {
    margin-top: 0.6rem;
  }
}

/* Timeline (Journey) */
.timeline {
  list-style: none;
}

.timeline-item {
  position: relative;
  padding-left: 1.75rem;
  padding-bottom: 2.25rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 1.1rem;
  bottom: -0.25rem;
  width: 1px;
  background: var(--border);
}

.timeline-item--current .timeline-marker {
  background: var(--text);
}

.timeline-content h3 {
  margin-bottom: 0.2rem;
}

.timeline-meta {
  font-size: var(--text-caption);
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.timeline-detail {
  font-size: var(--text-body);
  color: #999;
  margin-top: 0;
}

/* Writing / Sharing */
.sharing-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.sharing-item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  align-items: baseline;
  gap: 1.25rem;
}

.sharing-type {
  font-size: var(--text-label);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.sharing-title {
  font-size: var(--text-body);
  color: #999;
}

@media (hover: hover) {
  a.sharing-title:hover {
    color: var(--link-hover);
  }
}

/* Contact */
.contact p {
  font-size: var(--text-body);
  color: var(--muted);
}

.contact a {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) {
  .contact a:hover {
    border-color: var(--link-hover);
  }
}

/* Separator */
.separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3.5rem 0;
}

/* Footer */
footer {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: var(--text-caption);
  color: var(--muted);
  opacity: 0.6;
}

/* Language Toggle */
.lang-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  font-size: var(--text-caption);
  color: var(--muted);
  z-index: 10;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.lang-toggle button {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--text-caption);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  filter: grayscale(1);
  opacity: 0.45;
  transition: color 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  outline: none;
}

.lang-toggle button:focus-visible {
  color: var(--link-hover);
}

@media (hover: hover) {
  .lang-toggle button:hover {
    color: var(--link-hover);
  }
}

.lang-toggle button.active {
  color: var(--text);
  filter: none;
  opacity: 1;
}

.lang-toggle span {
  opacity: 0.4;
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 4.5rem 1.25rem 3rem;
  }

  section {
    margin-bottom: 2.5rem;
  }

  .lang-toggle {
    top: 1rem;
    right: 1rem;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    filter: blur(4px);
  }
  to {
    opacity: 1;
    filter: blur(0px);
  }
}

.lang-toggle {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

header {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 100ms;
}

main section:nth-of-type(1) {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 250ms;
}

main hr:nth-of-type(1) {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 325ms;
}

main section:nth-of-type(2) {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 400ms;
}

main hr:nth-of-type(2) {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 475ms;
}

main section:nth-of-type(3) {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 550ms;
}

main hr:nth-of-type(3) {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 625ms;
}

main section:nth-of-type(4) {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 700ms;
}

main hr:nth-of-type(4) {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 775ms;
}

main section:nth-of-type(5) {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 850ms;
}

main hr:nth-of-type(5) {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 925ms;
}

main section:nth-of-type(6) {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 1000ms;
}

@media (prefers-reduced-motion: reduce) {
  .lang-toggle,
  header,
  main section,
  main hr {
    animation: none;
  }
}

/* Case sheet */
.case-sheet {
  --case-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --case-duration: 320ms;
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.case-sheet.is-open {
  pointer-events: auto;
}

.case-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  transition-property: opacity;
  transition-duration: var(--case-duration);
  transition-timing-function: var(--case-ease);
}

.case-sheet.is-open .case-sheet-overlay {
  opacity: 1;
}

.case-sheet-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.case-sheet-panel {
  pointer-events: auto;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: 88dvh;
  background: #111;
  color: var(--text);
  border-radius: 14px 14px 0 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 -24px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(110%);
  transition-property: transform;
  transition-duration: var(--case-duration);
  transition-timing-function: var(--case-ease);
  overflow: hidden;
}

.case-sheet.is-open .case-sheet-panel {
  transform: translateY(0);
}

.case-sheet.is-animating .case-sheet-panel,
.case-sheet.is-dragging .case-sheet-panel {
  will-change: transform;
}

.case-sheet.is-animating .case-sheet-overlay {
  will-change: opacity;
}

.case-sheet.is-dragging .case-sheet-panel,
.case-sheet.is-dragging .case-sheet-overlay {
  transition: none;
}

.case-sheet.is-dragging .case-sheet-scroll {
  overflow: hidden;
  touch-action: none;
}

.case-sheet.is-dragging {
  user-select: none;
}

.case-sheet-handle {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 14px 1.5rem 10px;
  cursor: grab;
  touch-action: none;
}

.case-sheet-handle:active {
  cursor: grabbing;
}

.case-sheet-grabber {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.case-sheet-close {
  position: absolute;
  top: 0;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  touch-action: manipulation;
  transition-property: color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease;
}

.case-sheet-close:active {
  transform: scale(0.96);
}

.case-sheet-close:focus {
  outline: none;
}

.case-sheet-close:focus-visible {
  color: var(--link-hover);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16),
              0 0 0 4px rgba(255, 255, 255, 0.1);
}

@media (hover: hover) and (pointer: fine) {
  .case-sheet-close:hover {
    color: var(--link-hover);
  }
}

.case-sheet-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.case-sheet-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.case-sheet-body {
  --case-pad: 1.5rem;
  padding: 0.35rem var(--case-pad) calc(3.75rem + env(safe-area-inset-bottom));
}

.case-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 1.15rem;
}

.case-head .project-card-icon {
  position: static;
  display: block;
  flex: none;
  filter: none;
}

.case-head .project-card-info {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.case-head-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
}

.case-head-title h2 {
  margin: 0;
  text-wrap: balance;
}

.case-head--icon {
  gap: 0.7rem;
}

.case-head--icon .project-card-icon {
  width: 3rem;
  height: 3rem;
}

.case-head--icon .project-card-info h2 {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--text);
}

.case-head--icon .project-card-tag,
.case-head--featured .project-card-tag,
.case-downloads {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

.case-head--icon .project-card-tag {
  line-height: 1.3;
  margin-top: 0.12rem;
}

.case-head--featured {
  gap: 0.85rem;
}

.case-head--featured .project-card-icon {
  width: 3.7rem;
  height: 3.7rem;
}

.case-head--featured .project-card-info h2 {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-heading);
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -0.01em;
}

.case-head--featured .project-card-tag {
  line-height: 1.4;
  margin-top: 0.15rem;
}

.case-context,
.case-copy,
.case-insight {
  font-size: var(--text-body);
  line-height: 1.7;
  color: #999;
}

.case-context {
  color: #a8a8a8;
}

.case-insight {
  color: #7a7a7a;
  text-wrap: pretty;
}

.case-context + .case-copy,
.case-copy + .case-insight,
.case-context + .case-insight {
  margin-top: 0.8rem;
}

.case-context strong,
.case-copy strong,
.case-insight strong {
  color: var(--text);
  font-weight: 600;
}

.case-film {
  margin: 1.15rem calc(var(--case-pad) * -1) 0;
}

.case-film-track {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-inline: var(--case-pad);
  padding: 1px var(--case-pad);
  overscroll-behavior-x: contain;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scroll-behavior: auto;
}

.case-film-track::-webkit-scrollbar {
  display: none;
  height: 0;
}

.case-film figure {
  flex: none;
  flex-shrink: 0;
  width: calc(21.5rem * 9 / 19.5);
  height: 21.5rem;
  aspect-ratio: 9 / 19.5;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #0a0a0a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.case-film img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: inherit;
  outline: var(--image-outline);
  outline-offset: -1px;
  user-select: none;
  -webkit-user-drag: none;
  transition-property: opacity;
  transition-duration: 160ms;
  transition-timing-function: var(--case-ease);
}

.case-film img.is-pending {
  opacity: 0;
}

html.case-sheet-locked,
body.case-sheet-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 480px) {
  .case-sheet-body {
    --case-pad: 1.25rem;
  }

  .case-head--featured .project-card-icon {
    width: 3.35rem;
    height: 3.35rem;
  }

  .case-film figure {
    width: calc(20rem * 9 / 19.5);
    height: 20rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-sheet-overlay,
  .case-sheet-panel,
  .case-sheet-close {
    transition: none;
  }

  .case-sheet.is-animating .case-sheet-panel,
  .case-sheet.is-dragging .case-sheet-panel,
  .case-sheet.is-animating .case-sheet-overlay {
    will-change: auto;
  }

  .case-sheet-close:active {
    transform: none;
  }

  .case-film img {
    transition: none;
    opacity: 1;
  }

  .case-film-track {
    scroll-behavior: auto;
  }
}

/* Print */
@media print {
  body {
    background: #fff;
    color: #111;
  }

  .lang-toggle,
  .pt,
  .case-sheet {
    display: none !important;
  }

  a {
    color: #111;
  }
}
