/* The public pages share one fluid layout and a quiet text sidebar. */
:root {
  --paper: #080808;
  --ink: #ededeb;
  --muted: #9b9b97;
  --line: #292929;
  --accent: #ededeb;
  --soft: #161616;
  --field: #101010;
  --field-line: #3b3b3b;
  --link-line: #62625f;
  --button-hover: #d2d2cf;
  --danger: #f0958d;
  --danger-line: #71413d;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #fff;
  --ink: #252725;
  --muted: #727572;
  --line: #e6e7e5;
  --accent: #252725;
  --soft: #f7f7f7;
  --field: #fff;
  --field-line: #d9ddd9;
  --link-line: #b7bbb7;
  --button-hover: #41473e;
  --danger: #a13832;
  --danger-line: #ecd7d5;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration-color: var(--link-line); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--ink); }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--field-line);
  border-radius: 4px;
  background: var(--field);
  padding: .75rem .85rem;
  line-height: 1.5;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 160px; }
input:focus, textarea:focus { border-color: var(--accent); }
h1, h2 { font-weight: 500; letter-spacing: -.025em; }
h2 { font-size: 1.1rem; line-height: 1.4; margin: 0; }

.site-shell {
  display: grid;
  grid-template-columns: clamp(170px, 14vw, 230px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 5vw, 96px);
  width: 100%;
  min-height: 100dvh;
  padding: clamp(32px, 4vw, 72px);
}
.site-sidebar { position: sticky; top: clamp(32px, 4vw, 72px); min-width: 0; }
.wordmark {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: -.025em;
  text-decoration: none;
  margin: 0;
}
.sidebar-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 30px; }
.sidebar-nav a {
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.8;
  padding: 5px 0;
  text-decoration: none;
}
.sidebar-nav a:hover, .sidebar-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.home-shell .sidebar-nav a { color: var(--ink); text-decoration: underline; }
.sidebar-socials { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 38px; }
.sidebar-socials a { color: var(--muted); font-size: .8125rem; line-height: 1.8; }
.theme-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  min-height: 44px;
  margin-top: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: .75rem;
}
.theme-switch[hidden] { display: none; }
.theme-switch:hover { color: var(--ink); }
.theme-switch-track {
  display: block;
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid var(--field-line);
  border-radius: 20px;
  background: var(--soft);
}
.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .2s ease, background-color .2s ease;
}
.theme-switch:hover .theme-switch-track { border-color: var(--muted); }
.theme-switch[aria-checked="true"] .theme-switch-track { background: var(--ink); border-color: var(--ink); }
.theme-switch[aria-checked="true"] .theme-switch-thumb { transform: translateX(18px); background: var(--paper); }
.theme-switch:active .theme-switch-thumb { scale: .9; }
.site-content { min-width: 0; padding-bottom: 24px; }
.page-intro { margin-bottom: 38px; }
.page-intro h1 { font-size: clamp(1.3rem, 2vw, 1.75rem); line-height: 1.35; margin: 0; }
.page-intro .text-button { display: inline-block; margin-top: 18px; }
.text-button, .quiet-link { color: var(--muted); font-size: .875rem; background: none; border: none; padding: 0; text-decoration: none; }
.text-button:hover, .quiet-link:hover { color: var(--ink); text-decoration: underline; }
.empty-copy { font-size: 1rem; line-height: 1.8; color: var(--muted); margin: 24px 0; }
.entry-edit { display: block; margin-top: 18px; }
.entry-media { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin: 24px 0 0; }
.entry-media img, .entry-media video { display: block; width: 100%; max-width: 100%; height: auto; object-fit: contain; }

