:root {
  color-scheme: dark;
  --bg: #0d0d0c;
  --paper: #11110f;
  --text: #d8d0bd;
  --muted: #948d7f;
  --faint: #5e574c;
  --line: #2a2721;
  --accent: #dbc78e;
  --danger: #d26b57;
  --soft: rgba(219, 199, 142, 0.11);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.018), transparent 220px), var(--bg);
  color: var(--text);
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--soft); }

.site-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.site-name {
  display: inline-block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.site-line {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.route-indicator {
  margin-top: 12px;
  color: var(--faint);
  font-size: 12px;
}

.cursor {
  display: inline-block;
  width: 8px;
  color: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 18px;
  font-size: 13px;
  color: var(--muted);
}

.nav a.active { color: var(--accent); }

main { padding: 42px 0; }

.identity-strip {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 4px 0 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.identity-photo {
  width: 190px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
}

.identity-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  filter: grayscale(6%) contrast(1.03);
}

.identity-copy { min-width: 0; }
.identity-copy h2 {
  margin: 0;
  color: var(--accent);
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.055em;
}
.identity-copy p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}
.identity-role { color: var(--text) !important; font-weight: 700; }

.prompt, .mono { color: var(--faint); font-family: inherit; }
.small { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.02em; }
.muted-line { color: var(--muted); line-height: 1.8; max-width: 760px; }
.plain-title { margin: 0; font-size: clamp(38px, 8vw, 88px); line-height: 0.95; letter-spacing: -0.08em; }

.hero { padding: 8px 0 18px; max-width: 900px; }
.hero h1, .page-title h1, .post-header h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 74px);
  line-height: 0.95;
  letter-spacing: -0.075em;
  max-width: 980px;
}
.hero p:not(.prompt), .page-title p:not(.small), .post-header p:not(.small) {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}

.section {
  margin-top: 58px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.section-head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: baseline;
  margin-bottom: 18px;
}
.section-head span { color: var(--faint); font-size: 12px; }
.section-head h2, .project-entry h2, .work-entry h2, .featured-text h2, .post-body h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.04em;
}

.directory-list { border-top: 1px solid var(--line); }
.directory-row {
  display: grid;
  grid-template-columns: 44px 220px minmax(190px, 0.85fr) minmax(220px, 1.25fr) 96px;
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.row-icon {
  width: 28px;
  height: 28px;
  display: block;
  border: 1px solid var(--line);
  background: var(--paper);
  object-fit: cover;
}
.row-path { color: var(--faint); font-size: 12px; }
.row-main { color: var(--text); font-weight: 700; letter-spacing: -0.035em; }
.row-desc { color: var(--muted); line-height: 1.55; font-size: 13px; }
.row-meta { color: var(--faint); text-align: right; font-size: 12px; }

.featured-text, .project-entry, .work-entry, .post-body.slim { max-width: 780px; }
.featured-text p, .project-entry p, .post-body p, .work-entry p, .work-entry li, .post-body li {
  color: var(--muted);
  line-height: 1.85;
}
.inline-link, .back-link, button.linklike {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  border: 0;
  border-bottom: 1px solid rgba(219, 199, 142, 0.35);
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 36px;
  max-width: 840px;
}
.status-grid p {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.6;
}
.status-grid span { color: var(--faint); }

.page-title { margin-bottom: 34px; }
.search, .field, .studio-panel input, .studio-panel select, .studio-panel textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 12px 0;
  font: inherit;
  outline: none;
}
.search { margin-bottom: 28px; }
.search:focus, .field:focus, .studio-panel input:focus, .studio-panel select:focus, .studio-panel textarea:focus { border-color: var(--accent); }

.project-list, .work-list { display: grid; gap: 44px; }
.project-entry, .work-entry { border-top: 1px solid var(--line); padding-top: 20px; }
.project-entry dl { display: grid; gap: 10px; margin: 24px 0 0; }
.project-entry dl div { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.project-entry dt, .work-entry time { color: var(--faint); }
.project-entry dd { margin: 0; color: var(--muted); }

.terminal-block, .post-body pre, .studio-output pre {
  overflow-x: auto;
  margin: 24px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  line-height: 1.7;
}

.work-entry { display: grid; grid-template-columns: 1fr 220px; gap: 24px; }
.work-entry ul { grid-column: 1 / -1; margin: 0; padding-left: 20px; }

.post-page { max-width: 860px; }
.post-header { padding: 20px 0 34px; border-bottom: 1px solid var(--line); }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 24px; color: var(--faint); font-size: 12px; }
.post-body { max-width: 760px; padding-top: 16px; }
.post-body section { margin-top: 42px; }
.post-body h2 { margin-bottom: 14px; color: var(--text); }
.post-body ul { padding-left: 21px; }
.post-body figure { margin: 30px 0; }
.post-body figure img { max-width: 100%; border: 1px solid var(--line); display: block; }
.post-body figcaption { color: var(--faint); margin-top: 9px; font-size: 12px; }

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

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}
.footer a { color: var(--muted); }

/* Studio */
.studio-layout { display: grid; grid-template-columns: 280px 1fr; gap: 38px; }
.studio-sidebar { border-top: 1px solid var(--line); padding-top: 18px; }
.studio-list { display: grid; gap: 10px; margin-top: 18px; }
.studio-item { text-align: left; color: var(--muted); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; font: inherit; cursor: pointer; }
.studio-item:hover { color: var(--accent); }
.studio-main { min-width: 0; }
.studio-grid { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: 36px; }
.studio-panel, .studio-output { border-top: 1px solid var(--line); padding-top: 20px; }
.studio-panel label { display: block; margin-bottom: 22px; color: var(--faint); font-size: 12px; }
.studio-panel textarea { min-height: 180px; resize: vertical; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.studio-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 30px; }
.btn { border: 1px solid var(--line); background: transparent; color: var(--text); padding: 9px 12px; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { border-color: rgba(219,199,142,.45); color: var(--accent); }
.btn.danger { color: var(--danger); }
.section-editor { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.section-editor + .section-editor { margin-top: 28px; }
.section-tools { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--faint); font-size: 12px; }
.notice { color: var(--faint); line-height: 1.7; font-size: 13px; }
.save-status { color: var(--accent); min-height: 1.5em; }

@media (max-width: 900px) {
  .site-header, .section-head, .directory-row, .work-entry, .studio-grid, .status-grid, .identity-strip, .studio-layout, .form-row {
    grid-template-columns: 1fr;
  }
  .site-header { align-items: start; }
  .nav { justify-content: flex-start; }
  .directory-row { gap: 8px; align-items: start; }
  .row-meta { text-align: left; }
  .row-icon { margin-bottom: 4px; }
  .hero h1, .page-title h1, .post-header h1 { letter-spacing: -0.055em; }
  .identity-photo { width: 100%; max-width: 420px; }
}

.post-body a,
.studio-output .post-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(216, 196, 143, 0.35);
}

.post-body a:hover,
.studio-output .post-body a:hover {
  border-bottom-color: var(--accent);
}