﻿:root {
  --bg: #fff;
  --ink: #0b0b0b;
  --muted: #7a7a7a;
  --soft: #f3f3f3;
  --line: #d7d7d7;
  --line-strong: #111;
  --accent: #176f5f;
  --grid-columns: 12;
  --grid-gutter: 24px;
  --baseline: 8px;
  --leading: 24px;
  --max: 1600px;
  --page-pad: 24px;
  color-scheme: light;
}

body:is([data-page="home"], [data-page="works"], [data-page="info"], [data-page="work-detail"]) {
  --max: 9999px;
  --page-pad: clamp(24px, 10vw, 204px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: var(--leading);
  letter-spacing: 0;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
}
.grid-guides {
  position: fixed;
  z-index: 9998;
  inset: 0;
  width: min(var(--max), calc(100vw - var(--page-pad) * 2));
  margin: 0 auto;
  pointer-events: none;
  opacity: 0;
  background-image: repeating-linear-gradient(to bottom, rgba(228, 0, 43, 0.12) 0, rgba(228, 0, 43, 0.12) 1px, transparent 1px, transparent var(--baseline));
  transition: opacity 120ms ease;
}

.grid-guides::before {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to right, rgba(228, 0, 43, 0.055) 0, rgba(228, 0, 43, 0.055) calc((100% - (var(--grid-columns) - 1) * var(--grid-gutter)) / var(--grid-columns)), transparent calc((100% - (var(--grid-columns) - 1) * var(--grid-gutter)) / var(--grid-columns)), transparent calc((100% - (var(--grid-columns) - 1) * var(--grid-gutter)) / var(--grid-columns) + var(--grid-gutter)));
  content: "";
}

body.grid-on .grid-guides {
  opacity: 1;
}

@media (pointer: fine) {
  body:not([data-page="admin"]):not([data-page="layout-editor"]):not([data-page="site-admin"]):not([data-page="media-admin"]):not([data-page="backup-admin"]):not([data-page="tag-admin"]):not([data-page="publish-admin"]):not([data-page="work-index-admin"]):not([data-page="admin-login"]),
  body:not([data-page="admin"]):not([data-page="layout-editor"]):not([data-page="site-admin"]):not([data-page="media-admin"]):not([data-page="backup-admin"]):not([data-page="tag-admin"]):not([data-page="publish-admin"]):not([data-page="work-index-admin"]):not([data-page="admin-login"]) * {
    cursor: none !important;
  }
}

.custom-cursor {
  position: fixed;
  z-index: 10000;
  width: 21px;
  height: 21px;
  pointer-events: none;
  opacity: 0;
  color: #4d4d4d;
  mix-blend-mode: normal;
  transform: translate(-50%, -50%);
  transition: opacity 100ms ease;
}

.custom-cursor.is-visible {
  opacity: 1;
}

.custom-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.custom-cursor path {
  fill: none;
  stroke: currentColor;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  align-items: center;
  column-gap: var(--grid-gutter);
  width: 100%;
  max-width: calc(var(--max) + var(--page-pad) * 2);
  min-height: 64px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(12px);
}

