/* ==========================================================================
   Personal profile — rebuilt layout
   Palette variables are defaults; script.js replaces them from the wallpaper.
   ========================================================================== */
:root {
  --wallpaper-image: url("assets/wallpaper-placeholder.png");

  --bg: hsl(218 32% 9%);
  --bg-deep: hsl(220 36% 5%);
  --veil-top: hsla(218, 34%, 6%, .12);
  --veil-bottom: hsla(220, 38%, 4%, .34);
  --header-bg: hsla(218, 32%, 7%, .74);
  --card-fill: hsla(218, 30%, 6%, .55);

  --surface: hsla(218, 24%, 88%, .065);
  --surface-strong: hsla(218, 24%, 88%, .105);
  --line: hsla(218, 22%, 84%, .18);
  --text: hsl(218 16% 96%);
  --muted: hsl(218 18% 75%);

  --accent: hsl(28 82% 68%);
  --accent-2: hsl(172 72% 64%);
  --accent-soft: hsla(28, 82%, 68%, .14);
  --accent-2-soft: hsla(172, 72%, 64%, .14);
  --accent-contrast: hsl(24 58% 10%);

  --radius: 22px;
  --shadow-tight: hsla(218, 40%, 4%, .3);
  --shadow-soft: hsla(218, 45%, 3%, .42);
  --shadow: 0 2px 8px var(--shadow-tight), 0 20px 52px var(--shadow-soft);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: transparent;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Boot intro --------------------------------------------------------------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--bg-deep);
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-window {
  width: min(100%, 520px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0f18;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .85rem;
}
.boot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #151b26;
}
.boot-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.boot-dot:nth-child(2) { background: var(--accent-2); }
.boot-dot:nth-child(3) { background: var(--muted); }
.boot-title { margin-left: auto; color: var(--muted); font-size: .72rem; }
.boot-body { padding: 1rem; color: #7ee787; white-space: pre-wrap; }
.boot-prompt { color: #58a6ff; font-weight: 700; }
.boot-cursor {
  display: inline-block;
  width: .55ch;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: #7ee787;
  animation: boot-blink .9s step-end infinite;
}
.boot.is-done .boot-cursor { animation: none; opacity: 0; }
.boot-hint {
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: .72rem;
  text-align: right;
}
.boot.is-done .boot-hint { display: none; }
@keyframes boot-blink { 50% { opacity: 0; } }

/* Background -------------------------------------------------------------- */
.wallpaper, .wallpaper-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.wallpaper {
  z-index: -3;
  background: var(--wallpaper-image) center / cover no-repeat;
  filter: saturate(1.15) brightness(1.05);
  transform: translate3d(0, calc(var(--scroll, 0) * -30px), 0) scale(1.03);
  will-change: transform;
}
.wallpaper-veil {
  z-index: -2;
  background: linear-gradient(180deg, var(--veil-top), var(--veil-bottom));
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 40px 40px;
  content: '';
}

/* Shared pieces ----------------------------------------------------------- */
.surface-card {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--surface-strong), var(--surface)), var(--card-fill);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  backdrop-filter: blur(10px) saturate(115%);
}
.surface-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.06) 42%, rgba(255,255,255,.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  content: '';
}
.surface-card > * { position: relative; z-index: 1; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 30;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

.page-shell {
  width: min(100% - 2.5rem, 1180px);
  margin-inline: auto;
  padding-block: 0 3rem;
}

/* Header: one capsule; links inside are plain text ----------------------- */
.site-header {
  position: sticky;
  top: .75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: .75rem auto 0;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--header-bg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.wordmark {
  max-width: 55%;
  color: var(--text);
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.wordmark-dot { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: .2rem .55rem; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: .2rem .45rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .18s ease;
}
.site-nav a:hover { color: var(--accent-2); }

/* Widget board: a packed 12-column grid on desktop, one column on phones -- */
.widget-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: .8rem;
  margin-top: 1rem;
}
.widget {
  position: relative;
  display: flex;
  flex-direction: column;
  grid-column: span var(--span, 6);
  margin: 0;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, opacity .15s ease;
}
.widget:hover { transform: translateY(-3px); border-color: var(--accent); }
.widget.is-dragging { opacity: .65; transform: scale(.99); }
.widget.is-highlighted { animation: widget-spotlight .9s ease; }
@keyframes widget-spotlight {
  0% { border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-2-soft), var(--shadow); }
  40% { transform: translateY(-4px) scale(1.012); border-color: var(--accent-2); box-shadow: 0 0 0 6px var(--accent-2-soft), 0 24px 60px rgba(0,0,0,.5); }
  100% { box-shadow: var(--shadow); }
}

.widget-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  padding: .9rem 1rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
}
.widget img, .widget audio, .widget iframe { max-width: 100%; }
.widget.hero { padding: 0; }
.widget.hero .widget-body {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: .9rem;
  padding: 1.1rem;
  text-align: center;
}
.widget.hero .avatar { width: min(100%, 120px); }
.widget.hero .bio { margin-inline: auto; }
.widget.hero .hero-actions, .widget.hero .hero-media { justify-content: center; }

