/* Kalibrio — black & white, dot-matrix design */
@font-face {
  font-family: 'Doto';
  src: url('/assets/fonts/doto.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #000000;
  --card: #101010;
  --card-line: #1F1F1F;
  --ink: #F2F2F2;
  --muted: #8E8E8E;
  --faint: #555555;
  --line: #1A1A1A;
  --radius: 18px;
  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  --dot-font: 'Doto', "Helvetica Neue", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #FFFFFF; color: #000000; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--dot-font); font-weight: 900; font-size: 20px;
  letter-spacing: 0.04em; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav .links { display: flex; gap: 24px; margin-left: auto; align-items: center; }
.nav .links a { color: var(--muted); font-size: 14px; letter-spacing: 0.02em; }
.nav .links a:hover { color: var(--ink); text-decoration: none; }
.btn {
  display: inline-block; font-size: 14px; font-weight: 500;
  padding: 9px 20px; border-radius: 999px;
  background: var(--ink); color: #000;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.8; color: #000; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid #333; }
.btn.small { padding: 7px 16px; font-size: 13px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 40px 0 24px; text-align: center; }
.hero .stage { position: relative; height: 380px; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero h1.fallback {
  font-family: var(--dot-font); font-weight: 900;
  font-size: clamp(44px, 8vw, 96px); line-height: 1.1; letter-spacing: 0.02em;
  padding-top: 100px;
  display: none;
}
.no-js .hero h1.fallback { display: block; }
.no-js .hero canvas { display: none; }
.hero p.lead {
  color: var(--muted); font-size: clamp(16px, 2vw, 19px);
  max-width: 36em; margin: 0 auto 30px;
}
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.kicker {
  font-family: var(--dot-font); font-weight: 900;
  font-size: 13px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--faint);
}
h2.title {
  font-family: var(--dot-font); font-weight: 900;
  font-size: clamp(28px, 4.5vw, 44px); letter-spacing: 0.02em;
  margin: 10px 0 12px;
}
.sub { color: var(--muted); max-width: 42em; }

/* ---------- Category cards ---------- */
.grid { display: grid; gap: 18px; margin-top: 40px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); padding: 28px 26px 30px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 300px;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: #3A3A3A; }
.card h3 { font-size: 18px; font-weight: 600; letter-spacing: 0.01em; }
.card p.desc { color: var(--muted); font-size: 14.5px; }
.card .doticon { flex: 1; min-height: 130px; margin-top: 22px; position: relative; }
.doticon canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.doticon.live {
  -webkit-mask-image: none !important; mask-image: none !important;
  background: none !important; animation: none;
}

/* dotted icons: dot grid revealed through an SVG mask */
.doticon {
  background-image: radial-gradient(circle, #EDEDED 1.3px, transparent 1.45px);
  background-size: 9px 9px;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  animation: dotpulse 6s ease-in-out infinite;
}
@keyframes dotpulse { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.55; } }
.card:nth-child(2) .doticon { animation-delay: 1.5s; }
.card:nth-child(3) .doticon { animation-delay: 3s; }
.card:nth-child(4) .doticon { animation-delay: 4.5s; }
@media (prefers-reduced-motion: reduce) { .doticon { animation: none; } }

.doticon.game { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect x='12' y='12' width='45' height='45' rx='10'/%3E%3Crect x='63' y='12' width='45' height='45' rx='10'/%3E%3Crect x='12' y='63' width='45' height='45' rx='10'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect x='12' y='12' width='45' height='45' rx='10'/%3E%3Crect x='63' y='12' width='45' height='45' rx='10'/%3E%3Crect x='12' y='63' width='45' height='45' rx='10'/%3E%3C/svg%3E"); }
.doticon.book { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M60 24 C50 15 30 14 18 18 V100 C30 96 50 97 60 106 C70 97 90 96 102 100 V18 C90 14 70 15 60 24 Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M60 24 C50 15 30 14 18 18 V100 C30 96 50 97 60 106 C70 97 90 96 102 100 V18 C90 14 70 15 60 24 Z'/%3E%3C/svg%3E"); }
.doticon.music { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M48 88 V26 L96 16 V78' stroke='%23000' stroke-width='14' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cellipse cx='36' cy='90' rx='16' ry='13'/%3E%3Cellipse cx='84' cy='80' rx='16' ry='13'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M48 88 V26 L96 16 V78' stroke='%23000' stroke-width='14' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cellipse cx='36' cy='90' rx='16' ry='13'/%3E%3Cellipse cx='84' cy='80' rx='16' ry='13'/%3E%3C/svg%3E"); }
.doticon.tv { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect x='10' y='24' width='100' height='64' rx='12'/%3E%3Crect x='38' y='98' width='44' height='10' rx='5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect x='10' y='24' width='100' height='64' rx='12'/%3E%3Crect x='38' y='98' width='44' height='10' rx='5'/%3E%3C/svg%3E"); }

/* ---------- Principles ---------- */
.principles { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principles .grid { margin-top: 30px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.principle h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.principle p { color: var(--muted); font-size: 14.5px; }

/* ---------- Prose pages ---------- */
.prose { max-width: 700px; margin: 0 auto; padding: 72px 24px 88px; }
.prose h1 {
  font-family: var(--dot-font); font-weight: 900;
  font-size: clamp(30px, 5vw, 44px); letter-spacing: 0.02em; margin-bottom: 10px;
}
.prose .updated { color: var(--faint); font-size: 14px; margin-bottom: 36px; }
.prose h2 { font-size: 19px; font-weight: 600; margin: 38px 0 10px; }
.prose h3 { font-size: 16px; font-weight: 600; margin: 24px 0 6px; }
.prose p, .prose li { color: #B9B9B9; font-size: 15.5px; }
.prose ul, .prose ol { padding-left: 22px; margin: 10px 0 16px; }
.prose li { margin: 6px 0; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; color: var(--ink); }
.prose .note {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: 14px; padding: 16px 20px; font-size: 15px; margin: 22px 0;
}

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid var(--line);
  padding: 52px 0 44px;
  font-size: 14px; color: var(--muted);
}
footer.site .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
footer.site h4 {
  font-family: var(--dot-font); font-weight: 900;
  color: var(--ink); font-size: 14px; letter-spacing: 0.08em; margin-bottom: 12px;
}
footer.site ul { list-style: none; }
footer.site li { margin: 6px 0; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--ink); }
footer.site .legal {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero .stage { height: 220px; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .card { min-height: 240px; }
  footer.site .cols { grid-template-columns: 1fr; }
  .nav .links a.navlink { display: none; }
}
