: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);
}

.post-thumbnail-card {
  margin: 28px 0 34px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.post-thumbnail-copy {
  margin-bottom: 18px;
}

.post-thumbnail-kicker {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 12px;
}

.post-thumbnail-copy h2 {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 6vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.post-thumbnail-copy p {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.post-thumbnail-media {
  width: 100%;
  max-width: 760px;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}

.post-thumbnail-media img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: cover;
}

@media (max-width: 900px) {
  .post-thumbnail-copy h2 {
    font-size: clamp(26px, 9vw, 42px);
  }

  .post-thumbnail-copy p {
    font-size: 13px;
  }

  .post-thumbnail-media img {
    max-height: 320px;
  }
}

* { 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) 150px;
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.row-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
}

.post-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid rgba(216, 196, 143, 0.35);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(216, 196, 143, 0.06);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}
.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; }

.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, .code-block {
  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;
}

.inline-code {
  padding: 1px 5px;
  border: 1px solid rgba(219, 199, 142, 0.22);
  background: rgba(219, 199, 142, 0.06);
  color: var(--accent);
  font-size: 0.92em;
  border-radius: 4px;
  white-space: nowrap;
}
.code-block code {
  font: inherit;
}

/* Prism token colors */

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--faint);
}

.token.punctuation {
  color: var(--muted);
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: #d26b57;
}

.token.boolean,
.token.number {
  color: #d8a657;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #a7c080;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #dbc78e;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #7fbbb3;
}

.token.function,
.token.class-name {
  color: #e6c384;
}

.token.regex,
.token.important,
.token.variable {
  color: #d699b6;
}

.token.important,
.token.bold {
  font-weight: 700;
}

.token.italic {
  font-style: italic;
}

.token.decorator,
.token.annotation {
  color: #d699b6;
}

.token.builtin {
  color: #a7c080;
}

.token.keyword {
  color: #7fbbb3;
  font-weight: 700;
}

.token.function {
  color: #e6c384;
  font-weight: 700;
}

.token.string {
  color: #a7c080;
}

.token.operator {
  color: #dbc78e;
}

.token.number,
.token.boolean {
  color: #d8a657;
}

.token.comment {
  color: var(--faint);
  font-style: italic;
}

.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: 1040px; }
.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; }

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.site-shell,
main,
.post-page,
.post-layout,
.post-body {
  min-width: 0;
}

.post-body {
  width: 100%;
  max-width: 760px;
}

.post-body p,
.post-body li {
  overflow-wrap: break-word;
  word-break: normal;
}

.post-body pre,
.code-block {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.post-body pre code,
.code-block code {
  display: block;
  min-width: max-content;
}

html {
  scroll-behavior: smooth;
}

.post-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 760px);
  gap: 42px;
  align-items: start;
}

.post-toc {
  position: sticky;
  top: 28px;
  padding-top: 16px;
  color: var(--faint);
  font-size: 12px;
}

.post-toc-label {
  margin-bottom: 18px;
  color: var(--faint);
  font-size: 11px;
  text-transform: lowercase;
}

.post-toc a {
  display: block;
  margin-bottom: 14px;
  color: var(--faint);
  line-height: 1.45;
}

.post-toc a::before {
  content: "- ";
}

.post-toc a:hover {
  color: var(--accent);
}

.post-section {
  scroll-margin-top: 36px;
}

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

/* Featured article carousel */

.featured-carousel-section {
  margin-top: 58px;
}

.featured-carousel {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.featured-carousel-window {
  position: relative;
  width: 100%;
  min-height: 420px;
  overflow: hidden;
}

.featured-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(18px);
  transition:
    opacity 350ms ease,
    transform 350ms ease,
    visibility 350ms;
}

.featured-slide.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.featured-slide-link {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  width: 100%;
  min-height: 420px;
}

.featured-slide-link:hover {
  color: inherit;
}

.featured-slide-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 44px 42px 44px 0;
}

.featured-slide-copy h3 {
  max-width: 520px;
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 4.5vw, 54px);
  line-height: 1;
  letter-spacing: -0.065em;
}

.featured-slide-summary {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.featured-slide-action {
  width: fit-content;
  margin-top: 26px;
  color: var(--accent);
  font-size: 13px;
  border-bottom: 1px solid rgba(219, 199, 142, 0.35);
}

.featured-slide-media {
  width: 100%;
  min-width: 0;
  height: 420px;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--bg);
}

.featured-slide-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

.featured-carousel-controls {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid var(--line);
}

.featured-carousel-controls > button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.featured-carousel-controls > button:last-child {
  justify-self: end;
}

.featured-carousel-controls > button:hover,
.featured-carousel-controls > button:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.featured-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.featured-carousel-dot {
  width: 28px;
  height: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.featured-carousel-dot::before {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: var(--line);
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.featured-carousel-dot:hover::before,
.featured-carousel-dot:focus-visible::before {
  background: var(--muted);
}

.featured-carousel-dot.active::before {
  background: var(--accent);
  transform: scaleY(2);
}
/* Explore directory */


.explore-section {
  margin-top: 72px;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.explore-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 230px;
  padding: 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.explore-card:hover {
  color: var(--text);
  background: var(--paper);
}

.explore-card:focus-visible {
  z-index: 1;
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.explore-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.explore-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 18px;
}

.explore-card-arrow {
  color: var(--faint);
  font-size: 15px;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.explore-card:hover .explore-card-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

.explore-card-copy {
  margin-top: 38px;
}

.explore-card-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.explore-card-copy p {
  max-width: 34ch;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.explore-card-footer {
    margin-top: auto;
    padding-top: 28px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 12px;
}

.explore-card-count {
    color: var(--muted);
    font-weight: 600;
}

.explore-card-path {
    color: var(--faint);
}

@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 {
    justify-content: flex-start;
    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-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .post-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--line);
  }

  .post-toc-label {
    width: 100%;
    margin-bottom: 4px;
  }

  .post-toc a {
    margin: 0;
  }
  
  .site-shell {
    width: min(100% - 28px, 1040px);
  }

  .post-page {
    max-width: 100%;
  }

  .post-body {
    max-width: 100%;
  }

  .inline-code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .featured-carousel-window {
    min-height: 0;
  }

  .featured-slide-link {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .featured-slide-copy {
    padding: 30px 0;
  }

  .featured-slide-copy h3 {
    font-size: clamp(28px, 9vw, 44px);
  }

  .featured-slide-media {
    order: -1;
    height: auto;
    aspect-ratio: 16 / 9;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .featured-carousel-controls {
    grid-template-columns: 42px 1fr 42px;
  }

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

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

@media (prefers-reduced-motion: reduce) {
  .featured-slide {
    transition: none;
  }
}

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

  .explore-card {
    min-height: 210px;
  }
}

.closing-quote {
    margin: 140px 0 80px;
    padding-top: 48px;
    border-top: 1px solid var(--line);

    text-align: center;
}

.closing-quote blockquote {
    max-width: 760px;
    margin: 0 auto;

    color: var(--text);
    font-size: clamp(13px, 2vw, 20px);
    line-height: 1.45;
    letter-spacing: -0.03em;
    font-style: italic;
}

.closing-quote p {
    margin-top: 24px;

    color: var(--muted);
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