/* Section headings -------------------------------------------------------- */
.section-head { margin-bottom: .9rem; }
.section-index {
  margin: 0 0 .25rem;
  color: var(--accent);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.2; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.05em; }
h2 { margin: 0 0 .35rem; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.035em; }
.section-intro { margin: 0; color: var(--muted); font-size: .9rem; }

/* About ------------------------------------------------------------------- */
.hero-media { display: grid; justify-items: center; gap: .8rem; }
.avatar {
  display: block;
  width: min(100%, 200px);
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 28%;
  object-fit: cover;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .35rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .76rem;
}
.status-dot {
  width: .55rem;
  height: .55rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px var(--accent-2-soft);
}
.status-dot[data-status="idle"] { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.status-dot[data-status="dnd"] { background: hsl(0 78% 66%); box-shadow: 0 0 0 4px hsla(0,78%,66%,.16); }
.status-dot[data-status="offline"], .status-dot[data-status="unavailable"] { background: var(--muted); box-shadow: none; }

.eyebrow {
  margin: 0 0 .25rem;
  color: var(--accent-2);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.handle { margin: .2rem 0 .9rem; color: var(--accent); font-weight: 700; }
.bio { max-width: 52ch; margin: 0 0 1.1rem; color: var(--muted); }
.hero-actions, .settings-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { border-color: transparent; background: var(--accent); color: var(--accent-contrast); }
.button-primary:hover { background: var(--accent-2); }
.button-ghost { background: var(--surface); color: var(--text); }
.button-ghost:hover { border-color: var(--accent-2); }
.button[data-copied="true"] { border-color: var(--accent-2); color: var(--accent-2); }
body:not(.is-unlocked) .owner-only { display: none !important; }

/* Cards inside widgets ---------------------------------------------------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.project-card { display: flex; flex-direction: column; gap: .4rem; padding: 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.project-card:hover { border-color: var(--accent); }
.card-kicker { margin: 0; color: var(--accent-2); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.project-card h3 { margin: 0; font-size: 1.05rem; }
.project-card > p:not(.card-kicker) { margin: 0; color: var(--muted); font-size: .88rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 0; padding: 0; list-style: none; }
.tag-list li { padding: .22rem .6rem; border-radius: 999px; background: var(--accent-2-soft); color: var(--accent-2); font-size: .74rem; }
.card-link { margin-top: auto; padding-top: .6rem; color: var(--accent); font-size: .84rem; font-weight: 700; text-decoration: none; }
.card-link:hover { text-decoration: underline; }

.connections-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.connection-card { display: flex; align-items: center; gap: .7rem; min-height: 68px; padding: .8rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.connection-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.connection-card.is-placeholder { cursor: default; }
.connection-card.is-placeholder:hover { transform: none; border-color: var(--line); }
.connection-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--accent-2-soft); color: var(--accent-2); font-weight: 800; }
.connection-icon svg, .connection-icon img { display: block; width: 21px; height: 21px; }
.connection-text { min-width: 0; }
.connection-name { margin: 0; font-size: .92rem; font-weight: 700; }
.connection-handle { margin: 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.connection-arrow { margin-left: auto; color: var(--accent); }
.connection-card.is-placeholder .connection-arrow { display: none; }

.inline-link { color: var(--accent-2); font-weight: 700; text-underline-offset: 3px; }
.placeholder-note { color: var(--muted); font-size: .8rem; opacity: .8; }


.activity-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.activity-avatar { width: 80px; height: 80px; border: 1px solid var(--line); border-radius: 18px; object-fit: cover; }
.activity-info { min-width: 0; }
.activity-name { margin: 0 0 .2rem; font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; }
.activity-status { display: flex; align-items: center; gap: .45rem; margin: 0 0 .4rem; color: var(--muted); font-size: .84rem; }
.activity-detail { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.activity-footnote { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; margin: 0; padding-top: .7rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.text-button { min-height: 36px; border: 0; background: none; color: var(--accent-2); font: inherit; font-size: .76rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.music-layout { display: grid; gap: .7rem; width: 100%; }
.music-preview iframe {
  display: block;
  width: 100%;
  height: 200px;
  border: 0;
  border-radius: 14px;
}
.music-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.music-player audio { display: none; }
.music-now { position: relative; align-self: center; }
.music-art {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: cover;
}
.music-play {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-deep);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
}
.music-play svg { width: 18px; height: 18px; fill: currentColor; }
.music-play.is-playing svg { display: none; }
.music-play.is-playing::after {
  content: '';
  width: 12px;
  height: 14px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}
.music-body { min-width: 0; }
.music-state {
  margin: 0 0 .5rem;
  color: var(--text);
  font-size: .85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-controls { display: grid; gap: .45rem; }
.music-buttons { display: flex; align-items: center; gap: .5rem; }
.ios-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
}
.ios-btn:hover { background: var(--accent-soft); color: var(--accent); }
.ios-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ios-btn[data-mute] svg { fill: none; }
.music-progress { width: 100%; accent-color: var(--accent); }
.music-times {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.music-volume { display: flex; align-items: center; gap: .5rem; }
.music-volume input { flex: 1; accent-color: var(--accent-2); }
.music-actions { display: flex; justify-content: center; }
.song-link { width: 100%; justify-content: center; }
.widget[data-widget="music"] { align-self: start; }
.clock-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 190px;
}
.spike-clock {
  --clock-size: 190px;
  position: relative;
  width: var(--clock-size);
  height: var(--clock-size);
  flex: none;
}
.spike-ring { position: absolute; inset: 0; }
.spike {
  position: absolute;
  inset: 0;
  width: 4px;
  height: 1px;
  margin: auto;
  background: var(--line);
  transform-origin: 50%;
  transform: rotate(var(--rotate)) translateX(var(--dail-size));
}
.spike:nth-child(5n + 1) {
  background: var(--accent-2);
  box-shadow: -6px 0 var(--accent-2);
}
.spike::after {
  content: attr(data-i);
  position: absolute;
  right: 18px;
  top: -9px;
  color: var(--muted);
  font-size: 10px;
  transform: rotate(calc(-1 * var(--rotate)));
}
.spike-seconds {
  --dail-size: calc((var(--clock-size) / 2) - 6px);
  transform: rotate(calc(-1 * var(--dRotate, 0deg)));
  transition: transform 1s linear;
}
.spike-minutes {
  --dail-size: calc((var(--clock-size) / 2) - 40px);
  transform: rotate(calc(-1 * var(--dRotate, 0deg)));
  transition: transform 1s linear;
}
.spike-minute {
  position: absolute;
  right: calc(var(--clock-size) / 5);
  top: 50%;
  z-index: 2;
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  transform: translateY(-50%);
}
.spike-minute::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  width: calc(var(--clock-size) / 2.6);
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  transform: translateY(-50%);
}
.spike-hour {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  color: var(--text);
  font-size: 54px;
  font-weight: 900;
  transform: translate(-50%, -50%);
}
.clock-readout { display: grid; gap: .2rem; min-width: 0; }
.clock-readout time:first-child { color: var(--muted); font-size: .8rem; }
.clock-time { color: var(--text); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-readout span { color: var(--accent-2); font-size: .76rem; }

/* Interactive 3D Discord presence card ----------------------------------- */
.card-stage {
  display: grid;
  place-items: center;
  padding: .4rem .2rem .6rem;
  perspective: 900px;
}
.activity-3d {
  --rx: 0;
  --ry: 0;
  --mx: 50%;
  --my: 50%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--ry) * -1deg)) rotateY(calc(var(--rx) * 1deg));
  box-shadow:
    calc(var(--rx) * -.5px) calc(var(--ry) * .6px + 3px) 8px var(--shadow-tight),
    calc(var(--rx) * -1.5px) calc(var(--ry) * 1.6px + 20px) 52px var(--shadow-soft);
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: grab;
  touch-action: none;
}
.activity-3d.is-dragging { cursor: grabbing; transition: none; }
.activity-3d::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.26), transparent 52%);
  pointer-events: none;
  transform: translateZ(1px);
  content: '';
}
.activity-3d::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.12) 45%, rgba(255,255,255,.3) 50%, rgba(255,255,255,.1) 55%, transparent 70%);
  background-size: 220% 100%;
  background-position: calc(50% + var(--rx) * 3%) calc(50% + var(--ry) * 2%);
  opacity: .45;
  pointer-events: none;
  transform: translateZ(2px);
  transition: opacity .2s ease;
  content: '';
}
.activity-3d.is-dragging::after { opacity: 1; }
.activity-3d .activity-avatar { transform: translateZ(26px); }
.activity-3d .activity-info { transform: translateZ(18px); }
.activity-3d .activity-footnote { transform: translateZ(10px); }
.widget[data-widget="activity"] { text-align: center; }
.widget[data-widget="activity"] .section-head { text-align: center; }
.activity-3d {
  width: min(100%, 300px);
  border-radius: 24px;
  background: linear-gradient(160deg, var(--surface-strong), var(--card-fill));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    calc(var(--rx) * -.5px) calc(var(--ry) * .6px + 3px) 8px var(--shadow-tight),
    calc(var(--rx) * -1.5px) calc(var(--ry) * 1.6px + 20px) 52px var(--shadow-soft);
}
.badge-stage { display: grid; place-items: center; width: 100%; padding: .2rem 0 .5rem; perspective: 1000px; }
.badge-hanger {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transform-origin: 50% 0;
}
.lanyard {
  position: absolute;
  top: 0;
  left: 50%;
  width: 240px;
  height: 110px;
  overflow: visible;
  pointer-events: none;
  transform: translateX(-50%);
}
.lanyard .band {
  fill: none;
  stroke: url(#bandGradient);
  stroke-width: 12;
  stroke-linecap: round;
}
.lanyard .joint {
  fill: var(--surface-strong);
  stroke: var(--accent);
  stroke-width: 1;
}
.lanyard .anchor { fill: var(--accent); }
.badge-card {
  margin-top: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  width: min(100%, 240px) !important;
  min-height: 300px;
  padding: 1rem .9rem;
  text-align: center;
}
.badge-clip {
  width: 46px;
  height: 12px;
  margin-top: -20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}
.activity-card { padding: .8rem; }
.activity-avatar { width: 64px; height: 64px; }
.badge-card .activity-avatar {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: 0 0 0 3px var(--accent-2-soft), 0 12px 26px rgba(0, 0, 0, .5);
}
.badge-card .activity-info { width: 100%; }
.badge-card .activity-name { font-size: 1.25rem; letter-spacing: -.02em; }
.badge-card .activity-status {
  justify-content: center;
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.badge-card .activity-detail { text-align: center; margin-bottom: .5rem; }
.badge-card .activity-footnote { margin-top: auto; }
.badge-card.has-activity .activity-footnote { padding-top: .8rem; }
.badge-card .activity-footnote {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .3rem;
}
.card-stage { padding: .2rem .2rem .4rem; }

/* Footer ------------------------------------------------------------------ */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .75);
}
.site-footer .inline-link { color: var(--accent); text-shadow: none; }
.site-footer p { margin: 0; }
.settings-button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 42px;
  padding: .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.settings-button:hover {
  border-color: var(--accent);
  background: var(--surface-strong);
  transform: translateY(-2px);
}
.settings-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
}

