/* morganjlopes.com v2. One stylesheet, a handful of tokens, no framework. */

@font-face { font-family: "Recoleta"; src: url("/assets/Recoleta-Regular-c74de4be.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Recoleta"; src: url("/assets/Recoleta-Medium-18463cf5.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Recoleta"; src: url("/assets/Recoleta-SemiBold-f9a292d0.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #fbf9f5;
  --ink: #211d18;
  --ink-2: #615a4f;
  --ink-3: #958d80;
  --line: #e8e3da;
  --line-2: #d6cfc3;
  --wash: #f2eee6;
  --accent: #9c6d1c;
  --danger: #a13d2d;
  --shadow: 0 12px 40px rgba(40, 30, 10, .14);
  --serif: "Recoleta", Georgia, serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 40rem;
  color-scheme: light;
}
[data-theme="dark"] {
  --paper: #171512;
  --ink: #ece7de;
  --ink-2: #aba498;
  --ink-3: #7b7367;
  --line: #2a2722;
  --line-2: #3b362f;
  --wash: #1f1c18;
  --accent: #d6ac52;
  --danger: #d97a67;
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(156, 109, 28, .18); }

/* Top bar */
.nav a i { margin-right: 7px; font-size: 13px; }
.topbar {
  position: sticky; top: 12px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  width: min(var(--measure), calc(100% - 32px)); margin: 12px auto 0;
  padding: 9px 10px 9px 20px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(40, 30, 10, .07), 0 1px 2px rgba(40, 30, 10, .05);
}
[data-theme="dark"] .topbar { box-shadow: 0 6px 24px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .3); }
.brand { font-family: var(--serif); font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -.01em; }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; color: var(--ink-2); font-size: 14px; padding: 6px 10px; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--wash); }
.nav a[aria-current] { color: var(--ink); font-weight: 500; background: var(--wash); }
.theme-toggle {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: none; color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.topbar-actions { display: inline-flex; align-items: center; gap: 8px; }
.nav-cta { font-size: 13px; font-weight: 500; padding: 8px 15px; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; white-space: nowrap; }
.nav-cta:hover { opacity: .88; }
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* Page */
.page { max-width: var(--measure); margin: 0 auto; padding: 40px 24px 160px; }
.eyebrow { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--ink-3); }
.eyebrow .dot::before { content: "·"; }
.eyebrow b { color: var(--ink-2); font-weight: 500; }

.title {
  display: block; width: 100%; margin: 12px 0 18px; padding: 0;
  font-family: var(--serif); font-weight: 600; font-size: 38px; line-height: 1.15; letter-spacing: -.015em;
  color: var(--ink); background: none; border: 0; outline: none; resize: none; overflow: hidden;
}
.title::placeholder { color: var(--ink-3); opacity: .65; }

/* Prose: the reading and writing surface */
.prose {
  position: relative;
  font-family: var(--text); font-size: 20px; line-height: 1.65; font-optical-sizing: auto;
  outline: none; min-height: 45vh;
}
.prose.is-empty::before { content: attr(data-placeholder); position: absolute; color: var(--ink-3); opacity: .65; pointer-events: none; }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; margin: 1.6em 0 .5em; }
.prose h2 { font-size: 26px; }
.prose h3 { font-size: 21px; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose blockquote { margin: 1.2em 0; padding-left: 1.1em; border-left: 2px solid var(--line-2); color: var(--ink-2); font-style: italic; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .25em 0; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); width: 30%; margin: 2em auto; }
.prose code { font-family: var(--mono); font-size: .82em; background: var(--wash); padding: .1em .35em; border-radius: 4px; }
.prose img { display: block; max-width: 100%; border-radius: 4px; }
.prose figure { margin: 1.6em 0; }
.prose action-text-attachment { display: block; }
.prose action-text-attachment figure { margin: 0; }
.prose figure.uploading img { opacity: .5; }
.prose figure img { width: 100%; }
.prose figcaption { font-family: var(--ui); font-size: 13px; color: var(--ink-3); text-align: center; margin-top: 8px; outline: none; }
.prose[contenteditable="true"] figcaption:empty::before { content: "Add a caption"; opacity: .6; }
.prose figure.selected img { outline: 2px solid var(--accent); outline-offset: 2px; }
.prose.dropping { outline: 1px dashed var(--ink-3); outline-offset: 12px; border-radius: 4px; }
.prose.compact { font-size: 18px; min-height: 0; }

