:root {
  --bg: #05060a;
  --card-bg: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  --border: rgba(255,255,255,.10);
  --border-hover: rgba(255,255,255,.35);
  --text: #f5f5f7;
  --muted: #8a8a92;
  --muted-2: #5c5c66;
  --accent: #d97757;
  --accent2: #7c3aed;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

.wrap {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 24px 48px;
  overflow: hidden;
}

@keyframes drift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(-3%, 2%) scale(1.08); }
  100% { transform: translate(0,0) scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  animation: drift 14s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.glow.a { width: 520px; height: 520px; top: -180px; left: -120px; background: var(--accent); }
.glow.b { width: 460px; height: 460px; bottom: -160px; right: -100px; background: var(--accent2); animation-delay: -7s; }
.glow.c { width: 380px; height: 380px; top: 30%; left: 50%; margin-left: -190px; background: #22D3EE; opacity: .18; animation: drift 18s ease-in-out infinite; animation-delay: -3s; }

#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  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: 42px 42px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 20%, #000 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 20%, #000 40%, transparent 85%);
}

.header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 72px;
  text-align: center;
}

.ring {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring svg.orbit { position: absolute; inset: 0; animation: spin 20s linear infinite; z-index: 2; }
.mark {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -6px var(--accent);
  animation: mark-breathe 4s ease-in-out infinite;
}

@keyframes mark-breathe {
  0%, 100% { box-shadow: 0 8px 24px -6px var(--accent); }
  50%      { box-shadow: 0 8px 34px -4px var(--accent2); }
}

@keyframes pulse-ring {
  0%   { transform: scale(0.55); opacity: .55; }
  100% { transform: scale(1.9); opacity: 0; }
}

.pulse {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1.5px solid var(--accent);
  animation: pulse-ring 3s cubic-bezier(.2,.7,.3,1) infinite;
  z-index: 1;
}
.pulse.p2 { border-color: var(--accent2); animation-delay: 1.5s; }

h1.title {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #fff 10%, var(--accent) 40%, var(--accent2) 60%, #fff 90%);
  background-size: 220% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-shine 6s linear infinite;
}

@keyframes title-shine {
  0%   { background-position: 0% center; }
  100% { background-position: -220% center; }
}

.subtitle {
  font-size: 15px;
  color: var(--muted);
  opacity: 0;
  animation: fade-up .7s ease .15s forwards;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pulse, .mark, .ring svg.orbit, h1.title, .glow { animation: none !important; }
}

.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 28px;
  width: 100%;
  max-width: 860px;
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  overflow: hidden;
  text-decoration: none;
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .35s ease, box-shadow .35s ease;
  will-change: transform;
}
.card:hover {
  transform: perspective(900px) rotateX(6deg) rotateY(-6deg) translateY(-6px) scale(1.02);
  border-color: var(--border-hover);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06) inset;
}
.card:active { transform: perspective(900px) scale(0.99); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sheen {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.14) 45%, transparent 60%);
  background-size: 250% 250%; background-position: 100% 0%;
  transition: background-position .6s ease;
}
.card:hover .sheen { background-position: 0% 100%; }

.app-icon {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
  animation: float 5s ease-in-out infinite;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon.d2 { animation-delay: .6s; }
.app-icon.dark { background: #000000; }

.app-name { font-size: 19px; font-weight: 600; }
.app-host { font-size: 13px; color: var(--muted); word-break: break-all; }
.app-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

.card-foot {
  position: relative;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.live-tag {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.arrow-btn {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease, background .25s ease;
}
.card:hover .arrow-btn { transform: translate(2px,-2px); background: rgba(255,255,255,.18); }

.footer {
  position: relative;
  margin-top: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
}
.footer nav { display: flex; gap: 18px; }
.footer nav a { color: var(--muted); text-decoration: none; }
.footer nav a:hover { color: var(--text); }

/* Content pages (About / Terms) */
.doc {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.doc h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.doc .lede { color: var(--muted); font-size: 15px; margin-bottom: 40px; }
.doc h2 { font-size: 19px; font-weight: 600; margin: 40px 0 12px; }
.doc p, .doc li { font-size: 14.5px; line-height: 1.7; color: #d7d7dc; }
.doc ul { padding-left: 20px; }
.doc a.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 32px; }
.doc a.back:hover { color: var(--text); }
.doc a.inline { color: var(--accent); }