[data-page="home"] .topbar {
  position: fixed;
  right: 0;
  left: 0;
  background: transparent;
  color: #fff;
  mix-blend-mode: difference;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.brand {
  grid-column: 1 / 5;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  width: fit-content;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.brand span {
  color: var(--muted);
  font-size: 17px;
}

[data-page="home"] .brand span,
[data-page="home"] .nav,
[data-page="home"] .meta-link {
  color: currentColor;
}

.nav {
  grid-column: 5 / 9;
  display: flex;
  justify-content: center;
  gap: 36px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.nav a {
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 2px;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scaleX(0.65);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.meta-link {
  grid-column: 11 / 13;
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.lang-toggle {
  grid-column: 12 / 13;
  justify-self: end;
  min-width: 38px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.page {
  padding: 24px var(--page-pad) 0;
}

.section {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 32px 0 56px;
  border-top: 1px solid var(--line);
}

.section:first-child {
  border-top: 0;
}

.section-head {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  margin-bottom: 24px;
}

.section-content-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
}

.section-head > :first-child,
.section-content-grid > :first-child {
  grid-column: 1 / 3;
}

.section-head > :last-child,
.section-content-grid > :last-child {
  grid-column: 3 / 13;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  text-transform: uppercase;
}

.section-title {
  max-width: 860px;
  margin: 0;
  font-size: clamp(26px, 3.1vw, 54px);
  font-weight: 900;
  line-height: 1;
}

/* Home */

.home-page {
  min-height: 100vh;
  background: #000;
}

.home-carousel {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #111;
}

.home-slides,
.home-slide,
.home-slide-media {
  position: absolute;
  inset: 0;
}

.home-slide {
  opacity: 0;
  transition: opacity 700ms ease;
}

.home-slide.is-active {
  opacity: 1;
}

.home-slide canvas,
.cover canvas,
.cover-inner canvas,
.project-canvas canvas,
.preview-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

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

.slide-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 50%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.slide-zone-prev {
  left: 0;
}

.slide-zone-next {
  right: 0;
}

.slide-caption {
  display: none;
  position: absolute;
  right: var(--page-pad);
  bottom: 18px;
  z-index: 5;
  width: min(520px, calc(100% - 40px));
  color: #fff;
  mix-blend-mode: difference;
}

.slide-caption h1 {
  margin: 8px 0 10px;
  font-size: clamp(38px, 6.2vw, 108px);
  font-weight: 900;
  line-height: 0.9;
}

.slide-caption p {
  margin: 0;
  font-size: 16px;
  line-height: 1.22;
}

.slide-count {
  display: none;
  position: absolute;
  bottom: 20px;
  left: var(--page-pad);
  z-index: 5;
  color: #fff;
  font-size: 13px;
  mix-blend-mode: difference;
}

/* Works */

[data-page="works"] .section {
  width: min(var(--max), calc(100vw - var(--page-pad) * 2));
  max-width: var(--max);
  padding-top: 0;
}

.work-list {
  display: grid;
}

.work-list-item {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  align-items: start;
  padding: 0 0 48px;
  border-bottom: 1px solid var(--line);
}

.work-list-item + .work-list-item {
  padding-top: 24px;
}

.work-list-item > .cover {
  grid-column: 1 / 9;
}

.work-list-item > .work-text {
  grid-column: 9 / 13;
}

.cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--soft);
}

.cover-inner {
  width: 100%;
  height: 100%;
}

.cover::after {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  mix-blend-mode: difference;
  content: attr(data-label);
}

.cover-admin {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.form-action-row {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.cover-preview {
  display: grid;
  min-height: 170px;
  background: var(--soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

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

.cover-placeholder {
  display: grid;
  place-items: center;
  min-height: 170px;
  color: var(--muted);
  font-size: 14px;
}

.work-list-item .cover {
  aspect-ratio: 1.72 / 1;
}

.work-text {
  display: grid;
  gap: 16px;
  align-content: start;
}

.work-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  text-transform: uppercase;
}

.work-title-large {
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
  font-size: clamp(24px, 1.8vw, 32px);
  font-weight: 900;
  line-height: 40px;
}

.work-copy-large {
  margin: 0;
  color: var(--ink);
  font-size: clamp(16px, 1.15vw, 18px);
  display: -webkit-box;
  overflow: hidden;
  font-weight: 450;
  line-height: 24px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 14;
}

.card-summary {
  margin: 0;
  color: var(--ink);
  font-size: clamp(14px, 0.95vw, 17px);
  font-weight: 450;
  line-height: 24px;
}

/* Detail pages */

.detail-hero {
  width: min(var(--max), calc(100vw - var(--page-pad) * 2));
  margin: 0 auto;
  padding: 32px 0 24px;
}

.detail-hero h1 {
  max-width: 1260px;
  margin: 8px 0 16px;
  font-size: clamp(29px, 4.75vw, 80px);
  font-weight: 900;
  line-height: 0.96;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--grid-gutter);
  width: min(var(--max), calc(100vw - var(--page-pad) * 2));
  margin: 0 auto;
  padding: 0 0 72px;
}

.project-text {
  grid-column: 1 / 7;
  width: 100%;
  max-width: none;
  text-align: left;
}

.project-text p {
  margin: 0 0 24px;
  color: var(--ink);
  font-size: clamp(17px, 1.22vw, 22px);
  font-weight: 430;
  line-height: 32px;
}

.project-facts {
  display: grid;
  gap: 0;
  margin: 0 0 24px;
  border-top: 1px solid var(--line-strong);
}

.project-facts div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  min-height: 40px;
  padding: 8px 0 7px;
  border-bottom: 1px solid var(--line);
}

.project-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.project-facts dd {
  margin: 0;
  font-weight: 450;
}

.project-media {
  grid-column: span 6;
  min-width: 0;
  margin: 0;
}

.project-media-large {
  grid-column: 1 / -1;
}

.project-spacer {
  grid-column: 7 / 13;
}

.project-canvas {
  aspect-ratio: 1.32 / 1;
  width: 100%;
  overflow: hidden;
  background: var(--soft);
}

.project-media-large .project-canvas {
  aspect-ratio: 2 / 1;
}

.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gutter);
  width: min(var(--max), calc(100vw - var(--page-pad) * 2));
  margin: 0 auto 56px;
  border-top: 1px solid var(--line-strong);
}

.project-nav a {
  display: grid;
  gap: 12px;
  min-height: 128px;
  padding: 16px 0 15px;
  border-bottom: 1px solid var(--line);
}

.project-nav a:last-child {
  text-align: right;
}

.project-nav span {
  color: var(--muted);
  font-size: 12px;
}

.project-nav strong {
  font-size: clamp(22px, 2.2vw, 40px);
  line-height: 0.98;
}

/* Info and legacy sections */

.index-list,
.split-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line-strong);
}

