:root {
  color-scheme: light;
  --paper: #f5f5f2;
  --surface: #fcfcfa;
  --ink: #161a25;
  --secondary: #474d5b;
  --muted: #626878;
  --line: rgb(22 26 37 / 12%);
  --accent: #1742bd;
  --accent-dark: #10329a;
  --page-width: 1200px;
  --page-gutter: 32px;
  --header-height: 64px;
  --section-height: calc(100svh - var(--header-height));
  --radius: 8px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.5;
  scroll-padding-top: calc(var(--header-height) + 1px);
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100svh; margin: 0; }
h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { font-weight: 500; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: white; }

@media (any-hover: hover) and (any-pointer: fine) {
  :root {
    --site-cursor: url("./assets/cursor.png") 9 5;
    cursor: var(--site-cursor), auto;
  }

  a[href], button:enabled { cursor: var(--site-cursor), pointer; }
}

.container {
  width: min(var(--page-width), calc(100% - var(--page-gutter) * 2));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 3;
  inset: 12px auto auto 12px;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  transform: translateY(calc(-100% - 20px));
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 1.125rem;
  font-weight: 600;
}

.brand-mark { flex: none; filter: brightness(0) saturate(100%); }

.nav { display: flex; gap: 4px; }
.nav a, .menu-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--secondary);
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}

.nav a:hover, .menu-toggle:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current] { border-color: var(--line); background: var(--surface); color: var(--accent); }
.menu-toggle { display: none; background: transparent; border-color: var(--line); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  min-block-size: var(--section-height);
  padding-block: 64px;
}

.hero h1, .products-page h1 {
  font-size: clamp(2.5rem, 5.65vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.hero-words {
  display: block;
  inline-size: fit-content;
  max-inline-size: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: inherit;
  text-align: start;
}

.hero-words:disabled { cursor: inherit; }
.hero-words:enabled:hover, .hero-words:focus-visible { color: var(--accent-dark); }

.hero-words-window { display: block; block-size: 1lh; overflow: hidden; }
.hero-words-track { display: grid; grid-auto-rows: 1lh; white-space: nowrap; }
.hero-words-track > span { overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  .hero-words:enabled .hero-words-track { animation: hero-word-cycle 14s var(--ease) infinite; }
  .hero-words[aria-pressed="true"] .hero-words-track { animation-play-state: paused; }
}

@keyframes hero-word-cycle {
  0%, 21% { transform: translateY(0); }
  25%, 46% { transform: translateY(-20%); }
  50%, 71% { transform: translateY(-40%); }
  75%, 96% { transform: translateY(-60%); }
  100% { transform: translateY(-80%); }
}

.hero-copy > p {
  max-width: 33ch;
  margin-top: 24px;
  color: var(--secondary);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.25;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { border-color: var(--line); }
.button-secondary:hover { background: var(--surface); }

.hero-actions .button {
  min-height: 56px;
  padding-inline: 24px;
  font-size: 1.0625rem;
}

.screensaver {
  position: relative;
  min-width: 0;
  box-shadow: 0 12px 28px rgb(22 26 37 / 12%);
}

.screensaver-image { width: 100%; height: auto; image-rendering: pixelated; }

.screensaver-stage {
  position: absolute;
  inset: calc(26 / 154 * 100%) calc(8 / 186 * 100%) calc(8 / 154 * 100%);
  overflow: hidden;
}

.screensaver-track {
  position: absolute;
  inset: 0;
  animation-delay: -1.32s;
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  animation-play-state: paused;
}

.screensaver[data-playing="true"] .screensaver-track { animation-play-state: running; }
.screensaver-track-x { animation-name: screensaver-x; animation-duration: 3s; animation-timing-function: steps(129); }
.screensaver-track-y { animation-name: screensaver-y; animation-duration: 2s; animation-timing-function: steps(75); }
.screensaver-logo { width: calc(42 / 170 * 100%); height: auto; image-rendering: pixelated; }

@keyframes screensaver-x {
  to { transform: translateX(calc(129 / 170 * 100%)); }
}

@keyframes screensaver-y {
  to { transform: translateY(calc(75 / 120 * 100%)); }
}

.screensaver-toggle {
  position: absolute;
  inset: 9.6% 8% auto auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #0b246b;
  transform: translate(50%, -50%);
}

.screensaver-toggle span {
  display: grid;
  place-items: center;
  width: clamp(20px, 4.1vw, 28px);
  aspect-ratio: 1;
  border: 1px solid #8aa8ee;
  border-top-color: #f2f7ff;
  border-left-color: #f2f7ff;
  background: #d9e6ff;
  box-shadow: 1px 2px #0a287c;
}

.screensaver-toggle:hover span { background: #f2f7ff; }
.screensaver-toggle:focus-visible { outline-color: white; outline-offset: -4px; }

.screensaver-toggle span::before {
  width: 10px;
  height: 11px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: "";
}

.screensaver[data-playing="true"] .screensaver-toggle span::before {
  border-inline: 3px solid currentColor;
  background: transparent;
  clip-path: none;
}

.chapter {
  display: grid;
  align-content: center;
  min-block-size: var(--section-height);
  padding-block: 80px;
  border-top: 1px solid var(--line);
}

.section-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 48px;
}

.section-intro h2 {
  font-size: clamp(2rem, 3.6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -.032em;
}

.section-intro p, .section-message {
  max-width: 28ch;
  color: var(--secondary);
  font-size: 1.125rem;
}

.section-intro p { margin-top: 16px; }

.principles li { padding-block: 20px; border-bottom: 1px solid var(--line); }
.principles li:first-child { padding-top: 0; }
.principles h3, .social-link strong { font-size: 1.25rem; font-weight: 500; line-height: 1.25; }
.principles p { max-width: 46ch; margin-top: 4px; color: var(--secondary); }

.showcase-layout { display: grid; gap: 32px; }

.showcase-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--secondary);
}

.showcase-footer .button { margin-inline-start: auto; }
.showcase-footer-copy { display: grid; gap: 4px; }
.showcase-submit-note { font-size: .9375rem; }

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 288px), 1fr));
  gap: 16px;
}

