:root {
  /* Aligned with subfunc_design/colors_and_type.css.
     Warm-linen ground, plum lead, oxide companion. Squared corners,
     hairline rules, low chroma. Names kept for backwards compat. */
  --bg: #f8f6f1;            /* warm linen ground */
  --bg-2: #f4f1ea;          /* recessed surfaces */
  --surface: #f8f6f1;
  --text-main: #151515;
  --text-2: #3a3a37;
  --text-muted: #7d7d78;
  --text-faint: #a8a8a2;
  --line: #e5e3dc;
  --line-strong: #d2cfc6;
  --line-faint: #ece9e1;
  --accent: #efece4;

  /* Accent family — design system. */
  --accent-plum: #8f84b8;       /* LEAD */
  --accent-oxide: #b58f82;      /* COMPANION */
  --accent-sage: #aab7a8;
  --accent-bluegrey: #9eacbc;
  --accent-clay: #cab2a7;
  --accent-amber: #c9b99a;
  --accent-stone: #c8c5be;

  /* Tints (background washes for tinted underline / strip). */
  --tint-plum: #ece8f3;
  --tint-oxide: #f1e6e1;
  --tint-sage: #e6ebe5;

  /* Backwards-compat aliases used through the file. */
  --terra: var(--accent-plum);
  --sage: var(--accent-sage);
  --slate: var(--accent-bluegrey);
  --section-accent: var(--accent-plum);
  --section-accent-soft: rgba(143, 132, 184, 0.08);
}

body.section-home     { --section-accent: var(--accent-plum);     --section-accent-soft: rgba(143, 132, 184, 0.08); }
body.section-art      { --section-accent: var(--accent-sage);     --section-accent-soft: rgba(170, 183, 168, 0.10); }
body.section-tangents { --section-accent: var(--accent-plum);     --section-accent-soft: rgba(143, 132, 184, 0.08); }
body.section-subtext  { --section-accent: var(--accent-stone);    --section-accent-soft: rgba(200, 197, 190, 0.10); }
body.section-biotech  { --section-accent: var(--accent-bluegrey); --section-accent-soft: rgba(158, 172, 188, 0.10); }
body.section-academia { --section-accent: var(--accent-oxide);    --section-accent-soft: rgba(181, 143, 130, 0.08); }
body.section-ai       { --section-accent: var(--accent-clay);     --section-accent-soft: rgba(202, 178, 167, 0.10); }
body.section-thoughts { --section-accent: var(--accent-bluegrey); --section-accent-soft: rgba(158, 172, 188, 0.10); }
body.section-about    { --section-accent: var(--accent-sage);     --section-accent-soft: rgba(170, 183, 168, 0.10); }
body.section-work     { --section-accent: var(--accent-amber);    --section-accent-soft: rgba(201, 185, 154, 0.10); }

body, html {
  margin: 0; padding: 0;
  background-color: var(--bg);
  font-family: 'Inter', sans-serif; color: var(--text-main);
  scroll-behavior: smooth;
  text-transform: lowercase;
}

/* Subtle paper grain — fixed, low-alpha, registers as warmth only. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url('/img/brand/paper-grain.svg');
  background-size: 220px 220px;
  opacity: 0.55;
  mix-blend-mode: multiply;
  z-index: 0;
}
.layout, .shell, main, aside { position: relative; z-index: 1; }

.mono { font-family: 'JetBrains Mono', monospace; }

/* Layout
   Mirrors the homepage shell so section pages don't shift visual systems. */
.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* Sidebar */
aside {
  border-right: 1px solid var(--line);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  overflow: hidden;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mobile-sidebar-bar {
  display: block;
}

.mobile-nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-main);
  padding: 0.45rem 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
}

.sidebar-sticky {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  height: 100%;
}

.sidebar-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2.5rem;
  min-height: 0;
}

.sidebar-panel[hidden] {
  display: none !important;
}

.site-title {
  font-size: 11px;
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.site-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--section-accent);
  margin-top: 0.4rem;
  letter-spacing: 0.04em;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

nav a {
  text-decoration: none;
  color: inherit;
  transition: color 0.12s;
  display: block;
}

