*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
img { max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ic {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-lg { width: 26px; height: 26px; stroke-width: 1.6; }
.ic-fill { fill: currentColor; stroke: none; }

.app-icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 8px 16px rgba(20, 28, 44, 0.18);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

body {
  position: relative;
  z-index: 1;
  padding-bottom: calc(var(--dock-h) + 36px);
}

.wrap {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.glass {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--glass-fill);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
  backdrop-filter: blur(22px) saturate(1.22);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--glass-x) var(--glass-y), rgba(255, 255, 255, 0.5), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 30% 72%, rgba(255, 255, 255, 0.14));
}

:root[data-theme="ink"] .glass::before {
  background:
    radial-gradient(circle at var(--glass-x) var(--glass-y), rgba(180, 210, 255, 0.14), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%);
}

.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), transparent 28% 62%, rgba(255, 255, 255, 0.18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.7;
}

.glass > * { position: relative; z-index: 1; }

.nav {
  position: sticky;
  top: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(1180px, calc(100% - 28px));
  min-height: var(--nav-h);
  margin: 14px auto 0;
  padding: 10px 14px 10px 12px;
  border-radius: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 14.5px;
  font-weight: 720;
  letter-spacing: -0.03em;
}

.brand-copy small {
  color: var(--muted);
  font: 650 10px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-avatar,
.hero-avatar {
  display: block;
  object-fit: cover;
  background: #1b2430;
}

.brand-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 8px 18px rgba(20, 32, 48, 0.12);
}

.nav-links {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 4px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--sub);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 620;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: var(--chip);
}

.theme-switch {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  color: var(--sub);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.theme-btn[aria-pressed="true"] {
  color: var(--ink);
  background: var(--glass-thick);
  box-shadow: var(--glass-shadow);
}

.orb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.orb-liquid { background: conic-gradient(from 210deg, #fff, #d7e8f8, #f3e8ef, #e8f3ef, #fff); }
.orb-eye { background: linear-gradient(145deg, #efe7c8, #8ea36a); }
.orb-ink { background: linear-gradient(145deg, #1b2432, #7cb4ff); }

.hero-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-top: 28px;
}

.identity {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 360px;
  padding: 28px 30px 24px;
  border-radius: var(--radius);
}

.identity-top {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 22px;
  align-items: center;
}

.avatar-frame {
  padding: 7px;
  border: 0;
  border-radius: 42px;
  background: var(--glass-thick);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
}

.hero-avatar {
  width: 134px;
  height: 134px;
  border-radius: 34px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: var(--muted);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.identity h1,
.headline,
.section h2,
.card h3,
.note h3,
.sector h3 {
  letter-spacing: -0.04em;
}

.identity h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 650;
  line-height: 0.95;
}

.headline {
  margin: 10px 0 0;
  max-width: 18ch;
  color: var(--ink);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 620;
  line-height: 1.25;
}

.lead {
  max-width: 46ch;
  margin: 0;
  color: var(--sub);
  font-size: 16px;
  line-height: 1.7;
}

.now {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--chip);
}
.now-kicker {
  color: var(--muted);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.now-text {
  flex: 1;
  min-width: 12ch;
  font-weight: 620;
}
.now .btn { min-height: 32px; padding: 0 10px; }

.hero-actions,
.editor-bar,
.card-links,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: auto;
}

.stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--chip);
}

.stat b {
  display: block;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.stat span {
  color: var(--muted);
  font: 650 11px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-aside {
  display: grid;
  gap: 16px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  padding: 18px;
  border-radius: 26px;
  text-decoration: none;
}

.feature:hover { transform: translateY(-2px); }

.well {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 16%, var(--chip));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.well.app {
  width: 52px;
  height: 52px;
  padding: 0;
  overflow: hidden;
  color: inherit;
  background: transparent;
  box-shadow: 0 10px 22px rgba(20, 28, 44, 0.16);
}
.well.app .app-icon {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  box-shadow: none;
}
.btn .app-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  box-shadow: 0 3px 8px rgba(20, 28, 44, 0.22);
}
.btn .app-icon[width="18"] {
  width: 18px;
  height: 18px;
  border-radius: 6px;
}

.feature-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.feature-copy strong {
  font-size: 17px;
  letter-spacing: -0.03em;
}

.feature-copy span {
  color: var(--sub);
  font-size: 13px;
}

.feature .ic-arrow {
  margin-left: auto;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-decoration: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 650;
}

.btn.primary {
  border-color: transparent;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}

.btn.ghost { background: transparent; }
.btn:hover { transform: translateY(-1px); }
.btn.danger { color: var(--danger); }

.section { margin-top: 42px; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 650;
}

.hint {
  max-width: 28ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.jumps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.jump {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: 0;
  border-radius: 26px;
  text-decoration: none;
}

.jump:hover { transform: translateY(-3px); }

.shot {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #161c27;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .45s ease;
}
.jump:hover .shot img,
.card:hover .shot img { transform: scale(1.035); }

.jump-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 16px;
}
.jump-meta .copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.jump-meta .ic { color: var(--muted); }
.jump .well.app {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.jump .well.app .app-icon { border-radius: 12px; }

.jump strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.jump .copy span {
  color: var(--sub);
  font-size: 13.5px;
  line-height: 1.45;
}

.project-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 0 0 18px;
  border-radius: 26px;
}

.card .shot {
  border-radius: 0;
}

.card-top,
.stock-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card .card-top,
.card > p,
.card > .card-links,
.card > div:not(.shot):not(.card-top) {
  padding: 0 22px;
}

.stock-head { justify-content: flex-start; }
.stock-head .row-actions { margin-left: auto; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--sub);
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill.live { color: var(--good); }
.pill.degraded { color: var(--warn); }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
}

.card h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 680;
}

.card p,
.note p,
.sector p,
.stock p {
  margin: 0;
  color: var(--sub);
  line-height: 1.7;
}

.card-links { margin-top: auto; padding-top: 8px; }

.magazine {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.magazine .section { margin-top: 42px; }

.editor-bar {
  display: none;
  margin-bottom: 12px;
}

.notes,
.stocks {
  display: grid;
  gap: 12px;
}

.note,
.sector {
  padding: 22px;
  border-radius: 26px;
}

.note time,
.meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font: 650 11px/1 var(--font-mono);
  letter-spacing: 0.04em;
}

.note h3,
.sector h3 {
  margin: 10px 0 8px;
  font-size: 20px;
}

.note p,
.sector p,
.stock p { white-space: pre-wrap; }

.note-actions,
.row-actions {
  display: none;
  gap: 8px;
  margin-top: 12px;
}

body.admin .note-actions,
body.admin .row-actions,
body.admin .admin-only,
body.admin .editor-bar { display: flex; }

.admin-only { display: none; }

.stock {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--chip);
}

.symbol {
  min-width: 3.6em;
  color: var(--tint, var(--accent));
  font: 750 14px/1 var(--font-mono);
  letter-spacing: 0.04em;
}
.symbol a {
  color: inherit;
  text-decoration: none;
}
.symbol a:hover { text-decoration: underline; }

.disclaimer {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
  padding: 18px;
  border-radius: 24px;
  text-decoration: none;
}

.contact .well.app {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}
.empty .app-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.dock-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: transparent;
  box-shadow: 0 8px 16px rgba(20, 28, 44, 0.16);
}
.dock-mark .app-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  box-shadow: none;
}

