:root {
  color-scheme: dark;
  --bg: #001d34;
  --ink: #f0f5fa;
  --muted: #a2b1c1;
  --subtle: #6f8499;
  --line: rgba(166, 196, 224, 0.14);
  --teal: #7adbd2;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 54% 39% at 86% -12%, rgba(50, 122, 156, 0.16), transparent 83%),
    radial-gradient(ellipse 50% 45% at -15% 70%, rgba(22, 88, 131, 0.12), transparent 83%),
    var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 'DM Sans', 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; content: '';
  background-image: linear-gradient(rgba(213, 236, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(213, 236, 255, .018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #a5fff2; outline-offset: 5px; }
.page { width: min(1460px, calc(100% - 48px)); margin: 0 auto; }

.hero { padding: 30px 0 25px; }
h1 { margin: 0 0 5px; font: 600 clamp(44px, 5vw, 62px)/1.06 'Space Grotesk', sans-serif; letter-spacing: -.064em; }
.hero p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 720px; }

.catalog-toolbar { min-height: 55px; margin-bottom: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.catalog-title { display: flex; gap: 10px; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: #c7d7e4; white-space: nowrap; }
.catalog-symbol { color: var(--teal); font-size: 22px; line-height: 1; font-weight: 400; }
.catalog-total { font-size: 10px; letter-spacing: .04em; background: rgba(193, 214, 236, 0.09); color: #a5b7c8; border: 1px solid var(--line); border-radius: 100px; padding: 3px 8px; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.filter { padding: 6px 11px; border: 1px solid transparent; border-radius: 6px; color: #8fa4b7; background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.filter:hover { color: #f4f7f9; background: #1a3a52; }
.filter.is-active { color: #d7faf5; border-color: rgba(122, 219, 210, .24); background: rgba(115, 220, 204, .11); }

.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; align-items: stretch; }
.project-card { --accent: #69d8cf; min-width: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; border-radius: 9px; background: #09263d; border: 1px solid color-mix(in srgb, var(--accent) 43%, #244057); box-shadow: 0 9px 24px rgba(0, 8, 23, .2), 0 2px 7px rgba(0, 8, 23, .1); isolation: isolate; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.project-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 81%, #244057); box-shadow: 0 15px 30px rgba(0, 7, 20, .3), 0 0 27px color-mix(in srgb, var(--accent) 11%, transparent); }
.project-card:focus-visible { outline-offset: 5px; }
.card-visual { aspect-ratio: 1.9; position: relative; overflow: hidden; background: linear-gradient(155deg, #0c3248, #0a2137); }
.card-visual::after { pointer-events:none; content:''; position:absolute; inset:0; background: linear-gradient(to bottom,rgba(0,19,37,.27), transparent 35%, rgba(0,16,31,.1) 82%, rgba(0,16,31,.3)); }
.card-visual-fallback { position:absolute; inset:0; overflow:hidden; background: radial-gradient(ellipse at 60% 60%, color-mix(in srgb,var(--accent) 17%, transparent),transparent 55%),linear-gradient(135deg, #153a52,#061d32); }
.fallback-ring { position:absolute; width:180px; height:180px; border:1px solid color-mix(in srgb,var(--accent) 31%,transparent); border-radius:50%; left:calc(50% - 90px); top:calc(50% - 90px); box-shadow:0 0 0 35px #ffffff05,0 0 0 70px #ffffff03; }
.fallback-grid { position:absolute; inset:0; background-image:linear-gradient(#ffffff0d 1px,transparent 1px),linear-gradient(90deg,#ffffff0d 1px,transparent 1px); background-size:40px 40px; }
.card-preview { position: absolute; width: 100%; height: 100%; object-fit: cover; inset: 0; display: block; transition: transform .5s ease; }
.project-card:hover .card-preview { transform: scale(1.045); }
.card-index { position: absolute; z-index:1; left: 13px; top: 12px; font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #e8f3f9; text-shadow: 0 1px 9px #081c33; }
.card-index-divider { padding: 0 4px; color: var(--accent); }
.card-version { position: absolute; z-index:1; right: 12px; top: 10px; border: 1px solid #e5f6ff37; border-radius: 5px; padding: 3px 8px; color: #e7f3fa; background: rgba(4, 24, 39, .63); backdrop-filter: blur(10px); font: 600 11px/1.55 'Space Grotesk',sans-serif; letter-spacing: .02em; }
.card-content { flex: 1; min-height: 123px; padding: 15px 16px 14px; display: flex; flex-direction: column; background: linear-gradient(160deg,rgba(29, 61, 82, .18),transparent 66%); }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 9px; }
.card-heading h2 { margin: 0; font: 600 19px/1.2 'Space Grotesk', sans-serif; letter-spacing: -.045em; overflow-wrap: anywhere; }
.card-arrow { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; color: var(--accent); border-radius: 50%; border: 1px solid color-mix(in srgb,var(--accent) 30%,transparent); transition: transform .25s, background .25s; }
.project-card:hover .card-arrow { transform: translate(2px,-2px); background: color-mix(in srgb,var(--accent) 12%, transparent); }
.card-content p { font-size: 12px; color: #a4b6c7; line-height: 1.5; margin: 6px 0 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display:flex; flex-wrap:wrap; gap: 5px; margin-top: auto; }
.tag { font-size: 10px; letter-spacing: .05em; line-height: 1.4; font-weight: 650; border: 1px solid #8da4b628; background: #8da4b614; color: #a9b9c7; border-radius: 4px; padding: 3px 7px; text-transform: uppercase; }
.tag-web { background: rgba(96, 214, 185, .095); border-color: rgba(96, 214, 185, .21); color: #85dbc6; }
.tag-download { background: rgba(246, 181, 104, .09); border-color: rgba(246, 181, 104, .2); color: #e2ba81; }
.tag-archive { background: rgba(158, 172, 203, .09); border-color: rgba(158, 172, 203, .2); color: #b7bfd6; }
.empty-state { padding: 24px 16px; text-align: center; color: #abc0d1; border: 1px dashed rgba(170,196,217,.22); border-radius: 9px; background: rgba(255,255,255,.02); }
.footer { display:flex; justify-content:space-between; gap:20px; margin-top: 32px; padding: 18px 0 20px; border-top:1px solid var(--line); color:#70899d; font-size:10px; letter-spacing:.16em; font-weight:700; }
.footer-star { padding-left: 8px; color:var(--teal); font-size:15px; }

@media (max-width: 1099px) {
  .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .page { width: calc(100% - 38px); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .hero { padding: 27px 0 22px; }
  .catalog-toolbar { flex-wrap: wrap; padding: 12px 0; gap: 8px 18px; }
  .filters { justify-content: flex-start; }
}
@media (max-width: 540px) {
  .page { width: calc(100% - 28px); }
  .hero { padding: 23px 0 19px; }
  h1 { font-size: clamp(42px, 12vw, 54px); margin: 0 0 4px; }
  .hero p { font-size: 13px; }
  .catalog-toolbar { min-height: 0; margin-bottom: 9px; }
  .catalog-title { letter-spacing: .13em; }
  .filter { padding: 5px 10px; }
  .project-grid { grid-template-columns: 1fr; gap: 12px; }
  .card-visual { aspect-ratio: 2; }
  .card-content { min-height: 0; padding: 14px 15px 13px; }
  .card-content p { margin-bottom: 10px; }
  .footer { margin-top: 25px; padding: 15px 0 18px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
