:root {
  color-scheme: dark;
  --bg: #0c1424;
  --bg2: #14223a;
  --ink: #e6f1fb;
  --mute: #9fb4cc;
  --lamp: #ffb454;
  --aurora: #5ee6c8;
  --violet: #9b51e0;
  --magenta: #d946ef;
  --card: #172742;
  --line: #2c4466;
  --snow: #f4faff;
  --glow: rgba(255, 180, 84, .28);
  font-family: B612, "Trebuchet MS", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #e9f2fa;
    --bg2: #d3e4f3;
    --ink: #12233b;
    --mute: #4b6280;
    --lamp: #a84f00;
    --aurora: #0a6b5c;
    --violet: #6b21a8;
    --magenta: #a21caf;
    --card: #fbfdff;
    --line: #a9c3dc;
    --snow: #fff;
    --glow: rgba(199, 106, 10, .2);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9f2fa;
  --bg2: #d3e4f3;
  --ink: #12233b;
  --mute: #4b6280;
  --lamp: #a84f00;
  --aurora: #0a6b5c;
  --violet: #6b21a8;
  --magenta: #a21caf;
  --card: #fbfdff;
  --line: #a9c3dc;
  --snow: #fff;
  --glow: rgba(199, 106, 10, .2);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1424;
  --bg2: #14223a;
  --ink: #e6f1fb;
  --mute: #9fb4cc;
  --lamp: #ffb454;
  --aurora: #5ee6c8;
  --violet: #9b51e0;
  --magenta: #d946ef;
  --card: #172742;
  --line: #2c4466;
  --snow: #f4faff;
  --glow: rgba(255, 180, 84, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse 75% 35% at 50% 0%, color-mix(in srgb, var(--aurora) 17%, transparent), transparent 80%),
    radial-gradient(ellipse 65% 32% at 90% 6%, color-mix(in srgb, var(--violet) 16%, transparent), transparent 75%),
    linear-gradient(var(--bg), var(--bg2));
  font: 400 1rem/1.65 B612, "Trebuchet MS", Arial, sans-serif;
}

:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; }
a { color: var(--aurora); }
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.shell {
  width: min(100% - 2rem, 42rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(2.5rem, 9vh, 6rem) 0 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.2rem;
  position: relative;
}
.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.4rem, 5vw, 2.6rem);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  border: 3px solid var(--line);
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--line) 75%, transparent);
}
.profile { text-align: center; padding-top: clamp(2.5rem, 8vw, 4rem); }
.wordmark {
  display: inline-block;
  color: var(--lamp);
  font: 700 1.1rem/1.3 "Pixelify Sans", "Courier New", monospace;
  text-decoration: none;
}
.wordmark span:not(.tm) { color: var(--aurora); }
.tm { margin-left: .1em; font-size: .55em; vertical-align: super; }
.eyebrow {
  margin: .55rem 0 1.2rem;
  color: var(--mute);
  font: 700 .8rem/1.4 "Atkinson Hyperlegible", system-ui, sans-serif;
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1, h2, h3 {
  margin: 0;
  font-family: "Pixelify Sans", "Courier New", monospace;
  font-weight: 600;
  line-height: 1.15;
}
.profile h1 { margin-top: .8rem; font-size: clamp(2rem, 8vw, 3.2rem); }
.bio { max-width: 42ch; margin: .85rem auto 1.8rem; color: var(--mute); }
.pixel-snow {
  position: absolute;
  top: 1.1rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--lamp);
  font: 1rem "Pixelify Sans", monospace;
  transform: translateX(-50%);
}
.pixel-snow span:nth-child(2) { color: var(--aurora); font-size: 1.4rem; }
.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin: -.7rem 0 1.7rem;
}
.social-link {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  color: var(--ink);
  background: var(--bg2);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, color .16s ease;
}
.social-link svg { width: 1.45rem; height: 1.45rem; display: block; }
.social-link:hover {
  color: var(--aurora);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
  border-color: var(--aurora);
}
.profile-links { display: grid; gap: .8rem; }
.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: .8rem 1rem;
  color: var(--ink);
  background: var(--bg2);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font: 700 1rem/1.35 "Atkinson Hyperlegible", system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.profile-link:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); border-color: var(--aurora); }