.info-direct-list {
  border-top: 0;
}

.info-direct-list div:first-child {
  padding-top: 0;
}

.index-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 180px 110px;
  gap: 18px;
  align-items: baseline;
  min-height: 48px;
  padding: 8px 0 7px;
  border-bottom: 1px solid var(--line);
}

.split-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: start;
  align-items: baseline;
  min-height: 48px;
  padding: 8px 0 7px;
  border-bottom: 1px solid var(--line);
}

.row-no,
.row-meta,
.row-year,
.split-list dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.split-list dt {
  min-width: 64px;
}

.row-title,
.split-list dd {
  margin: 0;
  font-size: 20px;
  font-weight: 450;
  line-height: 32px;
}

.text-block {
  max-width: none;
  color: var(--ink);
  font-size: clamp(22px, 2.4vw, 42px);
  font-weight: 430;
  line-height: 48px;
}

.text-block p {
  margin: 0 0 24px;
}

.text-block strong {
  font-weight: 900;
}

html[lang="zh-CN"] body:not([data-page$="admin"]):not([data-page="layout-editor"]) .work-copy-large,
html[lang="zh-CN"] body:not([data-page$="admin"]):not([data-page="layout-editor"]) .card-summary {
  line-height: 24px;
}

html[lang="zh-CN"] body:not([data-page$="admin"]):not([data-page="layout-editor"]) .project-text p {
  line-height: 32px;
}

html[lang="zh-CN"] body:not([data-page$="admin"]):not([data-page="layout-editor"]) .text-block {
  line-height: 48px;
}

html[lang="zh-CN"] body:not([data-page$="admin"]):not([data-page="layout-editor"]) .text-block p {
  margin-bottom: 24px;
}

html[lang="zh-CN"] body:not([data-page$="admin"]):not([data-page="layout-editor"]) .split-list dd {
  line-height: 32px;
}

html[lang="zh-CN"] body:not([data-page$="admin"]):not([data-page="layout-editor"]) .section-title {
  line-height: 1.18;
}

.preview-grid,
.news-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.preview-card,
.news-card,
.info-panel,
.admin-panel {
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-panel .admin-button,
.editor-toolbar .admin-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  text-align: center;
}

.preview-stage {
  aspect-ratio: 1.4 / 1;
  margin: -16px -16px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.news-card h3,
.preview-card h3,
.info-panel h3,
.admin-panel h3 {
  margin: 10px 0 8px;
  font-size: 20px;
  line-height: 1.08;
}

.news-card p,
.preview-card p,
.info-panel p,
.admin-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.32;
}

/* Admin editor */

.admin-layout,
.editor-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-stack {
  display: grid;
  gap: 16px;
}

.work-library-panel .compact-field {
  margin: 18px 0;
}

.work-library-panel .admin-button + .admin-button {
  margin-top: -1px;
}

[data-page="site-admin"] .admin-panel .admin-button + .admin-button {
  margin-top: -1px;
}

