/* Cairn Website
 * Aesthetic: Dark, refined terminal feel
 * ---------------------------------------------- */

@font-face {
  font-family: 'Berkeley Mono';
  src: url('/fonts/BerkeleyMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('/fonts/BerkeleyMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Dark palette - slightly darker than app to differentiate screenshots */
  --bg: #141412;
  --bg-elevated: #242422;
  --bg-subtle: #2a2a28;
  --border: #3a3a38;

  /* Light text */
  --text: #e8e6e0;
  --text-soft: #b8b6b0;
  --text-muted: #787874;
  --text-faint: #58585a;

  /* Accent - warm sage from the app */
  --sage: #8fb085;
  --sage-dim: rgba(143, 176, 133, 0.15);

  /* Warm ochre accent */
  --ochre: #d4a574;

  /* Typography */
  --font-display: 'Berkeley Mono', ui-monospace, monospace;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --content-width: 680px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-soft);
  background: var(--bg);
  min-height: 100vh;
}

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

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

/* Navigation
   ---------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-logo img {
  opacity: 0.9;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-github {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

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

/* Hero
   ---------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 400px auto;
  gap: var(--space-lg);
  padding-top: var(--space-xl);
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.hero-content {
  max-width: 400px;
  justify-self: end;
  text-align: right;
}

.hero-content .hero-actions {
  justify-content: flex-end;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.hero-tagline {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-soft);
  margin-bottom: var(--space-sm);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.6rem 0.6rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--bg-elevated);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.btn-primary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-secondary {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
}

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

.hero-note {
  font-size: 0.875rem;
  color: var(--text-faint);
}

.hero-note a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hero-note a:hover {
  color: var(--text-soft);
}

.hero-alt-link {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hero-alt-link:hover {
  color: var(--text);
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.hero-screenshot {
  width: 950px;
  max-width: none;
  flex-shrink: 0;
}

/* Features
   ---------------------------------------------- */
.features {
  border-top: 1px solid var(--border);
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.feature:nth-child(even) {
  direction: rtl;
}

.feature:nth-child(even) > * {
  direction: ltr;
}

.feature + .feature {
  border-top: 1px solid var(--border);
}

.feature-content {
  max-width: 480px;
}

.feature-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: var(--space-md);
}

.feature h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.feature p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: var(--space-md);
}

.feature p:last-child {
  margin-bottom: 0;
}

.feature-visual {
  display: flex;
  justify-content: center;
}

.feature-visual img {
  width: 100%;
  max-width: 560px;
  border-radius: 8px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

/* Footer
   ---------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-faint);
}

.footer a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer a:hover {
  color: var(--text);
}

/* Responsive
   ---------------------------------------------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: calc(80px + var(--space-xl));
  }

  .hero-content {
    justify-self: center;
    max-width: 100%;
    text-align: center;
  }

  .hero-content .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    display: none;
  }

  .hero-screenshot {
    max-width: 100%;
  }

  .feature {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .feature:nth-child(even) {
    direction: ltr;
  }

  .feature-content {
    max-width: 100%;
    text-align: left;
  }

  .feature-visual {
    order: 1;
  }
}

@media (max-width: 600px) {
  :root {
    --space-lg: 1.5rem;
  }

  .nav {
    padding: var(--space-md);
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  .hero-tagline br {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ================================================
   Documentation Pages
   ================================================ */
.doc-layout {
  min-height: 100vh;
  padding-top: 60px;
}

.doc-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}

.doc-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.doc-header h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.doc-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Prose content */
.prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-soft);
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.prose p {
  margin-bottom: var(--space-md);
}

.prose ul, .prose ol {
  margin-bottom: var(--space-md);
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: var(--space-sm);
}

.prose li::marker {
  color: var(--text-faint);
}

.prose a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--sage-dim);
  transition: text-decoration-color 0.15s ease;
}

.prose a:hover {
  text-decoration-color: var(--sage);
}

.prose strong {
  font-weight: 500;
  color: var(--text);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--ochre);
}

.prose pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-md);
  margin: var(--space-md) 0 var(--space-lg);
  overflow-x: auto;
}

.prose pre code {
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

/* Back link */
.doc-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  transition: color 0.15s ease;
}

.doc-back:hover {
  color: var(--text);
}

.doc-back svg {
  width: 16px;
  height: 16px;
}