/* Same moving rim on the 3D badge ------------------------------------- */
.glow-surface .gradient {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  animation: glow-shift 2.4s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: .7;
  transition: opacity .25s ease;
}
.glow-surface:hover .gradient { opacity: 1; }
@keyframes glow-shift { to { background-position: 200% 0; } }

/* Settings dialogs -------------------------------------------------------- */
.settings-dialog {
  width: min(100% - 1.5rem, 540px);
  max-height: min(90vh, 820px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.settings-dialog::backdrop { background: rgba(3,6,12,.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.settings-form { display: grid; gap: .9rem; padding: clamp(1.2rem, 4vw, 1.8rem); }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.settings-head h2 { font-size: 1.3rem; }
.settings-close { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.settings-note, .field-hint { margin: 0; color: var(--muted); font-size: .76rem; }
.settings-group { display: grid; gap: .7rem; margin: 0; padding: .9rem 1rem 1rem; border: 1px solid var(--line); border-radius: 16px; }
.settings-group legend { padding: 0 .4rem; color: var(--accent-2); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.field label { display: block; margin-bottom: .25rem; font-size: .82rem; font-weight: 700; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 42px;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .88rem;
  resize: vertical;
}
.settings-status { min-height: 1.1em; margin: -.2rem 0 0; color: var(--accent-2); font-size: .8rem; }
code { padding: .1rem .3rem; border-radius: 5px; background: var(--surface-strong); font-size: .9em; }

.size-list, .movable-list, .mobile-order-list, .connections-editor { display: grid; gap: .45rem; }
.size-item, .movable-item { display: flex; align-items: center; gap: .6rem; font-size: .84rem; }
.size-name, .order-name { margin-right: auto; }
.size-item select { min-height: 38px; padding: .3rem .5rem; font-size: .8rem; }
.movable-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.mobile-order-item { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .82rem; }
.connection-row { display: grid; gap: .5rem; padding: .7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.connection-row input { width: 100%; min-height: 42px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-strong); color: var(--text); font: inherit; font-size: .84rem; }
.connection-row .row-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.connection-preview { display: grid; place-items: center; justify-self: end; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-2-soft); color: var(--accent-2); font-size: .72rem; font-weight: 800; }
.connection-preview svg { display: block; width: 18px; height: 18px; }
.mini-button { min-height: 34px; padding: .28rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .74rem; cursor: pointer; }
.mini-button:hover { border-color: var(--accent); color: var(--text); }
.mini-button[disabled] { opacity: .4; cursor: not-allowed; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 820px) {
  .page-shell { width: min(100% - 1.5rem, 1180px); }
  .widget-board { grid-template-columns: 1fr; gap: .8rem; margin-top: 1rem; }
  .widget { grid-column: 1 / -1 !important; }
  .widget.hero .widget-body { grid-template-columns: 1fr; padding: 1.1rem; }
  .music-layout { grid-template-columns: 1fr; }
  .activity-card { grid-template-columns: 1fr; }
  .site-header { gap: .3rem .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .widget:hover, .button:hover, .connection-card:hover { transform: none; }
  .activity-3d { transform: none !important; }
  .widget.is-highlighted { animation: none; outline: 2px solid var(--accent-2); }
  .badge-hanger { animation: none; }
  .glow-button .gradient::before, .glow-surface .gradient { animation: none; }
}