.editor-toolbar {
  position: sticky;
  top: 70px;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.editor-toolbar h2 {
  margin: 0;
  font-size: 20px;
}

.editor-toolbar p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.28;
}

.editor-save-zone {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.editor-save-zone .admin-note {
  margin-top: 0;
}

.editor-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fafafa;
}

.editor-block {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  cursor: grab;
}

.editor-block.is-dragging {
  opacity: 0.45;
}

.editor-block.is-large,
.editor-text-block {
  grid-column: 1 / -1;
}

.editor-text-block {
  max-width: calc(50% - 8px);
}

.editor-block-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.editor-block-tools button,
.admin-button,
.filter-btn,
.ghost-btn {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.danger-button {
  border-color: #a3281d;
  color: #a3281d;
}

.admin-button,
.mini-file-button,
.lang-toggle {
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.admin-button.is-working {
  background: #111;
  color: #fff;
}

.admin-button.is-success {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.danger-button.is-danger-flash,
.danger-button:hover {
  background: #a3281d;
  border-color: #a3281d;
  color: #fff;
}

.toast {
  position: fixed;
  right: var(--page-pad);
  bottom: 18px;
  z-index: 100;
  max-width: min(380px, calc(100vw - var(--page-pad) * 2));
  padding: 12px 14px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.28;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.mini-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
}

.mini-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.editor-block textarea {
  display: block;
  width: 100%;
  min-height: 160px;
  padding: 14px;
  border: 0;
  resize: vertical;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

/* Row-preserving public layout */

.project-layout-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  align-items: start;
  min-width: 0;
}

.project-layout-cell {
  min-width: 0;
}

.project-layout-cell.is-left {
  grid-column: 1 / 7;
}

.project-layout-cell.is-right {
  grid-column: 7 / 13;
}

.project-layout-cell.is-wide {
  grid-column: 1 / -1;
}

.project-copy-block p {
  margin: 0 0 24px;
  font-weight: 430;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.project-copy-block.text-size-small p {
  font-size: 14px;
  line-height: 24px;
}

.project-copy-block.text-size-body p {
  font-size: clamp(17px, 1.22vw, 22px);
  line-height: 32px;
}

.project-copy-block.text-size-large p {
  font-size: clamp(26px, 2.4vw, 40px);
  line-height: 48px;
}

.project-copy-block.is-bold p {
  font-weight: 800;
}

.project-layout-media {
  margin: 0;
}

.project-layout-media .project-canvas {
  aspect-ratio: 1.32 / 1;
}

.project-layout-cell.is-wide .project-layout-media .project-canvas,
.project-layout-media.is-video .project-canvas {
  aspect-ratio: 2 / 1;
}

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

.project-layout-media.is-uploaded-image .project-canvas,
.project-layout-cell.is-wide .project-layout-media.is-uploaded-image .project-canvas {
  aspect-ratio: auto;
  overflow: visible;
  background: transparent;
}

.project-layout-media.is-uploaded-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Visual row editor */

.editor-canvas {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 32px 40px;
  overflow: visible;
  border: 1px solid var(--line);
  background: #fff;
}

.editor-layout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  min-width: 0;
}

.editor-layout-row.is-wide {
  grid-template-columns: 1fr;
}

.editor-cell {
  position: relative;
  min-width: 0;
  min-height: 72px;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.editor-cell.is-empty {
  border: 1px dashed transparent;
}

.editor-cell.is-empty:hover,
.editor-cell.is-empty:focus-within {
  border-color: #cfcfcf;
  background: #fafafa;
}

.editor-empty-target {
  display: grid;
  width: 100%;
  min-height: 72px;
  padding: 16px;
  place-items: start;
  border: 0;
  background: transparent;
  color: transparent;
  text-align: left;
  cursor: text;
}

.editor-cell.is-empty:hover .editor-empty-target,
.editor-empty-target:focus-visible {
  color: #aaa;
}

.editor-add-button,
.editor-module-handle {
  position: absolute;
  z-index: 12;
  left: -32px;
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1px solid #111;
  border-radius: 50%;
  background: #fff;
  color: #111;
  opacity: 0;
  cursor: pointer;
  transition: opacity 120ms ease, color 120ms ease, background 120ms ease;
}

.editor-add-button {
  top: 16px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.editor-module-handle {
  top: 0;
  cursor: grab;
}

.editor-module-handle:active {
  cursor: grabbing;
}

.editor-cell:hover > .editor-add-button,
.editor-cell:focus-within > .editor-add-button,
.editor-module:hover > .editor-module-handle,
.editor-module:focus-within > .editor-module-handle,
.editor-module-handle:focus-visible {
  opacity: 1;
}

.editor-add-button:hover,
.editor-module-handle:hover {
  background: #111;
  color: #fff;
}

.editor-module-handle svg,
.editor-popover svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor-module {
  position: relative;
  min-width: 0;
  background: #fff;
}

.editor-module.is-dragging {
  opacity: 0.28;
}

.editor-text-module textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-weight: 430;
  resize: none;
}

.editor-text-module.text-size-small textarea {
  font-size: 14px;
  line-height: 24px;
}

.editor-text-module.text-size-body textarea {
  font-size: 18px;
  line-height: 32px;
}

.editor-text-module.text-size-large textarea {
  font-size: 32px;
  line-height: 40px;
}

.editor-text-module.is-bold textarea {
  font-weight: 800;
}

.editor-media-frame {
  width: 100%;
  aspect-ratio: 1.32 / 1;
  overflow: hidden;
  background: var(--soft);
}

.editor-cell.is-wide .editor-media-frame,
.editor-media-module.is-video .editor-media-frame {
  aspect-ratio: 2 / 1;
}

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

.editor-media-frame.is-uploaded-image,
.editor-cell.is-wide .editor-media-frame.is-uploaded-image {
  aspect-ratio: auto;
  overflow: visible;
  background: transparent;
}

.editor-media-frame.is-uploaded-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.editor-popover {
  position: absolute;
  z-index: 30;
  top: 32px;
  left: -32px;
  display: grid;
  width: 224px;
  padding: 12px;
  border: 1px solid #d7d7d7;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.editor-menu-section {
  display: grid;
  gap: 8px;
  padding: 6px 0 12px;
  border-bottom: 1px solid #e6e6e6;
}

.editor-menu-section + .editor-menu-section {
  padding-top: 12px;
  border-bottom: 0;
}

.editor-menu-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.editor-icon-row,
.editor-placement-row {
  display: flex;
  gap: 4px;
}

.editor-icon-row button,
.editor-placement-row button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.editor-icon-row button:hover,
.editor-placement-row button:hover,
.editor-icon-row button.is-selected,
.editor-placement-row button.is-selected {
  background: #111;
  color: #fff;
}

.type-icon {
  font-size: 18px;
  line-height: 1;
}

.type-icon.is-small {
  font-size: 13px;
}

.type-icon.is-large {
  font-size: 24px;
}

.editor-menu-command {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 6px 4px;
  border: 0;
  background: #fff;
  color: #111;
  text-align: left;
  cursor: pointer;
}

.editor-menu-command:hover {
  background: #f2f2f2;
}

.editor-menu-command.is-danger {
  margin-top: 8px;
  color: #b42318;
}

.editor-cell.drop-before::before,
.editor-cell.drop-after::after {
  position: absolute;
  z-index: 40;
  right: 0;
  left: 0;
  height: 2px;
  background: #111;
  content: "";
}

.editor-cell.drop-before::before {
  top: -12px;
}

.editor-cell.drop-after::after {
  bottom: -12px;
}

.editor-cell.drop-target {
  box-shadow: inset 0 0 0 2px #111;
  background: #f3f3f3;
}
.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.compact-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.compact-field select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.check-field {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px !important;
  min-height: 42px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink) !important;
  font-size: 14px !important;
  text-transform: none !important;
}

.check-field input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.field-grid .form-action-button {
  justify-self: center;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  min-height: 36px;
  white-space: nowrap;
}

#admin-form .form-action-button {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: none;
}

#admin-form .publish-work-button {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

#admin-form .publish-work-button:hover {
  background: #fff;
  color: var(--ink);
}

.featured-toggle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink) !important;
  font-size: 14px !important;
  font-weight: 800;
  line-height: 1;
  text-transform: none !important;
  white-space: nowrap;
  cursor: pointer;
}

