/* =============================================================
   Cornbelt Web Co. — shared stylesheet
   Palette: Barn Red brand spec (locked)
   ============================================================= */

:root {
  --barn-red: #9E2A2B;
  --cream: #EFE5D3;
  --charcoal: #3A3A38;
  --wheat: #E8A852;

  /* Derived tones */
  --barn-red-dark: #832223;
  --cream-light: #FBF7EE;
  --paper: #FFFDF8;
  --wheat-soft: rgba(232, 168, 82, 0.35);
  --charcoal-soft: rgba(58, 58, 56, 0.14);
  --ink-muted: #5C5C58;

  --font-head: "Poppins", "Avenir Next", sans-serif;
  --font-body: "Nunito", "Avenir", sans-serif;

  --radius-card: 18px;
  --radius-btn: 12px;
  --shadow-card: 0 2px 6px rgba(58, 58, 56, 0.06), 0 12px 28px -18px rgba(58, 58, 56, 0.25);
  --shadow-lift: 0 4px 10px rgba(58, 58, 56, 0.08), 0 22px 40px -20px rgba(158, 42, 43, 0.28);
  --container: 1080px;
}

/* ---------- Reset & base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--charcoal);
  background-color: var(--cream-light);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  color: var(--charcoal);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.1rem, 5.2vw, 3.3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.25rem); letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }

p {
  margin: 0 0 1em;
}

a {
  color: var(--barn-red);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--wheat);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 200;
  background: var(--charcoal);
  color: var(--cream);
  padding: 0.6rem 1rem;
  border-radius: 0 0 10px 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ---------- Header & nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 247, 238, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--charcoal-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  transition: transform 0.25s ease;
}

.brand:hover .brand-icon {
  transform: rotate(-4deg) scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--charcoal);
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  color: var(--barn-red);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .brand-sub {
    font-size: 0.6rem;
  }
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--charcoal);
  text-decoration: none;
  border-radius: 10px;
  border-bottom: 3px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-nav a:hover {
  color: var(--barn-red);
  background: var(--cream);
}

.site-nav a[aria-current="page"] {
  color: var(--barn-red);
  border-bottom-color: var(--wheat);
  border-radius: 10px 10px 0 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 10px;
  background: none;
  border: 1px solid var(--charcoal-soft);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle .bar {
  display: block;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  background: var(--barn-red);
  transition: transform 0.25s ease, opacity 0.2s ease;
  pointer-events: none;
}

.nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 767px) {
  .brand-name { font-size: 1.02rem; }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream-light);
    border-bottom: 1px solid var(--charcoal-soft);
    box-shadow: 0 18px 30px -18px rgba(58, 58, 56, 0.35);
    display: none;
  }

  .nav-open .site-nav {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .site-nav a {
    padding: 0.8rem 0.5rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--charcoal-soft);
    border-radius: 0;
  }

  .site-nav a[aria-current="page"] {
    border-bottom: 1px solid var(--charcoal-soft);
    border-left: 4px solid var(--wheat);
    padding-left: 0.85rem;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  padding: 0.8rem 1.7rem;
  border-radius: var(--radius-btn);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--barn-red);
  color: var(--cream-light);
}

.btn-primary:hover {
  background: var(--barn-red-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.btn-outline {
  background: transparent;
  color: var(--barn-red);
  border-color: var(--barn-red);
}

.btn-outline:hover {
  background: var(--barn-red);
  color: var(--cream-light);
  transform: translateY(-2px);
}

.btn-light {
  background: var(--cream);
  color: var(--barn-red);
}

.btn-light:hover {
  background: var(--wheat);
  color: var(--charcoal);
  transform: translateY(-2px);
}

/* ---------- Sections & shared patterns ---------- */

main {
  display: block;
}

.section {
  padding-block: clamp(3.2rem, 7vw, 5.5rem);
}

.section-cream {
  background: var(--cream);
}

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

.section-head.centered {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--barn-red);
  margin-bottom: 0.9rem;
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 10px;
  background: var(--wheat);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
}

