/* ==========================================================================
   Cairn Labs — Design System & Landing Page Styles
   Palette derived directly from the Cairn Labs & KanFlow logos:
   - Canvas Navy:     #151D30
   - KanFlow Navy:    #141C2F
   - Recessed Deep:   #0E1525
   - Card Surface:    #1A243C
   - Slate Stone:     #638AA9
   - Glacial Emerald: #0EBB85
   - Electric Cyan:   #38E8F5 / #6DFDFE
   ========================================================================== */

:root {
  --bg-canvas: #151d30;
  --bg-recessed: #0e1525;
  --bg-kanflow: #141c2f;
  --surface-card: #1a243c;
  --surface-card-hover: #1f2b47;

  --stone-slate: #638aa9;
  --stone-emerald: #0ebb85;
  --stone-cyan: #38e8f5;
  --stone-cyan-bright: #6dfdfe;
  --wordmark-labs: #b9ebf2;

  --text-primary: #f1f6fb;
  --text-secondary: #b7c6d8;
  --text-muted: #8295ae;

  --border-subtle: rgba(148, 179, 212, 0.16);
  --border-dashed: rgba(148, 179, 212, 0.24);
  --border-cyan: rgba(56, 232, 245, 0.38);
  --border-emerald: rgba(14, 187, 133, 0.36);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --container-max: 1120px;
  --shadow-card: 0 20px 50px -24px rgba(5, 10, 22, 0.78);
  --shadow-cyan: 0 14px 36px -14px rgba(56, 232, 245, 0.45);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--bg-canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--stone-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--stone-cyan);
  color: #081220;
  font-weight: 700;
  font-size: 0.9rem;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 14px;
}

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

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(21, 29, 48, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 70px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background-color: var(--bg-canvas);
  object-fit: cover;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.brand-cairn {
  font-weight: 800;
  color: #ffffff;
}

.brand-labs {
  font-weight: 400;
  color: var(--wordmark-labs);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--stone-cyan-bright);
  background: rgba(56, 232, 245, 0.09);
  border: 1px solid rgba(56, 232, 245, 0.3);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-cta:hover {
  background: rgba(56, 232, 245, 0.16);
  border-color: rgba(56, 232, 245, 0.55);
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  position: relative;
  padding: 76px 0 84px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  background:
    radial-gradient(62% 55% at 50% 18%, rgba(56, 232, 245, 0.12) 0%, rgba(14, 187, 133, 0.06) 42%, transparent 75%),
    linear-gradient(180deg, var(--bg-canvas) 0%, #121a2c 100%);
}

.hero-contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.22;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(26, 36, 60, 0.78);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 28px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stone-emerald);
  box-shadow: 0 0 10px rgba(14, 187, 133, 0.85);
  flex-shrink: 0;
}

.hero-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.hero-logo-wrap::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(109, 253, 254, 0.24) 0%, rgba(14, 187, 133, 0.12) 45%, transparent 72%);
  filter: blur(22px);
  z-index: 0;
  pointer-events: none;
}

