:root {
  color-scheme: light dark;
  --bg: #f4f4f4;
  --panel: #ececec;
  --panel-alt: #e4e4e4;
  --text: #000000;
  --muted: #6c6c6c;
  --line: #d6d6d6;
  --btn-bg: #000000;
  --btn-text: #ffffff;
  --btn-alt-bg: #ededed;
  --btn-alt-text: #404040;
  --sidebar-w: 355px;
}

html[data-theme="dark"] {
  --bg: #111111;
  --panel: #1a1a1a;
  --panel-alt: #212121;
  --text: #ffffff;
  --muted: #9e9e9e;
  --line: #2e2e2e;
  --btn-bg: #f5f5f5;
  --btn-text: #000000;
  --btn-alt-bg: #212121;
  --btn-alt-text: #dedede;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
}

button {
  font-weight: 300;
  font-family: inherit;
}

a {
  color: var(--text);
  text-decoration: none;
}

.layout {
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--bg);
  min-height: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.logo {
  width: 170px;
  height: auto;
  filter: var(--logo-filter, none);
}

html[data-theme="dark"] .logo {
  filter: invert(1);
}

.theme-switch {
  width: 48px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  padding: 2px;
  cursor: pointer;
}

.theme-switch span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: block;
  background: var(--text);
  transform: translateX(0);
  transition: transform 180ms ease;
}

html[data-theme="dark"] .theme-switch span {
  transform: translateX(21px);
}

.intro {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
  flex-shrink: 0;
}

.intro p {
  margin: 0 0 14px;
}

.works-nav-shell {
  position: relative;
  flex: 1;
  min-height: 0;
}

.works-nav-shell::before,
.works-nav-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 48px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 1;
}

.works-nav-shell::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg), transparent);
}

.works-nav-shell::after {
  bottom: 0;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

.works-nav-shell.is-fade-top::before {
  opacity: 1;
}

.works-nav-shell.is-fade-bottom::after {
  opacity: 1;
}

.works-nav {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.works-nav::-webkit-scrollbar {
  display: none;
}

.works-nav ul,
.works-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.works-nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.works-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel);
  color: inherit;
}

.works-nav-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
}

.works-nav-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.works-nav-name {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.2;
}

.works-nav-description {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.works-nav-item.is-active {
  background: var(--panel-alt);
}

.actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 0.9rem;
  border: 1px solid var(--line);
}

.btn img {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  border-color: transparent;
}

.btn-secondary {
  background: var(--btn-alt-bg);
  color: var(--btn-alt-text);
}

html[data-theme="dark"] .btn img {
  filter: invert(1);
}

.site-footer {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.site-footer p {
  margin: 0 0 5px;
}

.site-footer strong {
  color: var(--text);
  font-weight: 300;
}

.city-rotator-label {
  height: 1.2em;
  vertical-align: middle;
  display: inline-block;
  line-height: 1.2em;
}

.city-rotator {
  position: relative;
  display: inline-block;
  height: 1.2em;
  min-width: 11ch;
  overflow: hidden;
  vertical-align: middle;
  color: var(--text);
}

.city-rotator > span {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  line-height: 1.2em;
  white-space: nowrap;
  transform: translateY(0);
  opacity: 1;
  will-change: transform, opacity;
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), opacity 380ms ease;
}

#cityCurrent {
  transform: translateY(0);
  opacity: 1;
}

#cityNext {
  transform: translateY(100%);
  opacity: 0;
}

.city-rotator.is-animating #cityCurrent {
  transform: translateY(-18%);
  opacity: 0;
}

.city-rotator.is-animating #cityNext {
  transform: translateY(0);
  opacity: 1;
}

.city-rotator.is-resetting > span {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .city-rotator > span {
    transition: none;
  }
}

