/* === Design tokens === */
:root {
  --bg: #0d0d0f;
  --surface: #1a1a22;
  --text: #e4e4e9;
  --muted: #575768;
  --accent: #19c49a;
  --border: rgba(255,255,255,0.07);
  --accent-dim: rgba(25,196,154,0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
}

/* === Hero === */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

.hero-inner {
  max-width: 680px;
}

.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 600;
}

.hero-inner h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-style: normal;
  color: #e4e4e9;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.65;
}

.cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #0d0d0f;
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.88;
  color: #0d0d0f;
}

.btn-secondary {
  display: inline-block;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Stats bar === */
.stats-bar {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Feature showcase === */
.features {
  padding: 4rem 1.5rem;
}

.features-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.feature-block.reverse .feature-media {
  order: 2;
}

.feature-block.reverse .feature-copy {
  order: 1;
}

.feature-media {
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-media-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}

.feature-media img {
  width: 100%;
  height: auto;
  display: block;
}

.feature-media-button img {
  transition: transform 260ms ease, filter 260ms ease;
}

.feature-media-button:hover img,
.feature-media-button:focus-visible img {
  transform: scale(1.03);
  filter: saturate(1.05) contrast(1.03);
}

.feature-media-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: inherit;
}

.feature-media-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 45%, rgba(25,196,154,0.18));
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}

.feature-media-button:hover::after,
.feature-media-button:focus-visible::after {
  opacity: 1;
}

.feature-placeholder {
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.feature-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  margin-bottom: 0.75rem;
}

.feature-copy h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: #e4e4e9;
}

.feature-copy p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(6, 10, 15, 0.84);
  backdrop-filter: blur(18px);
  z-index: 1000;
}

.lightbox.open {
  display: flex;
}

.lightbox-panel {
  position: relative;
  width: min(1200px, 96vw);
  max-height: 92vh;
  background: rgba(9, 22, 30, 0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: lightboxIn 180ms ease-out;
}

.lightbox-image {
  width: 100%;
  max-height: 92vh;
  object-fit: contain;
  display: block;
  background: #05070a;
}

.lightbox-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(9, 22, 30, 0.9);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.lightbox-caption {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  max-width: calc(100% - 4rem);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text);
  background: rgba(9, 22, 30, 0.78);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}

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

@media (max-width: 700px) {
  .feature-block {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-block.reverse .feature-media {
    order: 0;
  }

  .feature-block.reverse .feature-copy {
    order: 0;
  }
}

@media (max-width: 900px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .hero {
    min-height: auto;
    padding: 5.5rem 1.25rem 3.5rem;
  }

  .hero-inner {
    max-width: 720px;
  }

  .hero-inner h1 {
    font-size: clamp(2.4rem, 9vw, 3.8rem);
  }

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

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary,
  .install-actions .btn-primary,
  .install-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .stats-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .features-grid,
  .pricing-grid,
  .security-grid,
  .enterprise-grid,
  .trust-stack-grid,
  .built-on-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-links {
    justify-content: flex-start;
  }

  .compare-wrap {
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
  }

  .compare-table {
    min-width: 720px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 5rem 1rem 3rem;
  }

  .hero-inner h1 {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .subtitle {
    font-size: 0.97rem;
  }

  .stats-inner {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    padding: 0.6rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
  }

  .stat-num {
    font-size: 1.55rem;
  }

  .features {
    padding: 3rem 1rem;
  }

  .feature-media {
    min-height: 180px;
  }

  .feature-copy h2 {
    font-size: 1.3rem;
  }

  .feat,
  .pricing-card,
  .product-card,
  .security-card,
  .enterprise-card,
  .trust-layer {
    padding: 1.25rem;
  }

  .code-block {
    width: 100%;
    overflow-x: auto;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.8rem 1rem;
  }

  .lightbox {
    padding: 0.75rem;
  }

  .lightbox-panel {
    width: 100%;
    max-height: 88vh;
    border-radius: 16px;
  }
}

/* === Utility: navigation links === */
.nav-link {
  color: #888;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #f0f0f0;
}

.footer-link {
  color: #888;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

/* === Utility: hero animation === */
.hero-headline {
  animation: fadeInUp 0.8s ease-out both;
}

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

/* === Utility: code copy button === */
.copy-btn {
  background: #2e2e2e;
  color: #888;
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.copy-btn:hover {
  background: #3e3e3e;
  color: #f0f0f0;
}

.copy-btn.copied {
  background: var(--accent);
  color: #0a0a0a;
}

/* === Utility: terminal === */
.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  background: #1c1c1c;
  border-bottom: 1px solid #2e2e2e;
}

.terminal-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
}

.terminal-body {
  padding: 1.25rem;
  color: #888;
  font-size: 0.8125rem;
  line-height: 1.6;
  margin: 0;
  overflow-x: auto;
}

.terminal-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.terminal-line-user {
  color: #3b82f6;
}

.terminal-line-carina {
  color: var(--accent);
}

.terminal-line-muted {
  color: #666;
}

/* === Utility: section helpers === */
.section-padding {
  padding: 5rem 0;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
}

@media (min-width: 640px) {
  .section-title {
    font-size: 2.25rem;
  }
}

/* === Utility: feature cards (used on sub-pages) === */
.feature-card {
  background: #1c1c1c;
  border: 1px solid #2e2e2e;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.feature-card:hover {
  border-color: #3e3e3e;
}

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

/* === Utility: steps === */
.step-number {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.step-connector {
  position: absolute;
  top: 1.5rem;
  left: 16.66%;
  right: 16.66%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, #2e2e2e 50%, var(--accent) 100%);
}

/* === Utility: comparison table === */
.comparison-table {
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #2e2e2e;
  text-align: center;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
}

.comparison-table thead th {
  color: #888;
  font-weight: 500;
  background: #1c1c1c;
}

.comparison-table .carina-col {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.comparison-table .yes::before {
  content: '\2713 ';
  color: var(--accent);
}

.comparison-table .no {
  text-decoration: line-through;
  color: #555;
}

.comparison-table .partial {
  color: #888;
}

.comparison-table .carina-col.yes {
  text-decoration: none;
}

/* === Utility: pricing cards (sub-pages) === */
.pricing-card {
  background: #1c1c1c;
  border: 1px solid #2e2e2e;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.pricing-card-pro {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(25, 196, 154, 0.2);
}

/* === Utility: scroll animations === */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Utility: subscribe form === */
#subscribe-message.success {
  color: var(--accent);
}

#subscribe-message.error {
  color: #ef4444;
}

/* === Utility: screen reader only === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
