/* Comfortaa, SIL Open Font License, https://fonts.google.com/specimen/Comfortaa */
@font-face {
  font-family: "Comfortaa";
  src: url("fonts/Comfortaa-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
/* Caveat, SIL Open Font License, https://fonts.google.com/specimen/Caveat */
@font-face {
  font-family: "Caveat";
  src: url("fonts/Caveat-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #faf9f5;            /* ivory */
  --fg: #141413;            /* slate */
  --muted: #5e5d59;
  --rule: #e8e6dc;
  --accent: #0072bb;        /* links, active nav */
  --accent-hover: #005a94;
  --lilac: #86608e;         /* highlights */
  --card: #f0eee6;
  --max: 780px;             /* content width */
  --fs-body: 16px;
  --fs-small: 0.9rem;
  --fs-lead: 1.15rem;
  --fs-h2: 2.1rem;
  --fs-h1: 3rem;
}
:root[data-theme="dark"] {
  --bg: #141413;
  --fg: #faf9f5;
  --muted: #b0aea5;
  --rule: #3d3d3a;
  --card: #1f1f1d;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  transition: background-color 0.2s ease, color 0.2s ease;
  font-family: "Comfortaa", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
}
/* Links draw their underline in from the left on hover. */
a {
  color: var(--accent); text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size 0.25s ease, color 0.15s ease;
}
a:hover { color: var(--accent-hover); background-size: 100% 1px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.logo { background-image: none; }
img { max-width: 100%; height: auto; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

header.site { position: sticky; top: 0; z-index: 10; background: var(--bg); transition: box-shadow 0.2s ease; }
header.site.scrolled { box-shadow: 0 1px 0 var(--rule); }
header.site .wrap {
  max-width: none; padding: 18px 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 24px;
}
.logo .sig { display: block; font-family: "Caveat", cursive; font-size: 1.85rem; line-height: 1; color: var(--fg); transition: color 0.2s ease; }
.logo:hover .sig { color: var(--lilac); }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
nav a { color: var(--fg); display: inline-flex; align-items: center; gap: 5px; }
nav .home-icon { position: relative; top: -1px; }
nav a[aria-current="page"] { color: var(--accent); }
nav a:hover { color: var(--accent); }

main { padding: 40px 0 80px; }
h1, h2 { font-family: "Caveat", cursive; font-weight: 400; line-height: 1.15; }
h1 { font-size: var(--fs-h1); margin: 0 0 20px; }
h2 { font-size: var(--fs-h2); margin: 44px 0 12px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }

/* Home */
.intro { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.intro .text { flex: 1 1 340px; }
.intro h1 { margin: 20px 0 32px; }
ul.prs { list-style: square; padding-left: 22px; margin: 0 0 16px; }
ul.prs li { padding: 3px 0; }
ul.prs li::marker { color: var(--lilac); }


/* Waving hand: one gentle wave on load, then still */
.wave { display: inline-block; transform-origin: 70% 70%; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-8deg); } 45% { transform: rotate(14deg); } 60% { transform: rotate(-4deg); } 75% { transform: rotate(10deg); } }
@media (prefers-reduced-motion: no-preference) { .wave { animation: wave 1.6s ease-in-out 0.3s 1; } }

.updated { font-family: "Caveat", cursive; font-size: 1.1rem; color: var(--muted); margin: 88px 0 0; }
main.notfound { padding-top: 72px; }

/* Contact disclosure */
main.home .block { margin-top: 72px; }
main.home .block h2 { margin-top: 0; }
details.contact summary {
  display: inline-block; cursor: pointer; list-style: none;
  padding: 8px 18px; border: 1.5px solid var(--muted); border-radius: 4px; color: var(--fg);
  transition: background-color 0.18s ease;
}
details.contact summary::-webkit-details-marker { display: none; }
details.contact summary:hover { background: var(--card); }
details.contact[open] summary { margin-bottom: 16px; }
details.contact p { margin: 0 0 10px; }
a.email { background-size: 100% 1px; }
a.email:hover { background-size: 100% 2px; }

/* Copied confirmation on the email link */
.email { position: relative; }
.email .toast {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px);
  background: var(--fg); color: var(--bg); font-size: var(--fs-small); line-height: 1; padding: 6px 9px; border-radius: 5px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s ease, transform 0.15s ease;
}
.email.copied .toast { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Theme switch, bottom right: the knob sits on the active mode's icon */
.theme-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 15;
  width: 64px; height: 32px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--card); color: var(--muted); cursor: pointer; padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle > svg { position: absolute; top: 7px; width: 16px; height: 16px; opacity: 0.6; }
.theme-toggle > .sun { left: 8px; }
.theme-toggle > .moon { right: 8px; display: block; }
.theme-toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--fg); color: var(--bg); transition: transform 0.22s ease;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle .knob svg { width: 14px; height: 14px; display: none; }
.theme-toggle .knob .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(32px); }
:root[data-theme="dark"] .theme-toggle .knob .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .knob .moon { display: block; }
.theme-toggle:hover .knob { transform: translateX(2px); }
:root[data-theme="dark"] .theme-toggle:hover .knob { transform: translateX(30px); }

@media print {
  header.site, .updated, .theme-toggle { display: none !important; }
  details.contact[open] summary { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000 !important; background: none !important; }
  main { padding: 0; }
}

/* Phones: a smaller greeting so the name doesn't break mid-way */
@media (max-width: 480px) {
  :root { --fs-h1: 2.5rem; }
  header.site .wrap { padding: 16px 20px; }
}

abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
