/* ═══════════════════════════════════════════════════════════════════════════
   KennelCore site layer.

   organic.css is the design system and the source of truth for the look —
   colors, type, radii, shadows and the component classes. This file only adds
   what a real multi-page site needs on top of it: page layout, the responsive
   behaviour, and the handful of page-specific patterns. Everything here takes
   its values from the system's tokens; no raw hexes, fonts or spacing.
   ═══════════════════════════════════════════════════════════════════════ */

/* — page shell ——————————————————————————————————————————————————————— */

html {
  scroll-behavior: smooth;
  /* Anchor targets (#demo, #growth …) must clear the sticky header, or the
     heading they point at lands underneath it. */
  scroll-padding-top: 88px;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

/* Visually hidden but still announced by screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Parked above the viewport with a transform rather than a large negative
   offset, which can otherwise extend the scrollable area. */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  transform: translateY(-110%);
}
.skip-link:focus {
  transform: translateY(0);
}

/* — navigation ————————————————————————————————————————————————————————
   The design's nav is a single flex row. That overflows below ~700px once the
   four links and the CTA are laid out, so past that it collapses behind a
   toggle. The toggle is a real <button> with aria-expanded; the menu is still
   fully usable with JS disabled (see .site-nav.no-js).                      */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--color-divider);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-3);
}

.nav-brand {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 18px;
  margin-right: auto;
  color: var(--color-text);
  text-decoration: none;
}
.nav-brand:hover {
  color: var(--color-accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
}
.nav-link:hover,
.nav-link[aria-current='page'] {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: 999px;
  color: var(--color-text);
  cursor: pointer;
}
.nav-toggle:hover {
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav-menu {
    position: absolute;
    inset-inline: clamp(20px, 4vw, 48px);
    top: calc(100% + var(--space-2));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
  }
  .nav-menu li {
    border-bottom: 1px solid var(--color-divider);
  }
  .nav-menu li:last-child {
    border-bottom: 0;
    padding-top: var(--space-2);
  }
  .nav-link {
    display: block;
    padding: var(--space-3) var(--space-2);
    font-size: 15px;
  }
  .nav-menu .btn {
    width: 100%;
  }
  /* Closed by default once JS has taken over. */
  .site-nav[data-nav='closed'] .nav-menu {
    display: none;
  }
}

/* — buttons ———————————————————————————————————————————————————————————
   The system's .btn is sized for interface chrome (14px). Marketing CTAs in
   the design ran larger, so that becomes a modifier rather than inline style. */

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

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

/* — sections ——————————————————————————————————————————————————————————— */

.section {
  padding-block: clamp(48px, 7vw, 88px);
}
.section-tight {
  padding-block: 0 clamp(48px, 7vw, 88px);
}

.section-kicker {
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: clamp(26px, 3vw, 34px);
  margin: var(--space-3) 0 var(--space-8);
  max-width: 20ch;
}

.lede {
  font-size: 17px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
  max-width: 46ch;
}

.prose {
  font-size: 15.5px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
  max-width: 60ch;
}

/* — interior page header ————————————————————————————————————————————
   The masthead on Features / Pricing / About: kicker, h1, standfirst.        */

.page-head {
  padding-block: clamp(32px, 6vw, 56px) clamp(32px, 5vw, 48px);
  max-width: 52ch;
}
.page-head h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  margin: var(--space-4) 0;
  max-width: 20ch;
}
.page-head .lede {
  max-width: 52ch;
  margin: 0;
}
.page-head-wide {
  max-width: none;
}

/* — screenshot frames ————————————————————————————————————————————————
   Replaces the design canvas's <image-slot>. The frame carries a labelled
   placeholder so a not-yet-supplied asset reads as intentional rather than as
   a broken image; site.js hides any <img> that fails to load, letting the
   placeholder underneath show through.                                       */

.shot {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) * 1.15);
  background: var(--color-neutral-200);
  box-shadow: var(--shadow-md);
}
.shot-lg {
  box-shadow: var(--shadow-lg);
}

.shot::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: var(--space-4);
  text-align: center;
  font-size: 13px;
  color: var(--color-neutral-600);
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 10px,
    color-mix(in srgb, var(--color-neutral-400) 22%, transparent) 10px 20px
  );
}

.shot img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shot img[hidden] {
  display: none;
}

/* — home: hero ————————————————————————————————————————————————————————— */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(32px, 6vw, 64px) clamp(56px, 8vw, 96px);
}

.hero-title {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: var(--space-4) 0 var(--space-4);
}

.hero-media {
  position: relative;
  padding-bottom: var(--space-8);
}
.hero-media .shot {
  aspect-ratio: 4 / 3;
}

.hero-stat {
  position: absolute;
  left: -16px;
  bottom: -16px;
  width: 150px;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
}
.hero-stat-figure {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 26px;
  color: var(--color-accent-700);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-media {
    order: -1;
    max-width: 560px;
  }
  .hero-stat {
    left: auto;
    right: 0;
  }
}

/* — home: feature grid ————————————————————————————————————————————————
   The design laid this out as four 2-column spans on a 4-column grid. Below
   900px that becomes a single column.                                        */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.feature-grid .card {
  padding: var(--space-6);
}
.feature-icon {
  color: var(--color-accent);
}

