:root {
  --ink: #17191c;
  --muted: #6c7278;
  --paper: #f5f6f4;
  --surface: #ffffff;
  --surface-soft: #ecefeb;
  --line: #d8ddd8;
  --line-strong: #17191c;
  --accent: #24775f;
  --accent-soft: #dcebe5;
  --blue-soft: #dce7f4;
  --shadow: rgba(28, 32, 36, 0.12);
  --shadow-strong: rgba(28, 32, 36, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  --brand-font: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 25, 28, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 25, 28, 0.045) 1px, transparent 1px);
  background-size: 4rem 4rem;
  opacity: 0.55;
}

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

button {
  touch-action: manipulation;
}

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

.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;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--paper);
}

.site-header {
  position: relative;
  top: 0;
  left: 50%;
  z-index: 5;
  display: flex;
  width: min(72rem, calc(100% - 2rem));
  height: 6.5rem;
  align-items: center;
  justify-content: space-between;
  transform: translateX(-50%);
  pointer-events: none;
}

.brand,
.socials {
  pointer-events: auto;
}

.brand {
  display: inline-grid;
  gap: 0.08rem;
  color: var(--ink);
  font-family: var(--brand-font);
}

.brand span {
  font-size: 2.9rem;
  font-weight: 800;
  line-height: 0.92;
}

.brand strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.brand strong:empty {
  display: none;
}

.socials {
  display: flex;
  gap: 1.05rem;
  align-items: center;
}

.socials a {
  display: inline-grid;
  min-width: 1.6rem;
  min-height: 2rem;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.socials a:hover,
.socials a:focus-visible {
  color: var(--ink);
  border-color: currentColor;
  outline: none;
}

.portfolio {
  position: relative;
  min-height: 100vh;
  padding: 1.6rem 1rem 5rem;
}

.work-wall {
  position: relative;
  width: min(72rem, 100%);
  min-height: 101rem;
  margin: 0 auto;
}

.work-card {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: var(--z);
  width: var(--w);
  padding: 0.45rem 0.45rem 0.55rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 1.35rem 3rem var(--shadow);
  transform: rotate(var(--r));
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.work-card:hover,
.work-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 1.6rem 3.4rem var(--shadow-strong);
  transform: translateY(-0.22rem) rotate(var(--r));
}

.z-badge {
  position: absolute;
  top: -0.8rem;
  left: -0.55rem;
  z-index: 2;
  display: none;
  min-width: 2.1rem;
  padding: 0.24rem 0.42rem;
  color: white;
  background: var(--accent);
  border: 1px solid var(--ink);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: 0 0.35rem 0.9rem rgba(20, 24, 28, 0.16);
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-soft);
  border: 0;
  border-radius: 5px;
  aspect-ratio: var(--ratio);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.work-card:hover img,
.work-card:focus-within img {
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.025);
}

.play {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  display: grid;
  width: 2.35rem;
  height: 1.95rem;
  place-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(23, 25, 28, 0.5);
  border-radius: 6px;
  backdrop-filter: blur(8px);
}

.play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 0.14rem;
  border-top: 0.42rem solid transparent;
  border-bottom: 0.42rem solid transparent;
  border-left: 0.66rem solid var(--ink);
}

.media-state {
  display: none;
}

