/* Design B — "Tiles": dashboard with a hero header and a grid of tiles per section.
   Follows OS light/dark unless the visitor picks one. */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --border: #dbe3ee;
  --text: #0f1a2e;
  --muted: #5a6a82;
  --brand: #0c8a91;
  --brand-2: #3b6fd8;
  --glow: rgba(12, 138, 145, .18);
  --hero-1: rgba(52, 195, 201, .22);
  --hero-2: rgba(79, 140, 255, .16);
  --hero-base: #e2ebf5;
  --mark-ring: rgba(15, 26, 46, .08);
  --search-bg: rgba(255, 255, 255, .8);
  --search-bg-focus: #ffffff;
  --search-border: rgba(15, 26, 46, .12);
  --kbd-border: rgba(15, 26, 46, .18);
  --count-bg: rgba(12, 138, 145, .1);
  --tile-hover-border: rgba(12, 138, 145, .5);
  --tile-shadow: 0 10px 28px rgba(15, 26, 46, .12), 0 0 0 1px rgba(12, 138, 145, .15);
  --icon-bg: #ffffff;
  --icon-shadow: 0 1px 2px rgba(15, 26, 46, .08), 0 0 0 1px rgba(15, 26, 46, .08);
  --toggle-bg: var(--search-bg);
  --toggle-border: var(--search-border);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #121b2d;
    --surface-2: #17223a;
    --border: #22304a;
    --text: #e8eef8;
    --muted: #8d9bb4;
    --brand: #34c3c9;
    --brand-2: #4f8cff;
    --glow: rgba(52, 195, 201, .25);
    --hero-1: rgba(52, 195, 201, .28);
    --hero-2: rgba(79, 140, 255, .22);
    --hero-base: #0f1a2e;
    --mark-ring: rgba(255, 255, 255, .08);
    --search-bg: rgba(255, 255, 255, .06);
    --search-bg-focus: rgba(255, 255, 255, .09);
    --search-border: rgba(255, 255, 255, .12);
    --kbd-border: rgba(255, 255, 255, .15);
    --count-bg: rgba(52, 195, 201, .12);
    --tile-hover-border: rgba(52, 195, 201, .55);
    --tile-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 0 1px rgba(52, 195, 201, .2);
    --icon-bg: #ffffff;
    --icon-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    --toggle-bg: var(--search-bg);
    --toggle-border: var(--search-border);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .mode-toggle .moon { display: none; }
  :root:not([data-theme="light"]) .mode-toggle .sun { display: block; }
}
:root[data-theme="dark"] {
    --bg: #0b1220;
    --surface: #121b2d;
    --surface-2: #17223a;
    --border: #22304a;
    --text: #e8eef8;
    --muted: #8d9bb4;
    --brand: #34c3c9;
    --brand-2: #4f8cff;
    --glow: rgba(52, 195, 201, .25);
    --hero-1: rgba(52, 195, 201, .28);
    --hero-2: rgba(79, 140, 255, .22);
    --hero-base: #0f1a2e;
    --mark-ring: rgba(255, 255, 255, .08);
    --search-bg: rgba(255, 255, 255, .06);
    --search-bg-focus: rgba(255, 255, 255, .09);
    --search-border: rgba(255, 255, 255, .12);
    --kbd-border: rgba(255, 255, 255, .15);
    --count-bg: rgba(52, 195, 201, .12);
    --tile-hover-border: rgba(52, 195, 201, .55);
    --tile-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 0 1px rgba(52, 195, 201, .2);
    --icon-bg: #ffffff;
    --icon-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    --toggle-bg: var(--search-bg);
    --toggle-border: var(--search-border);
    color-scheme: dark;
}
:root[data-theme="dark"] .mode-toggle .moon { display: none; }
:root[data-theme="dark"] .mode-toggle .sun { display: block; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
[hidden] { display: none !important; }

/* Light/dark toggle (top right). Shows the moon in light mode, the sun in dark mode. */
.mode-toggle {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--toggle-border); background: var(--toggle-bg); color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.mode-toggle:hover { color: var(--text); border-color: var(--brand); }
.mode-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mode-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mode-toggle .sun { display: none; }
.mode-toggle { grid-area: toggle; }

.top {
  background:
    radial-gradient(900px 300px at 15% -10%, var(--hero-1), transparent 70%),
    radial-gradient(700px 300px at 90% 0%, var(--hero-2), transparent 70%),
    linear-gradient(180deg, var(--hero-base), var(--bg));
  border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: 1180px; margin: 0 auto; padding: 28px 24px 34px;
  display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "brand greet toggle" "search search search";
  gap: 26px 24px; align-items: center;
}
.brand { grid-area: brand; display: flex; align-items: center; gap: 14px; }
.mark { width: 44px; height: 44px; border-radius: 12px; display: block; box-shadow: 0 0 0 1px var(--mark-ring), 0 6px 20px var(--glow); }
.brand h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.sub { margin: 1px 0 0; color: var(--muted); font-size: 13.5px; }
.greet { grid-area: greet; display: flex; flex-direction: column; text-align: right; }
.greet-hello { font-weight: 600; font-size: 15px; }
.greet-date { color: var(--muted); font-size: 13px; }

.search {
  grid-area: search; justify-self: center; width: min(640px, 100%);
  display: flex; align-items: center; background: var(--search-bg);
  border: 1px solid var(--search-border); border-radius: 14px; backdrop-filter: blur(8px);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--glow); background: var(--search-bg-focus); }