.contact small { color: var(--muted); font-size: 12px; }
.contact strong { font-size: 15px; letter-spacing: -0.02em; word-break: break-all; }

.danmaku-stage {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

.danmaku-item {
  position: absolute;
  left: 0;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 10px color-mix(in srgb, var(--bg-0) 70%, transparent);
  animation: fly linear forwards;
}

@keyframes fly {
  from { transform: translateX(100vw); }
  to { transform: translateX(-110%); }
}

.dock {
  position: fixed;
  right: 18px;
  bottom: 16px;
  left: 18px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 10px;
  border-radius: 26px;
}

.dock input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip);
}

.dock input.nick { flex: 0 0 108px; }

dialog {
  width: min(520px, calc(100% - 24px));
  padding: 0;
  border: 0;
  background: transparent;
}

dialog::backdrop { background: rgba(16, 22, 32, 0.42); }

.modal { padding: 24px; border-radius: 26px; }
.modal h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 26px; }
.modal p { margin: 0 0 14px; color: var(--sub); line-height: 1.6; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span { color: var(--muted); font-size: 12px; font-weight: 650; }
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--chip);
}
.field textarea { min-height: 120px; resize: vertical; }

.toast-host {
  position: fixed;
  top: 96px;
  right: 18px;
  z-index: 50;
  display: grid;
  gap: 8px;
}

.toast {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
}

.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 140px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border-radius: 24px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .jump:hover, .feature:hover, .btn:hover { transform: none; }
  .jump:hover .shot img,
  .card:hover .shot img { transform: none; }
  .danmaku-item { animation: none; left: 12%; }
}

@media (max-width: 980px) {
  .hero-bento,
  .magazine,
  .jumps,
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .project-board { grid-template-columns: 1fr 1fr; }
  .card, .card.wide { grid-column: span 1; }
  .identity-top { grid-template-columns: 120px 1fr; }
  .hero-avatar { width: 106px; height: 106px; border-radius: 28px; }
  .hint { text-align: left; }
}

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow: auto;
  }
  .hero-bento,
  .magazine,
  .jumps,
  .contact-grid,
  .stat-row,
  .project-board { grid-template-columns: 1fr; }
  .identity-top { grid-template-columns: 1fr; }
  .dock { flex-wrap: wrap; }
  .dock input.nick, .dock input { flex: 1 1 100%; }
  .theme-btn span { display: none; }
}