.content-pane {
  margin-left: var(--sidebar-w);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 22px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.content-pane::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.content-header {
  position: sticky;
  top: 0;
  flex-shrink: 0;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 0 14px;
  margin-bottom: 18px;
  background: var(--bg);
}

.content-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.breadcrumb-root {
  color: var(--text);
}

.breadcrumb-separator,
.breadcrumb-current {
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumb-current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.view-switcher-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.view-btn {
  width: 20px;
  height: 15px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.5;
}

.view-btn.is-active {
  opacity: 1;
}


.works-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.works-container.is-one-view {
  overflow: hidden;
}

.works-container.is-grid-view {
  overflow-y: auto;
  padding-bottom: 24px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.work-media-grid {
  margin-bottom: 11px;
}

.work-preview {
  border: 1px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  padding: 3px;
  background: transparent;
  cursor: pointer;
  aspect-ratio: 16 / 10;
}

.work-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 7px;
}

.work-preview.is-active {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

.work-preview-compact {
  flex: 0 0 72px;
  width: 72px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
}

.works-strip-overlay .work-preview {
  position: relative;
}

.works-strip-overlay .work-preview.is-active {
  box-shadow: none;
}

.works-strip-overlay .work-preview::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: calc(50% - 3px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
  border-radius: 0 7px 7px;
}

.work-preview-progress {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 20%;
  height: 2px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}

.work-preview.is-active .work-preview-progress {
  opacity: 1;
}

.work-preview-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #fff;
}

.work-preview-progress-fill.is-running {
  animation: work-preview-progress-fill var(--progress-duration, 4500ms) linear forwards;
}

@keyframes work-preview-progress-fill {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

.works-strip {
  overflow: hidden;
}

.works-strip-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.works-strip-overlay.has-thumb-nav {
  left: 8px;
  right: 8px;
}

.works-strip-overlay .works-strip-track {
  pointer-events: auto;
  flex: 1;
  min-width: 0;
}

.works-strip-overlay .carousel-control {
  position: static;
  transform: none;
  flex: 0 0 36px;
  pointer-events: auto;
}

.works-strip-overlay .carousel-control[hidden] {
  display: none;
}

.works-strip-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.works-strip-track::-webkit-scrollbar {
  display: none;
}

.carousel-track.is-full-width {
  grid-auto-columns: 100%;
  gap: 0;
  padding: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.carousel-track.is-full-width .media-frame {
  width: 100%;
  min-width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 14px;
}

.media-frame-selectable {
  cursor: pointer;
}

.content-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 16px;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--bg), transparent);
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.work-item {
  scroll-margin-top: 75px;
  min-height: 0;
  padding-bottom: 18px;
}

.is-one-view .work-item {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.is-one-view .carousel-wrap {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
}

.is-one-view .carousel-track.is-full-width {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: unset;
  max-height: none;
}

.is-one-view .carousel-track.is-full-width .media-frame {
  height: 100%;
}

.carousel-wrap {
  position: relative;
  width: 100%;
}

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72%, 1fr);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  background: var(--panel);
  border-radius: 14px;
  padding: 8px;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.media-frame {
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--panel-alt);
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-control {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(20, 20, 20, 0.5);
  color: #ffffff;
  cursor: pointer;
  z-index: 4;
}

.work-meta {
  flex-shrink: 0;
  margin-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.work-caption {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
}

.work-link {
  color: var(--text);
  font-size: 0.92rem;
  white-space: nowrap;
}

@media (max-width: 700px) {
  html,
  body {
    overflow: auto;
  }

  .layout {
    height: auto;
    overflow: visible;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .works-nav-shell {
    flex: none;
    min-height: auto;
  }

  .works-nav {
    height: auto;
    overflow: visible;
  }

  .works-nav-shell::before,
  .works-nav-shell::after {
    display: none;
  }

  .content-pane {
    margin-left: 0;
    height: auto;
    min-height: 0;
    overflow: visible;
    display: block;
    padding: 0 22px 12px;
  }

  .works-container {
    display: block;
    flex: none;
    overflow: visible;
  }

  .works-container.is-one-view {
    overflow: visible;
  }

  .is-one-view .work-item {
    display: block;
    flex: none;
    height: auto;
  }

  .is-one-view .carousel-wrap {
    display: block;
    width: 100%;
    flex: none;
    height: auto;
  }

  .is-one-view .carousel-track.is-full-width {
    display: grid;
    width: 100%;
    height: auto;
    flex: none;
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: none;
  }

  .is-one-view .carousel-track.is-full-width .media-frame {
    width: 100%;
    min-width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
}

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

  .content-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .work-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
