/* =========================================================
   Lodgepole AppWorks — Website Styles
   Tokens mirror brand-kit.md
   ========================================================= */

:root {
  /* Colors — Primary */
  --evergreen: #2D4A3E;
  --birch: #F5F0E6;
  --pine-bark: #3D2E22;

  /* Colors — Secondary */
  --mountain-sky: #7FA9C4;
  --ember: #D97742;
  --moss: #8BA87D;

  /* Colors — Neutrals */
  --stone-100: #EAE4D6;
  --stone-300: #C9C0AC;
  --stone-500: #8A8272;

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --container: 1120px;
  --radius: 12px;
  --radius-lg: 20px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
ul { padding: 0; margin: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  background: var(--birch);
  color: var(--pine-bark);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--evergreen);
  color: var(--birch);
  padding: 0.75rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--evergreen);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1, .display { font-size: clamp(2.5rem, 5vw + 1rem, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem); line-height: 1.15; }
h3 { font-size: 1.375rem; line-height: 1.3; }

.display em {
  font-style: italic;
  color: var(--ember);
}

p { margin: 0 0 1rem; max-width: 65ch; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--pine-bark);
  max-width: 55ch;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 1rem;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--evergreen);
  color: var(--birch);
}
.btn-primary:hover { background: var(--pine-bark); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--evergreen);
  border-color: var(--stone-300);
}
.btn-ghost:hover { border-color: var(--evergreen); }

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 240, 230, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--stone-100);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.brand-logo {
  height: 64px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}
.nav-list {
  display: flex;
  gap: 1.75rem;
}
.nav-list a {
  font-size: 0.95rem;
  color: var(--pine-bark);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-list a:hover {
  color: var(--evergreen);
  border-bottom-color: var(--evergreen);
}
@media (max-width: 640px) {
  .nav-list { display: none; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: clamp(4rem, 10vw, 8rem) 0 0;
  overflow: hidden;
  /* Warm, barely-there dawn wash fading into Birch */
  background:
    linear-gradient(180deg, #F3EAD4 0%, #F4EEDE 22%, var(--birch) 55%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-scene {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: clamp(320px, 46vw, 560px);
  display: block;
  filter: drop-shadow(0 -4px 24px rgba(45, 74, 62, 0.08));
}

/* Soft morning sun */
.hero-sun circle {
  fill: var(--ember);
}
.hero-sun circle:nth-child(1) { opacity: 0.09; }
.hero-sun circle:nth-child(2) { opacity: 0.14; }
.hero-sun circle:nth-child(3) { opacity: 0.22; }

/* Distant birds */
.hero-birds path {
  fill: none;
  stroke: var(--pine-bark);
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0.35;
}

/* Ridgelines — coolest, farthest */
.hero-mountains-far { fill: var(--mountain-sky); opacity: 0.32; }
.hero-mountains-near { fill: var(--mountain-sky); opacity: 0.52; }

/* Rolling hills */
.hero-hills { fill: var(--moss); opacity: 0.45; }

/* Mid-distance trees — softer green */
.hero-trees-mid polygon {
  fill: var(--evergreen);
  opacity: 0.4;
}

/* Foreground pines */
.hero-trees-front polygon { fill: var(--evergreen); }

.hero-inner {
  position: relative;
  z-index: 1;
  padding-bottom: clamp(11rem, 24vw, 17rem);
}
.hero-inner .lede {
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* =========================================================
   Sections
   ========================================================= */
.section {
  padding: clamp(4rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--stone-100);
}
.section-head {
  margin-bottom: 3rem;
}
.section-head.center,
.center { text-align: center; }
.section-head.center p,
.center p { margin-left: auto; margin-right: auto; }

/* Two-column about */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}
.prose p { font-size: 1.0625rem; }

/* =========================================================
   Apps / Tidy Story card
   ========================================================= */
.section-apps {
  background: linear-gradient(180deg, var(--birch) 0%, var(--stone-100) 100%);
}
.app-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  background: var(--birch);
  border: 1px solid var(--stone-100);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 2px 0 var(--stone-100), 0 20px 40px -20px rgba(61, 46, 34, 0.15);
}
@media (max-width: 768px) {
  .app-card { grid-template-columns: 1fr; }
}

.app-card-art {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}
.phone {
  width: 240px;
  aspect-ratio: 9 / 18;
  background: var(--evergreen);
  border-radius: 32px;
  padding: 12px;
  box-shadow: 0 20px 40px -10px rgba(45, 74, 62, 0.4);
}
.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--birch);
  border-radius: 22px;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
}
.phone-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--evergreen);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.phone-chore {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: var(--stone-100);
  border-radius: 10px;
  color: var(--pine-bark);
  font-size: 0.78rem;
}
.phone-chore.done {
  background: rgba(139, 168, 125, 0.25);
  color: var(--evergreen);
}
.check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--moss);
  color: var(--birch);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.check.empty {
  background: transparent;
  border: 1.5px solid var(--stone-300);
}
.star {
  color: var(--ember);
  font-size: 0.9rem;
}
.star.muted {
  color: var(--stone-300);
}
.phone-footer {
  margin-top: auto;
  text-align: center;
  font-size: 0.72rem;
  color: var(--stone-500);
  padding-top: 0.5rem;
}

.app-tagline {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--evergreen);
  font-style: italic;
  margin-bottom: 1rem;
  max-width: none;
}
.feature-list {
  margin: 1.5rem 0;
}
.feature-list li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  background: var(--moss);
  border-radius: 2px;
  transform: rotate(45deg);
}
.app-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--evergreen);
  color: var(--birch);
}
.badge-soft {
  background: var(--stone-100);
  color: var(--pine-bark);
}

/* =========================================================
   Principles
   ========================================================= */
.section-principles {
  background: var(--evergreen);
  color: var(--birch);
}
.section-principles h2,
.section-principles h3 {
  color: var(--birch);
}
.section-principles .eyebrow {
  color: rgba(245, 240, 230, 0.7);
}
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}
.principle {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(245, 240, 230, 0.15);
}
.principle-num {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ember);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}
.principle h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}
.principle p {
  color: rgba(245, 240, 230, 0.85);
  font-size: 0.95rem;
  margin: 0;
}

/* =========================================================
   Contact
   ========================================================= */
.section-contact {
  padding: clamp(5rem, 10vw, 8rem) 0;
}
.section-contact .lede {
  margin: 0 auto 2rem;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--pine-bark);
  color: var(--stone-300);
  padding: 3rem 0 2rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}
@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.25rem;
  }
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--birch);
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}
.footer-brand:hover { opacity: 0.85; }

.footer-mark {
  height: 44px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}

.footer-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.footer-wordmark-main {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  color: var(--birch);
}
.footer-wordmark-sub {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  margin-top: 0.35rem;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--stone-300);
  font-size: 0.9rem;
  transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--birch); }
.footer-meta {
  font-size: 0.85rem;
  margin: 0;
  color: var(--stone-500);
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 4px;
}

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