/* The two portrait formats retain their original framing at the same height. */
.interest-list { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr); gap: clamp(16px, 2vw, 32px); align-items: start; }
.interest-entry { min-width: 0; }
.interest-visual { position: relative; isolation: isolate; }
.interest-visual .entry-media { margin: 0; }
.interest-visual::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  height: 140px;
  max-height: 35%;
  background: linear-gradient(180deg, rgb(0 0 0 / .66) 0, rgb(0 0 0 / .66) 72px, transparent 140px);
  pointer-events: none;
}
.interest-label {
  position: absolute;
  z-index: 2;
  top: clamp(16px, 2vw, 28px);
  left: clamp(16px, 2vw, 28px);
  right: 16px;
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.015em;
  color: #fff;
  pointer-events: none;
}
.interest-label a { pointer-events: auto; text-decoration-color: rgb(255 255 255 / .6); }
.interest-label a:focus-visible { outline-color: #fff; }
.entry-summary { font-size: 1rem; line-height: 1.7; color: var(--muted); margin: 16px 0 0; }
.interest-entry .prose, .project-row .prose { font-family: inherit; font-size: 1rem; line-height: 1.75; margin-top: 18px; }

.quote-section { margin-top: clamp(56px, 6vw, 100px); padding-top: 26px; border-top: 1px solid var(--line); }
.quote-section > h2 { font-size: 1.1rem; margin-bottom: 28px; }
.quote { margin: 0; padding: 28px 0; }
.quote:first-child { padding-top: 0; }
.quote + .quote { border-top: 1px solid var(--line); }
.quote-with-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 96px); }
.quote .entry-media { margin: 0; }
.quote-text { min-width: 0; }
blockquote { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.4rem, 2.2vw, 2.4rem); line-height: 1.45; letter-spacing: -.025em; }
blockquote p { margin: 0; max-width: 24ch; }
.quote-attribution { color: var(--muted); font-size: .85rem; line-height: 1.8; margin: 20px 0 0; }
.quote-attribution a { margin-left: 12px; }

.project-list { border-top: 1px solid var(--line); }
.project-row { padding: 24px 0 28px; border-bottom: 1px solid var(--line); }
.project-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.project-heading h2 { font-size: clamp(1.05rem, 1.5vw, 1.3rem); }
.project-summary { font-size: .875rem; line-height: 1.6; color: var(--muted); text-align: right; margin: 0; }

.essay-row { display: flex; align-items: start; gap: 24px; justify-content: space-between; padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.essay-row > span { min-width: 0; flex: 1; }
.row-title, .row-summary, .project-heading h2, .project-summary, .entry-summary, .interest-label, .article-header h1, .quote-text { overflow-wrap: anywhere; }
.essay-list { border-top: 1px solid var(--line); }
.row-title { font-size: 1.1rem; line-height: 1.5; display: block; }
.essay-row:hover .row-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.row-summary { display: block; font-size: .92rem; line-height: 1.65; color: var(--muted); max-width: 60ch; margin-top: 7px; }
time { font-size: .8rem; line-height: 1.8; color: var(--muted); white-space: nowrap; margin-top: 3px; }
.article { max-width: 760px; }
.back-link { font-size: .875rem; color: var(--muted); }
.article-header { padding: 40px 0 30px; }
.article-header h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.2; font-weight: 500; letter-spacing: -.045em; margin: 18px 0; }
.article-summary { font-size: 1.12rem; color: var(--muted); line-height: 1.7; margin: 0; }
.prose { font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; line-height: 1.85; overflow-wrap: anywhere; }
.prose p { margin: 0 0 1.4em; }
.prose h2, .prose h3 { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5rem; line-height: 1.4; margin: 2em 0 1em; }
.prose h3 { font-size: 1.2rem; }
.prose blockquote { font-size: 1.18rem; padding-left: 24px; border-left: 2px solid var(--line); margin: 1.5em 0; }
.prose img { max-width: 100%; height: auto; }
.prose pre { font-size: .875rem; background: var(--soft); padding: 20px; overflow: auto; border-radius: 4px; }
.prose code { font-size: .875em; overflow-wrap: anywhere; }
.prose table { border-collapse: collapse; max-width: 100%; display: block; overflow: auto; }
.prose th, .prose td { padding: 8px; border: 1px solid var(--line); }
.article-edit { margin-top: 24px; }