#admin-form .featured-toggle {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.featured-toggle input {
  position: absolute;
  width: 1px !important;
  min-height: 0 !important;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.featured-toggle:has(input:checked) {
  border-color: transparent;
  background: #0b64d8;
  color: #fff !important;
}

.field-grid input,
.field-grid textarea,
.field-grid select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.tag-picker {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tag-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tag-picker .label,
.tag-picker-head .label {
  margin: 0;
}

.tag-plus-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.tag-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  align-items: center;
}

.selected-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.selected-tag strong,
.tag-option strong {
  font-size: 13px;
  font-weight: 800;
}

.selected-tag small,
.tag-option small {
  color: var(--muted);
  font-size: 12px;
}

.selected-tag button {
  position: absolute;
  top: -1px;
  right: -1px;
  display: none;
  width: 24px;
  height: calc(100% + 2px);
  border: 0;
  background: #c40000;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.selected-tag:hover {
  padding-right: 32px;
}

.selected-tag:hover button {
  display: grid;
  place-items: center;
}

.tag-modal[hidden] {
  display: none;
}

.tag-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--page-pad);
  background: rgba(255, 255, 255, 0.82);
}

.tag-modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - var(--page-pad) * 2));
  overflow: auto;
  border: 1px solid var(--ink);
  background: #fff;
  padding: 18px 18px 20px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
}

