/* Karvio — karvio.net */

:root {
  --primary: #3563e9;
  --primary-hover: #2a52d4;
  --primary-light: #c8daff;
  --on-primary: #ffffff;
  --secondary: #4a7a90;
  --accent: #c4a35a;
  --splash: #001b3b;
  --splash-mid: #10233f;
  --scaffold: #f4f8fc;
  --surface-canvas: #ebf2fa;
  --surface: #ffffff;
  --on-surface: #0f172a;
  --on-surface-variant: #4a5c72;
  --on-surface-tertiary: #94a3b8;
  --outline: #d6e2f0;
  --outline-strong: #c7d6e8;
  --brand-foreground: #d5d9e1;
  --shadow-color: rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.12),
    0 12px 24px -8px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 1px 2px var(--shadow-color), 0 8px 24px -4px var(--shadow-color);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-panel: 20px;
  --radius-pill: 999px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --max-width: 1120px;
  --header-height: 72px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-surface);
  background: var(--scaffold);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(244, 248, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--outline);
  box-shadow: 0 1px 8px var(--shadow-color);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--on-surface);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

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

.site-logo__chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--splash);
  border-radius: var(--radius-sm);
  padding: 6px;
}

.site-logo__chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.site-nav a {
  color: var(--on-surface-variant);
  font-size: 15px;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--on-surface);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--on-surface);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 8px rgba(53, 99, 233, 0.3);
}

.btn--primary:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
  box-shadow: 0 4px 16px rgba(53, 99, 233, 0.35);
}

.btn--outline {
  background: transparent;
  color: var(--brand-foreground);
  border: 1.5px solid rgba(213, 217, 225, 0.35);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--brand-foreground);
}

.btn--ghost {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--outline);
}

.btn--ghost:hover {
  background: var(--surface-canvas);
  color: var(--primary-hover);
}

/* Hero */

.hero {
  position: relative;
  padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-16);
  background: linear-gradient(165deg, var(--splash) 0%, var(--splash-mid) 45%, #1a3a6e 100%);
  overflow: hidden;
  min-height: 92vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(53, 99, 233, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(74, 122, 144, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--scaffold), transparent);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-foreground);
  margin-bottom: var(--space-5);
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero__title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: var(--space-5);
}

.hero__title span {
  background: linear-gradient(135deg, #6b9fff 0%, #c8daff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 18px;
  line-height: 1.65;
  color: var(--brand-foreground);
  opacity: 0.85;
  max-width: 480px;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__phone-mock {
  position: relative;
  width: 280px;
  background: var(--surface);
  border-radius: 28px;
  padding: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: perspective(800px) rotateY(-8deg) rotateX(4deg);
}

.hero__phone-screen {
  background: var(--scaffold);
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 9 / 19;
}

.mock-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface);
}

.mock-header {
  padding: 0 16px 12px;
}

.mock-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--on-surface);
}

.mock-header p {
  font-size: 13px;
  color: var(--on-surface-tertiary);
}

.mock-card {
  margin: 0 12px 10px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.mock-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.mock-card__id {
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
}

.mock-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: #fff8e1;
  color: #b8860b;
}

.mock-card__route {
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-bottom: 8px;
}

.mock-progress {
  height: 4px;
  background: var(--outline);
  border-radius: 2px;
  overflow: hidden;
}

.mock-progress__bar {
  height: 100%;
  width: 65%;
  background: linear-gradient(90deg, var(--primary), #6b9fff);
  border-radius: 2px;
}

.hero__glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(53, 99, 233, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
}

/* Sections */

.section {
  padding: var(--space-16) 0;
}

.section--alt {
  background: var(--surface);
}

.section__label {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

.section__title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--on-surface);
  margin-bottom: var(--space-4);
}

.section__desc {
  font-size: 17px;
  color: var(--on-surface-variant);
  max-width: 560px;
  line-height: 1.65;
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section__header .section__desc {
  margin: 0 auto;
}

/* Features */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.feature-card {
  background: var(--surface);
  border-radius: var(--radius-panel);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  color: var(--primary);
}

.feature-card__icon svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--on-surface);
}