nav a:hover { color: var(--text-main); }
nav a.active { color: var(--section-accent); font-weight: 600; }

.sidebar-foot {
  margin-top: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  line-height: 2;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.sidebar-foot a {
  color: inherit;
  text-decoration: none;
}

.sidebar-foot a:hover {
  color: var(--text-main);
}

.sidebar-foot span {
  display: block;
}

/* Main Content */
main {
  overflow: auto;
  padding: 2.5rem;
  max-width: none;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  aside {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0.95rem 1rem 0.85rem;
    gap: 0.75rem;
  }

  .mobile-sidebar-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
  }

  .sidebar-sticky {
    gap: 0.75rem;
    height: auto;
  }

  .sidebar-panel {
    gap: 0.9rem;
  }

  body:not(.nav-open) .sidebar-panel {
    display: none;
  }

  nav {
    flex-direction: column;
    gap: 0.75rem;
    font-size: 11px;
    line-height: 1.4;
    padding-top: 0.2rem;
  }

  nav a {
    display: block;
  }

  .sidebar-foot {
    margin-top: 0;
    display: block;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    font-size: 8px;
    line-height: 1.8;
  }

  .sidebar-foot span {
    display: block;
  }

  main {
    padding: 1.25rem 1rem 2rem;
  }
}

/* Typography */
h1 {
  font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 300;
  line-height: 0.85; letter-spacing: -0.05em; margin: 0 0 0 -0.2rem;
}
.subtitle { margin-top: 2.5rem; max-width: 450px; font-size: 1.2rem; line-height: 1.6; color: var(--text-muted); font-weight: 300; }

.section { margin-top: 4rem; }
.section-header { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 2rem; }
h2 { font-size: 2.5rem; font-weight: 300; margin: 0.5rem 0 0 -0.1rem; letter-spacing: -0.04em; line-height: 1; }
.section-tag { font-size: 11px; color: var(--section-accent); letter-spacing: 0.15em; }