.profile-error { color: #ffb3a7; }
.home-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--aurora);
  font: 700 .95rem "Atkinson Hyperlegible", system-ui, sans-serif;
  text-underline-offset: 4px;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--mute);
  font-size: .8rem;
}
.footer-mark { color: var(--lamp); font-family: "Pixelify Sans", monospace; }
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .65rem;
  color: var(--mute);
  background: var(--card);
  border: 2px solid var(--line);
  cursor: pointer;
  font: 700 .8rem "Atkinson Hyperlegible", system-ui, sans-serif;
}
.theme-icon { color: var(--lamp); font-size: 1rem; }
.not-found { margin: auto 0; }
.not-found h1 { margin: .3rem 0 .7rem; font-size: clamp(2rem, 8vw, 3.2rem); }
.not-found p:not(.eyebrow) { color: var(--mute); }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.9rem;
  padding: .65rem 1rem;
  color: #1a1020;
  background: var(--lamp);
  border: 3px solid #1a1020;
  box-shadow: 4px 4px 0 #1a1020;
  cursor: pointer;
  font: 700 1rem "Atkinson Hyperlegible", system-ui, sans-serif;
  text-decoration: none;
}
.button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #1a1020; }
.button:disabled { opacity: .6; cursor: wait; }
.button-secondary {
  color: var(--ink);
  background: var(--bg2);
  border-color: var(--line);
  box-shadow: 3px 3px 0 var(--line);
}
.admin-shell { width: min(100% - 2rem, 56rem); justify-content: flex-start; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.admin-heading .eyebrow { margin-bottom: .5rem; }
.admin-heading h1 { font-size: clamp(2rem, 6vw, 3rem); }
.admin-heading .home-link { margin: 0; }
.admin-panel h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
.section-intro { margin: .5rem 0 1.3rem; color: var(--mute); }
code {
  padding: .12rem .32rem;
  color: var(--lamp);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  overflow-wrap: anywhere;
}
.notice { min-height: 1.5em; margin: 0; color: var(--mute); }
.notice[data-error="true"] { color: #ffb3a7; }
.notice[data-success="true"] { color: var(--aurora); }
form { display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; color: var(--ink); font: 700 .95rem "Atkinson Hyperlegible", system-ui, sans-serif; }
input, textarea {
  width: 100%;
  padding: .7rem .8rem;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 0;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--mute); opacity: .75; }
.optional { color: var(--mute); font-weight: 400; }
.input-prefix { display: flex; align-items: stretch; min-width: 0; }
.input-prefix span {
  display: flex;
  align-items: center;
  padding: 0 .65rem;
  color: var(--mute);
  background: var(--bg2);
  border: 2px solid var(--line);
  border-right: 0;
  font-weight: 400;
}
.profile-link-editor { margin: 0; padding: 1rem; border: 2px solid var(--line); }
.profile-link-editor legend { padding: 0 .4rem; color: var(--mute); }
.profile-link-rows { display: grid; gap: .7rem; margin-bottom: .8rem; }
.profile-link-row {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto;
  gap: .5rem;
  align-items: center;
}
.profile-link-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.profile-link-actions button {
  min-height: 2.7rem;
  padding: .4rem .65rem;
  color: var(--ink);
  background: var(--bg2);
  border: 2px solid var(--line);
  cursor: pointer;
}
.profile-link-actions button:hover:not(:disabled) { border-color: var(--aurora); }
.profile-link-actions button:disabled { opacity: .4; cursor: not-allowed; }
.move-link { min-width: 2.7rem; font-size: 1.15rem; line-height: 1; }
.short-link-list { display: grid; gap: .7rem; margin-top: 1.5rem; }
.short-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  padding: .9rem;
  background: var(--bg2);
  border: 2px solid var(--line);
}
.short-item strong { display: block; color: var(--lamp); font-family: "Pixelify Sans", monospace; }
.short-item a { overflow-wrap: anywhere; }
.short-meta { color: var(--mute); font-size: .85rem; }
.short-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.short-actions button {
  padding: .4rem .55rem;
  background: var(--card);
  border: 2px solid var(--line);
  cursor: pointer;
}
.short-actions button:hover { border-color: var(--aurora); }
.disabled-link { opacity: .65; }

@media (max-width: 560px) {
  .shell { width: min(100% - 1.4rem, 42rem); }
  .panel { padding: 1.2rem; }
  .profile { padding-top: 3.3rem; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .profile-link-row { grid-template-columns: 1fr; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
  .profile-link-actions { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
