/*
 * Copyright (c) 2026 Anton Bespalov. All rights reserved.
 * Licensed under the terms specified by the PolyForm Shield License 1.0.0
 * Part of the csiPass project https://github.com/ABespalov/csipass
 *
 * Purpose: Public site visual system aligned with companion and device glass
 * Contributors: None
 *
 * Notice: This file may contain AI-generated or AI-assisted content.
 */

:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-elevated: #132033;
  --surface: #152238;
  --surface-border: rgba(148, 163, 184, 0.22);
  --surface-hover: rgba(148, 163, 184, 0.12);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --text: #f8fafc;
  --muted: #94a3b8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.55);
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --radius: 10px;
  --space: 8px;
  --focus: 0 0 0 3px rgba(59, 130, 246, 0.4);
  --motion: 220ms ease;
  --max: 68rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 55% at 15% -10%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 5%, rgba(15, 23, 42, 0.9), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.55;
}

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

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: var(--space);
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.86);
  border-bottom: 1px solid var(--surface-border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 8.5rem;
  height: auto;
  image-rendering: pixelated;
}

.brand-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--motion);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--primary);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(12rem, 0.7fr);
  gap: 2.5rem;
  align-items: center;
  min-height: min(78vh, 40rem);
  padding: 2.5rem 0 3rem;
  animation: rise 560ms ease both;
}

.hero-copy h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-lead {
  margin: 0 0 1.5rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 1.05rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  transition: background var(--motion), border-color var(--motion), color var(--motion);
  cursor: pointer;
}

.button-primary {
  background: var(--primary);
  color: #fff;
}

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

.button-ghost {
  background: transparent;
  border-color: var(--surface-border);
  color: var(--text);
}

.button-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.device-frame {
  justify-self: center;
  width: min(100%, 11.5rem);
  aspect-ratio: 172 / 320;
  padding: 0.55rem;
  border-radius: 1.1rem;
  background: linear-gradient(160deg, #1a2740, #0b1220);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow);
  animation: rise 700ms ease 80ms both;
}

.device-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 1rem 0.75rem 0.85rem;
  border-radius: 0.65rem;
  background: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.device-screen .wordmark {
  width: 100%;
  image-rendering: pixelated;
}

.device-state {
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.device-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.device-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.section {
  padding: 2.75rem 0;
  border-top: 1px solid var(--surface-border);
  animation: rise 520ms ease both;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  letter-spacing: -0.015em;
}

.section h3 {
  margin: 1.75rem 0 0.55rem;
  font-size: 1.1rem;
}

.section p,
.section li {
  color: var(--muted);
}

.section p strong,
.section li strong {
  color: var(--text);
  font-weight: 650;
}

.section > p:first-of-type {
  max-width: 42rem;
}

.stack {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.stack p {
  margin: 0;
  max-width: 42rem;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--surface-border);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-strip p {
  margin: 0;
  flex: 1 1 14rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1.25rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--surface-border);
}

th {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.45);
}

td {
  color: var(--muted);
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

.list-plain {
  margin: 0.85rem 0 0;
  padding-left: 1.15rem;
}

.list-plain li + li {
  margin-top: 0.45rem;
}

.roadmap {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.roadmap li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--surface-border);
}

.roadmap .milestone {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 650;
}

.roadmap .done .milestone {
  color: var(--success);
}

.downloads {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.download-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--surface-border);
}

.download-row h3 {
  margin: 0;
  font-size: 1rem;
}

.download-row p {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
}

.download-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.download-row .button[aria-disabled="true"],
.download-row .button:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.contact-block {
  margin-top: 1rem;
}

.contact-block a {
  font-weight: 650;
}

.site-footer {
  border-top: 1px solid var(--surface-border);
  background: rgba(11, 18, 32, 0.65);
}

.site-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.footer-claim {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-weight: 650;
}

.site-footer p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
}

.site-footer nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 1.75rem;
  }

  .device-frame {
    order: -1;
    width: min(100%, 10.5rem);
  }

  .download-row {
    grid-template-columns: 1fr;
  }
}

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

  .nav {
    justify-content: flex-start;
  }

  .roadmap li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero,
  .device-frame,
  .section {
    animation: none;
  }
}