/* Section shell = top rule + headline/meta block for section index pages. */
.section-shell {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.section-shell + .section-shell {
  margin-top: 4rem;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--section-accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.section-headline {
  font-size: clamp(2.75rem, 6vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
  margin: 0;
  color: var(--section-accent);
}

.section-deck {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 38rem;
  margin: 0;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.section-main {
  min-width: 0;
}

.work-list.compact {
  margin-top: 1.5rem;
}

.bio-text p { font-size: 1.18rem; max-width: 600px; color: var(--text-main); line-height: 1.55; margin-bottom: 1.25rem; }
.bio-text p:last-child { color: var(--text-muted); font-size: 0.98rem; }

.subsection { margin-top: 4rem; }
.subsection-title { font-size: 14px; color: var(--text-muted); letter-spacing: 0.1em; border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; margin-bottom: 0; border-left: 2px solid var(--section-accent); padding-left: 0.6rem; }
.subsection .work-list { margin-top: 0; border-top: none; }

.underline-link { color: var(--text-main); text-decoration: none; border-bottom: 1px solid var(--text-main); padding-bottom: 2px; transition: border-color 0.2s; font-size: 12px; letter-spacing: 0.05em; }
.underline-link:hover { border-color: transparent; }

.opacity-50 { opacity: 0.5; }

p { font-size: 0.98rem; line-height: 1.72; color: var(--text-muted); margin-bottom: 1.5rem; max-width: 550px; font-weight: 300; }

/* Work/Tangent/Blog list items */
.work-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 3rem; }
.work-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  text-decoration: none; padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  transition: transform 0.2s;
  gap: 1.5rem;
}
.work-item:hover { transform: translateX(6px); }
.work-item:hover .work-item-title { color: var(--section-accent); }
.work-item-left { display: flex; flex-direction: column; gap: 0.3rem; }
.work-item-title { font-size: 1.1rem; color: var(--text-main); font-weight: 500; transition: color 0.15s; }
.work-item-tagline { font-size: 0.85rem; color: var(--text-muted); font-weight: 300; line-height: 1.5; max-width: 480px; }
.work-item-right { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-end; flex-shrink: 0; }
.work-item-meta { font-size: 0.85rem; color: var(--text-muted); text-align: right; }
.work-status { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.06em; color: var(--text-muted); opacity: 0.6; white-space: nowrap; }
.work-status.s-active   { color: var(--section-accent);  opacity: 1; }
.work-status.s-ongoing  { color: var(--sage);   opacity: 1; }
.work-status.s-complete { color: var(--slate);  opacity: 1; }
.work-item[data-status="active"] .work-item-title { color: var(--section-accent); }
.work-item[data-status="ongoing"] .work-item-title { color: var(--sage); }
.writing-item {
  align-items: center;
}
.work-item-thumb {
  width: 120px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* 3D Illustrations */
.illustration-box {
  width: 100%; height: 400px; margin: 4rem 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden; background: var(--surface);
}
.illustration-label {
  position: absolute; top: 1.5rem; left: 0; z-index: 2;
  font-size: 10px; letter-spacing: 0.15em; color: var(--text-muted);
}
.illustration-hint {
  position: absolute; bottom: 1.5rem; right: 0; z-index: 2;
  font-size: 10px; letter-spacing: 0.1em; color: var(--text-muted); opacity: 0.6;
}
.canvas-target { width: 100%; height: 100%; display: block; outline: none; cursor: grab; }
.canvas-target:active { cursor: grabbing; }

/* Page-level content (tangent detail, blog post) */
/* Project/Tangent Container */
.project-container { margin-top: 1rem; }
.project-header { border-bottom: 1px solid var(--line); padding-bottom: 2rem; margin-bottom: 2.5rem; }
.project-title-row { display: flex; justify-content: space-between; align-items: flex-start; }
.project-badges { display: flex; gap: 0.5rem; }
.badge { font-size: 10px; padding: 0.2rem 0.6rem; border-radius: 0; text-transform: uppercase; letter-spacing: 0.05em; }
.status-active     { background: transparent; color: var(--section-accent);  border: 1px solid var(--section-accent); }
.status-experimental { background: transparent; color: var(--text-muted); border: 1px solid var(--line); }
.status-ongoing    { background: transparent; color: var(--sage);   border: 1px solid var(--sage); }
.status-complete   { background: transparent; color: var(--slate);  border: 1px solid var(--slate); }
.status-ice        { background: transparent; color: var(--slate);  border: 1px solid var(--line); }
.badge.version { border: 1px solid var(--line); color: var(--text-muted); }

.project-tagline { margin-top: 1.5rem !important; margin-bottom: 2rem !important; max-width: 600px !important; }

.project-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; font-size: 11px; color: var(--text-muted); }
.meta-item .label { color: var(--text-main); font-weight: 500; margin-right: 0.5rem; }
.meta-item a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.disclaimer-box { background: rgba(255, 249, 196, 0.3); border: 1px solid rgba(251, 192, 45, 0.2); padding: 1rem; margin: 3rem 0; font-size: 11px; display: flex; gap: 1rem; align-items: center; color: var(--text-muted); }

.meta-item .launch-btn {
  display: inline-block;
  color: var(--text-main) !important;
  padding: 0;
  border-radius: 0;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px !important;
  font-weight: 500;
  margin-left: 0.5rem;
  transition: opacity 0.2s;
}
.meta-item .launch-btn:hover { opacity: 0.6; }
.disclaimer-icon { font-size: 1.2rem; }

.project-content, .project-changelog { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 3rem; overflow: hidden; }
.readme-header { background: transparent; padding: 0.75rem 0; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: 0.1em; display: flex; align-items: center; gap: 0.5rem; color: var(--section-accent); }
.readme-body { padding: 1.35rem 1.5rem; }

/* ai post screenshot */
.ai-screenshot { margin: 2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.5rem 0 0.8rem; }
.ai-screenshot img { display: block; max-width: 480px; height: auto; }

/* demo video */
.demo-video { margin: 2rem 0 3rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.demo-video video { display: block; width: 100%; max-height: 80vh; object-fit: contain; background: #111; }
.demo-embed { margin: 2rem 0 3rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.5rem 0 0.8rem; }
.detail-image { display: block; width: 100%; max-height: 80vh; object-fit: contain; background: var(--surface); }
.demo-embed iframe { display: block; width: 100%; max-width: 100%; min-height: 420px; border: 0; background: var(--surface); }
.demo-caption { font-size: 10px; color: var(--text-muted); padding: 0.5rem 0; letter-spacing: 0.04em; }
.changelog-body { padding: 1rem 1.2rem; font-size: 11px; line-height: 2; }
.log-entry { display: flex; gap: 1rem; border-bottom: 1px dashed var(--line); padding: 0.2rem 0; }
.log-entry:last-child { border-bottom: none; }
.log-date { color: var(--text-muted); min-width: 70px; }

/* Science / Art Gallery */
.art-list { margin-top: 3rem; }
.art-list-item { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 1.2rem; }
.art-list-thumb { width: 96px; aspect-ratio: 4/3; object-fit: cover; border: 1px solid var(--line); background: #f5f5f5; }

/* Back link (shared across tangents, paintings, etc.) */
.back-link { display: inline-block; font-size: 11px; letter-spacing: 0.1em; color: var(--text-muted); text-decoration: none; margin-bottom: 3rem; transition: color 0.2s; }
.back-link:hover { color: var(--section-accent); }

/* Painting detail page */
.painting-detail { margin-top: 1rem; }
.painting-image-wrap { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.painting-image { width: 100%; display: block; max-height: 72vh; object-fit: contain; background: var(--surface); }
.painting-caption { padding-top: 2rem; }
.painting-title { font-size: 1.4rem; font-weight: 400; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.painting-medium { font-size: 10px; color: var(--text-muted); letter-spacing: 0.12em; display: block; margin-bottom: 1.5rem; }
.painting-body { font-size: 1rem; color: var(--text-muted); max-width: 480px; line-height: 1.7; margin: 0; }

/* Exhibition detail page */
.exhibition-detail { margin-top: 1rem; }
.exhibition-hero { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 3rem; background: #000; }
.exhibition-hero-img { width: 100%; display: block; max-height: 80vh; object-fit: contain; }
.exhibition-header { margin-bottom: 3rem; }
.exhibition-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; margin: 2rem 0; border-top: 1px solid var(--line); padding-top: 2rem; font-size: 11px; color: var(--text-muted); }
.exhibition-meta-item .label { display: block; color: var(--text-main); font-weight: 500; margin-bottom: 0.3rem; letter-spacing: 0.08em; }
.exhibition-meta-item .value { line-height: 1.6; }
.exhibition-body { margin-bottom: 3rem; }
.exhibition-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line); margin: 3rem 0; border: 1px solid var(--line); }
.exhibition-images img { width: 100%; display: block; object-fit: cover; aspect-ratio: 3/4; background: #111; }
.exhibition-link { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 11px; letter-spacing: 0.1em; color: var(--text-main); text-decoration: none; border-bottom: 1px solid var(--text-main); padding-bottom: 2px; transition: opacity 0.2s; margin-bottom: 4rem; }
.exhibition-link:hover { opacity: 0.5; }

/* News feed (home page latest section) */
.news-feed { border-top: 1px solid var(--line); margin-top: 2rem; }
.news-item { display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: start; padding: 1.5rem 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: transform 0.2s; }
.news-item:hover { transform: translateX(6px); }
.news-type { font-size: 10px; letter-spacing: 0.12em; color: var(--text-muted); padding-top: 0.25rem; white-space: nowrap; }
.news-title { font-size: 1rem; color: var(--text-main); font-weight: 500; margin-bottom: 0.4rem; }
.news-meta { font-size: 10px; color: var(--text-muted); letter-spacing: 0.08em; margin-bottom: 0.6rem; }
.news-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; max-width: 440px; margin: 0; }
.news-arrow { font-size: 11px; color: var(--text-muted); letter-spacing: 0.1em; padding-top: 0.25rem; }
.news-item:hover .news-title { color: var(--section-accent); }

/* Shared detail pages */
.page-header {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.1rem;
  margin-bottom: 2rem;
}

.page-meta {
  margin-top: 0.9rem;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.page-body {
  max-width: 42rem;
}

.page-body p,
.readme-body p,
.painting-body p,
.exhibition-body p {
  max-width: 40rem;
  font-size: 0.98rem;
  line-height: 1.72;
}

.page-body h2,
.readme-body h2,
.exhibition-body h2 {
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 2.4rem 0 1rem;
}

.page-body h3,
.readme-body h3,
.exhibition-body h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 2rem 0 0.7rem;
  letter-spacing: -0.01em;
}

.page-body ul,
.page-body ol,
.readme-body ul,
.readme-body ol,
.exhibition-body ul,
.exhibition-body ol {
  color: var(--text-muted);
  max-width: 38rem;
  line-height: 1.8;
  padding-left: 1.2rem;
}

.page-body li + li,
.readme-body li + li,
.exhibition-body li + li {
  margin-top: 0.35rem;
}

.section-empty {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

@media (min-width: 900px) {
  .section-head {
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.8fr);
    align-items: end;
  }

  .section-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.75fr);
    gap: 3rem;
  }
}

@media (max-width: 720px) {
  .writing-item {
    align-items: flex-start;
  }

  .work-item-thumb {
    width: 96px;
  }

  .art-list-item {
    grid-template-columns: 72px 1fr;
  }

  .art-list-thumb {
    width: 72px;
  }

  .art-list-item .work-item-right {
    grid-column: 2;
    align-items: flex-start;
  }
}

/* Editor */
.editor-shell {
  display: grid;
  gap: 2rem;
  margin-top: 1rem;
}

@media (min-width: 1100px) {
  .editor-shell {
    grid-template-columns: minmax(240px, 280px) minmax(300px, 420px) minmax(0, 1fr);
    align-items: start;
  }
}

.editor-panel {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.editor-kicker,
.editor-help,
.editor-meta,
.editor-empty,
.editor-status,
.editor-save-note,
.editor-list button,
.editor-label,
.editor-input,
.editor-textarea,
.editor-select,
.editor-preview-link,
.editor-auth-row button {
  font-family: 'JetBrains Mono', monospace;
}

.editor-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--terra);
  margin-bottom: 0.85rem;
}

.editor-help,
.editor-meta,
.editor-empty,
.editor-status,
.editor-save-note {
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: none;
}

.editor-auth {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.editor-auth-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.editor-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.editor-input,
.editor-textarea,
.editor-select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-main);
  font-size: 12px;
  padding: 0.75rem 0.8rem;
  border-radius: 0;
  outline: none;
}

.editor-input:focus,
.editor-textarea:focus,
.editor-select:focus {
  border-color: var(--text-main);
}

.editor-textarea {
  min-height: 220px;
  line-height: 1.7;
  resize: vertical;
}

.editor-auth-row button,
.editor-save-row button,
.editor-list button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-main);
  padding: 0.65rem 0.8rem;
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, color 0.16s;
}

