:root {
  color-scheme: light;
  --paper: #efede7;
  --ink: #090909;
  --muted: #7b7972;
  --line: rgba(9, 9, 9, 0.18);
  --light-line: rgba(255, 255, 255, 0.24);
  --accent: #ff4d36;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
}

body.is-locked {
  overflow: hidden;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-header h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 650;
  line-height: 1;
}

.site-header a {
  text-decoration: none;
}

.showcase {
  min-height: calc(100svh - 72px);
}

.desktop-showcase {
  display: grid;
  grid-template-columns: minmax(300px, 30vw) minmax(0, 1fr);
  height: calc(100svh - 72px);
  overflow: hidden;
}

.brand-index {
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}

.brand-index ol {
  display: grid;
  grid-template-rows: repeat(10, minmax(58px, 1fr));
  min-height: 100%;
  padding: 0;
  margin: 0;
  list-style: none;
}

.brand-index li {
  min-height: 0;
  border-bottom: 1px solid var(--line);
}

.brand-index li:last-child {
  border-bottom: 0;
}

.brand-button {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 58px;
  padding: 0 22px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color 180ms ease, background-color 180ms ease;
}

.brand-button::after {
  content: "";
  width: 0;
  height: 2px;
  justify-self: end;
  background: var(--accent);
  transition: width 220ms var(--ease);
}

.brand-button:hover,
.brand-button:focus-visible,
.brand-button.is-active {
  background: rgba(255, 255, 255, 0.34);
  color: var(--ink);
}

.brand-button.is-active::after {
  width: 18px;
}

.brand-button span:first-child {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.brand-button strong {
  min-width: 0;
  overflow: hidden;
  font-size: 21px;
  font-weight: 520;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-shell {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 34px;
  overflow: hidden;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 1280px;
  max-height: calc(100svh - 140px);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ink);
  isolation: isolate;
}

.stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 50% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
  pointer-events: none;
}

.stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: opacity 220ms ease, transform 600ms var(--ease);
}

.stage.has-missing-image img,
.mobile-visual img.is-missing {
  opacity: 0;
}

.stage.is-switching img {
  opacity: 0.28;
  transform: scale(0.99);
}

.stage:hover img {
  transform: scale(1.012);
}

.stage-label {
  position: absolute;
  z-index: 3;
  left: 28px;
  bottom: 25px;
  max-width: calc(100% - 150px);
  color: white;
  pointer-events: none;
}

.stage-label span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.stage-label h2 {
  margin: 0;
  font-size: 48px;
  font-weight: 600;
  line-height: 0.98;
}

.stage-open {
  position: absolute;
  z-index: 2;
  inset: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.stage-open svg {
  position: absolute;
  right: 28px;
  bottom: 26px;
  width: 34px;
  height: 34px;
  color: white;
  transition: transform 220ms var(--ease);
}

.stage-open:hover svg,
.stage-open:focus-visible svg {
  transform: translate(4px, -4px);
}

.stage-external {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 18px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: white;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: background-color 180ms ease, color 180ms ease;
}

.stage-external:hover {
  background: white;
  color: var(--ink);
}

.stage-external svg {
  width: 18px;
  height: 18px;
}

.mobile-projects {
  display: none;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

dialog {
  padding: 0;
  border: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.preview-dialog {
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  background: var(--ink);
  color: white;
}

.preview-dialog[open] {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  border-bottom: 1px solid var(--light-line);
}

.preview-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
}

.preview-meta span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.preview-meta strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-actions {
  display: flex;
  flex: 0 0 auto;
  align-self: stretch;
}

.preview-actions .icon-button {
  width: 58px;
  height: 100%;
  border-left: 1px solid var(--light-line);
}

.preview-actions .icon-button:hover {
  background: white;
  color: var(--ink);
}

.preview-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.preview-stage iframe {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
  opacity: 0;
  transition: opacity 180ms ease;
}

.preview-stage iframe.is-ready {
  opacity: 1;
}

.preview-loading {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.preview-loading[hidden] {
  display: none;
}

@media (max-width: 1120px) and (min-width: 801px) {
  .desktop-showcase {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .brand-button {
    padding: 0 16px;
  }

  .brand-button strong {
    font-size: 18px;
  }

  .stage-shell {
    padding: 24px;
  }

  .stage-label h2 {
    font-size: 38px;
  }
}

@media (max-width: 800px) {
  .site-header {
    position: sticky;
    top: 0;
    height: 62px;
    padding: 0 16px;
    background: rgba(239, 237, 231, 0.94);
    backdrop-filter: blur(12px);
  }

  .site-header h1 {
    font-size: 22px;
  }

  .showcase {
    min-height: 0;
  }

  .desktop-showcase {
    display: none;
  }

  .mobile-projects {
    display: block;
  }

  #mobile-list {
    padding: 0 14px 48px;
  }

  .mobile-project {
    position: relative;
    padding: 18px 0 26px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-visual {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--ink);
    background: var(--ink);
  }

  .mobile-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 420ms var(--ease);
  }

  .mobile-project h2 {
    max-width: 92%;
    margin: 14px 0 0;
    font-size: 34px;
    font-weight: 560;
    line-height: 1;
  }

  .mobile-open {
    position: absolute;
    z-index: 3;
    inset: 18px 0 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .mobile-open svg {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.62);
    color: white;
  }

  .mobile-project:has(.mobile-open:active) img {
    transform: scale(1.015);
  }

  .preview-dialog[open] {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .preview-meta {
    gap: 9px;
    padding: 0 10px;
  }

  .preview-meta strong {
    max-width: 120px;
    font-size: 13px;
  }

  .preview-actions .icon-button {
    width: 44px;
  }
}

@media (max-width: 370px) {
  .mobile-project h2 {
    font-size: 30px;
  }

  .preview-meta strong {
    max-width: 92px;
  }

  .preview-actions .icon-button {
    width: 41px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