/* Account controls and the browser editor. */
.owner-bar{display:flex;gap:18px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);font-size:.8rem;color:var(--muted)}.owner-bar a{margin-left:auto}.owner-bar .text-button{font-size:.8rem}dialog{padding:40px;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);box-shadow:0 20px 80px #2222}dialog::backdrop{background:rgba(31,36,30,.24);backdrop-filter:blur(3px)}dialog .eyebrow{margin-bottom:16px}dialog h2{font-size:1.65rem;line-height:1.3;font-weight:500;letter-spacing:-.04em}.dialog-description{font-size:.9rem;line-height:1.7;color:var(--muted);margin:12px 0 26px}.dialog-close{position:absolute;top:10px;right:12px;font-size:1.65rem;font-weight:300;border:0;background:none;color:var(--muted);padding:5px 10px}.primary-button,.secondary-button,.danger-button{padding:.8rem 1.05rem;border:1px solid var(--ink);border-radius:4px;font-size:.875rem;line-height:1.4;background:var(--ink);color:var(--paper);min-height:44px}.primary-button:hover{background:var(--button-hover)}.secondary-button{background:transparent;color:var(--ink);border-color:var(--field-line)}.secondary-button:hover{background:var(--soft)}.danger-button{background:transparent;border-color:var(--danger-line);color:var(--danger)}label{display:block;font-size:.875rem;margin:18px 0 8px;line-height:1.5}.form-error{color:var(--danger);font-size:.875rem;line-height:1.6;margin:12px 0;min-height:0}.form-error:empty{display:none}#login-form .primary-button{width:100%;margin-top:24px}.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(12px);opacity:0;transition:opacity .15s,transform .15s;background:var(--ink);color:var(--paper);padding:13px 20px;border-radius:5px;font-size:.875rem;max-width:calc(100% - 32px);pointer-events:none;z-index:20}.toast.visible{opacity:1;transform:translateX(-50%)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip-link{position:fixed;left:15px;top:-100px;z-index:30;padding:10px;background:var(--ink);color:var(--paper)}.skip-link:focus{top:15px}.admin-intro{padding-bottom:24px}.admin-tabs{display:flex;gap:22px;border-bottom:1px solid var(--line);margin-bottom:22px}.admin-tabs button{padding:12px 0;background:none;border:0;border-bottom:2px solid transparent;color:var(--muted);font-size:.875rem}.admin-tabs button[aria-selected=true]{color:var(--ink);border-bottom-color:var(--ink)}.admin-toolbar{display:flex;justify-content:space-between;gap:20px;align-items:center;margin:24px 0}.admin-count{color:var(--muted);font-size:.875rem}.admin-entry{display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid var(--line);padding:22px 0}.admin-entry button{border:none;background:none;padding:0;text-align:left;color:var(--ink);font-size:1rem;line-height:1.5;max-width:70%;overflow-wrap:anywhere}.admin-entry button:hover{text-decoration:underline;text-underline-offset:4px}.entry-status{font-size:.75rem;color:var(--muted);white-space:nowrap}.entry-status.published{color:var(--accent)}.editor{padding:14px 0 0}.editor-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:26px;gap:12px}.editor-top h2{font-size:1.1rem}.editor-info{color:var(--muted);font-size:.8rem;line-height:1.7;margin:20px 0}.field-help{font-size:.8rem;line-height:1.7;color:var(--muted);margin:8px 0}textarea#body{min-height:300px;line-height:1.75}.editor-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:24px}.editor-secondary{display:flex;gap:20px;align-items:center;margin-top:24px}.editor-secondary button{color:var(--muted)}.editor-secondary .delete-button{color:var(--danger)}.draft-notice{font-size:.875rem;color:var(--muted);line-height:1.7;margin-top:24px;padding:16px 18px;background:var(--soft);border-radius:4px}.preview-title{font-size:1.8rem;letter-spacing:-.035em;margin-top:20px}.markdown-tools{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0 8px}.markdown-tools button{background:none;border:1px solid var(--line);border-radius:3px;padding:6px 10px;font-size:.8rem;color:var(--muted);min-height:34px}.password-settings{margin-top:58px;border-top:1px solid var(--line);padding-top:24px}.password-settings summary{font-size:.875rem;color:var(--muted);cursor:pointer}.password-settings form{max-width:420px;padding:10px 0}.password-settings .primary-button{margin-top:20px}.confirm-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:24px}
.admin-content { max-width: 900px; }
.owner-bar { margin-bottom: 28px; flex-wrap: wrap; }
.admin-tabs { flex-wrap: wrap; }
.attached-media:empty { display: none; }
.attached-media { margin-top: 28px; }
.attached-item { display: flex; gap: 18px; align-items: flex-start; margin-top: 20px; }
.attached-item > img { width: 72px; height: 96px; object-fit: contain; }
.attached-item > div { flex: 1; min-width: 0; }
.attached-item label { margin-top: 0; }
.attached-item button { margin-top: 10px; }
.preview-dialog { width: min(720px, calc(100vw - 32px)); padding: 44px; }
.preview-dialog .prose { margin-top: 28px; }
.preview-dialog .article-summary { margin-top: 18px; }
.preview-dialog .quote-with-media { grid-template-columns: 1fr; gap: 24px; }
.preview-dialog .interest-visual { max-width: 420px; }

