/* ==========================================================================
   Kinetic Signal — Seven Affiliates public design system
   Used by: landing page, /blog listing, /blog/<slug> post pages.
   Deliberately separate from static/css/style.css (the dashboard's design
   system) — these are two different visual languages for two different
   audiences (public marketing vs. logged-in affiliates).
   ========================================================================== */

:root {
  --ks-bg: #0a0a0c;
  --ks-bg-alt: #101013;
  --ks-card: #161619;
  --ks-card-hover: #1c1c20;
  --ks-border: #27272c;
  --ks-text: #f5f5f0;
  --ks-text-secondary: #a3a3ac;
  --ks-text-muted: #6b6b74;
  --ks-accent: #d7ff4f;
  --ks-accent-soft: rgba(215, 255, 79, 0.12);
  --ks-accent-glow: rgba(215, 255, 79, 0.55);
  --ks-radius: 16px;
  --ks-radius-sm: 10px;
  --ks-font-ui: "Space Grotesk", sans-serif;
  --ks-font-mono: "DM Mono", monospace;
  --ks-max: 1180px;
}

* { box-sizing: border-box; }

body.ks {
  margin: 0;
  background: var(--ks-bg);
  color: var(--ks-text);
  font-family: var(--ks-font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.ks-wrap {
  max-width: var(--ks-max);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--ks-accent); color: #0a0a0c; }

/* ---- Typography ---- */

.hero-title {
  font-family: var(--ks-font-ui);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-title {
  font-family: var(--ks-font-ui);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.section-eyebrow {
  font-family: var(--ks-font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ks-accent);
  margin: 0 0 14px;
  display: block;
}

.section-lede {
  color: var(--ks-text-secondary);
  font-size: 16px;
  max-width: 560px;
  margin: 0 0 40px;
}

.accent { color: var(--ks-accent); }

.mono { font-family: var(--ks-font-mono); }

/* ---- Buttons / nav links (shared "reactive glow" style) ---- */

.button, .nav-link {
  font-family: var(--ks-font-ui);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.4s ease, background 0.2s ease, border-color 0.2s ease;
}

.button-primary {
  background: var(--ks-accent);
  color: #0a0a0c;
}

.button-primary:hover { transform: translateY(-1px); }

.button-outline {
  background: transparent;
  color: var(--ks-text);
  border-color: var(--ks-border);
}

.button-outline:hover {
  border-color: var(--ks-accent);
  color: var(--ks-accent);
}

/* Reactive glow: elements carrying this class pick up a pulsing lime glow
   once they scroll into view (see landing.html's IntersectionObserver). */
.ks-glow {
  transition: box-shadow 0.6s ease;
}
.ks-glow.in-view {
  animation: ks-pulse-glow 2.6s ease-in-out infinite;
}
@keyframes ks-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--ks-accent-glow); }
  50% { box-shadow: 0 0 26px 4px var(--ks-accent-glow); }
}

@media (prefers-reduced-motion: reduce) {
  .ks-glow.in-view { animation: none; box-shadow: 0 0 18px 2px var(--ks-accent-glow); }
}

/* ---- Sticky nav ---- */

.ks-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ks-border);
}

.ks-nav-inner {
  max-width: var(--ks-max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ks-wordmark {
  font-family: var(--ks-font-ui);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ks-wordmark-mark {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

.ks-wordmark-full {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.ks-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.ks-nav-links .nav-link {
  color: var(--ks-text-secondary);
  transition: color 0.2s ease;
}
.ks-nav-links .nav-link:hover { color: var(--ks-text); }

.ks-nav-actions { display: flex; align-items: center; gap: 10px; }

.ks-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--ks-border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  color: var(--ks-text);
  align-items: center;
  justify-content: center;
}

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

.ks-hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ks-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.ks-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,12,0.55) 0%, rgba(10,10,12,0.75) 55%, rgba(10,10,12,0.96) 100%);
  z-index: 1;
}

.ks-hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--ks-max);
  margin: 0 auto;
  padding: 0 24px;
}

.ks-hero-sub {
  margin: 24px 0 36px;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--ks-text-secondary);
  max-width: 480px;
}

/* ---- Why Us ---- */

.ks-why { padding: 110px 0; }

