:root {
  --bg: #d6d9e1;
  --card-bg: linear-gradient(180deg, #f3f4f9 0%, #dcdfe8 100%);
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.3));
  --edge: rgba(255, 255, 255, 0.9);
  --text: #1c1e26;
  --muted: #5d6272;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --shadow: 0 2px 8px rgba(20, 24, 40, 0.08);
  --shadow-hover: 0 12px 28px rgba(20, 24, 40, 0.16);
  --disabled-bg: #e6e8ef;
  --disabled-text: #8a8fa0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --card-bg: linear-gradient(180deg, #262a36 0%, #1a1d26 100%);
    --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03));
    --edge: rgba(255, 255, 255, 0.14);
    --text: #f1f2f6;
    --muted: #a3a8b8;
    --accent: #7c74ff;
    --accent-hover: #918bff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.55);
    --disabled-bg: #2a2e3a;
    --disabled-text: #7b8093;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #7f8bbd radial-gradient(circle at 50% 0%, #aab3d9 0%, #7f8bbd 40%, #5d6797 100%) fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.site-header {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 4rem 1.25rem 3.5rem;
  color: #fff;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,0.9) 0 7%, transparent 14%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 55%, rgba(255,255,255,0.28) 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
}
.b1 { width: 7rem;   height: 7rem;   left: 6%;  top: 12%; }
.b2 { width: 3rem;   height: 3rem;   left: 20%; top: 62%; }
.b3 { width: 1.5rem; height: 1.5rem; left: 14%; top: 38%; }
.b4 { width: 5rem;   height: 5rem;   right: 8%; top: 18%; }
.b5 { width: 2rem;   height: 2rem;   right: 22%; top: 66%; }
.b6 { width: 3.5rem; height: 3.5rem; right: 4%;  top: 60%; }
.b7 { width: 1rem;   height: 1rem;   right: 30%; top: 14%; }

.site-header h1,
.site-header .tagline { position: relative; }

.site-header .tagline { color: rgba(255,255,255,0.9); }

.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
  color: var(--muted);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 700px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Keep a lone card from stretching across the whole page. */
.app-grid > .card-row:only-child {
  grid-column: 1 / -1;
  max-width: 480px;
  width: 100%;
  justify-self: center;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-row .card { flex: 1; min-width: 0; }

.card-row.dragging { opacity: 0.35; }

.drag-ghost {
  position: fixed;
  z-index: 100;
  margin: 0;
  pointer-events: none;
  opacity: 0.95;
  transform: scale(1.03);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.3));
}

.drag-handle {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0.75rem 0.4rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drag-handle span {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--muted);
}

.card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 6.5rem;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.1rem;
  color: inherit;
  text-decoration: none;
  background: var(--card-bg);
  border-radius: 1.25rem;
  box-shadow: var(--shadow), inset 0 1px 0 var(--edge);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Glossy highlight across the top half, cut on a diagonal like a reflection. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 45% 0;
  z-index: -1;
  background: var(--gloss);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 0 100%);
  pointer-events: none;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover), inset 0 1px 0 var(--edge);
  }
}

.card-icon {
  flex: none;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  line-height: 1;
}

.card-icon img {
  width: 100%;
  height: 100%;
  border-radius: 22%;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-name {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.btn {
  flex: none;
  white-space: nowrap;
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.chevron {
  flex: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.card:hover .chevron,
.card:focus-visible .chevron {
  color: var(--accent);
  transform: translateX(3px);
}

.card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn.disabled {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: default;
  user-select: none;
}

.noscript {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 480px) {
  .btn { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
}

.site-footer {
  text-align: center;
  padding: 0 1.25rem 2.5rem;
  font-size: 0.875rem;
}

.site-footer a,
.tagline a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.site-footer a:hover,
.tagline a:hover { color: #fff; text-decoration: underline; }

.doc {
  max-width: 720px;
  display: grid;
  gap: 1rem;
}

.doc-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 1.25rem;
  box-shadow: var(--shadow), inset 0 1px 0 var(--edge);
}

.doc-card h2 { margin: 0 0 0.75rem; font-size: 1.35rem; }
.doc-card h3 { margin: 1.25rem 0 0.25rem; font-size: 1rem; }
.doc-card p, .doc-card li { color: var(--muted); }
.doc-card p { margin: 0.5rem 0; }
.doc-card ul { padding-left: 1.25rem; }
.doc-card li { margin: 0.5rem 0; }
.doc-card strong { color: var(--text); }
.doc-card a { color: var(--accent); }
.doc-card .updated { font-size: 0.85rem; }
.doc-card .sign { font-style: italic; }

.copyright {
  margin: 0.5rem 0 0;
  color: rgba(255, 255, 255, 0.8);
}