.edit-mode .media-state {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  display: inline-grid;
  min-height: 1.5rem;
  place-items: center;
  padding: 0 0.48rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(23, 25, 28, 0.35);
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.edit-mode .media-state.has-video {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.edit-mode .media-state.is-missing {
  color: #7a211b;
  background: #ffe6e2;
  border-color: rgba(122, 33, 27, 0.3);
}

.edit-mode .media-state.is-checking {
  color: var(--ink);
  background: var(--blue-soft);
}

.work-link {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(23, 25, 28, 0.55);
  border-radius: 6px;
  box-shadow: 0 0.5rem 1.2rem rgba(20, 24, 28, 0.12);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.work-link:hover,
.work-link:focus-visible {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
  outline: none;
  transform: translateY(-0.08rem);
}

.work-link.is-empty {
  display: none;
}

.work-card h2 {
  margin: 0.56rem 0.1rem 0;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.12;
}

.work-title {
  display: grid;
  gap: 0.08rem;
}

.work-title span,
.work-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-title span:nth-child(2) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.work-title small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.25;
}

.contact-card {
  position: absolute;
  right: 4rem;
  top: 91rem;
  min-width: 20rem;
  padding: 1rem 0 0;
  color: var(--ink);
  border-top: 1px solid var(--line-strong);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.65;
}

.contact-card p {
  margin: 0;
}

.contact-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.video-modal {
  width: min(60rem, calc(100% - 2rem));
  max-height: calc(100vh - 4rem);
  padding: 0.55rem;
  overflow: visible;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.28);
}

.video-modal.is-vertical {
  width: min(32rem, calc(100% - 2rem));
}

.video-modal::backdrop {
  background: rgba(15, 17, 20, 0.68);
}

.close {
  position: absolute;
  top: -1rem;
  right: -1rem;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  color: white;
  cursor: pointer;
  background: var(--ink);
  border: 1px solid var(--surface);
  border-radius: 6px;
  font-size: 1.5rem;
  line-height: 1;
}

.close:hover,
.close:focus-visible {
  background: var(--accent);
  outline: none;
}

.preview-frame {
  overflow: hidden;
  background: #101214;
  border-radius: 5px;
  aspect-ratio: var(--preview-ratio, 16 / 9);
  max-height: calc(100vh - 5.5rem);
  max-width: calc(100vw - 3.5rem);
}

.preview-frame video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 5.5rem);
  background: #000;
  object-fit: contain;
}

.preview-placeholder {
  position: relative;
  z-index: 2;
  display: grid;
  height: 100%;
  place-content: center;
  color: white;
  text-align: center;
}

.preview-placeholder p {
  margin: 0.3rem 0;
  font-weight: 800;
}

.modal-title {
  font-size: 2.2rem;
}

.access-locked .site-header,
.access-locked .portfolio {
  visibility: hidden;
  pointer-events: none;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: var(--paper);
}

.lock-form {
  display: grid;
  width: min(24rem, 100%);
  gap: 0.85rem;
  padding: 1.2rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 1.4rem 3rem var(--shadow);
}

.lock-title {
  margin: 0 0 0.2rem;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 0.98;
}

.lock-form label {
  display: grid;
  gap: 0.35rem;
}

.lock-form span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.lock-form input,
.lock-form button {
  min-height: 2.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
}

.lock-form input {
  width: 100%;
  padding: 0 0.75rem;
  background: var(--surface-soft);
}

.lock-form button {
  color: white;
  cursor: pointer;
  background: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.lock-form button:hover,
.lock-form button:focus-visible {
  background: var(--accent);
  outline: none;
}

.lock-message {
  min-height: 1.1rem;
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.edit-mode .work-card {
  cursor: grab;
  outline: 2px dashed rgba(36, 119, 95, 0.72);
  outline-offset: 0.35rem;
  touch-action: none;
}

.edit-mode .work-card.is-selected {
  border-color: var(--accent);
  outline-color: var(--accent);
  box-shadow: 0 1.5rem 3.6rem rgba(36, 119, 95, 0.25);
}

.edit-mode .work-card.is-dragging {
  opacity: 0.44;
}

.edit-mode .work-card.is-drop-target {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent-soft), 0 1.5rem 3.4rem rgba(36, 119, 95, 0.18);
}

.edit-mode .z-badge {
  display: inline-block;
}

.edit-mode .work-card:active {
  cursor: grabbing;
}

.edit-mode .thumb {
  pointer-events: none;
}

.edit-mode {
  --sidebar-width: 23rem;
  --sidebar-rail: 3.15rem;
}

.edit-mode .portfolio {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  overflow-x: hidden;
}

.edit-mode .site-header {
  left: auto;
  width: calc(100% - var(--sidebar-width) - 2rem);
  margin-left: calc(var(--sidebar-width) + 1rem);
  padding-inline: 2rem;
  transform: none;
}

.edit-mode .work-wall {
  left: auto;
  width: min(72rem, calc(100% - 3rem));
  max-width: 100%;
  margin: 0 auto;
  transform: none;
}

.editor {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  z-index: 20;
  display: grid;
  width: var(--sidebar-width);
  height: 100vh;
  max-height: none;
  padding: 0.95rem;
  overflow: auto;
  color: #f6f7f8;
  background: #121519;
  border-width: 0 1px 0 0;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0.9rem 0 2.6rem rgba(10, 12, 15, 0.2);
  gap: 0.72rem;
  scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
  scrollbar-width: thin;
  transition: transform 180ms ease;
}

.editor::-webkit-scrollbar,
.work-list::-webkit-scrollbar {
  width: 0.42rem;
  height: 0.42rem;
}

.editor::-webkit-scrollbar-track,
.work-list::-webkit-scrollbar-track {
  background: transparent;
}

.editor::-webkit-scrollbar-thumb,
.work-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.26);
  border-radius: 8px;
}

