:root {
  color-scheme: light;
  --navy: #071b2f;
  --navy-2: #0d2945;
  --blue: #1679b8;
  --blue-bright: #248ecc;
  --ink: #0b1d2e;
  --muted: #66788a;
  --canvas: #f2f6f9;
  --panel: #ffffff;
  --line: #dce5ec;
  --shadow: 0 18px 50px rgba(7, 27, 47, 0.09);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 93% 8%, rgba(36, 142, 204, 0.12), transparent 25rem),
    linear-gradient(180deg, #f8fbfd 0%, var(--canvas) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; border-radius: 12px; outline-offset: 5px; }
.brand-crop { position: relative; width: 316px; height: 76px; overflow: hidden; display: block; }
.brand-crop img { position: absolute; width: 425px; max-width: none; height: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button {
  border: 0;
  border-radius: 12px;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.icon-button:focus-visible, .link-card:focus-visible {
  outline: 3px solid rgba(22, 121, 184, 0.28);
  outline-offset: 3px;
}
.icon-button { width: 46px; height: 46px; display: grid; place-items: center; color: var(--navy); background: var(--panel); border: 1px solid var(--line); }
.icon-button:hover { background: #eaf3f8; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon { display: none; }

main { flex: 1; padding: 64px 0 72px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 54px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 0.78rem; line-height: 1.2; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.7rem, 6vw, 5.4rem); line-height: 0.96; letter-spacing: -0.055em; font-weight: 780; }
.intro-copy { margin: 18px 0 0; color: var(--muted); font-size: 1.1rem; }
.link-count { min-width: 140px; padding: 17px 20px; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 10px; background: rgba(255,255,255,0.72); border: 1px solid var(--line); border-radius: 16px; }
.link-count strong { color: var(--blue); font-size: 1.65rem; line-height: 1; }
.link-count span { color: var(--muted); font-size: 0.86rem; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 1.1rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }

.link-card {
  position: relative;
  aspect-ratio: 1;
  min-height: 180px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 3px 12px rgba(7, 27, 47, 0.03);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.link-card::after { content: ""; position: absolute; inset: auto -35% -55% 25%; height: 70%; background: radial-gradient(circle, rgba(36,142,204,.14), transparent 68%); pointer-events: none; }
.link-card:hover { transform: translateY(-5px); border-color: #b7cbd9; box-shadow: var(--shadow); }
.favicon-shell { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 6px 18px rgba(7, 27, 47, 0.08); }
.favicon-shell img { width: 32px; height: 32px; object-fit: contain; }
.favicon-fallback { display: none; color: var(--blue); font-weight: 800; font-size: 1.15rem; }
.card-copy { position: relative; z-index: 1; min-width: 0; }
.card-copy strong { display: block; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; }
.card-copy span { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; }
.launch-icon { position: absolute; top: 22px; right: 22px; width: 17px; height: 17px; color: #8ca0b2; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

footer { min-height: 74px; display: flex; align-items: center; gap: 10px; color: var(--muted); border-top: 1px solid var(--line); font-size: 0.82rem; }
.footer-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }


[data-theme="dark"] { color-scheme: dark; --ink: #ecf4fa; --muted: #9cb0c1; --canvas: #061626; --panel: #0b2136; --line: #243d52; --shadow: 0 18px 55px rgba(0,0,0,.28); }
[data-theme="dark"] body { background: radial-gradient(circle at 92% 8%, rgba(36,142,204,.18), transparent 25rem), linear-gradient(180deg, #091d31, #061626); }
[data-theme="dark"] .brand-crop { background: white; border-radius: 14px; }
[data-theme="dark"] .link-count, [data-theme="dark"] .link-card { background: rgba(11,33,54,.88); }
[data-theme="dark"] .favicon-shell { background: white; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 1180px); }
  .topbar { min-height: 96px; }
  .brand-crop { width: 222px; height: 56px; }
  .brand-crop img { width: 300px; }
  main { padding: 46px 0 58px; }
  .intro { align-items: flex-start; margin-bottom: 42px; }
  .link-count { min-width: 84px; padding: 14px; grid-template-columns: 1fr; gap: 4px; }
  .link-count span { font-size: 0.73rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .link-card { min-height: 0; padding: 16px; border-radius: 18px; }
  .favicon-shell { width: 50px; height: 50px; border-radius: 13px; }
  .favicon-shell img { width: 28px; height: 28px; }
  .launch-icon { top: 17px; right: 17px; }
  footer { flex-wrap: wrap; }
}

@media (max-width: 430px) {
  .brand-crop { width: 190px; height: 48px; }
  .brand-crop img { width: 258px; }
  .topbar-actions { gap: 7px; }
  .icon-button { width: 42px; height: 42px; min-height: 42px; }
  .intro { display: block; }
  .link-count { display: inline-flex; margin-top: 24px; align-items: baseline; }
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-copy strong { font-size: 0.92rem; }
  .card-copy span { font-size: 0.74rem; }
}

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