:root {
  color-scheme: light;
  --ink: #10141a;
  --ink-soft: #3a4450;
  --paper: #e7eef4;
  --paper-deep: #d5e0ea;
  --wash: #eef4f8;
  --mist: #f4f8fb;
  --haze: #dce8f1;
  --accent: #0d8f8a;
  --accent-deep: #0a6e6a;
  --status-busy: #c9a227;
  --line: rgba(16, 20, 26, 0.12);
  --glow-teal: rgba(13, 143, 138, 0.28);
  --glow-sky: rgba(90, 140, 180, 0.22);
  --font-display: "Syne", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eef3;
  --ink-soft: #9aa8b4;
  --paper: #10161c;
  --paper-deep: #0a1014;
  --wash: #0c1116;
  --mist: #162028;
  --haze: #0b141c;
  --accent: #4dd4ce;
  --accent-deep: #7ee0db;
  --status-busy: #e6c04a;
  --line: rgba(232, 238, 243, 0.12);
  --glow-teal: rgba(77, 212, 206, 0.18);
  --glow-sky: rgba(70, 110, 160, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.45;
  background:
    radial-gradient(120% 80% at 10% -10%, var(--mist) 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, var(--haze) 0%, transparent 50%),
    linear-gradient(165deg, var(--wash) 0%, var(--paper) 45%, var(--paper-deep) 100%);
  transition:
    background 0.35s ease,
    color 0.35s ease;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.9;
  animation: drift 18s ease-in-out infinite alternate;
}

.glow-a {
  width: min(55vw, 480px);
  height: min(55vw, 480px);
  top: -8%;
  right: -6%;
  background: var(--glow-teal);
}

.glow-b {
  width: min(50vw, 420px);
  height: min(50vw, 420px);
  bottom: 8%;
  left: -10%;
  background: var(--glow-sky);
  animation-delay: -6s;
  animation-duration: 22s;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100vw;
  height: 100dvh;
  padding: clamp(1.1rem, 3.2vh, 2.4rem) clamp(1.25rem, 5vw, 4.5rem);
}

.cluster {
  display: grid;
  grid-template-columns: minmax(13rem, 20rem) minmax(18rem, 26rem);
  align-items: center;
  justify-content: center;
  column-gap: 0;
  margin: auto;
  width: 100%;
  max-width: 52rem;
}

.hero {
  padding-right: clamp(1.5rem, 3.5vw, 2.75rem);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  line-height: 0.88;
  letter-spacing: -0.06em;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand::after {
  content: "";
  display: block;
  width: 2.6rem;
  height: 3px;
  margin: 0.7rem 0 0.85rem;
  border-radius: 999px;
  background: var(--accent);
}

.headline {
  margin: 0 0 0.4rem;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.8vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.lede {
  margin: 0 0 1rem;
  max-width: 36ch;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  transition: background 0.35s ease;
}

.status.is-busy .status-dot {
  background: var(--status-busy);
}

.meta-sep {
  opacity: 0.55;
}

#local-time {
  font-variant-numeric: tabular-nums;
}

.presence {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.7rem;
  row-gap: 0;
  margin: 0.85rem 0 0;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

.presence[hidden] {
  display: none;
}

.presence-row {
  display: contents;
}

.presence-src {
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}

.presence-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.3;
  text-decoration: none;
}

a.presence-text:hover {
  color: var(--accent-deep);
}

.panels {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.6rem, 4.2vh, 2.75rem);
  min-width: 0;
  min-height: 0;
  padding-left: clamp(1.5rem, 3.5vw, 2.75rem);
  border-left: 1px solid var(--line);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.panel h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: -0.03em;
}

.link-list,
.donate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.link-list a,
.donate-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: clamp(0.55rem, 1.4vh, 0.85rem) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.link-list a:hover,
.donate-item:hover {
  color: var(--accent-deep);
}

.link-list a:focus-visible,
.donate-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.link-label,
.donate-name {
  font-weight: 600;
  font-size: 1rem;
}

.link-hint,
.donate-action {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.donate-action {
  color: var(--accent-deep);
  font-weight: 600;
}

.donate-item {
  width: 100%;
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.donate-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.donate-address {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.toast {
  position: absolute;
  margin: 0.65rem 0 0;
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.panel {
  position: relative;
  min-width: 0;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.footer p {
  margin: 0;
}

.theme-toggle {
  appearance: none;
  margin: 0;
  padding: 0.35rem 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent-deep);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--paper-deep) 72%, transparent);
  backdrop-filter: blur(10px);
}

.veil-card {
  width: min(28rem, 100%);
  padding: 1.6rem 1.7rem 1.4rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.veil-card h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.veil-card p {
  margin: 0;
  color: var(--ink-soft);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(24px, -18px) scale(1.06);
  }
}

@media (max-width: 860px) {
  .cluster {
    grid-template-columns: 1fr;
    align-content: start;
    row-gap: 1rem;
  }

  .hero {
    padding-right: 0;
  }

  .panels {
    justify-content: flex-start;
    gap: 1.15rem;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
  }

  .brand {
    font-size: clamp(2.6rem, 16vw, 4.2rem);
  }

  .headline {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  .headline,
  .lede,
  .meta,
  .presence,
  .panels,
  .glow {
    animation: none;
  }
}
