/* ── TOKENS ───────────────────────────────── */
:root {
  --bg:       #f8f7f5;   /* warm near-white */
  --surface:  #f0ede8;   /* slightly deeper for inputs */
  --text:     #0f0e0c;   /* ink black */
  --mid:      #6b6560;   /* mid-tone for dates, meta */
  --dim:      #a09890;   /* dimmed for credits */
  --accent:   #b5522a;   /* terracotta */
  --accent-dk:#8f3d1c;   /* deeper for hover bg */
  --rule:     #e2ddd7;   /* warm rule */
  --hash:     #b5522a;
  /* aliases so any legacy --green refs don't break */
  --green:    #b5522a;
  --green-dk: #8f3d1c;
}

[data-theme="dark"] {
  --bg:       #1e1b18;   /* warm charcoal */
  --surface:  #272320;
  --text:     #f0ebe4;   /* warm cream */
  --mid:      #9a9088;
  --dim:      #5e5850;
  --accent:   #d4764a;
  --accent-dk:#e8916a;
  --rule:     #2e2a26;
  --hash:     #d4764a;
  --green:    #d4764a;
  --green-dk: #e8916a;
}

/* ── RESET ───────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  transition: background 0.25s, color 0.25s;
}

body {
  font-family: 'Azeret Mono', monospace;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── LAYOUT ───────────────────────────────── */
.wrap {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── HEADER ───────────────────────────────── */
.site-header {
  padding: 2.5rem 0 2rem;
  margin-bottom: 0.25rem;
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Avatar — circular placeholder */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--rule);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--mid);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.header-text { display: flex; flex-direction: column; gap: 0.1rem; }

.site-name {
  font-family: 'DotGothic16', sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
}

.site-tagline {
  font-size: 0.78rem;
  color: var(--mid);
  font-weight: 300;
}

/* Dark toggle */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--dim);
  cursor: none;
  line-height: 0;
  transition: color 0.15s;
  flex-shrink: 0;
}

.theme-btn:hover { color: var(--mid); }
.theme-btn svg { display: none; width: 15px; height: 15px; }
.theme-btn svg circle, .theme-btn svg path {
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
:root:not([data-theme="dark"]) .theme-btn .sun  { display: block; }
[data-theme="dark"]            .theme-btn .moon { display: block; }

/* ── MAIN ───────────────────────────────── */
main { padding-bottom: 4rem; }

/* ── SECTIONS ────────────────────────────── */
.site-section {
  padding: 1.75rem 0;
}

/* Section label row: # + label */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.section-hash {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--accent);
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

.section-label {
  font-family: 'DotGothic16', sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text);
  line-height: 1;
}

/* ── UNIVERSAL LINKS — BG highlight hover ── */
* { cursor: none !important; }

a {
  color: var(--accent);
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}

/* Inline links get padding so the bg fill has breathing room */
a:not(.site-name):not(.avatar) {
  padding: 0.05em 0.25em;
  margin: 0 -0.25em;
}

a:not(.site-name):not(.avatar):hover {
  background: var(--accent);
  color: #fff;
}

/* ── TRAIL CURSOR ─────────────────────────── */
.cursor-dot {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}

.cursor-trail {
  position: fixed;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* ── ABOUT ───────────────────────────────── */
.about-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}

/* ── WRITING ─────────────────────────────── */
.section-desc {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.section-desc em {
  font-style: italic;
  font-family: 'Azeret Mono', monospace;
}

.post-list { list-style: none; }

.post-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.45rem 0;
}

.post-btn {
  background: none; border: none;
  padding: 0.05em 0.25em;
  margin: 0 -0.25em;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--accent);
  cursor: none;
  text-align: left;
  line-height: 1.4;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}

.post-btn:hover {
  background: var(--accent);
  color: #fff;
}

