/* Hot takes — warm editorial, ember accents, quiet motion */

:root {
  --paper: #141210;
  --ink: #ece4d4;
  --muted: #a29885;
  --border: rgba(236, 228, 212, 0.13);
  --accent: #4db2ff;
  --accent-strong: #80c7ff;
  --accent-soft: rgba(77, 178, 255, 0.14);
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

/* light mode is opt-in via the header toggle (default is dark) */
:root[data-theme="light"] {
  --paper: #fbfaf7;
  --ink: #211c15;
  --muted: #6f665a;
  --border: #e8e0d2;
  --accent: #0066cc;
  --accent-strong: #0052a3;
  --accent-soft: rgba(0, 102, 204, 0.09);
  color-scheme: light;
}

/* per-post color themes — set as a class on <article> or .post-list li */
.theme-tide    { --accent: #3de3f2; --accent-strong: #7dedf8; --accent-soft: rgba(61, 227, 242, 0.14); }
.theme-moss    { --accent: #4ade80; --accent-strong: #86efac; --accent-soft: rgba(74, 222, 128, 0.14); }
.theme-iris    { --accent: #c170ff; --accent-strong: #d8a9ff; --accent-soft: rgba(193, 112, 255, 0.14); }
.theme-magenta { --accent: #ff338b; --accent-strong: #ff7ab3; --accent-soft: rgba(255, 51, 139, 0.14); }

:root[data-theme="light"] .theme-tide    { --accent: #0e7490; --accent-strong: #155e75; --accent-soft: rgba(14, 116, 144, 0.09); }
:root[data-theme="light"] .theme-moss    { --accent: #15803d; --accent-strong: #166534; --accent-soft: rgba(21, 128, 61, 0.09); }
:root[data-theme="light"] .theme-iris    { --accent: #8414db; --accent-strong: #6d10b8; --accent-soft: rgba(132, 20, 219, 0.09); }
:root[data-theme="light"] .theme-magenta { --accent: #be185d; --accent-strong: #9d174d; --accent-soft: rgba(190, 24, 93, 0.09); }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--paper); }

.wrap {
  max-width: 42rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---------- header ---------- */

.site-header { padding-block: 2rem 0; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark em { color: var(--accent); font-style: normal; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* about page portrait */
.about-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 6px var(--accent-soft);
  animation: rise-in 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

/* light/dark toggle */
.theme-toggle {
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.nav-link:hover { color: var(--ink); }

/* ---------- home ---------- */

.tagline {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  padding-block: 2.5rem 0;
  animation: rise-in 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

.post-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.post-list li {
  position: relative;
  border-top: 1px solid var(--border);
}
.post-list li:last-child { border-bottom: 1px solid var(--border); }

.post-list li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%) scale(1);
  transition: transform 0.25s ease;
}

.post-list li:hover::before { transform: translateY(-50%) scale(1.6); }

.post-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.35rem;
  padding-left: 1.75rem;
  color: var(--ink);
  text-decoration: none;
}

.post-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.post-link:hover .post-title { color: var(--accent-strong); }

.post-date {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- article ---------- */

.article-header { padding-block: 3rem 0; animation: rise-in 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) both; }

.post-glyph {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  height: 12px;
  margin: 0 0 1.5rem;
}

.post-glyph span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: drift 2.8s ease-in-out infinite;
}

.post-glyph span:nth-child(2) { animation-delay: 0.35s; }
.post-glyph span:nth-child(3) { animation-delay: 0.7s; }
.post-glyph span:nth-child(4) { animation-delay: 1.05s; }
.post-glyph span:nth-child(5) { animation-delay: 1.4s; }
.post-glyph span:nth-child(6) { animation-delay: 1.75s; }

@keyframes drift {
  0%   { opacity: 0; transform: translateY(6px) scale(0.6); }
  35%  { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-10px) scale(1); }
}

.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.article-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.prose { margin-top: 2.25rem; }
.prose p { margin-block: 1.5em; }
.prose p:first-child { margin-top: 0; }

.prose {
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.8;
}

.prose p:first-of-type::first-letter {
  font-size: 3.4em;
  line-height: 0.85;
  float: left;
  padding-right: 0.12em;
  padding-top: 0.05em;
  font-weight: 500;
  color: var(--accent-strong);
}

.prose a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.prose a:hover { text-decoration-color: var(--accent); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 5rem;
  padding-block: 2rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- motion ---------- */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* ---------- accessibility ---------- */

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
