/* ============================================================
tokens
============================================================ */
:root {
color-scheme: dark;
--bg:            #0d0d0d;
--surface:       #141414;
--surface-hover: #1a1a1a;
--text:          #ded9d0;
--muted:         #8a8580;
--border:        #232323;
--border-hover:  #3a3a3a;
--amber:         #ffb000;
--amber-dim:     #7a5600;
--maxw:          820px;
--pad:           24px;
}
#theme-light:checked ~ .page {
color-scheme: light;
--bg:            #f4f1ea;
--surface:       #fbf9f4;
--surface-hover: #ffffff;
--text:          #1a1a1a;
--muted:         #6b6560;
--border:        #ddd8ce;
--border-hover:  #c4bdae;
--amber:         #a85f00;
--amber-dim:     #d9c9a8;
}
/* ============================================================
base
============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0;
background: var(--bg);
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-size: 15px; line-height: 1.65; color: var(--text); -webkit-font-smoothing: antialiased;
}
.page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); transition: background .2s ease, color .2s ease; }
::selection { background: var(--amber); color: var(--bg); }
a { color: inherit; }
/* ============================================================
theme toggle
============================================================ */
.theme-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.theme-toggle { display: inline-flex; border: 1px solid var(--border); transition: border-color .2s ease; }
.theme-toggle label { padding: 4px 12px; font-size: 12px; line-height: 1.6; color: var(--muted); cursor: pointer; user-select: none; transition: color .2s ease, background .2s ease; }
.theme-toggle label + label { border-left: 1px solid var(--border); }
.theme-toggle label:hover { color: var(--text); }
#theme-dark:checked  ~ .page label[for="theme-dark"],
#theme-light:checked ~ .page label[for="theme-light"] { color: var(--amber); background: var(--surface); }
.theme-input:focus-visible ~ .page .theme-toggle { outline: 2px solid var(--amber); outline-offset: 2px; }
/* ============================================================
layout
============================================================ */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 28px var(--pad) 0; }
.brand { font-size: 14px; font-weight: 600; color: var(--amber); text-decoration: none; }
.brand:hover { text-decoration: underline; text-underline-offset: 3px; }
.home { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) 72px; }
/* ============================================================
intro
============================================================ */
.intro { padding: 64px 0 44px; }
.prompt { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.prompt-path { color: var(--amber-dim); }
.intro h1 { margin: 0 0 14px; font-size: clamp(22px, 4.4vw, 32px); font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.cursor { display: inline-block; width: .6ch; height: 1.05em; margin-left: 3px; vertical-align: -.1em; background: var(--amber); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bio { max-width: 52ch; margin: 0; color: var(--muted); }
.page-head { padding: 48px 0 32px; }
/* ============================================================
menu
============================================================ */
.menu-wrap .prompt { margin-bottom: 14px; }
.menu { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 0 16px; padding: 16px 14px 16px 10px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); transition: background .15s ease, border-color .15s ease; }
.row:hover { background: var(--surface-hover); border-bottom-color: var(--amber); }
.row:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.row-num { font-size: 13px; color: var(--amber-dim); transition: color .15s ease; }
.row:hover .row-num { color: var(--amber); }
.row-body { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.row-title { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.row:hover .row-title { color: var(--amber); }
.row-desc { font-size: 13px; color: var(--muted); }
.row-arrow { font-size: 15px; color: var(--border-hover); transition: color .15s ease, transform .15s ease; }
.row:hover .row-arrow { color: var(--amber); transform: translateX(4px); }
/* ============================================================
footer
============================================================ */
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 20px var(--pad) 32px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--amber); }

/* ============================================================
NEW: DYNAMIC COMPONENTS (Blog, Recs, Forms)
============================================================ */

/* Filters & Tags */
.filter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.filter-label { margin-right: 10px; }
.tag { padding: 2px 7px; border: 0; background: none; font: inherit; color: var(--muted); text-decoration: none; cursor: pointer; }
.tag::before { content: "["; color: var(--amber-dim); }
.tag::after  { content: "]"; color: var(--amber-dim); }
.tag:hover { color: var(--text); }
.tag.is-active { color: var(--amber); }
.tag.is-active::before, .tag.is-active::after { color: var(--amber); }
.tag-mini { font-size: 12px; padding: 0 4px; }

/* Post List (Blog) */
.post-list { border-top: 1px solid var(--border); }
.post { padding: 16px 10px; border-bottom: 1px solid var(--border); transition: background .15s; }
.post:hover { background: var(--surface-hover); border-bottom-color: var(--amber); }
.post-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 4px; gap: 12px; flex-wrap: wrap;}
.post-tags { display: flex; gap: 4px; }
.post-title { margin: 0; font-size: 16px; font-weight: 600; }
.post-title a { color: inherit; text-decoration: none; }
.post:hover .post-title a { color: var(--amber); }
.post-body { margin: 8px 0 0; font-size: 14px; color: var(--muted); max-width: 60ch; }

/* Recommendations List */
.rec-list { border-top: 1px solid var(--border); }
.rec { display: grid; grid-template-columns: 88px 1fr; gap: 16px; padding: 18px 10px; border-bottom: 1px solid var(--border); transition: background .15s; }
.rec:hover { background: var(--surface-hover); }
.rec-thumb img { display: block; width: 88px; height: 117px; object-fit: cover; border: 1px solid var(--border); }
.rec.no-thumb { grid-template-columns: 1fr; }
.rec-body { min-width: 0; }
.rec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.rec-title { margin: 0; font-size: 15px; font-weight: 600; }
.rec-rating { display: inline-flex; align-items: center; gap: 8px; }
.rec-num { font-size: 13px; color: var(--amber); }
.rec-bar { position: relative; display: inline-block; width: 72px; height: 4px; background: var(--border); }
.rec-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: calc(var(--v, 0) * 10%); background: var(--amber); }
.rec-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 2px; margin: 4px 0 8px; font-size: 12.5px; color: var(--muted); }
.rec-type { color: var(--amber-dim); }
.rec-sep { margin: 0 7px; color: var(--border-hover); }
.rec-review { margin: 0; max-width: 60ch; font-size: 14px; }

