:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #000000;
  --muted: rgba(0, 0, 0, 0.4);
  --line: rgba(0, 0, 0, 0.05);
  --card: #f4f4f4;
  --card-hover: #eeeeee;
  --surface: #ffffff;
  --header-h: 40px;
  --radius: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0f;
  --fg: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.48);
  --line: rgba(255, 255, 255, 0.12);
  --card: #1d1d1d;
  --card-hover: #252525;
  --surface: #0f0f0f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

a {
  text-decoration: none;
}

.site {
  min-height: 100vh;
  padding-top: var(--header-h);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.site-header,
.site-footer {
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  z-index: 20;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.detail-page .site-header {
  border-bottom: 1px solid transparent;
}

.brand-mini {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Oooh Baby", cursive;
  font-size: 14px;
  opacity: 0.25;
  pointer-events: none;
}

.icon-text,
.footer-meta,
.footer-touch,
.section-label,
.theme-toggle,
.back-link,
.project-nav {
  display: flex;
  align-items: center;
}

.icon-text,
.footer-meta,
.footer-touch {
  gap: 6px;
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.star {
  width: 8px;
  height: 8px;
  position: relative;
  flex: 0 0 8px;
}

.star::before,
.star::after {
  content: "";
  position: absolute;
  left: 3.4px;
  top: 0;
  width: 1px;
  height: 8px;
  background: currentColor;
  border-radius: 99px;
}

.star::after {
  transform: rotate(90deg);
}

.contact-wrap {
  position: relative;
}

.contact-panel {
  position: absolute;
  top: 25px;
  left: 0;
  width: max-content;
  min-width: 180px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.contact-panel[hidden] {
  display: none;
}

.site-footer .contact-panel {
  inset: auto 0 25px auto;
}

.contact-panel a:hover,
.project-nav a:hover,
.back-link:hover,
.preview-card:hover .card-title {
  text-decoration: underline;
}

.theme-toggle {
  width: 18px;
  height: 18px;
  justify-content: center;
}

.footer-meta {
  min-width: 0;
}

.avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.footer-copy {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  width: 100%;
}

.home-shell {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 0 0 48px;
}

.hero {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.script-title {
  margin: 0;
  font-family: "Oooh Baby", cursive;
  font-size: 41px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.hero-tags {
  display: flex;
  align-items: center;
  font-size: 24px;
  line-height: 1.2;
  white-space: nowrap;
  font-family: "Roboto Flex", "Montserrat", Arial, sans-serif;
  font-variation-settings: "wght" 400, "opsz" 9;
}

.split-parent {
  display: inline-block;
  overflow: hidden;
  text-align: inherit;
  white-space: normal;
  word-wrap: break-word;
}

.split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--split-index) * 70ms);
  will-change: transform, opacity;
}

.variable-letter {
  font-variation-settings: "wght" 400, "opsz" 9;
  transition: font-variation-settings 120ms linear;
}

.split-parent.is-visible .split-char {
  opacity: 1;
  transform: translateY(0);
}

.section-label {
  height: 40px;
  gap: 8px;
  padding: 0 16px;
  text-transform: uppercase;
  font-weight: 400;
}

.coming-soon {
  text-transform: none;
  font-size: 14px;
  font-weight: 400;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px;
}

.preview-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  transform:
    perspective(800px)
    rotateX(var(--tilt-rx, 0deg))
    rotateY(var(--tilt-ry, 0deg))
    scale(var(--tilt-scale, 1));
  transform-style: preserve-3d;
  transition:
    background 160ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.preview-card:hover {
  background: var(--card-hover);
}

.tilted-card.is-tilting {
  z-index: 2;
}

.preview-card:focus-visible,
.theme-toggle:focus-visible,
.contact-button:focus-visible,
.back-link:focus-visible,
.project-nav a:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}

.preview-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 16px 20px 0;
  line-height: 1.2;
  transform: translateZ(30px);
}

.card-title {
  font-size: 14px;
}

.card-type {
  font-size: 10px;
}

.preview-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translateZ(18px);
}

.preview-media img,
.preview-media video,
.preview-media canvas,
.preview-media lottie-player {
  width: 86.5%;
  height: 86.5%;
  object-fit: contain;
}

.detail-shell {
  width: min(100% - 24px, 720px);
  margin: 0 auto;
  padding-bottom: 48px;
}

.back-row {
  height: 40px;
  display: flex;
  align-items: center;
}

.back-link {
  width: auto;
  height: 22px;
  gap: 6px;
  justify-content: flex-start;
}

.detail-intro {
  padding: 48px 4px 24px;
}

.detail-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.2;
}

.detail-taxonomy {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.detail-description {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.detail-media {
  width: 100%;
  aspect-ratio: 600 / 480;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
}

.detail-media img,
.detail-media video,
.detail-media canvas,
.detail-media lottie-player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-contain img,
.media-contain video,
.media-contain canvas,
.media-contain lottie-player {
  object-fit: contain;
}

.project-nav {
  justify-content: space-between;
  padding: 24px 4px;
  font-size: 14px;
}

.empty {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

@media (max-width: 1199px) {
  .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preview-card {
    aspect-ratio: 1;
  }
}

@media (max-width: 767px) {
  .home-shell {
    padding-bottom: 0;
  }

  .hero {
    height: 300px;
    padding: 0 16px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
  }

  .script-title {
    font-size: 20px;
  }

  .hero-tags {
    font-size: 24px;
    font-weight: 400;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .footer-touch {
    display: none;
  }

  .site-footer {
    justify-content: center;
  }

  .detail-intro {
    padding-top: 48px;
  }

  .detail-meta {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .split-char {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .preview-card {
    transform: none;
    transition: background 160ms ease;
  }
}

@media (max-width: 390px) {
  .preview-copy {
    padding-inline: 14px;
  }

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