/* Hot Chip — инженерная тёмная тема */

:root {
  --bg: #0a0c0f;
  --bg-elevated: #12161c;
  --bg-card: #161b22;
  --border: #2a3140;
  --border-accent: #2e7d32;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --green-primary: #2e7d32;
  --green-dark: #1b5e20;
  --green-light: #a5d6a7;
  --green-container: #c8e6c9;
  --accent: var(--green-primary);
  --accent-hover: #388e3c;
  --grid-line: rgba(46, 125, 50, 0.08);
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

a {
  color: var(--green-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--green-container);
}

img {
  max-width: 100%;
  height: auto;
}

/* Layout */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 15, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.site-logo:hover {
  color: var(--text);
}

.site-logo__mark {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-accent);
  background: var(--bg-card);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--green-light);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.container--narrow {
  max-width: 760px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn--primary {
  background: var(--green-primary);
  border-color: var(--green-dark);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn--outline:hover {
  border-color: var(--border-accent);
  color: var(--green-light);
}

.btn--download {
  background: var(--green-dark);
  border-color: var(--green-primary);
  color: var(--green-container);
  font-size: 0.875rem;
  padding: 0.75rem 1.5rem;
}

.btn--download:hover {
  background: var(--green-primary);
  color: #fff;
}

.btn--download[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hero */

.hero {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hero__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-primary);
  margin: 0 0 0.75rem;
}

.hero__title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  margin: 0;
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.hero__actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Section */

.section-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* App cards grid */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.app-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}

.app-card__accent {
  height: 3px;
  background: linear-gradient(90deg, var(--green-dark), var(--green-primary), var(--green-light));
}

.app-card__body {
  padding: 1.25rem 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.app-card__header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.app-card__icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.app-card__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.app-card__tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-light);
}

.app-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  flex: 1;
}

.app-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.app-card__arrow {
  color: var(--green-primary);
}

/* App page */

.app-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.app-hero__icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  border: 1px solid var(--border-accent);
}

.app-hero__info {
  flex: 1;
  min-width: 200px;
}

.app-hero__title {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 600;
}

.app-hero__version {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--green-light);
  margin: 0 0 1rem;
}

.app-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.download-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Screenshots */

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.screenshot-item {
  margin: 0;
}

.screenshot-item__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.screenshot-item__btn:hover {
  box-shadow: 0 0 0 1px var(--border-accent), var(--shadow);
  transform: translateY(-1px);
}

.screenshot-item__btn:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 2px;
}

.screenshot-item img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  pointer-events: none;
}

.screenshot-item figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

/* Lightbox gallery */

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem 1.5rem;
  background: rgba(10, 12, 15, 0.72);
  backdrop-filter: blur(3px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1002;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lightbox__close::before,
.lightbox__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.lightbox__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.lightbox__close:hover {
  border-color: var(--border-accent);
  color: var(--green-light);
}

.lightbox__close:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 2px;
}

.lightbox__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  max-height: 100%;
}

.lightbox__img {
  max-width: min(100%, 540px);
  max-height: calc(100vh - 7rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  user-select: none;
}

.lightbox__caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.lightbox__hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-align: center;
}

/* Help / prose content */

.prose h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--green-primary);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.prose pre,
.prose .formula-block {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0 0 1rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.prose li {
  margin-bottom: 0.375rem;
}

.prose .notice {
  background: rgba(46, 125, 50, 0.1);
  border: 1px solid rgba(46, 125, 50, 0.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Donate page */

.donate-methods {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.donate-method {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.donate-method__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-light);
}

.donate-method p {
  margin: 0;
  color: var(--text-muted);
}

.donate-method code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--bg-elevated);
  padding: 0.125rem 0.375rem;
  border-radius: 2px;
  color: var(--text);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.site-footer a {
  color: var(--text-muted);
}

/* Breadcrumb */

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb span {
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 2rem;
  }
}