/* Roofline section divider (echoes the logo roof) */
.roofline {
  height: 14px;
  background-image: linear-gradient(135deg, var(--wheat) 25%, transparent 25%),
    linear-gradient(225deg, var(--wheat) 25%, transparent 25%);
  background-size: 28px 14px;
  background-repeat: repeat-x;
  opacity: 0.55;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(232, 168, 82, 0.07) 0px,
      rgba(232, 168, 82, 0.07) 2px,
      transparent 2px,
      transparent 26px
    ),
    var(--cream);
  padding-block: clamp(4rem, 10vw, 7rem);
}

.hero-inner {
  max-width: 760px;
}

.hero .eyebrow { animation: rise-in 0.6s ease both; }
.hero h1 { animation: rise-in 0.6s 0.08s ease both; }
.hero .lede { animation: rise-in 0.6s 0.16s ease both; }
.hero .hero-actions { animation: rise-in 0.6s 0.24s ease both; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-accent {
  color: var(--barn-red);
  background-image: linear-gradient(transparent 78%, var(--wheat-soft) 78%);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.hero-deco {
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 320px;
  height: 320px;
  opacity: 0.1;
  pointer-events: none;
}

@media (max-width: 640px) {
  .hero-deco { display: none; }
}

/* Page-top hero for interior pages */
.page-hero {
  background: var(--cream);
  padding-block: clamp(2.8rem, 6vw, 4.2rem);
}

.page-hero h1 {
  margin-bottom: 0.35em;
}

.page-hero .lede {
  max-width: 640px;
  margin-bottom: 0;
}

/* ---------- Card grids ---------- */

.card-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.card {
  background: var(--paper);
  border: 1px solid var(--charcoal-soft);
  border-radius: var(--radius-card);
  padding: 1.7rem 1.6rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--wheat);
  box-shadow: var(--shadow-lift);
}

.card h3 {
  margin-bottom: 0.4em;
}

.card p {
  color: var(--ink-muted);
  margin-bottom: 0;
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--barn-red);
  color: var(--cream);
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-link {
  display: inline-block;
  margin-top: 1.1rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--barn-red);
  text-decoration: none;
}

.card-link::after {
  content: " \2192";
  transition: margin-left 0.2s ease;
}

.card-link:hover::after {
  margin-left: 4px;
}

.coming-soon-tag {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--charcoal);
  background: var(--wheat);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ---------- Service area band ---------- */

.service-area {
  background: var(--charcoal);
  color: var(--cream);
}

.service-area h2 {
  color: var(--cream);
}

.service-area .eyebrow {
  color: var(--wheat);
}

.service-area p {
  color: rgba(239, 229, 211, 0.85);
  max-width: 620px;
}

.town-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.4rem 0 0;
  padding: 0;
}

.town-list li {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid rgba(232, 168, 82, 0.55);
  color: var(--cream);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
}

.town-list li.home-town {
  background: var(--wheat);
  border-color: var(--wheat);
  color: var(--charcoal);
  font-weight: 600;
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--barn-red);
  color: var(--cream);
  text-align: center;
}

.cta-band h2 {
  color: var(--cream-light);
}

.cta-band p {
  color: rgba(239, 229, 211, 0.9);
  max-width: 560px;
  margin-inline: auto;
}

.cta-band .btn {
  margin-top: 1.2rem;
}

/* ---------- Services page ---------- */

.service-list {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.pricing-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
  align-items: stretch;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--charcoal-soft);
  border-radius: var(--radius-card);
  padding: 1.9rem 1.7rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.price-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift);
}

.price-card.featured {
  border: 3px solid var(--wheat);
  box-shadow: 0 6px 14px rgba(58, 58, 56, 0.1), 0 26px 48px -22px rgba(232, 168, 82, 0.55);
}

.badge-popular {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--wheat);
  color: var(--charcoal);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.3rem 1rem;
  white-space: nowrap;
}

.price-tier {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--barn-red);
  margin-bottom: 0.4rem;
}

.price-amount {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--charcoal);
  line-height: 1.1;
}

.price-amount .per {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.price-desc {
  color: var(--ink-muted);
  margin: 0.7rem 0 1rem;
}

.price-features {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  flex-grow: 1;
}

.price-features li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.7rem;
  border-bottom: 1px dashed var(--charcoal-soft);
  font-size: 0.98rem;
}

.price-features li:last-child {
  border-bottom: none;
}