.post-date {
  font-size: 0.88rem;
  color: var(--dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.archive-link-wrap { margin-top: 0.85rem; }
.archive-link { font-size: 0.88rem; }
.feed-state { font-size: 0.88rem; color: var(--mid); padding: 0.25rem 0; }

/* ── ACCORDION ───────────────────────────── */
.accordion-toggle {
  background: none; border: none;
  padding: 0.05em 0.25em;
  margin: 0.6rem -0.25em 0;
  font-family: inherit; font-size: 0.88rem;
  color: var(--accent); cursor: none;
  text-align: left; display: block;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}

.accordion-toggle:hover {
  background: var(--accent);
  color: #fff;
}

.accordion-list { margin-top: 0.25rem; }

/* ── STAY IN TOUCH ───────────────────────── */
.contact-note {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.social-list {
  display: flex; flex-wrap: wrap;
  column-gap: 1rem; row-gap: 0.2rem;
}

/* ── NEWSLETTER FORM ─────────────────────── */
.nl-row { display: flex; max-width: 360px; }

.nl-row input[type="email"] {
  flex: 1; min-width: 0;
  padding: 0.5rem 0.7rem;
  font-family: inherit; font-size: 1rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--rule); border-right: none;
  outline: none; border-radius: 0; -webkit-appearance: none;
  cursor: text !important;
  transition: border-color 0.2s;
}

.nl-row input[type="email"]::placeholder { color: var(--dim); }
.nl-row input[type="email"]:focus { border-color: var(--accent); }

.nl-row input[type="submit"] {
  flex-shrink: 0;
  padding: 0.5rem 0.85rem;
  font-family: inherit; font-size: 0.78rem; font-weight: 500;
  color: #fff; background: var(--accent);
  border: 1px solid var(--accent);
  cursor: none; border-radius: 2px; -webkit-appearance: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.nl-row input[type="submit"]:hover   { background: var(--accent-dk); border-color: var(--accent-dk); }
.nl-row input[type="submit"]:disabled { opacity: 0.5; }

.nl-confirm { margin-top: 0.5rem; font-size: 0.75rem; color: var(--accent); min-height: 1rem; }

.nl-credit { margin-top: 0.4rem; font-size: 0.65rem; color: var(--dim); }
.nl-credit a { font-size: 0.65rem; }

/* ── POST READER ─────────────────────────── */
#reader-view  { display: none; }
#default-view { display: block; }

.reader-back {
  background: none; border: none;
  padding: 0.05em 0.25em;
  margin: 0 -0.25em;
  font-family: inherit; font-size: 0.78rem;
  color: var(--accent); cursor: none;
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin-bottom: 2rem;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}

.reader-back:hover {
  background: var(--accent);
  color: #fff;
}

.reader-title {
  font-family: 'DotGothic16', sans-serif;
  font-size: 1.4rem; font-weight: 400; line-height: 1.3;
  color: var(--text); margin-bottom: 0.4rem;
}

.reader-meta {
  font-size: 0.72rem; color: var(--mid);
  margin-bottom: 1.75rem;
}

.reader-body {
  font-family: 'Azeret Mono', monospace;
  font-size: 1rem; line-height: 1.85; color: var(--text);
}

.reader-body p          { margin-bottom: 1.25em; }
.reader-body h2, .reader-body h3 { font-family: inherit; margin: 1.5em 0 0.5em; font-size: 1rem; }
.reader-body blockquote { border-left: 2px solid var(--rule); padding-left: 1rem; margin: 1.25em 0; color: var(--mid); font-style: italic; }
.reader-body img        { max-width: 100%; height: auto; margin: 1.25em 0; display: block; }
.reader-body ul, .reader-body ol { padding-left: 1.25rem; margin-bottom: 1.25em; }
.reader-body li         { margin-bottom: 0.3em; }
.reader-body hr         { border: none; border-top: 1px solid var(--rule); margin: 1.75em 0; }

.reader-external {
  margin-top: 1.5rem;
  font-size: 0.72rem; color: var(--mid);
}

.reader-below { margin-top: 3rem; }

/* ── FOOTER ──────────────────────────────── */
.site-footer { padding: 1.25rem 0 2rem; }
.site-footer p { font-size: 0.65rem; color: var(--dim); }

/* ── MOBILE ───────────────────────────────── */
@media (max-width: 480px) {
  .site-section  { padding: 1.5rem 0; }
  .reader-title  { font-size: 1.2rem; }
  .post-item     { flex-direction: column; gap: 0.1rem; }
  .post-item .post-date { padding-left: 0.25em; font-size: 0.72rem; }
  .nl-row        { flex-direction: column; max-width: 100%; }
  .nl-row input[type="email"]  { border-right: 1px solid var(--rule); border-bottom: none; width: 100%; }
  .nl-row input[type="submit"] { width: 100%; border-top: none; border-radius: 0 0 2px 2px; }
}
