/* ============================================================
   Clutch & Kernel — Stylesheet
   Combined design tokens + marketing page styles.
   Mobile-first, clean typography, minimal reset.
   ============================================================ */

/* ---------- Design tokens (light mode) ---------- */
:root {
  --color-bg:            #fafafa;
  --color-text:          #1a1a2e;
  --color-text-muted:    #6b7280;
  --color-text-subtle:   #374151;
  --color-link:          #f59e0b;
  --color-link-hover:    #d97706;
  --color-border:        #e5e7eb;
  --color-border-input:  #d1d5db;
  --color-surface:       #fff;
  --color-surface-alt:   #f9fafb;

  /* Nav */
  --color-nav-bg:        #1a1a2e;
  --color-nav-text:      #fff;
  --color-nav-hover:     #fbbf24;

  /* Primary accent */
  --color-primary:       #f59e0b;
  --color-primary-hover: #d97706;

  /* Focus ring */
  --color-focus-ring:    rgba(245, 158, 11, 0.2);
  --color-focus-border:  #f59e0b;
}

/* ---------- Dark color values (shared by auto + manual) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg:            #121212;
    --color-text:          #e5e7eb;
    --color-text-muted:    #9ca3af;
    --color-text-subtle:   #d1d5db;
    --color-link:          #fbbf24;
    --color-link-hover:    #f59e0b;
    --color-border:        #374151;
    --color-border-input:  #4b5563;
    --color-surface:       #1e1e2e;
    --color-surface-alt:   #252536;
    --color-nav-bg:        #1e1e30;
    --color-nav-text:      #e5e7eb;
    --color-nav-hover:     #fbbf24;
    --color-focus-ring:    rgba(251, 191, 36, 0.3);
    --color-focus-border:  #fbbf24;
  }
}

/* ---------- Manual dark override ---------- */
:root[data-theme="dark"] {
  --color-bg:            #121212;
  --color-text:          #e5e7eb;
  --color-text-muted:    #9ca3af;
  --color-text-subtle:   #d1d5db;
  --color-link:          #fbbf24;
  --color-link-hover:    #f59e0b;
  --color-border:        #374151;
  --color-border-input:  #4b5563;
  --color-surface:       #1e1e2e;
  --color-surface-alt:   #252536;
  --color-nav-bg:        #1e1e30;
  --color-nav-text:      #e5e7eb;
  --color-nav-hover:     #fbbf24;
  --color-focus-ring:    rgba(251, 191, 36, 0.3);
  --color-focus-border:  #fbbf24;
}

/* ---------- Theme toggle button ---------- */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 1rem;
  color: var(--color-nav-text);
  font-size: 1.25rem;
  line-height: 1;
  vertical-align: middle;
  transition: opacity 0.15s;
}

.theme-toggle:hover {
  opacity: 0.75;
}

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

/* ---------- Base ---------- */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

p {
  margin-bottom: 1em;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* ---------- Responsive typography ---------- */
@media (min-width: 768px) {
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.2rem; }
}

/* ============================================================
   Marketing / Site Pages
   ============================================================ */

/* ---------- Reset for marketing pages ---------- */
.mkt-nav,
.mkt-hero,
.mkt-page-hero,
.mkt-section,
.mkt-cta,
.mkt-footer {
  box-sizing: border-box;
}

/* ---------- Container ---------- */
.mkt-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Navigation ---------- */
.mkt-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-nav-bg, #1a1a2e);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.mkt-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.mkt-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.mkt-nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.mkt-nav-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

.mkt-nav-links a:hover {
  color: #fff;
}

/* Mobile nav toggle */
.mkt-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  width: 28px;
  height: 28px;
}

.mkt-nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.mkt-nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mkt-nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.mkt-nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Buttons ---------- */
.mkt-btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-align: center;
}

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

.mkt-btn:hover {
  text-decoration: none;
}

.mkt-btn-primary {
  background: #f59e0b;
  color: #1a1a2e;
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
}

.mkt-btn-primary:hover {
  background: #d97706;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
  color: #1a1a2e;
}

.mkt-btn-lg {
  padding: 0.85rem 2.25rem;
  font-size: 1.05rem;
}

/* ---------- Hero (Landing) ---------- */
.mkt-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  color: #fff;
  padding: 6rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.mkt-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 100%),
    radial-gradient(ellipse 500px 300px at 80% 30%, rgba(251, 191, 36, 0.06) 0%, transparent 100%);
  pointer-events: none;
}

.mkt-hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #f59e0b;
  margin-bottom: 1rem;
}

.mkt-hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1.25rem;
  letter-spacing: -0.03em;
}