.price-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 14px;
  height: 10px;
  background: var(--barn-red);
  clip-path: polygon(0 45%, 12% 30%, 38% 60%, 88% 0, 100% 15%, 38% 90%);
}

/* ---------- Portfolio ---------- */

.portfolio-grid {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
}

.work-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--charcoal-soft);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.work-card:hover {
  transform: translateY(-5px);
  border-color: var(--wheat);
  box-shadow: var(--shadow-lift);
}

.work-shot {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  border-bottom: 3px solid var(--wheat);
  background: var(--cream);
}

.work-body {
  padding: 1.5rem 1.6rem 1.7rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.work-meta {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--barn-red);
  margin-bottom: 0.35rem;
}

.work-body p {
  color: var(--ink-muted);
  flex-grow: 1;
}

/* ---------- Coming soon (AI agents) ---------- */

.coming-soon {
  text-align: center;
  padding-block: clamp(4rem, 10vw, 7rem);
}

.coming-soon-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 1.6rem;
  border-radius: 20px;
  animation: gentle-bob 3.2s ease-in-out infinite;
}

@keyframes gentle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.coming-soon h1 {
  margin-bottom: 0.4em;
}

.coming-soon .lede {
  max-width: 560px;
  margin-inline: auto;
}

/* ---------- About & contact ---------- */

.about-grid {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
}

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

.about-facts {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.about-facts li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--charcoal-soft);
  border-left: 4px solid var(--wheat);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}

.about-facts .fact-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--barn-red);
  color: var(--cream);
  display: grid;
  place-items: center;
}

.about-facts .fact-icon svg {
  width: 18px;
  height: 18px;
}

.about-facts strong {
  font-family: var(--font-head);
  font-weight: 600;
  display: block;
  font-size: 0.98rem;
}

.about-facts span.fact-note {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

/* ---------- Contact form ---------- */

.contact-panel {
  background: var(--paper);
  border: 1px solid var(--charcoal-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 2rem 1.8rem;
}

.contact-panel h2 {
  margin-bottom: 0.3em;
}

.contact-intro {
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.form-field {
  margin-bottom: 1.15rem;
}

.form-field label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

.form-field .optional {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--charcoal);
  background: var(--cream-light);
  border: 1.5px solid var(--charcoal-soft);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--wheat);
  background: #fff;
}

.form-field textarea {
  resize: vertical;
  min-height: 130px;
}

.form-status {
  display: none;
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
}

.form-status.success {
  display: block;
  background: #E8F0E2;
  border: 1px solid #7BA05B;
  color: #33502A;
}

.form-status.error {
  display: block;
  background: #F7E4E0;
  border: 1px solid var(--barn-red);
  color: var(--barn-red-dark);
}

.contact-direct {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--charcoal-soft);
  font-size: 0.98rem;
  color: var(--ink-muted);
}

button[disabled] {
  opacity: 0.6;
  cursor: wait;
  transform: none !important;
}

/* ---------- 404 ---------- */

.notfound {
  text-align: center;
  padding-block: clamp(4rem, 12vw, 8rem);
}

.notfound .big-code {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(4.5rem, 14vw, 8rem);
  line-height: 1;
  color: var(--barn-red);
  letter-spacing: -0.03em;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--charcoal);
  color: var(--cream);
  padding-block: 3rem 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
}

.footer-brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.footer-brand .brand-icon {
  width: 48px;
  height: 48px;
}

.footer-tagline {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--cream);
  margin: 0;
}

.footer-sub {
  color: var(--wheat);
  font-size: 0.85rem;
  margin: 0.15rem 0 0;
}

.footer-info {
  text-align: right;
  font-size: 0.95rem;
}

.footer-info p {
  margin: 0 0 0.35rem;
  color: rgba(239, 229, 211, 0.85);
}

.footer-info a {
  color: var(--wheat);
  text-decoration: none;
  font-weight: 600;
}

.footer-info a:hover {
  text-decoration: underline;
}

.footer-copy {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(239, 229, 211, 0.18);
  font-size: 0.88rem;
  color: rgba(239, 229, 211, 0.65);
  text-align: center;
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
  }

  .footer-info {
    text-align: left;
  }
}

/* ---------- Motion preferences ---------- */

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