@media (max-width: 760px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* — home: pricing teaser ——————————————————————————————————————————————— */

.pricing-teaser {
  background: var(--color-surface);
  border-radius: calc(var(--radius-lg) * 1.15);
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  gap: var(--space-8);
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
.pricing-teaser-copy {
  max-width: 36ch;
}

.plan-chips {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.plan-chip {
  width: 130px;
  background: var(--color-bg);
  text-decoration: none;
  color: inherit;
}
.plan-chip:hover {
  box-shadow: var(--shadow-md);
}
.plan-chip-featured {
  background: var(--color-accent-100);
  border: 1.5px solid var(--color-accent);
}
.plan-chip-price {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.plan-chip-price span {
  font-size: 12px;
  font-family: var(--font-body);
}

/* — home: quote ———————————————————————————————————————————————————————— */

.quote {
  max-width: 56ch;
}
.quote blockquote {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.4;
  margin: 0 0 var(--space-4);
}
.quote figcaption {
  font-size: 14px;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}

/* — closing CTA band ——————————————————————————————————————————————————— */

.cta-band {
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: calc(var(--radius-lg) * 1.15);
  padding: clamp(32px, 5vw, 56px);
  text-align: center;
}
.cta-band h2 {
  color: var(--color-bg);
  font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 var(--space-3);
}
.cta-band p {
  margin: 0 auto var(--space-6);
  max-width: 48ch;
  opacity: 0.8;
}

/* — footer —————————————————————————————————————————————————————————————— */

.site-footer {
  padding-block: var(--space-6) var(--space-8);
  border-top: 1px solid var(--color-divider);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
.footer-links {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer-links a {
  color: inherit;
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--color-accent);
}

/* — features page ——————————————————————————————————————————————————————— */

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding-bottom: clamp(40px, 6vw, 56px);
}
.feature-row .shot {
  aspect-ratio: 4 / 3;
}
.feature-row h2 {
  font-size: clamp(22px, 2.6vw, 26px);
  margin: var(--space-3) 0 var(--space-2);
}
.feature-row .prose {
  max-width: 44ch;
  margin-bottom: var(--space-4);
}

/* Alternating sides. Source order always puts the copy first so the page
   still reads correctly to a screen reader and on a phone. */
.feature-row-reverse .feature-row-media {
  order: -1;
}
@media (max-width: 900px) {
  .feature-row {
    grid-template-columns: 1fr;
  }
  .feature-row-reverse .feature-row-media {
    order: 0;
  }
}

.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.check-list li {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
}
.check-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: none;
}

/* — pricing page ———————————————————————————————————————————————————————— */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  /* stretch, so the three cards match height and their CTAs bottom-align
     even though the feature lists differ in length */
  align-items: stretch;
}
@media (max-width: 900px) {
  .plan-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-inline: auto;
  }
}

.plan {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  padding: var(--space-6);
  gap: var(--space-3);
}
.plan-featured {
  background: var(--color-accent-100);
  border: 1.5px solid var(--color-accent);
  box-shadow: var(--shadow-md);
}
.plan-badge {
  position: absolute;
  top: calc(var(--space-4) * -1);
  left: var(--space-6);
}
.plan-price {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 34px;
  line-height: 1;
}
.plan-price span {
  font-family: var(--font-body);
  font-size: 14px;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}
.plan-blurb {
  font-size: 14px;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
  min-height: 3em;
}
.plan .check-list {
  flex: 1;
  margin-bottom: var(--space-4);
  font-size: 14px;
}
.plan .btn {
  width: 100%;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6) var(--space-8);
}
@media (max-width: 760px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
}
.faq h3 {
  font-size: 17px;
  margin-bottom: var(--space-2);
}
.faq p {
  font-size: 14px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
  margin: 0;
}

/* — about page —————————————————————————————————————————————————————————— */

.about-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.about-split .shot {
  aspect-ratio: 4 / 3;
}
@media (max-width: 900px) {
  .about-split {
    grid-template-columns: 1fr;
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 620px) {
  .stat-row {
    grid-template-columns: 1fr;
  }
}
.stat-figure {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 30px;
  color: var(--color-accent-700);
  line-height: 1;
}

/* — demo request form ——————————————————————————————————————————————————— */

.demo-form-card {
  background: var(--color-surface);
  border-radius: calc(var(--radius-lg) * 1.15);
  padding: clamp(24px, 4vw, 40px);
}

.demo-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.demo-form .field-full {
  grid-column: 1 / -1;
}
@media (max-width: 620px) {
  .demo-form {
    grid-template-columns: 1fr;
  }
}

.demo-form .input {
  background: var(--color-bg);
}

/* Native validation styling, only after the field has been interacted with. */
.demo-form .input:user-invalid {
  border-color: var(--color-accent-700);
}
.field-error {
  display: none;
  font-size: 12px;
  margin-top: 5px;
  color: var(--color-accent-700);
}
.demo-form .input:user-invalid ~ .field-error {
  display: block;
}

.form-status {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.form-status:empty {
  display: none;
}
.form-status[data-state='ok'] {
  background: var(--color-accent-2-100);
  color: var(--color-accent-2-800);
}
.form-status[data-state='error'] {
  background: var(--color-accent-100);
  color: var(--color-accent-800);
}

/* — motion ————————————————————————————————————————————————————————————— */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
