:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-muted: #eef2ef;
  --text: #101315;
  --muted: #5c6670;
  --border: #d5ddd9;
  --accent: #1d766f;
  --accent-dark: #12514d;
  --warn: #a15c00;
  --danger: #a23a2d;
  --shadow: 0 18px 45px rgba(16, 19, 21, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Plus Jakarta Sans",
    "Inter",
    "Segoe UI",
    system-ui,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  background: #96a5a0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(29, 118, 111, 0.45);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(247, 248, 245, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 45%, rgba(255, 255, 255, 0.85) 45% 55%, transparent 55%),
    var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a,
.login-trigger {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  font-weight: 700;
}

.nav-links a:hover,
.login-trigger:hover {
  background: var(--surface-muted);
  color: var(--text);
}

main {
  padding: 0 clamp(16px, 4vw, 48px) 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1.18fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: end;
  min-height: min(680px, calc(100vh - 72px));
  padding: clamp(32px, 6vw, 88px) 0 32px;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.04;
}

.hero-copy p {
  max-width: 640px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-preview {
  min-height: 340px;
  border-radius: 8px;
  overflow: hidden;
  background: #111816;
  box-shadow: var(--shadow);
}

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

.empty-preview,
.detail-empty,
.state-message {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.scene-sidebar,
.scene-detail,
.admin-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.scene-sidebar,
.admin-area {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-heading span {
  color: var(--muted);
  font-weight: 700;
}

.search-form label,
.admin-login label {
  display: block;
  margin: 12px 0 6px;
  color: #334047;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--text);
}

.scene-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.scene-card {
  width: 100%;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.scene-card:hover,
.scene-card.is-active {
  border-color: rgba(29, 118, 111, 0.55);
  background: #f4fbf8;
}

.scene-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.02rem;
}

.scene-card span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.scene-detail {
  overflow: hidden;
}

.detail-media {
  background: #111816;
}

.detail-media img,
.detail-media video {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.detail-body {
  padding: clamp(20px, 3vw, 34px);
}

.detail-body h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.12;
}

.detail-description {
  max-width: 860px;
  color: var(--muted);
}

.detail-meta,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.meta-item,
.metric-item {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.meta-item span,
.metric-item span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.meta-item strong,
.metric-item strong {
  display: block;
  margin-top: 4px;
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.admin-area {
  margin-top: 24px;
}

.admin-grid {
  display: block;
}

.admin-summary {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
}

.form-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.form-message.is-error {
  color: var(--danger);
}

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

.metric-row {
  min-height: 112px;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.metric-row strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.admin-scenes {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-scene-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.admin-scene-row h3 {
  margin: 0;
}

.admin-scene-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.delete-button {
  background: #fff2ee;
  color: var(--danger);
  border: 1px solid #efc4b9;
}

.delete-button:hover {
  background: #f8ded7;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 800;
}

.status-chip.is-published {
  background: #e5f5ef;
  color: var(--accent-dark);
}

.status-chip.is-deleted {
  background: #fff2d8;
  color: var(--warn);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 19, 21, 0.45);
}

.login-modal {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(16, 19, 21, 0.22);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 0;
}

.modal-heading h2 {
  margin: 0;
}

.icon-button {
  width: 40px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
}

.icon-button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.login-form {
  padding: 18px 20px 20px;
}

.login-form label {
  display: block;
  margin: 12px 0 6px;
  color: #334047;
  font-weight: 800;
}

.login-form button {
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .hero,
  .workspace,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .detail-meta,
  .metrics-grid,
  .admin-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
  }

  .nav-links a {
    flex: 1;
    text-align: center;
  }

  .search-row,
  .admin-scene-row {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