.showcase-layout .showcase-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.work-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.work-media {
  position: relative;
  min-inline-size: 0;
  aspect-ratio: 4 / 3;
  margin: 8px 8px 0;
  overflow: hidden;
  border-radius: 4px;
  border-block-end: 4px solid var(--accent);
  background: var(--paper);
}

.work-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.work-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
}

.work-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 1.0625rem; color: var(--secondary); }
.work-category { font-weight: 500; color: var(--accent); }
.work-title { font-size: clamp(1.75rem, 3.3vw, 2.625rem); line-height: 1.14; }
.work-description { max-width: 52ch; color: var(--secondary); font-size: 1.125rem; white-space: pre-line; }
.work-link { margin-block-start: auto; color: var(--accent); font-size: 1rem; }
.work-link:hover { border-color: var(--accent); }

.partners-chapter { background: var(--surface); }

.partners-layout {
  display: grid;
  grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
  grid-template-areas:
    "title title"
    "partners card";
  align-items: start;
}

.partners-layout h2 {
  grid-area: title;
  font-size: clamp(3rem, 8.2vw, 7.5rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.partners-layout h2, .products-page h1 {
  margin-inline-start: -.065em;
}

.partners-content { grid-area: partners; margin-top: 16px; }
.partner-cards { display: grid; gap: 10px; width: min(100%, 480px); }
.partner-cards li {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.partner-cards h3 { font-size: 1.125rem; font-weight: 600; }
.partner-cards p { color: var(--secondary); white-space: pre-line; }
.partner-cards a { justify-self: start; color: var(--accent); }
.partner-cards a:hover { text-decoration: underline; }

.founder-card {
  grid-area: card;
  width: min(calc(100% - 12px), 424px);
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(22 26 37 / 12%);
  transform: rotate(4deg);
}

.founder-card img { width: 100%; height: auto; }

.social-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 248px), 1fr));
  gap: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.social-link:hover { border-color: var(--accent); background: white; }
.social-mark { display: grid; flex: none; place-items: center; width: 64px; height: 64px; border-radius: 10px; }
.social-mark-telegram { background: #e7f4fb; color: #26a5e4; }
.social-mark-discord { background: #5865f2; color: white; }
.social-copy { display: grid; gap: 4px; min-width: 0; }
.social-copy > span { color: var(--secondary); }

.products-page {
  display: grid;
  align-content: center;
  gap: 16px;
  min-block-size: var(--section-height);
  padding-block: 48px;
}
.products-page > p { color: var(--secondary); font-size: 1.25rem; }
.product-catalog:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 12px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}
.product-catalog > li {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow-wrap: anywhere;
}
.product-catalog h2 { font-size: 1.3rem; line-height: 1.2; }
.product-catalog p { color: var(--secondary); white-space: pre-wrap; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 32px;
  padding-block: 32px;
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 600; }
.footer-identity > p { margin-top: 4px; color: var(--secondary); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer-links a, .back-top { display: inline-flex; align-items: center; min-height: 44px; color: var(--secondary); }
.footer-links a:hover, .back-top:hover { color: var(--accent); text-decoration: underline; }
.back-top { justify-self: end; }

@media (max-width: 760px) {
  :root { --page-gutter: 24px; }
  .hero { gap: 32px; padding-block: 48px; }
  .hero-actions .button { padding-inline: 16px; font-size: 1rem; }
  .chapter { padding-block: 56px; }
  .section-layout { gap: 32px; }

  .header-inner { flex-wrap: wrap; gap: 0 12px; }
  .nav { flex: 1 0 100%; flex-wrap: wrap; padding-bottom: 8px; }
  .site-header[data-menu] .menu-toggle { display: inline-flex; min-height: 44px; }
  .site-header[data-menu] .nav {
    position: absolute;
    inset: 100% 0 auto;
    display: grid;
    gap: 4px;
    padding: 8px var(--page-gutter) 16px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .site-header[data-menu="closed"] .nav { display: none; }
  .site-header[data-menu] .nav a { min-height: 44px; }
}

@media (max-width: 660px) {
  :root { --page-gutter: 20px; }
  .hero, .section-layout { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 40px; padding-block: 48px; }
  .hero h1 { font-size: clamp(2.5rem, 9vw, 4rem); }
  .hero-copy > p { margin-top: 16px; }
  .hero-actions { margin-top: 24px; }
  .chapter { padding-block: 48px; }
  .section-layout { gap: 24px; }
  .showcase-layout { gap: 24px; }
  .partners-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "partners"
      "card";
    gap: 16px;
  }
  .partners-layout h2 { font-size: clamp(2.5rem, 10vw, 3.5rem); }
  .partners-content { margin-top: 0; }
  .founder-card { width: min(100%, 424px); margin-top: 8px; transform: none; }
  .footer-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 16px; padding-block: 24px; }
  .footer-links { grid-column: 1 / -1; grid-row: 2; }
  .back-top { grid-column: 2; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
