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

:root {
  --blue:    #4051CC;
  --navy:    #001A39;
  --bg:      #f5f7ff;
  --surface: #ffffff;
  --border:  #dde2f5;
  --muted:   #5a6480;
  --text:    #001A39;
  --radius:  10px;

  /* card-icon tint */
  --icon-bg: #eef0fb;

  /* labs badge */
  --badge-bg:     #eef0fb;
  --badge-border: #c6cbf0;

  /* auth badge + card */
  --auth-badge-bg:     #eef2f8;
  --auth-badge-color:  #3a5070;
  --auth-badge-border: #a8bcda;
  --auth-card-bg:      #f8fafc;
  --auth-card-border:  #c2d0e4;
  --auth-hover-border: #5a7fa8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue:    #7b8ff5;
    --navy:    #e8eaf6;
    --bg:      #0f1117;
    --surface: #1a1d27;
    --border:  #2a2f45;
    --muted:   #8892b0;
    --text:    #e8eaf6;

    --icon-bg: #1e2236;

    --badge-bg:     #1e2236;
    --badge-border: #3a4070;

    --auth-badge-bg:     #1a2233;
    --auth-badge-color:  #90aecb;
    --auth-badge-border: #2e4a6a;
    --auth-card-bg:      #151c2a;
    --auth-card-border:  #243550;
    --auth-hover-border: #5a7fa8;
  }
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color-scheme: light dark;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-inner img { height: 52px; width: auto; }
.labs-badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 2px;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #0d2b55 100%);
  color: #fff;
  padding: 2rem 2rem;
  text-align: center;
}
.hero-img {
  height: 80px;
  width: auto;
  margin-bottom: 1rem;
  opacity: 0.9;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
}
.hero p {
  margin-top: 0.85rem;
  font-size: 1.05rem;
  color: #b3bfe8;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Grid ── */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(64, 81, 204, 0.12);
  border-color: var(--blue);
}
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}
.card-icon svg { width: 18px; height: 18px; fill: var(--blue); }
.card h2 {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
}
.card p {
  font-size: 0.855rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}
.card-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.25rem;
}
.card-link svg { width: 12px; height: 12px; fill: var(--blue); }

/* ── Visibility badge ── */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.vis-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-radius: 99px;
  padding: 2px 8px;
  flex-shrink: 0;
  margin-top: 2px;
}
.vis-badge svg { width: 10px; height: 10px; flex-shrink: 0; }
.vis-auth { background: var(--auth-badge-bg); color: var(--auth-badge-color); border: 1px solid var(--auth-badge-border); }

/* Tint restricted cards */
.card[data-vis="auth"]       { background: var(--auth-card-bg); border-color: var(--auth-card-border); }
.card[data-vis="auth"]:hover { border-color: var(--auth-hover-border); box-shadow: 0 8px 24px rgba(58,80,112,0.10); }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
footer a { color: var(--blue); text-decoration: none; }
footer a:hover { text-decoration: underline; }