.editor-auth-row button:hover,
.editor-save-row button:hover,
.editor-list button:hover {
  border-color: var(--text-main);
  transform: translateX(4px);
}

.editor-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.editor-list button {
  text-align: left;
}

.editor-list button.is-active {
  border-color: var(--text-main);
  color: var(--terra);
}

.editor-list-title {
  display: block;
  font-size: 11px;
  color: var(--text-main);
  margin-bottom: 0.3rem;
}

.editor-list-meta {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.editor-save-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.5rem;
}

.editor-status {
  min-height: 1.5rem;
}

.editor-preview-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 70vh;
}

.editor-preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0;
}

.editor-preview-link {
  font-size: 11px;
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px solid var(--text-main);
  padding-bottom: 2px;
}

.editor-preview {
  width: 100%;
  height: 68vh;
  border: none;
  display: block;
  background: white;
}

/* Paper thumbnails */
.paper-thumbnail {
  width: 100%; aspect-ratio: 5/3; background: #f5f5f5;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  padding: 1.2rem; box-sizing: border-box;
}
.paper-thumbnail-label { font-size: 11px; letter-spacing: 0.1em; color: var(--text-muted); }
.paper-thumbnail-year { font-size: 2rem; font-weight: 300; color: var(--text-main); letter-spacing: -0.02em; line-height: 1; margin-top: 0.3rem; }