.search svg { width: 20px; height: 20px; margin-left: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 16px; padding: 14px 12px; outline: none;
}
.search input::placeholder { color: var(--muted); }
.search kbd {
  margin-right: 14px; font: 600 11px/1 Inter, system-ui, sans-serif; color: var(--muted);
  border: 1px solid var(--kbd-border); border-radius: 6px; padding: 4px 7px;
}

.sections { max-width: 1180px; margin: 0 auto; padding: 30px 24px 8px; }
.section { margin: 0 0 30px; }
.section h2 {
  margin: 0 0 12px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.section h2::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.count {
  font-size: 11px; color: var(--brand); background: var(--count-bg);
  border-radius: 99px; padding: 1px 8px; letter-spacing: 0;
}
.links {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px;
}
.links li { display: flex; }
.link {
  position: relative; flex: 1; display: flex; align-items: flex-start; gap: 14px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  color: inherit; text-decoration: none;
  transition: transform .15s, border-color .15s, background .15s, box-shadow .15s;
}
.link:hover, .link:focus-visible {
  transform: translateY(-2px); border-color: var(--tile-hover-border); background: var(--surface-2);
  box-shadow: var(--tile-shadow); outline: none;
}
.icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--icon-bg); box-shadow: var(--icon-shadow);
}
.icon img { width: 28px; height: 28px; object-fit: contain; display: block; }
.letter {
  width: 100%; height: 100%; display: grid; place-items: center; border-radius: 12px;
  font-weight: 700; font-size: 18px; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 60% 50%), hsl(calc(var(--h) + 40) 55% 38%));
}
.text { display: flex; flex-direction: column; min-width: 0; flex: 1; padding-right: 14px; }
.name { font-weight: 600; font-size: 15px; }
.desc { color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 3px; }
.go { position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .15s; }
.link:hover .go { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.foot { display: flex; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 8px 24px 32px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 560px) {
  .top-inner { padding: 20px 16px 24px; grid-template-columns: 1fr auto; grid-template-areas: "brand toggle" "greet greet" "search search"; gap: 14px; }
  .greet { text-align: left; flex-direction: row; gap: 8px; flex-wrap: wrap; }
  .search kbd { display: none; }
  .sections { padding: 22px 16px 8px; }
  .links { grid-template-columns: 1fr; }
  .foot { padding: 8px 16px 24px; }
}

.foot-admin { color: var(--muted); text-decoration: none; }
.foot-admin:hover { color: var(--brand); text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; }
