/* ============================================================
   F'Amos Fencing & Construction — Main Stylesheet
   v1.0
   ============================================================ */

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

:root {
  --dark:       #1c170d;
  --green:      #2a5c1f;
  --green-mid:  #3d7a30;
  --amber:      #b5742a;
  --amber-dark: #9a6022;
  --cream:      #f0ebe0;
  --cream-alt:  #e4ddd2;
  --text:       #2e2820;
  --text-muted: #6b5e4e;
  --white:      #faf6f0;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  background: var(--dark);
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(28, 23, 13, 0.45) 0%,
    rgba(28, 23, 13, 0.82) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.biz-name {
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.03em;
  line-height: 1.05;
}

.biz-name span {
  color: var(--amber);
}

.tagline {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--amber);
}

.subtitle {
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  color: rgba(250, 246, 240, 0.68);
  max-width: 500px;
  line-height: 1.8;
}

/* ===== Buttons ===== */
.cta-buttons {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--amber);
  color: var(--white);
  border: 2px solid var(--amber);
}

.btn-primary:hover {
  background: var(--amber-dark);
  border-color: var(--amber-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(181, 116, 42, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

/* ===== Services ===== */
.services-section {
  padding: 5.5rem 1.5rem;
  background: var(--cream);
}

.section-heading {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--dark);
  text-align: center;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
}

.section-rule {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--amber);
  margin: 0 auto 3rem;
}

.services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 880px;
  margin: 0 auto;
}

.service {
  background: var(--white);
  border-top: 6px solid var(--amber);
  overflow: hidden;
}

.service-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--cream-alt);
  overflow: hidden;
}

.service-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.service:hover .service-img-wrap img {
  transform: scale(1.04);
}

.service-body {
  padding: 1.4rem 1.5rem 1.75rem;
}

.service h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.service p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ===== Logo SVG ===== */
.logo-svg {
  display: block;
  width: 100%;
  max-width: 380px;
  margin: 0 auto 0.1rem;
}

.biz-sub {
  display: block;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(250, 246, 240, 0.6);
  margin-top: -0.25rem;
}

/* ===== More section ===== */
.more-section {
  background: var(--dark);
  padding: 5rem 1.5rem;
  text-align: center;
}

.more-section .section-heading.light {
  color: var(--white);
}

.section-rule.light {
  background: var(--amber);
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 880px;
  margin: 0 auto;
}

.more-item {
  background: rgba(255, 255, 255, 0.05);
  border-top: 4px solid var(--amber);
  padding: 2rem 1.25rem;
}

.more-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.75rem;
}

.more-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.more-item p {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .more-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Contact band ===== */
.contact-band {
  background: var(--green);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.75rem;
  padding: 1.35rem 1.5rem;
  font-size: 0.85rem;
}

.contact-band a {
  color: #fff;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}

.contact-band a:hover {
  border-color: var(--white);
}

/* ===== Footer ===== */
footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  padding: 1.3rem 1rem;
  font-size: 0.73rem;
  letter-spacing: 0.06em;
}

footer a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: color 0.2s, border-color 0.2s;
}

footer a:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ===== Business card flip widget ===== */
.biz-card {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  width: 178px;
  height: 98px;
  perspective: 800px;
  cursor: pointer;
}

.biz-card-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  position: relative;
}

.biz-card:hover .biz-card-inner {
  transform: rotateY(180deg);
}

.biz-card-front,
.biz-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* Front — teaser */
.biz-card-front {
  background: #1a1a1a;
  border-left: 3px solid #1b7a3d;
}

.biz-card-label {
  display: block;
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.3rem;
}

.biz-card-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

/* Back — CTA */
.biz-card-back {
  background: #1b7a3d;
  transform: rotateY(180deg);
}

.biz-card-back-label {
  display: block;
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.25rem;
}

.biz-card-back-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

.biz-card-arrow {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.08em;
}

/* ===== Page flip overlay ===== */
.page-flip {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: perspective(2000px) rotateY(-90deg);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.page-flip.active {
  transform: perspective(2000px) rotateY(0deg);
  pointer-events: all;
}

.page-flip-content {
  text-align: center;
}

.page-flip-eyebrow {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.85rem;
}

.page-flip-name {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #1b7a3d;
  line-height: 1.15;
}

/* ===== Dark mode (automatic) ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --cream:      #171310;
    --cream-alt:  #211c15;
    --text:       #d0c8bc;
    --text-muted: #988a7a;
  }

  .service {
    background: #1e1912;
    border-top-color: var(--amber);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .more-item {
    background: rgba(255, 255, 255, 0.04);
  }

  .section-heading {
    color: var(--text);
  }

  .service h3 {
    color: var(--text);
  }

  .contact-band {
    background: #1f4016;
  }
}

/* ===== Biz pill (mobile only) ===== */
.biz-pill {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 200;
  align-items: center;
  background: #1a1a1a;
  border-left: 3px solid #1b7a3d;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.biz-pill img {
  height: 32px;
  width: auto;
  display: block;
}

.page-flip-logo {
  display: block;
  height: 80px;
  width: auto;
  margin: 0 auto;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .services {
    grid-template-columns: 1fr;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .contact-band {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .biz-card {
    display: none;
  }

  .biz-pill {
    display: flex;
  }
}
