/* -----------------
   Design tokens
------------------ */
:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-subtle: #f0f2f5;
  --text: #0b1220;
  --text-soft: #4b5563;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-strong: #1d4ed8;
  --border-subtle: #e5e7eb;
  --border-soft: rgba(148, 163, 184, 0.55);
  --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.12);
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.18s ease-out;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

/* Dark theme override */
html[data-theme="dark"] {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-subtle: #020617;
  --text: #e5e7eb;
  --text-soft: #d1d5db;
  --text-muted: #9ca3af;
  --accent: #60a5fa;
  --accent-soft: rgba(37, 99, 235, 0.18);
  --accent-strong: #60a5fa;
  --border-subtle: #111827;
  --border-soft: rgba(55, 65, 81, 0.95);
  --shadow-soft: 0 22px 60px rgba(15, 23, 42, 0.9);
}

/* Respect system preference when auto */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #020617;
    --bg-elevated: #020617;
    --bg-subtle: #020617;
    --text: #e5e7eb;
    --text-soft: #d1d5db;
    --text-muted: #9ca3af;
    --accent: #60a5fa;
    --accent-soft: rgba(37, 99, 235, 0.18);
    --accent-strong: #60a5fa;
    --border-subtle: #111827;
    --border-soft: rgba(55, 65, 81, 0.95);
    --shadow-soft: 0 22px 60px rgba(15, 23, 42, 0.9);
  }
}

/* -----------------
   Global
------------------ */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 52%),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  flex: 1;
}

a {
  color: inherit;
}

/* -----------------
   Header
------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: linear-gradient(
    to bottom,
    rgba(248, 250, 252, 0.9),
    rgba(248, 250, 252, 0.7),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, #22c55e, #16a34a);
  box-shadow:
    0 0 0 6px rgba(34, 197, 94, 0.2),
    0 0 20px rgba(22, 163, 74, 0.5);
}

.brand-text {
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 13px;
  text-transform: uppercase;
}

/* Nav */
.nav {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding-bottom: 2px;
  position: relative;
  transition: color var(--transition-fast);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  transition: width var(--transition-fast);
}

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

.nav a:hover::after {
  width: 100%;
}

/* Theme toggle */
.theme-toggle {
  border: 1px solid var(--border-soft);
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform 0.12s ease-out;
}

.theme-toggle:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  font-size: 14px;
}

/* -----------------
   Hero
------------------ */

.hero {
  padding: 40px 0 32px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.hero-text h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 3.4vw, 2.9rem);
  letter-spacing: -0.04em;
}

.hero-subtitle {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.meta-item {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 12px;
  display: inline-flex;
  flex-direction: row;
  gap: 6px;
}

.meta-label {
  font-weight: 500;
  color: var(--text-muted);
}

.meta-value {
  color: var(--text-soft);
}

/* Hero visual – real screenshots */

.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* рамка телефону */
.hero-screenshot-frame {
  position: relative;
  max-width: 260px;
  width: 100%;
  padding: 10px;
  border-radius: 34px;
  background:
    radial-gradient(circle at top, rgba(15, 23, 42, 0.95), #020617);
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow:
    0 22px 55px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.8);
  overflow: hidden;
}

/* екран */
.hero-screenshot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
}

/* За замовчуванням показуємо light-версію (для теми auto / без атрибута) */
.hero-screenshot--dark {
  display: none;
}

/* Явні режими теми */
html[data-theme="dark"] .hero-screenshot--dark {
  display: block;
}
html[data-theme="dark"] .hero-screenshot--light {
  display: none;
}

html[data-theme="light"] .hero-screenshot--dark {
  display: none;
}
html[data-theme="light"] .hero-screenshot--light {
  display: block;
}

/* Якщо режим auto – підлаштовуємось під системну тему */
html[data-theme="auto"] .hero-screenshot--dark,
html:not([data-theme]) .hero-screenshot--dark {
  display: none;
}
html[data-theme="auto"] .hero-screenshot--light,
html:not([data-theme]) .hero-screenshot--light {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .hero-screenshot--dark,
  html:not([data-theme]) .hero-screenshot--dark {
    display: block;
  }
  html[data-theme="auto"] .hero-screenshot--light,
  html:not([data-theme]) .hero-screenshot--light {
    display: none;
  }
}