/* ─────────────────────────────────────────────────────────────
   Ornament — rule endpoints (design-system D3 device).
   Applied only to major structural rules, not list-item dividers,
   so the page reads as a document, not a checkered grid.
   ───────────────────────────────────────────────────────────── */
.section-shell,
.work-list,
.news-feed,
.page-header,
.project-content,
.project-changelog,
.illustration-box,
.painting-image-wrap,
.exhibition-hero,
.demo-video,
.demo-embed,
.ai-screenshot {
  position: relative;
}
.section-shell::before, .section-shell::after,
.work-list::before, .work-list::after,
.news-feed::before, .news-feed::after,
.page-header::before, .page-header::after,
.project-content::before, .project-content::after,
.project-changelog::before, .project-changelog::after,
.illustration-box::before, .illustration-box::after,
.painting-image-wrap::before, .painting-image-wrap::after,
.exhibition-hero::before, .exhibition-hero::after,
.demo-video::before, .demo-video::after,
.demo-embed::before, .demo-embed::after,
.ai-screenshot::before, .ai-screenshot::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--line-strong);
  pointer-events: none;
}
.section-shell::before, .work-list::before, .news-feed::before,
.page-header::before, .project-content::before, .project-changelog::before,
.illustration-box::before, .painting-image-wrap::before, .exhibition-hero::before,
.demo-video::before, .demo-embed::before, .ai-screenshot::before { left: 0; }
.section-shell::after, .work-list::after, .news-feed::after,
.page-header::after, .project-content::after, .project-changelog::after,
.illustration-box::after, .painting-image-wrap::after, .exhibition-hero::after,
.demo-video::after, .demo-embed::after, .ai-screenshot::after { right: 0; }