@media (max-width: 760px) {
  .site-shell { grid-template-columns: 140px minmax(0, 1fr); gap: 28px; padding: 28px; }
  .site-sidebar { top: 28px; }
  .sidebar-socials { flex-direction: column; gap: 5px; }
  .interest-list { grid-template-columns: 1fr; gap: 24px; }
  .quote-with-media { grid-template-columns: 1fr; gap: 24px; }
  .quote-text { padding-bottom: 8px; }
  .quote-text blockquote { max-width: 28ch; }
  .project-heading { flex-wrap: wrap; gap: 6px 20px; }
  .project-summary { text-align: left; }
}
@media (max-width: 560px) {
  .site-shell { display: block; padding: 24px 20px; }
  .site-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; margin-bottom: 42px; }
  .wordmark { grid-column: 1 / -1; }
  .sidebar-nav { margin-top: 20px; }
  .sidebar-socials { align-self: end; margin-top: 0; margin-bottom: 5px; }
  .home-shell .sidebar-socials { grid-column: 1 / -1; flex-direction: row; margin-top: 30px; }
  .theme-switch { grid-column: 1 / -1; margin-top: 12px; }
  .page-intro { margin-bottom: 26px; }
  .page-intro h1 { font-size: 1.4rem; }
  .project-row { padding: 20px 0 24px; }
  .project-summary { font-size: .8125rem; }
  .essay-row { flex-direction: column; gap: 10px; }
  .essay-row time { margin-top: 0; }
  .row-summary { font-size: .9rem; }
  .article-header { padding: 30px 0 24px; }
  .prose { font-size: 1.1rem; }
  .owner-bar { gap: 12px; font-size: .75rem; }
  .owner-bar a { margin-left: 0; }
  .owner-bar span { width: 100%; }
  dialog, .preview-dialog { padding: 30px 24px; }
  .admin-tabs { gap: 20px; }
  .admin-entry { align-items: start; }
  .entry-status { white-space: normal; text-align: right; max-width: 110px; }
  .editor-top { flex-wrap: wrap; }
  .editor-actions .primary-button, .editor-actions .secondary-button { flex: 1; }
  .editor-secondary { justify-content: space-between; }
  .admin-toolbar { gap: 12px; }
  .attached-item { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