.ks-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.ks-feature-card {
  background: var(--ks-card);
  border: 1px solid var(--ks-border);
  border-radius: var(--ks-radius);
  padding: 28px 22px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ks-feature-card:hover {
  background: var(--ks-card-hover);
  border-color: #35353c;
  transform: translateY(-3px);
}

.ks-feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--ks-accent-soft);
  color: var(--ks-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.ks-feature-title {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 8px;
}

.ks-feature-desc {
  color: var(--ks-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- Commissions ---- */
/* Open, poster-style composition (not boxed cards) — a hand-lettered
   headline, a torn/spray-paint transition from the section above, three
   plain-text commission labels spread across the row, and a rough-edged
   CTA. Font choices ("Permanent Marker" / "Baloo 2" / "Nunito") are loaded
   in landing.html's <head>, scoped to this page only. */

.ks-commissions {
  background: var(--ks-accent);
  color: #0a0a0c;
  padding: 150px 0 90px;
  text-align: left;
  position: relative;
}

.ks-commissions-edge {
  position: absolute;
  top: -74px;
  left: 0;
  width: 100%;
  height: 100px;
  pointer-events: none;
}
.ks-commissions-edge svg { width: 100%; height: 100%; display: block; }
.ks-edge-shape, .ks-edge-dot { fill: var(--ks-accent); }

.ks-commissions-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px 48px;
  flex-wrap: wrap;
  margin: 0 0 72px;
}

.ks-commissions-headline {
  font-family: "Permanent Marker", cursive;
  font-weight: 400;
  font-size: clamp(3.4rem, 9vw, 7.5rem);
  line-height: 0.88;
  margin: 0;
  transform: rotate(-2deg);
  flex: 1 1 380px;
}

.ks-commissions-callout {
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.4;
  max-width: 300px;
  margin: 0 0 10px;
  text-align: right;
}
.ks-commissions-callout strong { font-weight: 800; }

.ks-commission-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin: 0 0 96px;
}

.ks-commission-label {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.ks-commission-label:nth-child(1) { transform: rotate(-1.5deg); }
.ks-commission-label:nth-child(2) { transform: rotate(1deg); }
.ks-commission-label:nth-child(3) { transform: rotate(-1deg); }

.ks-commissions-cta-rough {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 15px;
  color: #fff;
  background: #0a0a0c;
  padding: 20px 44px;
  clip-path: polygon(3% 10%, 20% 0%, 45% 6%, 70% 1%, 92% 9%, 100% 20%, 96% 45%, 100% 70%, 94% 90%, 72% 100%, 48% 94%, 22% 100%, 5% 92%, 0% 68%, 4% 42%, 0% 18%);
  transform: rotate(-1.5deg);
  transition: transform 0.2s ease;
}
.ks-commissions-cta-rough:hover { transform: rotate(-1.5deg) scale(1.05); }

/* ---- Dashboard preview ---- */

.ks-dashboard { padding: 120px 0; text-align: center; }

.ks-preview-stage {
  position: relative;
  max-width: 920px;
  margin: 70px auto 0;
  padding-bottom: 60px;
}

.ks-preview-desktop {
  border-radius: var(--ks-radius);
  border: 1px solid var(--ks-border);
  overflow: hidden;
  background: var(--ks-card);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.7);
}

.ks-preview-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--ks-bg-alt);
  border-bottom: 1px solid var(--ks-border);
}

.ks-preview-chrome span {
  width: 9px; height: 9px; border-radius: 50%;
  background: #3a3a41;
}

.ks-preview-desktop img { width: 100%; display: block; }

.ks-preview-placeholder {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ks-text-muted);
  font-family: var(--ks-font-mono);
  font-size: 13px;
  background:
    repeating-linear-gradient(45deg, #141417, #141417 10px, #17171a 10px, #17171a 20px);
}

/* iPhone-style frame: dark chassis with rounded "squircle" corners, a
   Dynamic Island cutout, and side buttons — around an inner screen that
   clips the actual dashboard screenshot. */
.ks-preview-mobile {
  position: absolute;
  right: -8px;
  bottom: 0;
  width: 200px;
  padding: 9px;
  border-radius: 40px;
  background: linear-gradient(160deg, #2a2a2e, #0a0a0c 55%);
  box-shadow:
    0 30px 70px -20px rgba(0,0,0,0.8),
    inset 0 0 0 1.5px rgba(255,255,255,0.12);
}

.ks-preview-mobile-screen {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  background: var(--ks-card);
}

.ks-preview-mobile-screen img { width: 100%; display: block; }

.ks-preview-mobile-island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 16px;
  background: #0a0a0c;
  border-radius: 10px;
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* Side buttons: power (right) and volume/action (left) */
.ks-preview-mobile::before,
.ks-preview-mobile::after {
  content: "";
  position: absolute;
  background: #0a0a0c;
  border-radius: 2px;
}
.ks-preview-mobile::before {
  right: -2.5px;
  top: 90px;
  width: 3px;
  height: 46px;
}
.ks-preview-mobile::after {
  left: -2.5px;
  top: 70px;
  width: 3px;
  height: 26px;
  box-shadow: 0 38px 0 0 #0a0a0c;
}

.ks-preview-mobile .ks-preview-placeholder {
  aspect-ratio: 9 / 18;
  font-size: 11px;
}

/* ---- Contact ---- */

.ks-contact { padding: 110px 0; }

.ks-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.ks-contact-email {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--ks-font-mono);
  font-size: 15px;
  color: var(--ks-accent);
  text-decoration: none;
}
.ks-contact-email:hover { text-decoration: underline; }

.ks-contact-socials {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.ks-social-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--ks-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ks-text-secondary);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.ks-social-icon:hover { border-color: var(--ks-accent); color: var(--ks-accent); }

