/* Liquid glass on a dark navy base. The palette and the glass tokens mirror
   STAT-Tag's own (src/App.css), so this page reads as part of the same family. */
:root {
  /* Base */
  --bg:            #0b1220;
  --ink:           rgba(255, 255, 255, 0.92);
  --ink-muted:     rgba(203, 213, 225, 0.72);
  --ink-faint:     rgba(203, 213, 225, 0.5);

  /* Glass surfaces */
  --glass-bg:       linear-gradient(180deg, rgba(96, 165, 250, 0.13), rgba(59, 130, 246, 0.05));
  --glass-bg-hover: linear-gradient(180deg, rgba(96, 165, 250, 0.22), rgba(59, 130, 246, 0.10));
  --glass-border:       rgba(147, 197, 253, 0.26);
  --glass-border-hover: rgba(147, 197, 253, 0.45);
  --glass-hi:      inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --glass-blur:    blur(14px) saturate(150%);
  --glass-shadow:  0 2px 10px rgba(2, 6, 23, 0.45);
  --glass-shadow-hover: 0 12px 32px rgba(2, 6, 23, 0.55);

  --accent:       #60a5fa;
  --accent-light: #93c5fd;

  --radius: 16px;
  /* Spacing and type scale with viewport height so the six cards fit one
     screen where they can. Each clamp has a floor, so on a genuinely short
     window the page gives up and scrolls rather than shrinking to nothing. */
  --gap: clamp(0.7rem, 1.8vh, 1.25rem);
  --measure: 74rem;

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  color-scheme: dark;
}

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

/* Column layout so <main> can claim the leftover height and hand it to the
   grid, rather than the cards sizing purely to their text. */
body {
  margin: 0;
  padding: clamp(1.5rem, 4.5vh, 4.5rem) clamp(1rem, 3vw, 2rem)
           clamp(1rem, 2.5vh, 3rem);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Ambient light behind everything. Glass has nothing to refract over a flat
   fill, so these blooms are what make the blur read as a material at all.
   Fixed rather than absolute, so they stay viewport-anchored while scrolling. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%,  rgba(59, 130, 246, 0.20), transparent 70%),
    radial-gradient(760px 620px at 92% 108%, rgba(34, 211, 238, 0.12), transparent 72%),
    radial-gradient(620px 480px at 78% 6%,   rgba(129, 140, 248, 0.12), transparent 70%);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.page-header {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto clamp(1.1rem, 3.2vh, 2.75rem);
  flex: none;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4.4vh, 2.9rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff, var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0.4rem 0 0;
  color: var(--ink-muted);
  font-size: clamp(0.9rem, 1.9vh, 1.0625rem);
}

/* ── Card grid ───────────────────────────────────────────────────────────── */

/* main takes the leftover height; min-height:0 lets it actually shrink inside
   the flex column instead of defaulting to its content size. */
main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.apps {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  /* minmax(min-content, 1fr): rows share the spare height evenly, but never
     squeeze below the text they hold. That is what keeps this fitting the
     screen without ever clipping a description. */
  grid-auto-rows: minmax(min-content, 1fr);
  gap: var(--gap);
  flex: 1;
  min-height: 0;
}

/* The whole tile is the link, so the touch target is the full card. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(0.95rem, 2.4vh, 1.5rem);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), var(--glass-shadow);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease,
              box-shadow 0.2s ease,
              border-color 0.2s ease,
              background 0.2s ease;
}

/* The specular sheen across the top edge that sells the glass. */
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 45%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent);
  opacity: 0.8;
}

/* ── Logos ───────────────────────────────────────────────────────────────── */

/* One consistent tile for every mark. The apps whose icons carry their own
   background fill it edge to edge; STAT-Tag's is transparent, so the glass
   shows through its ring, which is why the tile is tinted rather than empty. */
.logo {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(36px, 5.4vh, 54px);
  height: clamp(36px, 5.4vh, 54px);
  margin-bottom: clamp(0.55rem, 1.5vh, 1.1rem);
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: clamp(10px, 1.5vh, 15px);
  background: rgba(15, 23, 42, 0.55);
  box-shadow: var(--glass-hi);
  overflow: hidden;
  flex: none;
}

.logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Card text ───────────────────────────────────────────────────────────── */

.card h2 {
  position: relative;
  margin: 0 0 clamp(0.25rem, 0.7vh, 0.5rem);
  font-size: clamp(1rem, 2.1vh, 1.1875rem);
  font-weight: 620;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

/* The one-line hook, above the detail. Brighter and slightly larger so it
   carries the card on a quick scan. */
.card .lead {
  position: relative;
  margin: 0 0 clamp(0.3rem, 0.9vh, 0.6rem);
  color: var(--ink);
  font-size: clamp(0.875rem, 1.85vh, 1rem);
  font-weight: 560;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.card p {
  position: relative;
  margin: 0 0 clamp(0.7rem, 1.8vh, 1.5rem);
  color: var(--ink-muted);
  font-size: clamp(0.8125rem, 1.6vh, 0.9375rem);
  line-height: 1.5;
}

/* Pushed to the bottom so every card's URL sits on the same baseline. */
.visit {
  position: relative;
  margin-top: auto;
  color: var(--accent);
  font-size: clamp(0.7rem, 1.4vh, 0.8125rem);
  font-weight: 550;
  line-height: 1.4;
  word-break: break-word;
}

.visit::after {
  content: " →";
  display: inline-block;
  transition: transform 0.2s ease;
}

/* ── Interaction ─────────────────────────────────────────────────────────── */

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-hi), var(--glass-shadow-hover);
}

.card:hover .visit::after,
.card:focus-visible .visit::after {
  transform: translateX(3px);
}

.card:hover .logo,
.card:focus-visible .logo {
  border-color: rgba(147, 197, 253, 0.4);
}

/* Keep a visible ring for keyboard users on top of the hover treatment. */
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── 404 page ────────────────────────────────────────────────────────────── */

.back-link {
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration-color: rgba(147, 197, 253, 0.4);
  text-underline-offset: 3px;
}

.back-link:hover { color: var(--accent-light); }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.page-footer {
  width: 100%;
  max-width: var(--measure);
  margin: clamp(1rem, 2.6vh, 3rem) auto 0;
  color: var(--ink-faint);
  font-size: 0.875rem;
  flex: none;
}

.page-footer p { margin: 0; }

.page-footer a {
  color: var(--ink-faint);
  text-decoration-color: rgba(147, 197, 253, 0.25);
  text-underline-offset: 2px;
}

.page-footer a:hover { color: var(--accent); }

/* Without backdrop-filter the tinted gradients still read as translucent
   panels, so the layout degrades cleanly rather than losing its surfaces. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: linear-gradient(180deg, rgba(96, 165, 250, 0.16), rgba(30, 41, 59, 0.9)); }
}

@media (prefers-reduced-motion: reduce) {
  .card, .visit::after { transition: none; }
  .card:hover, .card:focus-visible { transform: none; }
}