.tag-modal-head,
.tag-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.tag-modal-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.05;
  white-space: nowrap;
}

.tag-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tag-modal-close:hover {
  background: var(--ink);
  color: #fff;
}

.tag-modal-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.tag-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.tag-option:hover,
.tag-option.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.tag-option:hover small,
.tag-option.is-selected small {
  color: rgba(255, 255, 255, 0.76);
}

.tag-modal-actions {
  justify-content: center;
}

.tag-confirm-button {
  width: auto;
  min-width: 92px;
  min-height: 36px;
  padding: 7px 24px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.tag-confirm-button:hover {
  background: var(--ink);
  color: #fff;
}

.tag-admin p {
  max-width: 620px;
}

.tag-add-grid,
.tag-library-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 54px 54px;
  gap: 8px;
  align-items: end;
}

.tag-library-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.tag-library-row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tag-add-grid .admin-button {
  grid-column: 3 / 5;
  width: 100%;
}

.tag-add-grid label,
.tag-library-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.tag-add-grid input,
.tag-library-row input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.publish-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.publish-summary article,
.publish-card,
.publish-row {
  border: 1px solid var(--line);
  background: #fff;
}

.publish-summary article {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 12px;
}

.publish-summary span,
.publish-row span {
  color: var(--muted);
  font-size: 12px;
}

.publish-summary strong {
  font-size: 34px;
  line-height: 0.9;
}

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

.publish-card {
  padding: 14px;
}

.publish-card h3,
.publish-list h3 {
  margin: 0 0 10px;
}

.publish-card ul,
.publish-row ul {
  margin: 0;
  padding-left: 18px;
  color: #a3281d;
}

.publish-ok,
.publish-warn {
  margin: 0;
  font-weight: 800;
}

.publish-ok {
  color: #157a3b !important;
}

.publish-warn {
  color: #a3281d !important;
}

.publish-list {
  display: grid;
  gap: 8px;
}

.publish-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.9fr);
  gap: 12px;
  padding: 12px;
}

.publish-row div {
  display: grid;
  gap: 4px;
}

.publish-issue-cell {
  display: grid;
  gap: 10px !important;
}

.publish-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px !important;
}