.feature-card p {
  font-size: 15px;
  color: var(--on-surface-variant);
  line-height: 1.6;
}

/* Partners */

.partners {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: center;
}

.partners__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.partners__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 15px;
  color: var(--on-surface-variant);
}

.partners__check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: #e8f5ec;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f6b42;
  margin-top: 2px;
}

.partners__check svg {
  width: 14px;
  height: 14px;
}

.partners__panel {
  background: linear-gradient(145deg, var(--splash) 0%, var(--splash-mid) 100%);
  border-radius: var(--radius-panel);
  padding: var(--space-8);
  color: var(--brand-foreground);
  box-shadow: var(--shadow-lg);
}

.partners__panel h3 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-4);
}

.partners__stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.partners__stat-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.partners__stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.partners__stat-label {
  font-size: 13px;
  color: var(--brand-foreground);
  opacity: 0.75;
  margin-top: 2px;
}

/* Contact */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.contact-card {
  background: var(--surface);
  border-radius: var(--radius-panel);
  padding: var(--space-6);
  border: 1px solid var(--outline);
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  border-color: var(--outline-strong);
  box-shadow: var(--shadow-card);
}

.contact-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-4);
  background: var(--surface-canvas);
  border-radius: var(--radius-sm);
  color: var(--primary);
}

.contact-card__icon svg {
  width: 22px;
  height: 22px;
}

.contact-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.contact-card a,
.contact-card p {
  font-size: 15px;
  color: var(--on-surface-variant);
}

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

/* Footer */

.site-footer {
  background: var(--splash);
  color: var(--brand-foreground);
  padding: var(--space-12) 0 var(--space-6);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.site-footer__brand p {
  font-size: 15px;
  line-height: 1.65;
  opacity: 0.75;
  margin-top: var(--space-4);
  max-width: 320px;
}

.site-footer__brand .site-logo {
  color: #fff;
}

.site-footer h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: var(--space-4);
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.site-footer a {
  font-size: 15px;
  color: var(--brand-foreground);
  opacity: 0.75;
}

.site-footer a:hover {
  opacity: 1;
  color: #fff;
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  opacity: 0.6;
}

/* Legal pages */

.legal-page {
  padding-top: var(--header-height);
  min-height: 100vh;
}

.legal-hero {
  background: linear-gradient(165deg, var(--splash) 0%, var(--splash-mid) 100%);
  padding: var(--space-12) 0 var(--space-10);
}

.legal-hero h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.legal-hero p {
  font-size: 15px;
  color: var(--brand-foreground);
  opacity: 0.75;
  margin-top: var(--space-2);
}

.legal-body {
  padding: var(--space-10) 0 var(--space-16);
}

.legal-content {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-panel);
  padding: var(--space-8) var(--space-8);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--outline);
}

.legal-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin: var(--space-8) 0 var(--space-3);
  color: var(--on-surface);
}

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

.legal-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin: var(--space-6) 0 var(--space-2);
  color: var(--on-surface);
}

.legal-content p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--on-surface-variant);
  margin-bottom: var(--space-4);
}

.legal-content ul,
.legal-content ol {
  font-size: 15px;
  line-height: 1.7;
  color: var(--on-surface-variant);
  margin: 0 0 var(--space-4) var(--space-6);
}

.legal-content li {
  margin-bottom: var(--space-2);
}

.legal-content a {
  word-break: break-word;
}

.legal-content .legal-placeholder {
  padding: var(--space-6);
  background: var(--surface-canvas);
  border: 1px dashed var(--outline-strong);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--on-surface-tertiary);
  font-size: 14px;
}

.legal-loading {
  text-align: center;
  padding: var(--space-10);
  color: var(--on-surface-tertiary);
  font-size: 15px;
}

/* Responsive */

@media (max-width: 960px) {
  .hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__visual {
    order: -1;
  }

  .hero__phone-mock {
    width: 240px;
    transform: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .partners {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--outline);
    padding: var(--space-4);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav a {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
  }

  .site-nav a:hover {
    background: var(--surface-canvas);
  }

  .site-nav .btn {
    margin-top: var(--space-2);
  }

  .site-footer__bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  .legal-content {
    padding: var(--space-6) var(--space-5);
  }
}
