/* ============================================================
   Bark Barn Farm - standalone marketing site
   Hand written CSS, no build step. Design tokens and component
   styles are carried over from the original site.
   ============================================================ */

/* ---------- Self hosted fonts (latin subset, variable) ---------- */
@font-face {
  font-family: 'Rubik';
  src: url('fonts/rubik-latin-var.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src: url('fonts/nunito-sans-latin-var.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --color-primary: #F47932;
  --color-primary-light: #F89556;
  --color-primary-dark: #D4621E;
  --color-accent: #7DA343;
  --color-accent-light: #96B85E;

  --color-bg: #FAFBFD;
  --color-bg-elevated: #FFFFFF;
  --color-bg-card: #FFFFFF;
  --color-border: #E4E9F0;
  --color-text: #0B1B3F;
  --color-text-secondary: #4A5568;
  --color-text-muted: #A0AEC0;

  --gradient-primary: linear-gradient(135deg, #F47932 0%, #F89556 100%);
  --gradient-hero: linear-gradient(160deg, #0B1B3F 0%, #1A2D56 100%);

  --font-heading: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-full: 999px;

  --shadow-md: 0 4px 20px rgba(11, 27, 63, 0.08);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;

  /* Wave fill colours. The waves are SVG, so they read these. */
  --wave-into-features: #FFFFFF;
  --wave-into-cta: #0B1B3F;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --color-bg: #0F1724;
  --color-bg-elevated: #1A2332;
  --color-bg-card: #1E2A3A;
  --color-border: #2A3A4E;
  --color-text: #E8ECF2;
  --color-text-secondary: #9AAEC0;
  --color-text-muted: #5C7080;
  --gradient-hero: linear-gradient(160deg, #080E18 0%, #0F1A2E 100%);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  --wave-into-features: #1A2332;
  --wave-into-cta: #080E18;
  color-scheme: dark;
}

/* Fallback for visitors with JavaScript off: follow the OS preference. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0F1724;
    --color-bg-elevated: #1A2332;
    --color-bg-card: #1E2A3A;
    --color-border: #2A3A4E;
    --color-text: #E8ECF2;
    --color-text-secondary: #9AAEC0;
    --color-text-muted: #5C7080;
    --gradient-hero: linear-gradient(160deg, #080E18 0%, #0F1A2E 100%);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --wave-into-features: #1A2332;
    --wave-into-cta: #080E18;
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

h1, h2, h3 {
  line-height: 1.2;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: var(--space-md);
  top: var(--space-md);
}

/* ---------- Layout helper ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  line-height: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(244, 121, 50, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(244, 121, 50, 0.45);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* ---------- Navbar: transparent over the hero, solid on scroll ---------- */
.navbar-landing {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  background: transparent;
  transition: background var(--duration-normal), backdrop-filter var(--duration-normal);
}

.navbar-landing.navbar-solid {
  background: var(--color-bg-elevated);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-text-landing {
  color: #FFFFFF;
  font-size: 1.5rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  transition: color var(--duration-normal), text-shadow var(--duration-normal);
}

.navbar-solid .brand-text-landing {
  color: var(--color-text);
  text-shadow: none;
}

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

/* ---------- Hamburger and mobile drawer ---------- */
.hamburger-btn {
  display: none;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  font-size: 1.25rem;
  cursor: pointer;
  color: #fff;
  transition: border-color var(--duration-fast), color var(--duration-fast);
  line-height: 1;
  min-height: 40px;
  min-width: 44px;
}

.navbar-solid .hamburger-btn {
  color: var(--color-text);
  border-color: var(--color-border);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 63, 0.5);
  z-index: 200;
  animation: fade-in var(--duration-fast) var(--ease-out);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: var(--color-bg-elevated);
  padding: var(--space-2xl) var(--space-lg) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  animation: slide-in-right var(--duration-normal) var(--ease-out);
  overflow-y: auto;
}

.mobile-menu-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast), color var(--duration-fast);
}

.mobile-menu-link:hover {
  background: rgba(244, 121, 50, 0.06);
  color: var(--color-primary);
}

.mobile-menu-content .btn {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero-landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('hero-bg.jpg') center 75% / cover no-repeat;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(11, 27, 63, 0.95) 0%,
      rgba(11, 27, 63, 0.7) 35%,
      rgba(0, 0, 0, 0.3) 65%,
      rgba(0, 0, 0, 0.2) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--space-2xl) var(--space-lg);
  padding-top: 5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 700px;
}

.hero-landing h1 {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.1;
  color: #FFFFFF;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.hero-highlight {
  color: var(--color-primary-light);
}

.hero-sub-landing {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255, 255, 255, 0.85);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.hero-ctas {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

.hero-wave-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
}

.hero-wave-bottom svg {
  display: block;
  width: 100%;
  height: 100px;
}

.hero-wave-bottom path {
  fill: var(--wave-into-features);
}

/* ---------- Features ---------- */
.features-section {
  padding: var(--space-xl) var(--space-lg) var(--space-4xl);
  background: var(--color-bg-elevated);
  position: relative;
  overflow: hidden;
}

/* Decorative blobs behind the cards */
.features-section::before,
.features-section::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.features-section::before {
  width: 450px;
  height: 450px;
  background: rgba(244, 121, 50, 0.05);
  top: -100px;
  left: -150px;
}

.features-section::after {
  width: 350px;
  height: 350px;
  background: rgba(125, 163, 67, 0.05);
  bottom: -80px;
  right: -100px;
}

.logo-showcase {
  max-width: 550px;
  margin: 0 auto var(--space-lg);
  position: relative;
  z-index: 1;
}

.logo-showcase img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.logo-dark {
  display: none;
}

/* Blend the logo's baked in background with the page in dark mode */
[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="dark"] .logo-dark {
  display: block;
  mix-blend-mode: lighten;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light {
    display: none;
  }

  :root:not([data-theme="light"]) .logo-dark {
    display: block;
    mix-blend-mode: lighten;
  }
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
  position: relative;
  z-index: 1;
}

.section-header .overline {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
}

.section-header h2 .highlight {
  color: var(--color-primary);
}

.section-header p {
  color: var(--color-text-secondary);
  margin: var(--space-sm) auto 0;
  max-width: 500px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.feature-card:hover {
  border-color: rgba(244, 121, 50, 0.3);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(11, 27, 63, 0.1), 0 4px 12px rgba(244, 121, 50, 0.08);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  background: linear-gradient(135deg, rgba(244, 121, 50, 0.12) 0%, rgba(125, 163, 67, 0.08) 100%);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-card h3::after {
  content: '\2192';
  font-size: 1.1rem;
  color: var(--color-text-muted);
  transition: color var(--duration-fast), transform var(--duration-fast);
}

.feature-card:hover h3::after {
  color: var(--color-primary);
  transform: translateX(4px);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ---------- Wave divider into the closing call to action ---------- */
.cta-wave {
  position: relative;
  margin-bottom: -1px;
  background: var(--color-bg-elevated);
}

.cta-wave svg {
  display: block;
  width: 100%;
  height: 80px;
}

.cta-wave path {
  fill: var(--wave-into-cta);
}

/* ---------- Closing call to action ---------- */
.cta-section {
  padding: var(--space-4xl) var(--space-lg);
  text-align: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(244, 121, 50, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.cta-section::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(125, 163, 67, 0.1);
  bottom: -100px;
  right: -50px;
  pointer-events: none;
}

.cta-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-md);
  color: #FFFFFF;
  position: relative;
  z-index: 1;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.75);
  margin: 0 auto var(--space-xl);
  max-width: 480px;
  position: relative;
  z-index: 1;
}

.cta-section .btn {
  position: relative;
  z-index: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-2xl) var(--space-lg);
  background: #0A1530;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--color-primary-light);
  transition: color var(--duration-fast);
}

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

/* ---------- Floating theme toggle ---------- */
.theme-toggle {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: transform var(--duration-fast) var(--ease-out);
}

.theme-toggle:hover {
  transform: scale(1.08);
}

/* Hidden until the script confirms it works, so it is never a dead button. */
.theme-toggle[hidden] {
  display: none;
}

/* ---------- Animations ---------- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.animate-in {
  animation: fade-in-up 0.6s var(--ease-out) both;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .navbar-links {
    display: none;
  }

  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .navbar-brand {
    font-size: 1.2rem;
  }

  .brand-text-landing {
    font-size: 1.2rem;
  }

  .hero-landing {
    /* A little more cover over the bright sky on narrow screens. */
    background-position: center 70%;
  }

  .hero-overlay {
    background: linear-gradient(to top,
        rgba(11, 27, 63, 0.95) 0%,
        rgba(11, 27, 63, 0.78) 40%,
        rgba(0, 0, 0, 0.45) 70%,
        rgba(0, 0, 0, 0.35) 100%);
  }

  .hero-landing h1 {
    font-size: 2.1rem;
  }

  .hero-sub-landing {
    font-size: 1rem;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-wave-bottom svg {
    height: 60px;
  }

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

  .feature-card {
    padding: var(--space-lg);
  }

  .btn {
    min-height: 44px;
  }
}

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

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