/* Hero badge */
.hero-badge {
  position: absolute;
  bottom: -18px;
  right: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

/* -----------------
   Sections
------------------ */

.section {
  padding: 36px 0;
}

.section-divider {
  border-top: none;
}

.section-muted {
  background: transparent;
}

.narrow {
  max-width: 640px;
}

.section-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.section-header p {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text-soft);
}

/* -----------------
   Apps grid
------------------ */

.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* <-- рівні колонки */
  gap: 20px;
  align-items: stretch;
}

.app-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
}

.app-card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.app-card-header h3 {
  margin: 0;
  font-size: 18px;
}

.app-tag {
  align-self: flex-start;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.app-summary {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-soft);
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.app-feature-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

.app-meta-block {
  border-radius: var(--radius-md);
  padding: 10px 11px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px dashed rgba(148, 163, 184, 0.7);
}

.app-meta-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.app-meta-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.app-card-placeholder {
  opacity: 0.95;
  border-style: dashed;
}

/* Другорядний текст */
.muted {
  color: var(--text-soft);
  font-size: 13px;
}

/* -----------------
   Buttons & links
------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    transform 0.12s ease-out,
    box-shadow var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #22c55e);
  color: #f9fafb;
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.4);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(30, 64, 175, 0.45);
}

.btn.ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
}

.btn.ghost:hover {
  background: rgba(148, 163, 184, 0.12);
}

.btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.text-link {
  font-size: 13px;
  color: var(--accent-strong);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.dot-separator {
  font-size: 13px;
  color: var(--text-muted);
}

/* -----------------
   Support
------------------ */

.contact-list {
  margin: 10px 0 4px;
  padding-left: 18px;
  font-size: 14px;
}

/* -----------------
   Footer
------------------ */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 14px 0;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(12px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 12px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-soft);
}

/* -----------------
   Responsive
------------------ */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .hero {
    padding-top: 30px;
  }

  .hero-visual {
    align-items: flex-start;
  }

  .hero-badge {
    right: auto;
    left: 8px;
  }

  .apps-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .header-inner {
    gap: 10px;
  }

  .nav {
    gap: 14px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ------------------------------------
   Dark theme refinements (top & bottom)
------------------------------------ */

/* Фон сторінки в темній темі — більш спокійні градієнти */
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.35), transparent 55%),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.3), transparent 55%),
    #020617;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] body {
    background:
      radial-gradient(circle at top left, rgba(37, 99, 235, 0.35), transparent 55%),
      radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.3), transparent 55%),
      #020617;
  }
}

/* Хедер в темній темі */
html[data-theme="dark"] .site-header {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.9),
    transparent
  );
  border-bottom-color: rgba(30, 64, 175, 0.5);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .site-header {
    background: linear-gradient(
      to bottom,
      rgba(15, 23, 42, 0.96),
      rgba(15, 23, 42, 0.9),
      transparent
    );
    border-bottom-color: rgba(30, 64, 175, 0.5);
  }
}

/* Футер в темній темі */
html[data-theme="dark"] .site-footer {
  background: #020617;
  border-top-color: #111827;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .site-footer {
    background: #020617;
    border-top-color: #111827;
  }
}

/* Заголовки секцій */

.section-title {
  font-size: clamp(1.9rem, 2.4vw, 2.3rem);
  font-weight: 600;
}

/* Однаковий стиль для великих секційних заголовків */
.section-header h2,
.about-main h2 {
  font-size: clamp(1.9rem, 2.4vw, 2.3rem);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Більш комфортний інтерліньяж в секції About */
.about-main p {
  line-height: 1.7;
  margin-bottom: 0.7em;
}

.about-card ul {
  padding-left: 18px;
  margin: 8px 0 0;
}

.about-card li {
  line-height: 1.6;
  margin-bottom: 0.35em;
}

.about-main h2.section-title {
  margin-bottom: 14px;
}

/* Більше простору в секціях (Apps from the lab) */
.section-header {
  margin-bottom: 22px;
}

.section-header h2 {
  margin: 0 0 10px;
}

.section-header p {
  margin: 0;
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.65;
}

.hero-qr {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0.85;
}

.hero-qr img {
  width: 104px;
  height: 104px;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
}

.hero-qr-caption {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  max-width: 160px;
  line-height: 1.4;
}

