:root {
  --bg: #f7f7f4;
  --ink: #0a0a0a;
  --accent: #ff2b2b;
  --grid: 18px;
  --border: 2px solid var(--ink);
  --mono: "Courier New", Courier, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.25;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  gap: 16px;
}


.header-right {
  display: flex;
  align-items: flex-start;
}

.menu-dropdown {
  position: relative;
}

.menu-dropdown > summary {
  list-style: none;
}

.menu-dropdown > summary::-webkit-details-marker {
  display: none;
}

.menu-dropdown[open] .menu {
  display: grid;
}

.header.hidden {
  transform: translateY(-120%);
  transition: transform 0.2s ease;
}

.header.visible {
  transform: translateY(0);
  transition: transform 0.2s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 20px;
}

.logo img {
  width: 120px;
  height: 60px;
  object-fit: cover;
  border: none;
  background: transparent;
  display: none;
}

.logo.has-image img {
  display: block;
}

.menu-dropdown .menu {
  display: none;
  gap: 10px;
  font-weight: 600;
  border: var(--border);
  background: #fff;
  padding: 12px;
  position: absolute;
  right: 0;
  top: 40px;
  min-width: 180px;
  z-index: 12;
}

.editor-body .menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  padding: 0;
  position: static;
}

.menu a {
  border: var(--border);
  padding: 6px 10px;
  background: #fff;
}

.menu .menu-button {
  border: var(--border);
  padding: 6px 10px;
  background: #fff;
}

.menu-button {
  border: var(--border);
  padding: 6px 12px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.editor-menu {
  display: flex;
  gap: 12px;
  font-weight: 600;
}

.editor-menu a {
  border: var(--border);
  padding: 6px 10px;
  background: #fff;
}

.container {
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  border-bottom: var(--border);
  padding-bottom: 24px;
}

.hero h1 {
  font-size: clamp(40px, 8vw, 92px);
  font-weight: 800;
  text-transform: uppercase;
}

.hero p {
  font-size: 18px;
  font-weight: 500;
}

.badge {
  border: var(--border);
  padding: 8px 12px;
  font-weight: 700;
  display: inline-block;
  background: var(--accent);
  color: #fff;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.project-card {
  border: var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: var(--border);
}

.project-card .content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-card p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.project-card .mono {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.divider {
  height: 2px;
  background: var(--ink);
  margin: 24px 0;
}

.project-view {
  display: none;
}

.project-view.active {
  display: block;
}

.project-mode .hero,
.project-mode #projects {
  display: none;
}

.project-mode .project-view {
  display: block;
}

.project-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
}

.project-sidebar {
  border: var(--border);
  background: #fff;
  padding: 12px;
  height: fit-content;
  position: sticky;
  top: 96px;
}

.project-sidebar h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
}

.file-list {
  display: grid;
  gap: 6px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: var(--border);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  background: #fff;
}

.file-item.active {
  background: var(--accent);
  color: #fff;
}

.file-item span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
}

.project-content {
  display: grid;
  gap: 24px;
}

.project-hero {
  border: var(--border);
  background: #fff;
  margin-bottom: 24px;
}

.project-hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-bottom: var(--border);
}

.project-meta {
  padding: 20px;
}

.project-meta h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 54px);
  font-weight: 800;
  text-transform: uppercase;
}

.project-meta p {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.preserve {
  white-space: pre-wrap;
}

.chapter {
  border: var(--border);
  background: #fff;
  margin-bottom: 24px;
  padding: 16px;
}

.chapter h4 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
}

.chapter p {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
  white-space: pre-wrap;
  text-align: left;
}

.chapter .image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.chapter .image-grid img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border: none;
  background: transparent;
}

.video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 24px;
}

.video-overlay.active {
  display: flex;
}

.video-window {
  width: min(900px, 92vw);
  background: #fff;
  border: var(--border);
  box-shadow: 10px 10px 0 #000;
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: var(--border);
  background: #f2f2ef;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #000;
}

.dot-red {
  background: #ff5f57;
}

.dot-yellow {
  background: #ffbd2e;
}

.dot-green {
  background: #28c840;
}

.window-close {
  border: var(--border);
  background: #fff;
  padding: 4px 8px;
  font-weight: 700;
  cursor: pointer;
}

.window-video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}

.footer {
  margin-top: auto;
  border-top: var(--border);
  padding: 16px 24px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mono {
  font-family: var(--mono);
}

body.mono-body {
  font-family: var(--mono);
}

.mono-body .hero h1,
.mono-body .project-meta h2,
.mono-body .project-card h3,
.mono-body .chapter h4 {
  font-family: var(--sans);
}

.editor {
  display: grid;
  gap: 16px;
}

.editor-shell {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 2fr);
}

.editor-section {
  border: var(--border);
  background: #fff;
  padding: 16px;
}

.editor-section h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  border: var(--border);
  padding: 8px;
  font-family: var(--sans);
  font-size: 14px;
  background: #fff;
}

.field textarea {
  min-height: 80px;
}

.button {
  border: var(--border);
  background: #fff;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.danger {
  background: var(--accent);
  color: #fff;
}

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

.editor-item {
  border: var(--border);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  cursor: grab;
}

.editor-item strong {
  text-transform: uppercase;
}

.editor-item.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.notice {
  border: var(--border);
  background: #fff;
  padding: 10px;
  font-size: 13px;
}

.editor-body {
  background: #f2f2ef;
}

.editor-body .header {
  background: #f2f2ef;
}

.editor-body .editor-section {
  border-radius: 12px;
  border: 1px solid #d8d8d2;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.editor-body .field input,
.editor-body .field textarea,
.editor-body .field select {
  border: 1px solid #c9c9c3;
  border-radius: 8px;
}

.editor-body .button {
  border-radius: 999px;
  border: 1px solid #111;
}

.editor-body .editor-item {
  border-radius: 10px;
  border: 1px solid #d8d8d2;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.hidden-field {
  display: none;
}

.hidden {
  display: none;
}

.dropzone {
  border: 2px dashed #c2c2bc;
  border-radius: 12px;
  padding: 16px;
  background: #fafaf6;
  display: grid;
  gap: 8px;
  cursor: pointer;
  text-align: center;
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone-active {
  border-color: #111;
  background: #fff;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.preview-grid img,
.preview-grid video {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ccc;
  background: #fff;
}

.preview-item {
  display: grid;
  gap: 4px;
  font-size: 11px;
}

.preview-item.is-dragging {
  opacity: 0.6;
}

.preview-item span {
  word-break: break-all;
}

.preview-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.preview-pill {
  border: 1px solid #c9c9c3;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #fff;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.chapter details {
  border: 1px dashed #c7c7c0;
  border-radius: 12px;
  padding: 10px;
  background: #fafaf6;
}

.chapter summary {
  cursor: pointer;
  font-weight: 700;
}

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

  .chapter .image-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-shell {
    grid-template-columns: 1fr;
  }

  .project-sidebar {
    position: static;
  }

  .editor-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .menu {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .chapter .image-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 420px) {
  .chapter .image-grid {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.preview-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preview-actions button {
  border: 1px solid #bbb;
  background: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
}