.ks-field { margin-bottom: 16px; }

.ks-field label {
  display: block;
  font-size: 13px;
  color: var(--ks-text-secondary);
  margin-bottom: 6px;
}

.ks-field input,
.ks-field textarea {
  width: 100%;
  background: var(--ks-card);
  border: 1px solid var(--ks-border);
  border-radius: var(--ks-radius-sm);
  padding: 12px 14px;
  color: var(--ks-text);
  font-family: var(--ks-font-ui);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}
.ks-field input:focus,
.ks-field textarea:focus { border-color: var(--ks-accent); }

.ks-field textarea { min-height: 120px; resize: vertical; }

.ks-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ks-text-secondary);
  margin: 18px 0 20px;
}
.ks-consent-row input { margin-top: 3px; }

.ks-form-note {
  border-radius: var(--ks-radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.ks-form-note.success { background: var(--ks-accent-soft); color: var(--ks-accent); }
.ks-form-note.error { background: rgba(255,90,90,0.1); color: #ff8a8a; }

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

.ks-footer {
  border-top: 1px solid var(--ks-border);
  padding: 40px 0;
}

.ks-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.ks-footer-links {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--ks-text-muted);
}
.ks-footer-links a:hover { color: var(--ks-text-secondary); }

.ks-footer-copy {
  font-size: 13px;
  color: var(--ks-text-muted);
  font-family: var(--ks-font-mono);
}

.ks-footer-socials { display: flex; gap: 10px; }

/* ---- Blog (listing + post) ---- */

.ks-blog-header { padding: 160px 0 60px; text-align: center; }

.ks-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 120px;
}

.ks-blog-card {
  background: var(--ks-card);
  border: 1px solid var(--ks-border);
  border-radius: var(--ks-radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.ks-blog-card:hover { transform: translateY(-3px); border-color: #35353c; }

.ks-blog-card-img {
  aspect-ratio: 16/10;
  background: var(--ks-bg-alt);
  overflow: hidden;
}
.ks-blog-card-img img { width: 100%; height: 100%; object-fit: cover; }

.ks-blog-card-body { padding: 20px; }

.ks-blog-card-date {
  font-family: var(--ks-font-mono);
  font-size: 12px;
  color: var(--ks-text-muted);
  margin-bottom: 8px;
}

.ks-blog-card-title { font-weight: 700; font-size: 17px; margin-bottom: 8px; }

.ks-blog-card-excerpt { color: var(--ks-text-secondary); font-size: 13.5px; line-height: 1.6; }

.ks-blog-empty {
  text-align: center;
  color: var(--ks-text-muted);
  padding: 60px 0 120px;
}

.ks-post { padding: 160px 0 120px; }
.ks-post-inner { max-width: 720px; margin: 0 auto; }
.ks-post-date { font-family: var(--ks-font-mono); font-size: 13px; color: var(--ks-text-muted); margin-bottom: 16px; }
.ks-post-title { font-family: var(--ks-font-ui); font-weight: 700; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.02em; margin-bottom: 30px; }
.ks-post-image { border-radius: var(--ks-radius); overflow: hidden; margin-bottom: 40px; }
.ks-post-body { color: var(--ks-text-secondary); font-size: 16.5px; line-height: 1.8; }
.ks-post-body h2, .ks-post-body h3 { color: var(--ks-text); font-family: var(--ks-font-ui); margin-top: 36px; }
.ks-post-body h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 14px; }
.ks-post-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.ks-post-body a { color: var(--ks-accent); text-decoration: underline; }
.ks-post-body img { border-radius: var(--ks-radius-sm); margin: 20px 0; }
.ks-post-body p { margin: 0 0 18px; }
.ks-post-body ul, .ks-post-body ol { margin: 0 0 18px; padding-left: 22px; }
.ks-post-body li { margin-bottom: 8px; }
.ks-post-body strong { color: var(--ks-text); font-weight: 700; }
.ks-post-back { display: inline-block; margin-bottom: 40px; color: var(--ks-text-secondary); font-size: 13px; }
.ks-post-back:hover { color: var(--ks-accent); }

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

@media (max-width: 900px) {
  .ks-feature-grid { grid-template-columns: repeat(2, 1fr); }
  .ks-contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .ks-blog-grid { grid-template-columns: repeat(2, 1fr); }
  .ks-preview-mobile { width: 150px; right: 10px; }
}

@media (max-width: 640px) {
  .ks-nav-links { display: none; }
  .ks-nav-toggle { display: flex; }
  .ks-feature-grid { grid-template-columns: 1fr; }
  .ks-blog-grid { grid-template-columns: 1fr; }
  .ks-preview-mobile { position: static; width: 60%; margin: 24px auto 0; }
  .ks-nav-actions .button-outline { display: none; }
  .ks-commissions-callout { text-align: left; max-width: 100%; }
  .ks-commission-row { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 64px; }
  .ks-commission-label:nth-child(n) { transform: none; }
}
