/* ===== AnuPpuccin: Rosé Pine Dawn (light) ===== */
:root {
  --bg:        #faf4ed;
  --sidebar:   #fffaf3;
  --border:    #eaddd2;
  --faint:     #f2e9e1;
  --ink:       #575279;
  --muted:     #797593;
  --accent:    #1a7da4;
  --hover:     #efe6dc;

  /* rainbow file accents (Rosé Pine) */
  --r1: #d7827e; --r2: #ea9d34; --r3: #56949f;
  --r4: #907aa9; --r5: #286983; --r6: #b4637a;
  --r7: #ea9d34;

  --measure: 52rem;
  --nav-w: 250px;
}

/* ===== AnuPpuccin: Catppuccin Frappé (dark) ===== */
html[data-theme="dark"] {
  --bg:        #303446;
  --sidebar:   #292c3c;
  --border:    #414559;
  --faint:     #414559;
  --ink:       #c6d0f5;
  --muted:     #a5adce;
  --accent:    #11b7c5;
  --hover:     #363a4c;

  /* rainbow file accents (Frappé) */
  --r1: #e78284; --r2: #ef9f76; --r3: #a6d189;
  --r4: #85c1dc; --r5: #ca9ee6; --r6: #f4b8e4;
  --r7: #e5c890;
}

html[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', 'Iowan Old Style', serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--nav-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem 1.25rem;
}

.sidebar-head a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* pinned to the bottom: copyright left, action buttons right */
.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.25rem 0.6rem 0;
}

.copyright {
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  white-space: nowrap;
}

.brand-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* rainbow chips, AnuPpuccin "rainbow folder" style — exact v3 row dimensions */
.nav a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.32rem 0.6rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--fi, var(--muted)) 18%, transparent);
  color: var(--fi, var(--ink));
  text-decoration: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover { background: color-mix(in srgb, var(--fi, var(--muted)) 32%, transparent); }
.nav a.active {
  background: var(--fi, var(--accent));
  color: var(--sidebar);
}

.nav li:nth-child(1) a { --fi: var(--r1); }
.nav li:nth-child(2) a { --fi: var(--r2); }
.nav li:nth-child(3) a { --fi: var(--r3); }
.nav li:nth-child(4) a { --fi: var(--r4); }
.nav li:nth-child(5) a { --fi: var(--r5); }
.nav li:nth-child(6) a { --fi: var(--r6); }
.nav li:nth-child(7) a { --fi: var(--r7); }

.head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
}

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  flex: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.toggle:hover { background: var(--hover); color: var(--ink); }
.toggle svg { width: 15px; height: 15px; flex: none; }
.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;
}
.toggle .icon-dark { display: none; }
html[data-theme="dark"] .toggle .icon-light { display: none; }
html[data-theme="dark"] .toggle .icon-dark { display: block; }

/* Poke buttons (Now page) */
.pokeable {
  position: relative;
  border-radius: 6px;
  transition: background 0.3s ease;
}
.poke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-right: 0.4rem;
  vertical-align: -5px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.poke svg { width: 13px; height: 13px; }
