:root {
  color-scheme: light;
  --bg: #f5f3ef;
  --surface: #ffffff;
  --ink: #171717;
  --muted: #68645d;
  --line: #ded9d0;
  --accent: #0f766e;
  --accent-dark: #0b514d;
  --warm: #b45309;
  --shadow: 0 18px 45px rgba(23, 23, 23, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  min-height: 44px;
  padding: 0 18px;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(18px, 4vw, 42px);
  min-height: 168px;
  padding: 0 clamp(20px, 5vw, 64px);
  border-bottom: 1px solid rgba(222, 217, 208, 0.8);
  background: rgba(245, 243, 239, 0.92);
  backdrop-filter: blur(18px);
}

.home-header {
  justify-content: flex-start;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand-logo {
  width: 144px;
  height: 144px;
  object-fit: contain;
}

.header-intro {
  flex: 1 1 auto;
  min-width: 0;
}

.header-title {
  margin: 0;
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.admin-entry,
.back-link,
.text-button {
  color: var(--muted);
  font-size: 14px;
}

.admin-entry:hover,
.back-link:hover,
.text-button:hover {
  color: var(--accent-dark);
}

.text-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.text-button:hover {
  background: transparent;
  transform: none;
}

.home-shell,
.detail-shell,
.admin-shell,
.legal-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: 64px;
  line-height: 1;
  letter-spacing: 0;
}

.home-title {
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intro-copy {
  max-width: none;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-wrap {
  padding: 34px 0 80px;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.gallery-toolbar p {
  margin: 0;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.work-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 23, 23, 0.06);
  break-inside: avoid;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.play-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.74);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.work-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: var(--shadow);
}

.work-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #f0ece4;
}

.work-card-content {
  padding: 16px;
}

.work-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

.tool-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 650;
}

.empty-state {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.empty-state h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 28px;
}

.detail-shell {
  padding: 34px 0 80px;
}

.legal-shell {
  padding: 34px 0 72px;
}

.detail-loading {
  margin-top: 32px;
  color: var(--muted);
}

.detail-view {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  margin-top: 28px;
}

.detail-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-media img,
.detail-media video {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #f0ece4;
}

.detail-media video {
  height: auto;
  max-height: min(78vh, 900px);
}

.detail-info {
  padding-top: 8px;
}

.detail-info h1 {
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.05;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 34px;
}

.process-block {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.process-block h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.process-block p {
  margin: 0;
  color: #35322e;
  line-height: 1.85;
  white-space: pre-wrap;
}

.legal-page {
  max-width: 860px;
  margin-top: 28px;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 23, 23, 0.05);
}

.legal-page h1 {
  max-width: none;
  font-size: clamp(38px, 5vw, 58px);
}

.legal-date {
  margin: 16px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

.legal-page section {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.legal-page section + section {
  margin-top: 24px;
}

.legal-page h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.legal-page p {
  margin: 0;
  color: #35322e;
  line-height: 1.85;
}

.legal-page p + p {
  margin-top: 12px;
}

.site-footer {
  border-top: 1px solid rgba(222, 217, 208, 0.8);
  color: var(--muted);
  background: rgba(245, 243, 239, 0.76);
}

.admin-body .site-footer {
  background: rgba(247, 247, 244, 0.76);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  font-size: 14px;
}

.footer-inner span {
  font-weight: 700;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.footer-inner a:hover {
  color: var(--accent-dark);
}

.admin-body {
  background: #f7f7f4;
}

.admin-header {
  background: rgba(247, 247, 244, 0.92);
}

.admin-header .text-button {
  flex: 0 0 auto;
  margin-left: auto;
}

.admin-shell {
  padding: 38px 0 80px;
}

.auth-panel {
  max-width: 460px;
  margin: 46px auto 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel h1,
.dashboard-title h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.stack-form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.compact-form {
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #36332f;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbc4b8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.7;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.hint,
.muted {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.dashboard-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.dashboard-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.dashboard-account p {
  margin: 0;
}

.password-drawer {
  margin-bottom: 20px;
}

.password-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.admin-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 23, 23, 0.05);
}

.admin-section.full {
  margin-top: 20px;
}

.admin-section h2 {
  margin: 0;
  font-size: 22px;
}

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

.search-field {
  width: min(320px, 100%);
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.search-field input {
  min-height: 40px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  margin: 18px 0;
}

.compact-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.compact-row,
.admin-work-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf8;
}

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.account-row {
  align-items: start;
}

.account-info {
  display: grid;
  gap: 4px;
}

.reset-password-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  width: min(320px, 100%);
}

.reset-password-form input {
  min-height: 36px;
  padding: 7px 10px;
}

.admin-work-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.admin-work-list > .muted {
  grid-column: 1 / -1;
}

.admin-work-item {
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  break-inside: avoid;
  box-shadow: 0 10px 28px rgba(23, 23, 23, 0.05);
}

.admin-work-preview {
  display: block;
  background: #f0ece4;
}

.admin-work-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #f0ece4;
}

.admin-work-main {
  min-width: 0;
  padding: 14px;
}

.admin-work-main h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.admin-work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.12);
  color: #7c3b0a;
  font-size: 13px;
  font-weight: 650;
}

.admin-work-main p {
  display: -webkit-box;
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.6;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.admin-work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}

.small-button:hover {
  background: var(--accent-dark);
  color: #fff;
}

.subtle-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.subtle-button:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: #f0faf7;
  color: var(--accent-dark);
}

.danger-button {
  background: #8f1d1d;
}

.danger-button:hover {
  background: #6f1515;
}

.work-editor textarea {
  min-height: 240px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: #effaf7;
  color: var(--accent-dark);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  h1 {
    font-size: 48px;
  }

  .header-title {
    font-size: 48px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-work-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-view,
  .admin-layout,
  .password-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 116px;
    padding: 0 18px;
    gap: 12px;
  }

  .brand-logo {
    width: 88px;
    height: 88px;
  }

  .home-shell,
  .detail-shell,
  .admin-shell,
  .legal-shell {
    width: min(100% - 28px, 1180px);
  }

  h1 {
    font-size: 31px;
  }

  .header-title {
    font-size: 31px;
  }

  .intro-copy {
    font-size: 11px;
  }

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

  .inline-form {
    grid-template-columns: 1fr;
  }

  .account-row,
  .reset-password-form {
    grid-template-columns: 1fr;
  }

  .account-row {
    display: grid;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-work-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .dashboard-title,
  .dashboard-account {
    align-items: start;
    flex-direction: column;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 28px, 1180px);
    padding: 18px 0;
  }

  .footer-inner nav {
    justify-content: flex-start;
  }

  .work-card,
  .admin-work-item {
    margin: 0;
  }

  .work-card-content,
  .admin-work-main {
    padding: 11px;
  }

  .work-card h2,
  .admin-work-main h3 {
    font-size: 15px;
  }

  .admin-work-actions {
    gap: 6px;
  }

  .small-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 27px;
  }

  .header-title {
    font-size: 27px;
  }

  .intro-copy {
    font-size: 9px;
  }
}
