*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #070b14;
  --text: #eef2ff;
  --muted: rgba(238, 242, 255, 0.55);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.11);
  --border: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.28);
  --accent: #7c9cff;
  --accent-soft: rgba(124, 156, 255, 0.18);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ── background ── */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, #1a2550 0%, var(--bg) 70%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: #3b5bdb;
  top: -8%;
  left: -6%;
}

.orb-2 {
  width: 360px;
  height: 360px;
  background: #7048e8;
  bottom: 10%;
  right: -4%;
  animation-delay: -6s;
}

.orb-3 {
  width: 280px;
  height: 280px;
  background: #1098ad;
  bottom: -5%;
  left: 30%;
  animation-delay: -12s;
  opacity: 0.35;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, -20px) scale(1.08); }
}

/* ── layout ── */
.page {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
      gap: 2rem;
}

.grid {
  flex: 1;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ── hero ── */
.hero {
  border-radius: var(--radius);
  padding: 2.25rem 1.75rem;
  text-align: center;
}

.logo {
  display: block;
  margin: 0 auto 1.25rem;
  width: fit-content;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.logo-img {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.tagline {
  margin-top: 0.55rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.external-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 1.25rem;
  width: 100%;
  max-width: none;
}

@media (min-width: 640px) {
  .external-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .external-link-wide {
    grid-column: 1 / -1;
  }
}

.external-link {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  background: var(--btn-color, var(--accent));
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.external-link:hover,
.external-link:focus-visible {
  opacity: 0.88;
  transform: translateY(-1px);
  outline: none;
}

.external-link:active {
  transform: translateY(0);
}

/* ── service grid (Gitea-style) ── */
.grid-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .card-wide {
    grid-column: 1 / -1;
  }
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
  animation: fadeUp 0.45s ease both;
  animation-delay: var(--delay, 0s);
}

.card:hover,
.card:focus-visible {
  background: var(--glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft);
  outline: none;
}

.card:active {
  transform: translateY(-1px);
}

.card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(124, 156, 255, 0.25);
  color: var(--accent);
}

.card-icon img {
  width: 28px;
  height: 28px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.card-sub {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── card transitions ── */
.card-enter-active {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.card-enter-from {
  opacity: 0;
  transform: translateY(12px) scale(0.97);
}

.card-move {
  transition: transform 0.35s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── footer ── */
.footer {
  text-align: center;
  padding-top: 0.25rem;
  font-size: 0.78rem;
  color: rgba(238, 242, 255, 0.28);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 640px) {
  .page {
    padding-top: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  .card { animation: none; transition: none; }
  .card-enter-active { transition: none; }
  .uwu .logo-img { animation: none; }
}

/* ── uwu mode (?uwu=true) ── */
html.uwu {
  --bg: #140810;
  --text: #ffe4f3;
  --muted: rgba(255, 190, 220, 0.65);
  --glass: rgba(255, 160, 200, 0.09);
  --glass-hover: rgba(255, 160, 200, 0.16);
  --border: rgba(255, 180, 220, 0.2);
  --border-hover: rgba(255, 180, 220, 0.35);
  --accent: #ff6eb4;
  --accent-soft: rgba(255, 110, 180, 0.25);
}

html.uwu .bg {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, #4a1538 0%, var(--bg) 70%);
}

html.uwu .orb-1 { background: #ff6eb4; }
html.uwu .orb-2 { background: #e649a0; opacity: 0.6; }
html.uwu .orb-3 { background: #ffb3d9; opacity: 0.45; }

html.uwu .logo-img {
  animation: uwu-bounce 2.5s ease-in-out infinite;
  filter: saturate(1.35) hue-rotate(-10deg);
}

html.uwu .hero h1 {
  letter-spacing: 0.01em;
}

html.uwu .card-icon {
  border-color: rgba(255, 110, 180, 0.35);
}

html.uwu .card-icon img {
  filter: hue-rotate(280deg) saturate(1.4);
}

@keyframes uwu-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-4px) rotate(-3deg); }
}
