:root {
  color-scheme: light;
  --ink: #0e1a22;
  --ink-soft: #243642;
  --paper: #e8f0f2;
  --foam: #f4fafb;
  --river: #1a6b6a;
  --river-deep: #0f4544;
  --copper: #c46b2e;
  --cta-text: #f7fffe;
  --line: rgba(14, 26, 34, 0.12);
  --shadow: 0 18px 40px rgba(14, 26, 34, 0.12);
  --shadow-hover: 0 22px 44px rgba(14, 26, 34, 0.16);
  --code-bg: rgba(14, 26, 34, 0.06);
  --grid-line: rgba(14, 26, 34, 0.03);
  --glow-river: rgba(26, 107, 106, 0.22);
  --glow-copper: rgba(196, 107, 46, 0.16);
  --bg-mid: #d7e8ea;
  --bg-end: #dfe9ec;
  --tile: color-mix(in srgb, var(--foam) 88%, white);
  --err: #8a1f1f;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e8f2f4;
    --ink-soft: #b4c6cc;
    --paper: #0c161c;
    --foam: #132229;
    --river: #3aa8a4;
    --river-deep: #7dd3cf;
    --copper: #e09a5a;
    --cta-text: #061314;
    --line: rgba(232, 242, 244, 0.12);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 22px 44px rgba(0, 0, 0, 0.55);
    --code-bg: rgba(232, 242, 244, 0.08);
    --grid-line: rgba(232, 242, 244, 0.05);
    --glow-river: rgba(58, 168, 164, 0.18);
    --glow-copper: rgba(224, 154, 90, 0.12);
    --bg-mid: #0a1218;
    --bg-end: #101c24;
    --tile: color-mix(in srgb, var(--foam) 92%, black);
    --err: #ff8f8f;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 12% -10%, var(--glow-river), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, var(--glow-copper), transparent 50%),
    linear-gradient(165deg, var(--bg-mid) 0%, var(--paper) 42%, var(--bg-end) 100%);
}

.atmosphere {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 70%);
  animation: drift 28s linear infinite;
}

@keyframes drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 24px, -24px 48px; }
}

.hero {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 7rem) 1.5rem 2.5rem;
  animation: rise 0.7s ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.brand {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--river-deep);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 500;
  color: var(--ink-soft);
}

.lede {
  margin: 0 0 1.5rem;
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.cta-link {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: var(--river);
  color: var(--cta-text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta-link:hover {
  background: var(--river-deep);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .cta-link:hover {
    color: var(--paper);
  }
}

.directory {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  animation: rise 0.8s 0.12s ease-out both;
}

.dir-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
}

.dir-note {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.dir-note code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
}

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

@media (min-width: 720px) {
  .app-list { grid-template-columns: 1fr 1fr; }
}

.app-link {
  display: block;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--tile);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-link:hover,
.app-link:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--river) 45%, var(--line));
  box-shadow: var(--shadow-hover);
  outline: none;
}

.app-link:nth-child(odd) { animation: rise 0.55s ease-out both; }
.app-link:nth-child(even) { animation: rise 0.55s 0.06s ease-out both; }

.app-name {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.65rem;
}

.app-badge {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper);
  border: 1px solid color-mix(in srgb, var(--copper) 55%, transparent);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.app-blurb {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--copper);
}

.err {
  color: var(--err);
  font-size: 0.95rem;
}

.foot {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.muted { opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}