/* Pagination */
.pager { display: flex; justify-content: space-between; margin-top: 24px; font-size: 13px; }
.pager-link { color: var(--amber); text-decoration: none; }
.pager-off { color: var(--border-hover); }

/* Comments & AMA Notes */
.comments-section, .notes-section { margin-top: 64px; border-top: 1px solid var(--border); padding-top: 32px; }
.comment { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px dashed var(--border); }
.comment strong { color: var(--amber); }
.comment .muted { color: var(--muted); font-size: 12px; margin-left: 8px; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.note { padding: 16px; border: 1px solid var(--border); background: var(--surface); min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; }
.note-text { margin: 0; font-size: 14px; }
.note-meta { margin: 0; font-size: 12px; color: var(--muted); text-align: right; }

/* Forms */
.ask-form { display: flex; flex-direction: column; gap: 16px; max-width: 500px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 12px; color: var(--muted); }
.ask-form input, .ask-form textarea { padding: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; border-radius: 0; }
.ask-form input:focus, .ask-form textarea:focus { border-color: var(--amber); outline: none; }
.btn { align-self: flex-start; padding: 8px 16px; border: 1px solid var(--border); background: none; color: var(--text); font: inherit; cursor: pointer; transition: all .15s; }
.btn:hover { color: var(--amber); border-color: var(--amber); }

/* Prose (For Blog Posts & About) */
.prose h1 { font-size: 24px; margin-bottom: 8px; }
.prose h2::before { content: "# "; color: var(--amber-dim); }
.prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.prose code { background: var(--surface); padding: 2px 4px; border: 1px solid var(--border); }
.prose pre { background: var(--surface); padding: 16px; border: 1px solid var(--border); overflow-x: auto; }
.back-link { margin: 44px 0 0; font-size: 13px; }
.back-link a { color: var(--muted); text-decoration: none; }
.back-link a:hover { color: var(--amber); }
.empty { padding: 28px 10px; font-size: 13px; color: var(--muted); }

/* ============================================================
responsive
============================================================ */
@media (max-width: 600px) {
:root { --pad: 18px; }
.intro { padding: 44px 0 34px; }
.row { grid-template-columns: auto 1fr; padding: 14px 10px 14px 8px; }
.row-arrow { display: none; }
.row-body { flex-direction: column; gap: 2px; }
.rec { grid-template-columns: 64px 1fr; gap: 12px; }
.rec-thumb img { width: 64px; height: 85px; }
}
/* ============================================================
motion
============================================================ */
@media (prefers-reduced-motion: reduce) {
.cursor { animation: none; }
*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
photography - folder-based gallery
============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}
.ph {
  margin: 0;
  position: relative;
  border: 1px solid var(--border);
  transition: border-color .15s ease;
}
.ph:hover {
  border-color: var(--amber);
}
.ph-link {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.ph img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform .3s ease;
}
.ph:hover img {
  transform: scale(1.05);
}
.ph-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  opacity: 0;
  transition: opacity .2s ease;
}
.ph:hover .ph-overlay {
  opacity: 1;
}
.ph-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}
.ph-tags {
  display: block;
  font-size: 11px;
  color: var(--amber);
}