.poke:hover { background: var(--hover); color: var(--ink); }
.poke:disabled { cursor: default; }
.pokeable.poked .poke {
  color: var(--accent);
  border-color: var(--accent);
  animation: poke-wiggle 0.5s ease;
}
.pokeable.poked {
  animation: poke-glow 1.2s ease;
}
.pokeable.poked::after {
  content: "poked!";
  position: absolute;
  top: -0.25rem; right: 0;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  pointer-events: none;
  animation: poke-float 1.2s ease forwards;
}
@keyframes poke-wiggle {
  0%   { transform: scale(1) rotate(0deg); }
  25%  { transform: scale(1.25) rotate(-14deg); }
  50%  { transform: scale(1.25) rotate(12deg); }
  75%  { transform: scale(1.1) rotate(-6deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes poke-glow {
  0%   { background: color-mix(in srgb, var(--accent) 22%, transparent); }
  100% { background: transparent; }
}
@keyframes poke-float {
  0%   { opacity: 0; transform: translateY(6px); }
  20%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .pokeable.poked, .pokeable.poked .poke, .pokeable.poked::after { animation: none; }
  .pokeable.poked::after { opacity: 1; }
}

/* Newsletter (Contact page) */
.newsletter-blurb { position: relative; padding-right: 7rem; }
.newsletter-blurb p:last-of-type { margin-bottom: 0; }

/* Minecraft-title-screen style splash: diagonal, pulsing, same font as "poked!" */
.splash {
  position: absolute;
  right: 0; top: 0.6rem;
  display: inline-block;
  transform: rotate(-18deg);
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--r7);
  text-shadow: 1px 1px 0 color-mix(in srgb, var(--r7) 35%, transparent);
  white-space: nowrap;
  pointer-events: none;
  animation: splash-pulse 0.9s ease-in-out infinite;
}
@keyframes splash-pulse {
  0%, 100% { transform: rotate(-18deg) scale(1); }
  50%      { transform: rotate(-18deg) scale(1.1); }
}

.subscribe {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  max-width: 28rem;
}
.subscribe input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s ease;
}
.subscribe input::placeholder { color: var(--muted); }
.subscribe input:focus { outline: none; border-color: var(--accent); }
.subscribe button {
  flex: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--sidebar);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.subscribe button:hover { opacity: 0.88; }
.subscribe-note { font-size: 0.8rem; margin: 0.6rem 0 0; }

@media (prefers-reduced-motion: reduce) {
  .splash { animation: none; }
}
@media (max-width: 820px) {
  .newsletter-blurb { padding-right: 0; padding-top: 1.5rem; }
  .splash { right: auto; left: 0; top: -0.25rem; transform-origin: left center; }
  .subscribe { flex-direction: column; }
}

/* ===================== MAIN ===================== */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 8rem 2rem 10rem;
  margin-left: var(--nav-w);
}
@media (min-width: 1100px) {
  main { margin-left: 0; padding-left: calc(var(--nav-w) + 3rem); padding-right: 3rem; }
}

section { margin-bottom: 4.5rem; scroll-margin-top: 3rem; }
section:last-of-type { margin-bottom: 0; }

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

/* Name + social icon buttons on the home page */
.name-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.name-row h1 { margin: 0; }
.social-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
}
.social-actions .toggle { text-decoration: none; }

h2 {
  font-size: 0.8rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 1.25rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

p { margin: 0 0 1.1rem; }
.lead { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-color: var(--accent); }

.muted { color: var(--muted); }

ul { list-style: none; margin: 0; padding: 0; }

.entries li { margin-bottom: 1rem; }
.entries .title { color: var(--accent); }

.rows li {
  display: flex;
  gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--faint);
  align-items: baseline;
}
.rows li:last-child { border-bottom: 1px solid var(--faint); }
.rows .date {
  color: var(--muted);
  font-size: 0.85rem;
  flex: 0 0 5.5rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--faint);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

hr {
  border: none;
  border-top: 1px solid var(--faint);
  margin: 4.5rem 0;
}

/* ===================== MOBILE ===================== */
.menu-btn { display: none; }

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease, background 0.25s ease;
    z-index: 20;
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  main { margin-left: 0; padding: 5rem 1.5rem 6rem; }

  .menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 1rem; left: 1rem;
    z-index: 30;
    width: 40px; height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--sidebar);
    color: var(--ink);
    cursor: pointer;
  }
  .menu-btn svg { width: 18px; height: 18px; }
  body.nav-open .menu-btn { display: none; }

  .scrim {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 15;
  }
  body.nav-open .scrim { display: block; }

  .rows li { flex-direction: column; gap: 0.1rem; }
  .rows .date { flex: none; }
}
