/* ---------- Tweakables ---------- */
:root {
  --bg: #faf6ef;          /* warm paper */
  --ink: #2b2724;         /* dark ink */
  --muted: #6f655c;       /* faded ink for small text */
  --accent: #b5532f;      /* terracotta; try moss #5f6f3a or ochre #a8741a */

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 38rem;
}

/* Warm dark mode: deep brown, not black */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1b17;
    --ink: #ede3d4;
    --muted: #a89c8e;
    --accent: #e08a62;
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #faf6ef;
  --ink: #2b2724;
  --muted: #6f655c;
  --accent: #b5532f;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1b17;
  --ink: #ede3d4;
  --muted: #a89c8e;
  --accent: #e08a62;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 350;
  line-height: 1.48;
  font-optical-sizing: auto;
}

/* Single centered column, mobile-first */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.35rem 1.75rem;
}

@media (min-width: 40rem) {
  body { font-size: 0.92rem; }
  main { padding: 2rem 1.5rem 1.75rem; }
}

/* ---------- Name + sun doodle ---------- */
.masthead {
  margin: 0 0 0.75rem;
}

.theme-toggle {
  display: block;
  margin: 0 0 0.25rem 0.1rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  line-height: 0;
}

.theme-toggle:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.sun {
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  overflow: visible;
}

.sun-rays {
  transform-origin: 32px 32px;
  animation: sun-spin 28s linear infinite;
}

.sun-eyes {
  opacity: 0;
  transition: opacity 180ms ease;
}

/* Hover the name or the sun: it spins faster, bobs, and peeks */
.masthead:hover .sun-rays,
.masthead:focus-within .sun-rays {
  animation-duration: 2.2s;
}

.masthead:hover .sun,
.masthead:focus-within .sun {
  animation: sun-bob 0.65s ease-in-out;
}

.masthead:hover .sun-eyes,
.masthead:focus-within .sun-eyes {
  opacity: 1;
}

@keyframes sun-spin {
  to { transform: rotate(360deg); }
}

@keyframes sun-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-4px) rotate(-10deg); }
  65% { transform: translateY(-1px) rotate(7deg); }
}

/* ---------- Type ---------- */
h1,
h2 {
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.7rem;
  margin: 0;
}

/* A small hand-inked dash under the name */
h1::after {
  content: "";
  display: block;
  width: 2.1rem;
  height: 2.5px;
  margin-top: 0.4rem;
  background: var(--accent);
  border-radius: 2px 6px 3px 5px;
  transform: rotate(-1.5deg);
}

h2 {
  font-size: 1.02rem;
  font-style: italic;
  margin: 1.05rem 0 0.25rem;
}

p {
  margin: 0 0 0.52rem;
}

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

li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.18rem;
}

/* Small terracotta dash instead of a round bullet */
li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.55rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px 2px 1px 2px;
}

/* ---------- Links ---------- */
a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 150ms ease, text-underline-offset 150ms ease;
}

/* On hover, the underline turns into a little wavy pen stroke */
a:hover {
  text-decoration-style: wavy;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.28em;
}

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

/* ---------- Footer ---------- */
footer {
  margin-top: 1.1rem;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
}

footer p {
  margin: 0;
}

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