/* Photo modal */
.photo-modal[hidden] { display: none; }
.photo-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.photo-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  width: 100%;
}
.photo-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  z-index: 1001;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-modal-close:hover {
  color: var(--amber);
}
.photo-detail {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 0;
}
.photo-detail-img {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-detail-img img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.photo-detail-info {
  padding: 20px;
  border-left: 1px solid var(--border);
}
.photo-detail-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
}
.photo-detail-desc {
  margin: 0 0 16px;
  color: var(--text);
  line-height: 1.6;
}
.photo-detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.photo-detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag-mini {
  font-size: 11px;
  padding: 2px 6px;
  background: var(--surface-hover);
  color: var(--amber-dim);
  border-radius: 0;
}
.photo-detail-date {
  font-size: 12px;
  color: var(--muted);
}
.photo-detail-map {
  margin-top: 20px;
}
.photo-detail-map h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--amber);
}
.map-container {
  border: 1px solid var(--border);
  height: 250px;
  margin-bottom: 10px;
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.map-coords {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.map-coords a {
  color: var(--amber);
  text-decoration: none;
}
.map-coords a:hover {
  text-decoration: underline;
}

/* Mobile responsive for photo modal */
@media (max-width: 768px) {
  .photo-detail {
    grid-template-columns: 1fr;
  }
  .photo-detail-info {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .ph img {
    height: 150px;
  }
}

.admin-section { margin-top: 48px; border-top: 1px solid var(--border); padding-top: 24px; }
.admin-row { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); }
.admin-row-title { font-size: 14px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.admin-note-actions { display: flex; gap: 8px; margin-top: 8px; }
.admin-note { border-color: var(--border-hover); }
.muted { color: var(--muted); font-style: normal; }
.ask-input { padding: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; margin: 8px 0 16px; }
.form-status { margin: 0; font-size: 13px; color: var(--amber); }

/* Admin type-specific form sections */
.type-fields:not([hidden]) { display: flex; flex-direction: column; gap: 16px; }

/* Projects */
.proj-list { border-top: 1px solid var(--border); }
.proj {
  padding: 18px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  outline: none;
}
.proj:hover, .proj:focus-visible {
  background: var(--surface-hover);
  border-bottom-color: var(--amber);
}
.proj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.proj-title { margin: 0; font-size: 16px; font-weight: 600; }
.proj-year { font-size: 13px; color: var(--muted); }
.proj-summary { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.proj-tags { margin: 8px 0 0; }
.proj-detail { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.proj-desc { margin: 0 0 12px; font-size: 14px; }
.proj-source a { color: var(--amber); text-decoration: none; }
.proj-source a:hover { text-decoration: underline; }

/* Reactions */
.reactions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.reaction {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border: 1px solid var(--border); background: none;
  color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.reaction:hover { border-color: var(--amber); color: var(--text); background: var(--surface-hover); }
.reaction.is-active { border-color: var(--amber); color: var(--amber); }
.reaction:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.reaction-emoji { font-size: 14px; line-height: 1; }
.reaction-count { min-width: 1ch; }
.reactions.is-busy { opacity: .6; pointer-events: none; }
.note .reactions { margin-top: 10px; }

/* Threaded comments */
.comment-thread { display: flex; flex-direction: column; gap: 0; }
.comment-children { margin: 16px 0 0 18px; padding-left: 14px; border-left: 1px solid var(--border); }
.reply-btn { margin-top: 8px; padding: 2px 8px; font-size: 12px; }
.reply-form { margin-top: 12px; }
.reply-form .field { gap: 2px; }
.reply-form textarea { min-height: 80px; }