.hero-logo {
  position: relative;
  z-index: 1;
  width: 210px;
  height: 210px;
  border-radius: 28px;
  object-fit: cover;
  background-color: var(--bg-canvas);
  box-shadow: 0 18px 46px -18px rgba(4, 9, 20, 0.85);
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(2.15rem, 4.8vw, 3.45rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.hero-title-accent {
  background: linear-gradient(120deg, var(--stone-cyan-bright) 0%, var(--stone-emerald) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 0 34px;
  max-width: 600px;
  font-size: clamp(1.02rem, 1.8vw, 1.16rem);
  color: var(--text-secondary);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  color: #07131e;
  background: linear-gradient(135deg, var(--stone-cyan-bright) 0%, var(--stone-cyan) 48%, var(--stone-emerald) 100%);
  box-shadow: var(--shadow-cyan);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px -12px rgba(56, 232, 245, 0.58);
}

.btn-secondary {
  color: var(--text-primary);
  background: rgba(26, 36, 60, 0.72);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-cyan);
  transform: translateY(-2px);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: 84px 0;
}

.section-recessed {
  background-color: var(--bg-recessed);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-cyan);
}

.section-title {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #ffffff;
}

.section-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

/* ==========================================================================
   Projects Grid & Flagship KanFlow Card
   ========================================================================== */

.projects-stack {
  display: grid;
  gap: 24px;
}

.kanflow-card {
  display: grid;
  grid-template-columns: minmax(250px, 330px) 1fr;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.kanflow-card:hover {
  border-color: var(--border-cyan);
  transform: translateY(-2px);
  box-shadow: 0 26px 56px -24px rgba(56, 232, 245, 0.22);
}

.kanflow-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  background:
    radial-gradient(circle at 50% 45%, rgba(41, 242, 249, 0.14) 0%, rgba(38, 185, 140, 0.08) 45%, transparent 72%),
    var(--bg-kanflow);
  border-right: 1px solid var(--border-subtle);
}

.kanflow-logo {
  width: 224px;
  height: 224px;
  border-radius: 22px;
  object-fit: cover;
  background-color: var(--bg-kanflow);
}

.kanflow-body {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
}

.pill-live {
  background: rgba(14, 187, 133, 0.14);
  border: 1px solid var(--border-emerald);
  color: #5ee9ba;
}

.pill-domain {
  background: rgba(99, 138, 169, 0.14);
  border: 1px solid var(--border-subtle);
  color: var(--wordmark-labs);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.77rem;
}

.pill-lab {
  background: rgba(99, 138, 169, 0.14);
  border: 1px solid rgba(99, 138, 169, 0.34);
  color: #a9c5dc;
}

.project-title {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.project-title-flow {
  color: var(--stone-cyan-bright);
}

.project-summary {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 0.99rem;
  line-height: 1.65;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
}

.feature-chip {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: rgba(14, 21, 37, 0.72);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.83rem;
  font-weight: 500;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.card-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Teaser Card */

.teaser-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 34px;
  border-radius: var(--radius-md);
  background: rgba(20, 28, 47, 0.65);
  border: 1px dashed var(--border-dashed);
}

.teaser-content {
  max-width: 680px;
}

.teaser-title {
  margin: 10px 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.teaser-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.teaser-stones {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.75;
  flex-shrink: 0;
}

.stone-bar {
  display: block;
  height: 7px;
  border-radius: var(--radius-pill);
}

.stone-bar-top {
  width: 24px;
  background: var(--stone-cyan-bright);
}

.stone-bar-mid {
  width: 36px;
  background: var(--stone-emerald);
}

.stone-bar-base {
  width: 48px;
  background: var(--stone-slate);
}

/* ==========================================================================
   Approach Section (Three-Stone Craft Pillars)
   ========================================================================== */

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.pillar-card {
  position: relative;
  padding: 28px 26px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pillar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 4px 4px;
}

.pillar-slate::before {
  background: var(--stone-slate);
}

.pillar-emerald::before {
  background: var(--stone-emerald);
}

.pillar-cyan::before {
  background: var(--stone-cyan);
}

.pillar-stone {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.pillar-slate .pillar-stone {
  background: var(--stone-slate);
  box-shadow: 0 0 12px rgba(99, 138, 169, 0.6);
}

.pillar-emerald .pillar-stone {
  background: var(--stone-emerald);
  box-shadow: 0 0 12px rgba(14, 187, 133, 0.65);
}

.pillar-cyan .pillar-stone {
  background: var(--stone-cyan-bright);
  box-shadow: 0 0 12px rgba(109, 253, 254, 0.7);
}

.pillar-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
}

.pillar-text {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.62;
}

/* ==========================================================================
   Footer & 404 Page
   ========================================================================== */

.site-footer {
  margin-top: auto;
  padding: 34px 0;
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-subtle);
}

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

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.footer-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: var(--bg-canvas);
  object-fit: cover;
}

.footer-name {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.footer-location {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--stone-cyan-bright);
}

.error-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 24px;
  text-align: center;
}

.error-card {
  max-width: 520px;
  width: 100%;
  padding: 44px 34px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.error-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 20px;
}

.error-code {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-cyan);
}

.error-title {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 800;
  color: #ffffff;
}

.error-text {
  margin: 0 0 28px;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

/* ==========================================================================
   Responsive & Reduced Motion
   ========================================================================== */

@media (max-width: 880px) {
  .kanflow-card {
    grid-template-columns: 1fr;
  }

  .kanflow-media {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 32px 24px;
  }

  .kanflow-body {
    padding: 28px 26px 32px;
  }

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

@media (max-width: 600px) {
  .header-inner {
    height: 64px;
  }

  .site-nav {
    gap: 14px;
  }

  .nav-link-hide-sm {
    display: none;
  }

  .hero {
    padding: 54px 0 64px;
  }

  .hero-logo {
    width: 176px;
    height: 176px;
    border-radius: 24px;
  }

  .section {
    padding: 62px 0;
  }

  .teaser-card {
    padding: 24px 22px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