.publish-actions .admin-button {
  width: auto;
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.production-deploy-panel {
  gap: 10px;
}

.production-deploy-button {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.production-deploy-button:hover {
  background: #fff;
  color: var(--ink);
}

#production-deploy-output {
  max-height: 240px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-left: 2px solid #a3281d;
  background: #f7f7f7;
  color: #a3281d;
  font: 12px/1.5 Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.work-index-list {
  display: grid;
  gap: 0;
}

.work-index-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-top: 1px solid var(--line);
}

.work-index-row:last-child {
  border-bottom: 1px solid var(--line);
}

.work-index-main {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 82px 72px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px 8px 0;
  color: var(--ink);
  text-decoration: none;
}

.work-index-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 10px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.icon-button:hover {
  border-color: transparent;
  background: #ededed;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.22;
}

.icon-button:disabled:hover {
  background: transparent;
}

.file-button {
  display: grid;
  place-items: center;
  text-align: center;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

code {
  font-family: "Courier New", monospace;
  font-size: 0.95em;
}

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

.field-grid textarea {
  min-height: 100px;
  resize: vertical;
}

.site-admin-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.site-admin-form h3,
.site-admin-form label,
.site-admin-form button {
  grid-column: 1 / -1;
}

.site-admin-form label:has(input) {
  grid-column: auto;
}

.long-textarea {
  min-height: 180px !important;
}

.media-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.media-admin-head h3 {
  margin: 0;
}

.media-admin-head .admin-button {
  width: auto;
}

.media-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.media-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.media-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1.32 / 1;
  overflow: hidden;
  background: var(--soft);
}

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

.media-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.media-info strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-info span,
.empty-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.media-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.backup-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.backup-section h3 {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}

.backup-list {
  display: grid;
  gap: 8px;
}

.backup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.backup-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.backup-row strong,
.backup-row span,
.backup-row code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-row span {
  color: var(--muted);
  font-size: 12px;
}

.admin-note {
  margin-top: 12px;
  padding: 12px;
  border-left: 2px solid var(--line-strong);
  background: #f7f7f7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--grid-gutter);
  width: min(var(--max), calc(100% - var(--page-pad) * 2));
  margin: 40px auto 0;
  padding: 16px 0 24px;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.footer .site-legal {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
  text-transform: none;
}

.site-legal[hidden] {
  display: none;
}

.site-legal a {
  color: inherit;
  text-decoration: none;
}

.site-legal a:hover {
  color: var(--ink);
}

.home-legal {
  position: fixed;
  z-index: 12;
  right: var(--page-pad);
  bottom: 12px;
  display: flex;
  gap: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
}

.home-legal a {
  color: inherit;
}

@media (max-width: 920px) {
  :root {
    --grid-gutter: 16px;
    --page-pad: 16px;
  }

  body:is([data-page="home"], [data-page="works"], [data-page="info"], [data-page="work-detail"]) {
    --page-pad: 16px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .nav {
    justify-content: flex-start;
    gap: 14px;
    overflow-x: auto;
    font-size: 17px;
  }

  .meta-link {
    justify-self: start;
  }

  .brand,
  .nav,
  .meta-link,
  .lang-toggle,
  .section-head > :first-child,
  .section-head > :last-child,
  .section-content-grid > :first-child,
  .section-content-grid > :last-child,
  .work-list-item > .cover,
  .work-list-item > .work-text,
  .project-text,
  .project-spacer,
  .project-media {
    grid-column: 1 / -1;
  }

  .page {
    padding-top: 16px;
  }

  .section-head,
  .section-content-grid,
  [data-page="works"] .section-head,
  .work-list-item,
  .project-grid,
  .admin-layout,
  .site-admin-form,
  .editor-shell,
  .editor-canvas,
  .split-list div {
    grid-template-columns: 1fr;
  }

  .work-list-item {
    gap: 16px;
    padding: 16px 0 32px;
  }

  .work-list-item .cover {
    aspect-ratio: 1.35 / 1;
  }

  .project-media-large,
  .editor-block.is-large,
  .editor-text-block,
  .project-nav {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .editor-text-block {
    max-width: none;
  }
  .project-layout-row,
  .editor-layout-row {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .project-layout-cell.is-left,
  .project-layout-cell.is-right,
  .project-layout-cell.is-wide {
    grid-column: 1 / -1;
  }

  .project-layout-cell.is-empty {
    display: none;
  }

  .editor-canvas {
    padding: 24px 32px;
  }

  .editor-add-button,
  .editor-module-handle,
  .editor-popover {
    left: -28px;
  }

  .editor-toolbar {
    position: static;
  }

  .detail-hero {
    padding-top: 24px;
  }

  .detail-hero h1 {
    font-size: clamp(30px, 9vw, 48px);
  }

  .project-facts div {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .backup-row {
    grid-template-columns: 1fr;
  }

  .preview-grid,
  .news-grid,
  .info-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .tag-add-grid,
  .tag-library-row {
    grid-template-columns: 1fr;
  }

  .slide-caption {
    right: var(--page-pad);
    bottom: 18px;
    width: calc(100% - var(--page-pad) * 2);
  }

  .slide-count {
    left: var(--page-pad);
    top: 96px;
    bottom: auto;
  }

  .footer {
    grid-template-columns: 1fr;
  }

  .home-legal {
    right: 14px;
    bottom: 8px;
    left: 14px;
    justify-content: center;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
