:root {
  --bg: #f6f5f2;
  --text: #121212;
  --muted: #7a7a7a;
  --line: #e2e0db;
  --accent: #6d4aff;
  --on-accent: #fff;
  --spot: rgba(109, 74, 255, .10);
}
:root[data-theme="dark"] {
  --bg: #0c0c0c;
  --text: #eeeeee;
  --muted: #808080;
  --line: #232323;
  --accent: #b6a4ff;
  --on-accent: #0c0c0c;
  --spot: rgba(182, 164, 255, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0c;
    --text: #eeeeee;
    --muted: #808080;
    --line: #232323;
    --accent: #b6a4ff;
    --on-accent: #0c0c0c;
    --spot: rgba(182, 164, 255, .08);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light dark; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--on-accent); }

.spot {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .6s;
  background: radial-gradient(420px circle at var(--x, 50%) var(--y, 50%), var(--spot), transparent 70%);
}
.spot.on { opacity: 1; }

.page {
  position: relative; z-index: 1;
  max-width: 640px; min-height: 100vh; margin: 0 auto;
  padding: 28px 24px 32px;
  display: flex; flex-direction: column;
}

/* --- top bar --- */
.bar { display: flex; justify-content: space-between; align-items: center; }
.mark { font-weight: 700; font-size: 1.1rem; letter-spacing: -.03em; }
.theme {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: none; cursor: pointer; display: grid; place-items: center; transition: border-color .2s, transform .3s;
}
.theme:hover { border-color: var(--text); transform: rotate(180deg); }
.theme span {
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(90deg, var(--text) 50%, transparent 50%);
  border: 1.5px solid var(--text);
}

/* --- hero --- */
.hero { padding: 16vh 0 0; }
.hi { color: var(--muted); font-size: 1rem; margin-bottom: 6px; }
.name {
  font-size: clamp(3.6rem, 15vw, 6.8rem); font-weight: 700; letter-spacing: -.055em; line-height: .95;
  display: flex; cursor: default; user-select: none;
}
.name span {
  display: inline-block; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), color .25s;
  animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms);
}
.name:hover span { transform: translateY(-6px); transition-delay: var(--d, 0ms); }
.name span:hover { color: var(--accent); }
.name .accent { color: var(--accent); }

/* the "i" is a hidden link */
.name .rick { cursor: pointer; }
.name .rick:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.lead { margin-top: 18px; font-size: 1.15rem; color: var(--muted); min-height: 1.6em; display: flex; align-items: center; }
.rotator { color: var(--text); }
.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- links --- */
.links { margin-top: 64px; border-top: 1px solid var(--line); counter-reset: l; }
.link {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 34px 1fr auto 22px; align-items: center; gap: 14px;
  padding: 20px 10px; border-bottom: 1px solid var(--line);
  transition: color .3s, padding .3s;
}
.link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  transform: scaleY(0); transform-origin: bottom; transition: transform .35s cubic-bezier(.7, 0, .2, 1);
}
.link:hover, .link:focus-visible, .link.pressed { color: var(--on-accent); padding-left: 18px; padding-right: 18px; outline: none; }
.link:hover::before, .link:focus-visible::before, .link.pressed::before { transform: scaleY(1); }
.num { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; color: var(--muted); transition: color .3s; }
.body { display: flex; flex-direction: column; min-width: 0; }
.label { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.desc {
  font-size: .88rem; max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .35s, opacity .3s, margin .35s;
}
.link:hover .desc, .link:focus-visible .desc { max-height: 2.6em; opacity: .85; margin-top: 2px; }
.meta { font-size: .88rem; color: var(--muted); transition: color .3s; }
.arrow { transition: transform .3s; justify-self: end; }
.link:hover .num, .link:hover .meta, .link:focus-visible .num, .link:focus-visible .meta { color: inherit; opacity: .8; }
.link:hover .arrow, .link:focus-visible .arrow { transform: translateX(4px) rotate(-45deg); }
.copy { cursor: copy; border-bottom: 1px dashed currentColor; }

/* --- extras --- */
.extras { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; }
.qr {
  display: flex; align-items: center; gap: 12px; padding: 0; background: none; border: 0;
  color: var(--muted); font: inherit; font-size: .88rem; cursor: zoom-in;
}
.qr img { background: #fff; padding: 3px; border-radius: 6px; border: 1px solid var(--line); image-rendering: pixelated; transition: transform .25s; }
.qr:hover img { transform: rotate(-6deg) scale(1.08); }
.qr:hover span { color: var(--text); }
.hint { color: var(--muted); font-size: .82rem; }
kbd {
  font-family: ui-monospace, Menlo, monospace; font-size: .75rem;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text);
}

.foot { margin-top: auto; padding-top: 72px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .82rem; }

/* --- dialog + toast --- */
.qr-dialog {
  margin: auto; padding: 28px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--bg); color: var(--text); text-align: center; max-width: calc(100vw - 32px);
}
.qr-dialog[open] { animation: pop .25s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
.qr-dialog::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px); }
.qr-dialog img { display: block; max-width: 100%; height: auto; background: #fff; padding: 12px; border-radius: 10px; image-rendering: pixelated; }
.qr-dialog p { color: var(--muted); margin: 14px 0 18px; }
.close { font: inherit; font-size: .9rem; padding: 8px 18px; border-radius: 8px; cursor: pointer; background: var(--text); color: var(--bg); border: 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 5; transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .88rem;
  transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- mobile --- */
@media (max-width: 560px) {
  .page { padding: 20px 16px 28px; }
  .hero { padding-top: 10vh; }
  .link { grid-template-columns: 28px 1fr 22px; }
  .meta, .hint { display: none; }
  .desc { max-height: 2.6em; opacity: .7; margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
