:root {
  color-scheme: dark;
  --paper: #171714;
  --surface: #23241e;
  --ink: #f6f0e5;
  --muted: #c4c0b3;
  --line: #e6d2b82b;
  --accent: #eab995;
  --ambient: #35352a;
  --warm-light: #87503949;
  --masthead: #1a1916e8;
  --selected: #c4937430;
  --control: #242a22;
  --control-hover: #394235;
  --clay-button: #edb494;
  --clay-ink: #302015;
  --clay-hover: #f6c7ac;
  --ease: cubic-bezier(.22,.75,.24,1);
  font-family: "Geist", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f8f4eb;
  --surface: #fffaf1;
  --ink: #292820;
  --muted: #625a4d;
  --line: #ded4c3;
  --accent: #8b492f;
  --ambient: #efe8d7;
  --warm-light: #e7b79762;
  --masthead: #fffbf4ed;
  --selected: #eee1ce;
  --control: #f3f5ee;
  --control-hover: #e4ebdf;
  --clay-button: #99583e;
  --clay-ink: #fffaf4;
  --clay-hover: #844831;
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
body {
  background:
    radial-gradient(ellipse 52% 420px at 83% 7%, var(--warm-light), transparent 100%),
    radial-gradient(ellipse 80% 650px at 43% 0, var(--ambient), transparent 95%),
    var(--paper);
}
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 540px;
  background: url('./paper-grain.png') repeat;
  opacity: .19;
  mask-image: linear-gradient(#000 30%, transparent);
  pointer-events: none;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(2200px, calc(100% - clamp(34px, 7.4vw, 172px))); margin-inline: auto; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.65; }
[data-art="personal"] { --art-position: center; }
[data-art="dedicated"] { --art-position: right; }

.masthead { position: relative; background: var(--masthead); border-bottom: 1px solid var(--line); }
.nav { min-height: 65px; display: flex; align-items: center; gap: clamp(22px, 4vw, 62px); }
.brand { display: inline-flex; gap: 9px; align-items: center; width: fit-content; white-space: nowrap; }
.brand img { border: 1px solid var(--line); border-radius: 10px; }
.brand strong { font-size: 23px; line-height: 1; letter-spacing: -.045em; }
.nav nav { display: flex; align-items: center; gap: 5px; }
.nav nav a { padding: 8px 13px; border-radius: 7px; white-space: nowrap; color: var(--muted); font-size: 13px; }
.nav a:hover, .footer a:hover, .back:hover { color: var(--accent); }
.theme-switch { display: inline-flex; gap: 2px; flex: none; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.theme-switch button { min-width: 32px; min-height: 30px; padding: 2px 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; line-height: 1; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { border-color: var(--line); background: var(--selected); color: var(--ink); font-weight: 700; }
.theme-switch button:focus-visible { outline-offset: 1px; }
.button {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  transition: background-color .2s ease, transform .2s var(--ease);
}
.button:active { transform: translateY(1px); }
.button-quiet { background: var(--control); color: var(--ink); border-color: var(--line); }
.button-quiet:hover { background: var(--control-hover); }
.footer { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer .brand strong { font-size: 18px; color: var(--ink); }
@media (max-width: 630px) {
  .nav { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding-block: 8px 3px; }
  .nav nav { grid-column: 1 / -1; grid-row: 2; margin-left: -8px; }
  .nav nav a { padding: 5px 8px; font-size: 12px; }
  .brand { gap: 6px; }
  .brand img { width: 30px; height: 30px; border-radius: 8px; }
  .brand strong { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