/* ─────────────────────────────────────────────────────────────
   Registration mark — small crosshair `+` used quietly as a
   structural anchor near brand or section starts.
   ───────────────────────────────────────────────────────────── */
.reg-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  position: relative;
  vertical-align: middle;
  margin: 0 0.35rem;
  flex-shrink: 0;
}
.reg-mark::before, .reg-mark::after {
  content: '';
  position: absolute;
  background: var(--text-muted);
}
.reg-mark::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-0.5px); }
.reg-mark::after  { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-0.5px); }

/* ─────────────────────────────────────────────────────────────
   Tinted underline — restrained ornament for emphasis spans.
   ───────────────────────────────────────────────────────────── */
.tint-underline {
  background-image: linear-gradient(transparent 62%, var(--tint-plum) 62%);
  padding: 0 0.05em;
}
.tint-underline.oxide { background-image: linear-gradient(transparent 62%, var(--tint-oxide) 62%); }
.tint-underline.sage  { background-image: linear-gradient(transparent 62%, var(--tint-sage) 62%); }

/* ─────────────────────────────────────────────────────────────
   Sidebar brand — quiet registration anchor + mono colophon.
   ───────────────────────────────────────────────────────────── */
.site-brand-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.1rem;
}
.site-brand-row .monogram {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.site-colophon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  line-height: 1.6;
  margin-top: 0.3rem;
}
.site-colophon .sep { color: var(--line-strong); margin: 0 0.25rem; }

/* ─────────────────────────────────────────────────────────────
   Selection — quiet tint, not browser-blue.
   ───────────────────────────────────────────────────────────── */
::selection { background: var(--tint-plum); color: var(--text-main); }

/* ─────────────────────────────────────────────────────────────
   Drop cap — opening letter in plum on first paragraph of
   tangent / blog detail pages. Auto-applied to first p in body.
   ───────────────────────────────────────────────────────────── */
.readme-body > p:first-of-type::first-letter,
.page-body > p:first-of-type::first-letter {
  font-size: 4.2em;
  float: left;
  line-height: 0.84;
  padding: 0.08em 0.2em 0 0;
  color: var(--accent-plum);
  font-weight: 300;
  letter-spacing: -0.04em;
}
.readme-body > h1:first-child + p::first-letter,
.readme-body > h2:first-child + p::first-letter,
.readme-body > h3:first-child + p::first-letter {
  font-size: inherit; float: none; padding: 0; color: inherit;
  font-weight: inherit; letter-spacing: inherit;
}