/* Bottom bar */
.footbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: 13px; color: var(--ink-3);
}
.meta { display: flex; gap: 0; align-items: baseline; white-space: nowrap; overflow: hidden; }
.meta span + span::before { content: "·"; margin: 0 10px; color: var(--line-2); }
.meta .link { color: var(--ink-3); text-decoration: none; }
.meta .link:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.btn {
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2;
}
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { opacity: .9; border-color: var(--ink); }
.btn-quiet { border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); border-color: transparent; background: var(--wash); }
.btn:disabled { opacity: .45; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-3); font-size: 13px; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--danger); }

/* Floating toolbar */
.toolbar {
  position: absolute; z-index: 10;
  display: flex; align-items: center;
  padding: 4px; border-radius: 9px;
  background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.toolbar.visible { opacity: 1; pointer-events: auto; transform: none; }
.toolbar-buttons { display: flex; align-items: center; gap: 2px; }
.toolbar button {
  width: 30px; height: 28px; border: 0; border-radius: 5px; background: transparent; cursor: pointer;
  font-size: 14px; font-family: var(--ui); color: inherit; line-height: 1;
}
.toolbar button[data-cmd="quote"] { font-family: var(--serif); font-size: 20px; padding-top: 6px; }
.toolbar button:hover, .toolbar button.active { background: rgba(255, 255, 255, .16); }
[data-theme="dark"] .toolbar button:hover, [data-theme="dark"] .toolbar button.active { background: rgba(0, 0, 0, .22); }
.toolbar .sep { width: 1px; height: 18px; background: rgba(255, 255, 255, .22); margin: 0 4px; }
[data-theme="dark"] .toolbar .sep { background: rgba(0, 0, 0, .3); }
.toolbar-link { width: 280px; height: 28px; padding: 0 8px; border: 0; background: transparent; color: inherit; outline: none; font-size: 13px; font-family: var(--ui); }
.toolbar-link::placeholder { color: inherit; opacity: .55; }

/* Dialogs */
dialog {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  padding: 26px 28px; width: min(460px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
dialog.wide { width: min(680px, calc(100vw - 32px)); padding: 0; }
dialog::backdrop { background: rgba(30, 24, 14, .28); }
[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h2 { font-family: var(--serif); font-weight: 600; font-size: 21px; margin: 0 0 18px; letter-spacing: -.01em; }
dialog p { margin: 0 0 16px; color: var(--ink-2); }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 15px; width: 100%; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); color: var(--ink); outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink-3); }
.field textarea { resize: vertical; min-height: 72px; font-family: var(--text); font-size: 17px; }
.field small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 8px 0; cursor: pointer; }
.choice input[type="radio"] { accent-color: var(--ink); margin: 0; }
.choice input[type="datetime-local"] { font: inherit; font-size: 14px; border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 8px; background: var(--paper); color: var(--ink); }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.dialog-actions .spacer { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 76px; z-index: 20;
  transform: translate(-50%, 8px);
  padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 13px;
  opacity: 0; pointer-events: none; transition: .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Lists */
.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-family: var(--serif); font-weight: 600; font-size: 28px; margin: 0; letter-spacing: -.01em; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tabs [role="tab"] { background: none; border: 0; padding: 8px 0; margin-bottom: -1px; color: var(--ink-3); cursor: pointer; font-size: 13px; border-bottom: 1px solid transparent; text-decoration: none; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 18px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.row:hover .row-title { color: var(--accent); }
.row-date { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row-title { font-family: var(--serif); font-size: 18px; font-weight: 500; line-height: 1.3; }
.row-title.untitled { color: var(--ink-3); font-style: italic; font-weight: 400; }
.row-sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.row-side { font-size: 12px; color: var(--ink-3); text-align: right; white-space: nowrap; display: flex; gap: 10px; align-items: baseline; }
.row-side:empty { display: none; }
.row-role { font-family: var(--ui); font-size: 13px; font-weight: 400; color: var(--ink-2); margin-left: 10px; }
.row-title a { text-decoration: none; }
.row-title a:hover { color: var(--accent); }
.row-link { color: var(--ink-3); text-decoration: none; }
.row-link:hover { color: var(--ink); }
.pin { display: inline-flex; color: var(--ink-3); }
.pill {
  display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; line-height: 1.5;
}
.pill.published, .pill.sent { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.scheduled { border-color: var(--accent); color: var(--accent); }
.empty { padding: 56px 0; text-align: center; color: var(--ink-3); font-size: 14px; }
.list-foot { margin-top: 28px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; }

/* Email header */
.email-head { margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.email-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.email-line label { width: 56px; font-size: 13px; color: var(--ink-3); flex-shrink: 0; }
.email-line select, .email-line input { font: inherit; flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); outline: none; padding: 0; }
.email-line select {
  appearance: none; cursor: pointer; flex: 0 1 auto; padding-right: 20px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23958d80' stroke-width='1.4'/></svg>") no-repeat right center;
}
.email-line .count { font-size: 13px; color: var(--ink-3); }
.email-line .subject { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.email-line .subject::placeholder { color: var(--ink-3); opacity: .65; font-weight: 500; }
.email-line.locked select, .email-line.locked input { pointer-events: none; }

/* Email preview */
.preview { padding: 32px 36px; }
.preview .from { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; display: flex; justify-content: space-between; }
.preview h1 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0 0 20px; letter-spacing: -.01em; }
.preview .prose { min-height: 0; }
.preview .foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.preview .foot a { color: inherit; }
.preview-close { position: absolute; top: 14px; right: 16px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--wash); cursor: pointer; color: var(--ink-2); }

/* Insert-a-post picker */
.picker { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; }
.picker button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 0; cursor: pointer; }
.picker button:hover .pick-title { color: var(--accent); }
.pick-title { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.pick-date { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* Public site */
.public { padding-bottom: 80px; }
.public .prose { min-height: 0; }
.intro { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; margin: 4px 0 56px; }
.intro .ikigai { flex-basis: 100%; margin: 0; }
.intro .lede { margin: 0; flex: 1; }
.headshot { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); background: var(--wash); }
.lede { font-family: var(--text); font-size: 24px; line-height: 1.5; color: var(--ink); margin: 8px 0 56px; }
.lede-toggle {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline dotted; text-decoration-color: var(--line-2); text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.lede-toggle:hover, .lede-toggle[aria-expanded="true"] { color: var(--accent); text-decoration-color: var(--accent); }
.ikigai { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; align-items: center; margin: -32px 0 56px; padding: 22px 0 8px; border-top: 1px solid var(--line); animation: reveal .3s ease; }
.ikigai p { font-family: var(--text); font-size: 18px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.ikigai-venn { width: 100%; height: auto; }
.venn-circles circle { fill: var(--accent); fill-opacity: .13; stroke: var(--accent); stroke-opacity: .55; stroke-width: 1; }
.venn-labels text { font-family: var(--ui); font-size: 11px; fill: var(--ink-2); text-anchor: middle; }
.venn-center { font-family: var(--serif); font-size: 17px; font-weight: 600; fill: var(--ink); text-anchor: middle; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 500; margin: 0 0 6px; }
.section { margin-top: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.section-head .section-title { margin: 0; }
.section-quote { font-family: var(--text); font-style: italic; font-size: 15px; color: var(--ink-3); margin: 10px 0 2px; }
.section-quote::before { content: "\201C"; } .section-quote::after { content: "\201D"; }
.view-all { font-size: 12px; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.view-all:hover { color: var(--ink); }
.section .rows > li:last-child .row { border-bottom: 0; }
.section-more {
  display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr) auto; gap: 18px; align-items: baseline;
  margin-top: 2px; padding: 12px 12px 12px 0; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px;
  text-decoration: none; color: var(--ink-2); font-size: 13px; transition: background .15s ease, color .15s ease;
}
.section-more:hover { background: var(--wash); color: var(--ink); padding-left: 12px; margin-left: -12px; margin-right: -12px; }
.more-count { color: var(--accent); font-weight: 500; white-space: nowrap; }
.more-peek { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-more:hover .more-peek { color: var(--ink-2); }
.more-go { display: inline-flex; color: var(--ink-3); transition: transform .15s ease; }
.section-more:hover .more-go { transform: translateX(3px); color: var(--accent); }
.section-lede { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.page-lede { font-family: var(--text); font-size: 19px; color: var(--ink-2); margin: -8px 0 18px; }
.page-lede + .tabs { margin-bottom: 4px; }
.subscribe { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.subscribe h2 { font-family: var(--serif); font-weight: 600; font-size: 20px; margin: 0 0 6px; }
.subscribe p { color: var(--ink-2); margin: 0 0 14px; font-size: 14px; }
.subscribe form { display: flex; gap: 8px; max-width: 420px; }
.subscribe input { flex: 1; font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); color: var(--ink); outline: none; }
.subscribe input:focus { border-color: var(--ink-3); }
.post-title { font-family: var(--serif); font-weight: 600; font-size: 38px; line-height: 1.15; letter-spacing: -.015em; margin: 12px 0 28px; }
.post-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.post-nav a { text-decoration: none; color: var(--ink-2); max-width: 48%; }
.post-nav a:hover { color: var(--ink); }
.post-nav small { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.post-nav .next { text-align: right; margin-left: auto; }
.site-foot { max-width: var(--measure); margin: 0 auto; padding: 24px 24px 40px; display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.site-foot a { color: inherit; text-decoration: none; }
.subscribe:target { animation: pulse 1.2s ease; }
@keyframes pulse { 0% { background: color-mix(in srgb, var(--accent) 12%, transparent); } 100% { background: transparent; } }
.site-foot a:hover { color: var(--ink); }

/* A single photo with a caption, kept muted so it sits with the type */
.photo { margin: 28px 0 0; }
.photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 45% 35%; border-radius: 8px; filter: saturate(.82) contrast(.98); }
.photo figcaption { font-family: var(--text); font-style: italic; font-size: 15px; color: var(--ink-3); margin-top: 10px; }
.photo .photo-missing { display: flex; align-items: center; justify-content: center; line-height: 1.7; aspect-ratio: 16 / 9; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--ink-3); font-size: 13px; text-align: center; padding: 20px; }
.photo .photo-missing code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

/* Activity grid */
.activity { margin-bottom: 52px; }
.activity .section-title { margin-bottom: 14px; }
.activity-months, .activity-grid { display: grid; grid-template-columns: repeat(53, minmax(0, 1fr)); gap: 3px; }
.activity-months { height: 14px; margin-bottom: 4px; font-size: 10px; color: var(--ink-3); line-height: 14px; }
.activity-months span { grid-row: 1; grid-column: calc(var(--w) + 1) / span 4; white-space: nowrap; overflow: visible; }
.activity-grid { grid-template-rows: repeat(7, minmax(0, 1fr)); grid-auto-flow: column; }
.cell { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--wash); }
.cell.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--wash)); }
.cell.l2 { background: color-mix(in srgb, var(--accent) 52%, var(--wash)); }
.cell.l3 { background: color-mix(in srgb, var(--accent) 78%, var(--wash)); }
.cell.l4 { background: var(--accent); }
.cell.future { background: transparent; }
.cell.today { outline: 1px solid var(--ink-2); outline-offset: -1px; }
.activity-note { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
.activity-scale { display: inline-flex; align-items: center; gap: 3px; }
.activity-scale .cell { width: 9px; height: 9px; }

/* Sprites: small looping animations beside section titles */
.sprite { display: inline-flex; align-items: center; width: 40px; height: 28px; margin-right: 10px; vertical-align: middle; color: var(--ink-3); flex-shrink: 0; }
.sprite svg { width: 100%; height: 100%; overflow: visible; }
.section-title .sprite, .page-title .sprite { position: relative; top: -1px; }
.page-title .sprite { width: 48px; height: 34px; margin-right: 12px; }
.section-head .section-title { display: inline-flex; align-items: center; }
.list-head .page-title { display: inline-flex; align-items: center; }

.gear { transform-box: view-box; transform-origin: var(--cx) var(--cy); animation: gear 7s linear infinite; }
@keyframes gear { from { transform: rotate(var(--a0)); } to { transform: rotate(var(--a1)); } }
.ecg-pulse { stroke-dasharray: 100 100; animation: ecg 2.6s linear infinite; }
@keyframes ecg { 0% { stroke-dashoffset: 100; } 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }

.hammer-arm { transform-box: view-box; transform-origin: 17px 11px; animation: hammer 1.4s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes hammer { 0%, 100% { transform: rotate(0deg); } 32% { transform: rotate(96deg); } 48% { transform: rotate(96deg); } }
.hammer-spark { opacity: 0; animation: spark 1.4s linear infinite; }
@keyframes spark { 0%, 30%, 52%, 100% { opacity: 0; } 34%, 44% { opacity: 1; } }

.ink-line { stroke-dasharray: 100 100; animation: ink 3.2s linear infinite; }
@keyframes ink { 0% { stroke-dashoffset: 100; opacity: 1; } 68% { stroke-dashoffset: 0; opacity: 1; } 84% { stroke-dashoffset: 0; opacity: 1; } 92% { opacity: 0; } 99% { stroke-dashoffset: 100; opacity: 0; } 100% { stroke-dashoffset: 100; opacity: 1; } }
.pen { transform-box: view-box; animation: pen 3.2s linear infinite; }
@keyframes pen {
  0%    { transform: translate(4px, 22px) rotate(0deg); opacity: 1; }
  17%   { transform: translate(12px, 20.5px) rotate(4deg); }
  34%   { transform: translate(20px, 20px) rotate(-3deg); }
  51%   { transform: translate(28px, 18.5px) rotate(4deg); }
  68%   { transform: translate(36px, 22px) rotate(0deg); opacity: 1; }
  84%   { transform: translate(36px, 22px) rotate(0deg); opacity: 1; }
  92%   { opacity: 0; }
  99%   { transform: translate(4px, 22px) rotate(0deg); opacity: 0; }
  100%  { transform: translate(4px, 22px) rotate(0deg); opacity: 1; }
}

.lid { transform-box: view-box; transform-origin: 31px 14px; animation: lid 2.8s cubic-bezier(.4, 0, .3, 1) infinite; }
@keyframes lid {
  0%, 28%  { transform: rotate(0deg) translate(0, 0); }
  40%      { transform: rotate(-24deg) translate(0, -2.5px); }
  62%      { transform: rotate(-22deg) translate(0, -2.2px); }
  74%      { transform: rotate(0deg) translate(0, .6px); }
  80%      { transform: rotate(0deg) translate(0, 0); }
  100%     { transform: rotate(0deg) translate(0, 0); }
}
.sparkle { transform-box: fill-box; transform-origin: center; opacity: 0; animation: sparkle 2.8s ease-out infinite; }
.s2 { animation-delay: .12s; } .s3 { animation-delay: .22s; }
@keyframes sparkle {
  0%, 36%  { opacity: 0; transform: scale(.3) translateY(2px); }
  46%      { opacity: 1; transform: scale(1) translateY(-1px); }
  62%      { opacity: 1; transform: scale(.9) translateY(-3px); }
  72%, 100% { opacity: 0; transform: scale(.4) translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) { .sprite * { animation: none !important; } .ecg-pulse, .ink-line { stroke-dasharray: none; } }

/* Smash: the Work Easter egg layer */
.smash { position: fixed; inset: 0; z-index: 50; display: none; background: color-mix(in srgb, var(--paper) 78%, transparent); backdrop-filter: blur(3px); cursor: none; }
.smash.open { display: block; animation: reveal .25s ease; }
.smash canvas { position: absolute; inset: 0; display: block; }
.smash-hud { position: absolute; top: 18px; left: 24px; display: flex; gap: 18px; font-size: 13px; color: var(--ink-3); pointer-events: none; }
.smash-hud b { color: var(--ink); font-weight: 600; }
.smash-combo { color: var(--accent); }
.smash-close { position: absolute; top: 12px; right: 24px; font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-2); cursor: pointer; }
.smash-close:hover { color: var(--ink); border-color: var(--ink-3); }
.smash-hint { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-family: var(--text); font-size: 20px; color: var(--ink-2); pointer-events: none; margin: 0; }
.smash-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100vw - 32px)); padding: 26px 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); text-align: center; cursor: default; animation: reveal .3s ease; }
.smash-panel h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0 0 6px; }
.smash-panel p { color: var(--ink-2); margin: 0 0 18px; }
.smash-actions { display: flex; gap: 8px; justify-content: center; }
body.smash-open { overflow: hidden; }
.sprite.playable { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 6px; transition: transform .15s ease; }
.sprite.playable:hover { transform: scale(1.12); color: var(--ink); }
@media (max-width: 640px) { .smash-hud { left: 18px; gap: 12px; font-size: 12px; } .smash-hint { font-size: 17px; padding: 0 24px; } }

/* Landing */
.landing { max-width: 32rem; margin: 18vh auto 0; padding: 0 24px; }
.landing h1 { font-family: var(--serif); font-weight: 600; font-size: 32px; margin: 0 0 8px; letter-spacing: -.015em; }
.landing p { color: var(--ink-2); margin: 0 0 28px; }
.landing ul { list-style: none; padding: 0; margin: 0; }
.landing li { border-top: 1px solid var(--line); }
.landing li:last-child { border-bottom: 1px solid var(--line); }
.landing a { display: flex; justify-content: space-between; padding: 14px 0; text-decoration: none; }
.landing a:hover { color: var(--accent); }
.landing a small { color: var(--ink-3); }

@media (max-width: 640px) {
  .topbar { top: 8px; margin-top: 8px; padding: 8px 8px 8px 16px; gap: 10px; }
  .brand, .nav a { white-space: nowrap; }
  .nav { gap: 2px; }
  .topbar.admin, .topbar.wrap { flex-wrap: wrap; row-gap: 4px; border-radius: 22px; padding-bottom: 10px; }
  .topbar.admin .nav, .topbar.wrap .nav { order: 3; width: 100%; margin-left: -8px; }
  .topbar.admin .nav a, .topbar.wrap .nav a { font-size: 13px; padding: 5px 9px; }
  .page { padding: 28px 18px 170px; }
  .public { padding-bottom: 60px; }
  .title { font-size: 30px; }
  .post-title { font-size: 30px; margin-bottom: 22px; }
  .prose { font-size: 18px; }
  .lede { font-size: 20px; margin-bottom: 40px; }
  .intro { gap: 16px; margin-bottom: 40px; align-items: flex-start; }
  .headshot { width: 60px; height: 60px; margin-top: 4px; }
  .photo img, .photo .photo-missing { aspect-ratio: 4 / 3; }
  .ikigai { grid-template-columns: 1fr; gap: 16px; margin-top: -22px; }
  .ikigai-venn { max-width: 280px; margin: 0 auto; }
  .page-title { font-size: 24px; }

  .row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .row-date { grid-column: 1 / -1; margin-bottom: -4px; }
  .row-title { font-size: 17px; }
  .row-side .words { display: none; }
  .row-role { display: block; margin: 2px 0 0; }
  .section { margin-top: 44px; }
  .section-more { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .more-peek { grid-column: 1 / -1; white-space: normal; }

  .footbar { padding: 10px 18px 12px; flex-wrap: wrap; gap: 8px 12px; }
  .footbar .meta { flex: 1 1 100%; font-size: 12px; }
  .footbar .actions { width: 100%; justify-content: flex-end; }
  .btn { padding: 7px 12px; }

  .email-line { flex-wrap: wrap; row-gap: 4px; }
  .email-line label { width: 48px; }
  .email-line .subject { font-size: 20px; flex-basis: 100%; }
  .email-line .count { flex-basis: 100%; padding-left: 60px; margin-top: -4px; }

  .activity-months, .activity-grid { grid-template-columns: repeat(26, minmax(0, 1fr)); }
  .activity-months span { grid-column: calc(var(--w) - 26) / span 4; }
  .w-old { display: none !important; }
  .subscribe form { flex-direction: column; }
  .subscribe input, .subscribe .btn { width: 100%; justify-content: center; padding: 10px 14px; }
  .site-foot { flex-direction: column; gap: 10px; padding: 20px 18px 32px; }
  .nav-cta { padding: 7px 12px; }
  .post-nav { flex-direction: column; gap: 14px; }
  .post-nav a { max-width: none; }
  .post-nav .next { text-align: left; margin-left: 0; }

  .field-row { grid-template-columns: 1fr; }
  .choice { flex-wrap: wrap; }
  .choice input[type="datetime-local"] { flex-basis: 100%; margin-left: 24px; }
  dialog { padding: 22px 20px; }
  .preview { padding: 26px 20px; }
  .toolbar-link { width: min(280px, calc(100vw - 40px)); }
}

/* Contacts and groups */
button.row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; }
.row.two { grid-template-columns: minmax(0, 1fr) auto; }
.row-sub .sep::before { content: "·"; margin: 0 6px; color: var(--line-2); }
.list-tools { display: flex; align-items: center; gap: 16px; }
.search { font: inherit; font-size: 14px; width: 190px; padding: 4px 0; border: 0; border-bottom: 1px solid var(--line-2); background: none; color: var(--ink); outline: none; border-radius: 0; }
.search:focus { border-color: var(--ink-3); }
.search::placeholder { color: var(--ink-3); opacity: .8; }
.tabs .tab-caret { margin-left: 6px; font-size: 9px; color: var(--ink-3); }
.picker button[aria-current] .pick-title { color: var(--accent); }
.tabs .tab-count { margin-left: 5px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tabs .tab-link { margin-left: auto; font-size: 12px; color: var(--ink-3); text-decoration: none; padding: 8px 0; }
.tabs .tab-link:hover { color: var(--ink); }
a.link-btn { text-decoration: none; }
.list-foot .foot-links { display: flex; gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 2px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; white-space: nowrap; }
.checks input { accent-color: var(--ink); margin: 0; }
.dialog-meta { font-size: 12px; color: var(--ink-3); margin: -10px 0 18px; }
.field textarea.notes { font-family: var(--ui); font-size: 14px; min-height: 56px; }
.field textarea.paste { font-family: var(--mono); font-size: 13px; min-height: 120px; }