.editor-head {
  display: grid;
  gap: 0.35rem;
  padding: 0.2rem 2.2rem 0.8rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  cursor: default;
  user-select: none;
}

.editor-head strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
}

.editor-head span,
.editor-note {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  line-height: 1.45;
}

.editor-nav,
.editor-actions,
.editor-export {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.48rem;
}

.editor-nav {
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.editor-nav .wide-button {
  grid-column: 1 / -1;
}

.editor-nav a,
.editor-nav button {
  min-height: 2.35rem;
  display: grid;
  place-items: center;
}

.editor-nav a {
  color: #f6f7f8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.editor button,
.editor input,
.editor select {
  min-height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  font: inherit;
}

.editor button {
  color: #f6f7f8;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

.editor button:hover,
.editor button:focus-visible,
.editor-nav a:hover,
.editor-nav a:focus-visible {
  color: #121519;
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  outline: none;
}

.editor button:disabled,
.editor input:disabled,
.editor select:disabled {
  color: rgba(255, 255, 255, 0.36);
  cursor: default;
  background: rgba(255, 255, 255, 0.04);
}

.editor button.is-busy,
.editor button.is-busy:disabled {
  color: #111418;
  cursor: progress;
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(141, 227, 200, 0.18);
}

.editor button.is-done,
.editor button.is-done:disabled {
  color: #0f241d;
  background: #9be6c8;
  border-color: #9be6c8;
}

.editor button.is-error,
.editor button.is-error:disabled {
  color: #35110d;
  background: #ffb3a8;
  border-color: #ffb3a8;
}

.editor-block {
  display: grid;
  gap: 0.68rem;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
}

.section-title {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-height: 2.25rem;
  padding: 0 0.35rem 0 0.55rem;
  color: white;
  background: transparent;
  border: 0;
  font-size: 0.82rem;
  text-align: left;
}

.section-chevron {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.62rem;
  transition: transform 140ms ease;
}

.section-title[aria-expanded="false"] .section-chevron {
  transform: rotate(-90deg);
}

.site-form,
.frames-panel,
.work-form {
  display: grid;
  gap: 0.58rem;
}

.site-form.is-collapsed,
.frames-panel.is-collapsed {
  display: none;
}

.work-list {
  display: grid;
  max-height: 10rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
}

.work-list-row {
  display: grid;
  grid-template-columns: 1fr 2.1rem 2.1rem;
  min-height: 2.25rem;
  background: rgba(0, 0, 0, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.work-list-row:last-child {
  border-bottom: 0;
}

.work-list-row.active {
  color: #121519;
  background: var(--accent-soft);
}

.work-select {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: center;
  justify-items: start;
  width: 100%;
  min-height: 0;
  padding: 0 0.55rem;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.work-list span {
  display: inline-grid;
  min-width: 2rem;
  min-height: 1.35rem;
  place-items: center;
  color: #121519;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.work-list b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
}

.work-list-row.active .work-select span {
  background: rgba(18, 21, 25, 0.12);
}

.site-form label,
.work-form label {
  display: grid;
  gap: 0.28rem;
}

.site-form span,
.work-form span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
}

.site-form input,
.site-form select,
.work-form input,
.work-form select {
  width: 100%;
  padding: 0 0.55rem;
  color: white;
  background: rgba(0, 0, 0, 0.22);
}

.site-form input:focus,
.site-form select:focus,
.work-form input:focus,
.work-form select:focus {
  border-color: var(--accent-soft);
  outline: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

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

.range-field > div,
.asset-field > div {
  display: grid;
  grid-template-columns: 1fr 5.25rem;
  gap: 0.45rem;
  align-items: center;
}

.range-field input[type="range"] {
  padding: 0;
  accent-color: var(--accent-soft);
}

.range-field input[type="number"] {
  text-align: right;
}

.asset-field > div {
  grid-template-columns: 1fr 3.6rem 4.6rem;
}

.file-button {
  display: grid;
  min-height: 2.25rem;
  place-items: center;
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.asset-latest {
  min-height: 2.25rem;
  padding: 0;
}

.file-button:hover,
.file-button:focus-within {
  color: #121519;
  background: var(--accent-soft);
}

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

.editor-note {
  margin: 0;
}

.save-help {
  padding: 0.68rem;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
}

.save-help strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.save-help p,
.editor-status {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.45;
}

.editor-status {
  min-height: 1.75rem;
  padding: 0.38rem 0.48rem;
  color: var(--accent-soft);
  background: rgba(141, 227, 200, 0.08);
  border: 1px solid rgba(141, 227, 200, 0.14);
  border-radius: 6px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.editor-status.is-active {
  color: #f6fff9;
  background: rgba(141, 227, 200, 0.16);
  border-color: rgba(141, 227, 200, 0.34);
}

.editor-collapse {
  position: absolute;
  top: 0.8rem;
  right: 0.68rem;
  z-index: 5;
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  padding: 0;
  border-radius: 6px;
}

.editor-collapsed .portfolio {
  width: calc(100% - var(--sidebar-rail));
  margin-left: var(--sidebar-rail);
}

.editor-collapsed .site-header {
  width: calc(100% - var(--sidebar-rail) - 2rem);
  margin-left: calc(var(--sidebar-rail) + 1rem);
}

.editor-collapsed .editor {
  transform: translateX(calc(var(--sidebar-rail) - 100%));
}

.editor-collapsed .editor > *:not(.editor-collapse) {
  opacity: 0;
  pointer-events: none;
}

.editor-collapsed .editor-collapse {
  right: 0.2rem;
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: 0.75rem;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.001);
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0.19rem;
  bottom: 0;
  width: 1px;
  background: transparent;
  transition: background 140ms ease;
}

.sidebar-resizer:hover::after,
.is-resizing-sidebar .sidebar-resizer::after {
  background: var(--accent-soft);
}

.preview-mobile .site-header {
  position: relative;
  left: auto;
  width: 390px;
  max-width: calc(100vw - 2rem);
  height: auto;
  margin: 0 auto;
  padding: 1.7rem 1rem 1.1rem;
  transform: none;
}

.preview-mobile .portfolio {
  width: 390px;
  max-width: calc(100vw - 2rem);
  min-height: 844px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  background: rgba(255, 255, 255, 0.34);
}

.preview-mobile .work-wall {
  display: grid;
  width: min(28rem, 100%);
  min-height: 0;
  gap: 1.3rem;
  transform: none;
}

.preview-mobile .work-card,
.preview-mobile .contact-card {
  position: relative;
  inset: auto;
  width: 100%;
}

.preview-mobile .work-card {
  justify-self: center;
  transform: translateX(var(--mobile-shift, 0)) rotate(var(--mobile-rotate, 0deg));
}

.preview-mobile .work-card:hover,
.preview-mobile .work-card:focus-within {
  transform: translateX(var(--mobile-shift, 0)) translateY(-0.12rem) rotate(var(--mobile-rotate, 0deg));
}

.preview-mobile .work-card.is-portrait {
  width: min(18rem, 74vw);
}

.preview-mobile .contact-card {
  min-width: 0;
  padding-bottom: 1rem;
}

.preview-mobile .work-card:nth-of-type(1),
.work-card:nth-of-type(1) {
  --mobile-shift: -0.55rem;
  --mobile-rotate: -0.4deg;
}

.preview-mobile .work-card:nth-of-type(2),
.work-card:nth-of-type(2) {
  --mobile-shift: 0.8rem;
  --mobile-rotate: 0.35deg;
}

.preview-mobile .work-card:nth-of-type(3),
.work-card:nth-of-type(3) {
  --mobile-shift: -0.15rem;
  --mobile-rotate: -0.28deg;
}

.preview-mobile .work-card:nth-of-type(4),
.work-card:nth-of-type(4) {
  --mobile-shift: 0.45rem;
  --mobile-rotate: 0.42deg;
}

.preview-mobile .work-card:nth-of-type(5),
.work-card:nth-of-type(5) {
  --mobile-shift: -0.75rem;
  --mobile-rotate: 0.24deg;
}

.preview-mobile .work-card:nth-of-type(6),
.work-card:nth-of-type(6) {
  --mobile-shift: 0.25rem;
  --mobile-rotate: -0.36deg;
}

.preview-mobile .work-card:nth-of-type(7),
.work-card:nth-of-type(7) {
  --mobile-shift: 0.7rem;
  --mobile-rotate: 0.32deg;
}

.preview-mobile .work-card:nth-of-type(8),
.work-card:nth-of-type(8) {
  --mobile-shift: -0.4rem;
  --mobile-rotate: -0.3deg;
}

.edit-mode.preview-mobile .site-header,
.edit-mode.preview-mobile .portfolio {
  width: min(390px, calc(100% - var(--sidebar-width) - 2rem));
  max-width: calc(100% - var(--sidebar-width) - 2rem);
  margin-right: 1rem;
  margin-left: calc(var(--sidebar-width) + 1rem);
}

.edit-mode.preview-mobile .site-header {
  position: relative;
  left: auto;
  right: auto;
  padding-inline: 1rem;
  transform: none;
}

.editor-collapsed.preview-mobile .site-header,
.editor-collapsed.preview-mobile .portfolio {
  width: min(390px, calc(100% - var(--sidebar-rail) - 2rem));
  max-width: calc(100% - var(--sidebar-rail) - 2rem);
  margin-left: calc(var(--sidebar-rail) + 1rem);
}

.preview-mobile .frames-block {
  opacity: 0.48;
  filter: grayscale(0.55);
}

.preview-mobile .frames-block .work-form,
.preview-mobile .frames-block .editor-actions,
.preview-mobile .frames-block .work-list {
  pointer-events: none;
}

.preview-mobile .frames-block::after {
  content: "スマホレイアウト中はPC用フレーム設定をロックしています。";
  display: block;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  line-height: 1.45;
}

@media (max-width: 1120px) and (min-width: 761px) {
  .work-wall {
    left: 50%;
    width: 72rem;
    max-width: none;
    margin: 0;
    transform: translateX(-50%) scale(0.84);
    transform-origin: top center;
  }
}

@media (max-width: 1500px) and (min-width: 761px) {
  .edit-mode .work-wall {
    left: 50%;
    width: 72rem;
    max-width: none;
    margin: 0;
    transform: translateX(-50%) scale(0.74);
    transform-origin: top center;
  }
}

@media (max-width: 1180px) and (min-width: 761px) {
  .edit-mode .work-wall {
    transform: translateX(-50%) scale(0.62);
  }
}

@media (max-width: 960px) and (min-width: 761px) {
  .work-wall {
    transform: translateX(-50%) scale(0.72);
  }
}

@media (max-width: 760px) {
  body::before {
    background-size: 3.2rem 3.2rem;
  }

  .site-header {
    position: relative;
    left: auto;
    width: auto;
    height: auto;
    padding: 1.7rem 1rem 1.1rem;
    transform: none;
  }

  .brand span {
    font-size: 2.25rem;
  }

  .socials {
    gap: 0.65rem;
  }

  .portfolio {
    padding: 0.6rem 1rem 4rem;
  }

  .work-wall {
    display: grid;
    width: min(28rem, 100%);
    min-height: 0;
    gap: 1.35rem;
  }

  .work-card,
  .contact-card {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .work-card {
    justify-self: center;
    transform: translateX(var(--mobile-shift, 0)) rotate(var(--mobile-rotate, 0deg));
  }

  .work-card:hover,
  .work-card:focus-within {
    transform: translateX(var(--mobile-shift, 0)) translateY(-0.12rem) rotate(var(--mobile-rotate, 0deg));
  }

  .work-card.is-portrait {
    width: min(18rem, 74vw);
  }

  .contact-card {
    min-width: 0;
    padding-bottom: 1rem;
  }

  .video-modal {
    width: calc(100% - 1rem);
  }

  .close {
    right: 0;
  }

  .edit-mode {
    --sidebar-width: min(21rem, calc(100vw - 2rem));
  }

  .edit-mode .editor {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: var(--sidebar-width);
    height: 100vh;
    max-height: none;
  }

  .edit-mode .portfolio,
  .editor-collapsed .portfolio {
    width: 100%;
    margin-left: 0;
  }

  .edit-mode .site-header,
  .editor-collapsed .site-header {
    left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Viewing layout: simple 16:9 grid */
.site-header {
  justify-content: flex-start;
}

.brand span {
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  letter-spacing: 0;
}

.socials {
  display: none;
}

.portfolio {
  padding-top: 1.6rem;
}

.work-wall,
.preview-mobile .work-wall,
.edit-mode .work-wall {
  position: relative;
  left: auto;
  display: grid;
  width: min(74rem, 100%);
  max-width: 100%;
  min-height: 0;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.05rem;
  align-items: start;
  transform: none;
}

.work-card,
.work-card.is-portrait,
.work-card.is-square,
.preview-mobile .work-card,
.preview-mobile .work-card.is-portrait,
.contact-card,
.preview-mobile .contact-card {
  position: relative;
  inset: auto;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  min-width: 0;
  transform: none;
}

.work-card {
  z-index: auto;
  height: 100%;
  isolation: isolate;
  transform-origin: 50% 62%;
  will-change: transform, box-shadow;
  transition:
    transform 480ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 480ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 240ms ease,
    background-color 240ms ease;
}

body:not(.suppress-card-hover) .work-card:hover,
body:not(.suppress-card-hover) .work-card.is-hovering,
body:not(.suppress-card-hover) .work-card:focus-within,
body:not(.suppress-card-hover) .preview-mobile .work-card:hover,
body:not(.suppress-card-hover) .preview-mobile .work-card.is-hovering,
body:not(.suppress-card-hover) .preview-mobile .work-card:focus-within {
  border-color: rgba(36, 119, 95, 0.58);
  box-shadow: 0 1.35rem 3.2rem rgba(20, 24, 28, 0.18);
  transform: translateY(-0.48rem) scale(1.014);
}

.work-wall.has-active-card .work-card:not(.is-hovering) {
  transform: translate3d(var(--push-x, 0), var(--push-y, 0), 0);
}

.suppress-card-hover .work-wall.has-active-card .work-card {
  transform: none;
}

.thumb {
  aspect-ratio: 16 / 9;
  transform: translateZ(0);
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  box-shadow: none;
  transition: opacity 180ms ease;
}

body:not(.suppress-card-hover) .work-card:hover .thumb::after,
body:not(.suppress-card-hover) .work-card.is-hovering .thumb::after,
body:not(.suppress-card-hover) .work-card:focus-within .thumb::after {
  opacity: 0;
}

body:not(.suppress-card-hover) .work-card:hover img,
body:not(.suppress-card-hover) .work-card.is-hovering img,
body:not(.suppress-card-hover) .work-card:focus-within img,
body:not(.suppress-card-hover) .preview-mobile .work-card:hover img,
body:not(.suppress-card-hover) .preview-mobile .work-card.is-hovering img,
body:not(.suppress-card-hover) .preview-mobile .work-card:focus-within img {
  filter: none;
  transform: none;
  transition-duration: 760ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

body:not(.suppress-card-hover) .work-card:hover .play,
body:not(.suppress-card-hover) .work-card.is-hovering .play,
body:not(.suppress-card-hover) .work-card:focus-within .play {
  transform: translateY(-0.12rem) scale(1.05);
}

.play {
  z-index: 2;
  transition:
    transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 240ms ease,
    border-color 240ms ease;
}

.work-title {
  min-height: 2.35rem;
}

.work-title span,
.work-title small {
  white-space: normal;
}

.work-title small:empty {
  display: none;
}

.contact-card {
  grid-column: 1 / -1;
  margin-top: 1.2rem;
  padding-top: 1.1rem;
}

.edit-mode .thumb {
  pointer-events: auto;
}

.edit-mode .work-wall {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
  gap: 0.75rem;
}

.media-panel {
  display: grid;
  gap: 0.7rem;
}

.media-block .work-form {
  gap: 0.8rem;
}

.media-block .asset-field > div {
  grid-template-columns: 1fr 3.6rem 4.8rem;
}

.preview-mobile .portfolio {
  width: min(390px, calc(100vw - 2rem));
  min-height: 0;
  padding-bottom: 4rem;
}

.preview-mobile .work-wall {
  gap: 1rem;
}

.video-modal[open]::backdrop {
  animation: backdrop-soft-in 320ms ease both;
}

.video-modal.is-zooming {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.preview-frame {
  position: relative;
  opacity: 1;
  transform: none;
  transition: opacity 100ms linear;
  background-color: #101214;
  background-image: var(--preview-poster, none);
  background-position: center;
  background-size: cover;
}

.preview-frame::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background-image: var(--preview-poster, none);
  background-position: center;
  background-size: cover;
  opacity: 1;
  transition: opacity 620ms cubic-bezier(0.2, 0, 0.16, 1);
}

.preview-frame.is-video-revealed::before {
  opacity: 0;
}

.preview-frame.is-video-loading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 2.45rem;
  height: 2.45rem;
  pointer-events: none;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  filter: drop-shadow(0 0.5rem 1.2rem rgba(0, 0, 0, 0.32));
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: preview-loader-spin 880ms linear infinite;
  transition: opacity 180ms ease;
}

.preview-frame.is-video-revealed::after {
  opacity: 0;
  animation-play-state: paused;
}

.video-modal.is-zooming .preview-frame {
  opacity: 0;
  transform: none;
}

.video-modal.is-zooming .close {
  opacity: 0;
}

.preview-frame video {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 560ms cubic-bezier(0.22, 0.72, 0.18, 1);
}

.preview-frame.is-video-revealed video {
  opacity: 1;
}

.preview-flight {
  position: fixed;
  z-index: 80;
  overflow: hidden;
  pointer-events: none;
  background: #101214;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 1.2rem 3.2rem rgba(0, 0, 0, 0.2);
  opacity: 1;
  transform-origin: top left;
  will-change: transform, border-radius, opacity;
}

.preview-flight.is-settling {
  opacity: 0;
  transition: opacity 100ms linear;
}

.preview-flight img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
}

@keyframes backdrop-soft-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes preview-loader-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (max-width: 760px) {
  .site-header {
    padding-top: 1.35rem;
  }

  .brand span {
    font-size: clamp(1.5rem, 8.2vw, 2.05rem);
  }

  .portfolio {
    padding-top: 0.45rem;
  }

  .work-wall {
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-card,
  .thumb::after,
  .work-card img,
  .play,
  .video-modal[open],
  .video-modal[open]::backdrop,
  .preview-frame {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }

  .preview-flight {
    display: none;
  }
}