.mkt-hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.mkt-hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Page Hero (inner pages) ---------- */
.mkt-page-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 4rem 0 3rem;
  text-align: center;
}

.mkt-page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.mkt-page-hero .mkt-hero-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.05rem;
  margin: 0 auto;
  max-width: 480px;
}

/* ---------- Sections ---------- */
.mkt-section {
  padding: 5rem 0;
}

.mkt-section-alt {
  background: var(--color-surface, #f1f5f9);
}

[data-theme="dark"] .mkt-section-alt {
  background: var(--color-surface, #1e1e2e);
}

.mkt-section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  color: var(--color-text, #1a1a2e);
}

.mkt-section-sub {
  text-align: center;
  color: var(--color-text-muted, #6b7280);
  font-size: 1.05rem;
  margin: 0 0 3rem;
}

/* ---------- Feature Cards ---------- */
.mkt-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.mkt-card {
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.75rem;
  padding: 2rem 1.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mkt-card:hover {
  border-color: var(--color-primary, #f59e0b);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .mkt-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.mkt-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.mkt-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text, #1a1a2e);
}

.mkt-card p {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.925rem;
  line-height: 1.65;
  margin: 0;
}

/* ---------- Highlights ---------- */
.mkt-highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
}

.mkt-highlight h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text, #1a1a2e);
}

.mkt-highlight p {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.925rem;
  line-height: 1.65;
  margin: 0;
}

/* ---------- CTA Section ---------- */
.mkt-cta {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 5rem 0;
  text-align: center;
}

.mkt-cta h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.mkt-cta p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.05rem;
  margin: 0 0 2rem;
}

/* ---------- Prose (long-form content) ---------- */
.mkt-prose {
  max-width: 720px;
  margin: 0 auto;
}

.mkt-prose h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
  color: var(--color-text, #1a1a2e);
}

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

.mkt-prose p {
  color: var(--color-text-muted, #4b5563);
  font-size: 0.975rem;
  line-height: 1.75;
  margin: 0 0 1rem;
}

[data-theme="dark"] .mkt-prose p {
  color: var(--color-text-muted, #9ca3af);
}

/* ---------- Contact Grid ---------- */
.mkt-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.mkt-contact-card {
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.75rem;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mkt-contact-card:hover {
  border-color: var(--color-primary, #f59e0b);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .mkt-contact-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.mkt-contact-icon {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.mkt-contact-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text, #1a1a2e);
}

.mkt-contact-card p {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.mkt-contact-link {
  color: var(--color-link, #f59e0b);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s;
}

.mkt-contact-link:hover {
  color: var(--color-link-hover, #d97706);
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.mkt-footer {
  background: var(--color-nav-bg, #1a1a2e);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0 0;
}

.mkt-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mkt-footer-brand .mkt-logo {
  display: block;
  margin-bottom: 0.5rem;
}

.mkt-footer-brand p {
  font-size: 0.85rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  max-width: 280px;
}

.mkt-footer-cols {
  display: flex;
  gap: 4rem;
}

.mkt-footer-cols h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 0.75rem;
}

.mkt-footer-cols a {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.2rem 0;
  transition: color 0.15s;
}

.mkt-footer-cols a:hover {
  color: #fff;
}

.mkt-footer-bottom {
  padding: 1.25rem 0;
}

.mkt-footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  /* Nav goes hamburger */
  .mkt-nav-toggle {
    display: flex;
  }

  .mkt-nav-links {
    display: none;
    position: absolute;
    top: 3.5rem;
    left: 0;
    right: 0;
    background: var(--color-nav-bg, #1a1a2e);
    flex-direction: column;
    padding: 1rem 1.5rem 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mkt-nav-links.open {
    display: flex;
  }

  .mkt-nav-links a {
    font-size: 1rem;
    padding: 0.35rem 0;
  }

  /* Hero */
  .mkt-hero {
    padding: 4rem 0 3.5rem;
  }

  /* Features: stack on mobile */
  .mkt-features {
    grid-template-columns: 1fr;
  }

  /* Highlights: stack on mobile */
  .mkt-highlights {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Contact: stack on mobile */
  .mkt-contact-grid {
    grid-template-columns: 1fr;
  }

  /* Footer: stack */
  .mkt-footer-inner {
    flex-direction: column;
    gap: 2rem;
  }

  .mkt-footer-cols {
    gap: 2.5rem;
  }

  /* Sections: less padding */
  .mkt-section {
    padding: 3.5rem 0;
  }

  .mkt-cta {
    padding: 3.5rem 0;
  }
}

@media (min-width: 769px) and (max-width: 1120px) {
  .mkt-features {
    grid-template-columns: repeat(2, 1fr);
  }

  .mkt-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}
