/* ============================================================
   Goulds D&F Ltd — Main CSS
   Skills referenced: docs/skills/seo-audit-skill.md (CWV/CLS)
                      docs/skills/marketingskills.md (CRO/design)
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  --charcoal:      #1C1C1E;
  --charcoal-mid:  #2A2A2D;
  --charcoal-light:#3A3A3D;
  --gold:          #B09145;
  --gold-hover:    #C8A854;
  --gold-light:    #D4B87A;
  --off-white:     #F5F0E8;
  --white:         #FFFFFF;
  --text-dark:     #E8E3D9;
  --text-muted:    #A09890;
  --text-body:     #2D2D2D;

  --font-sans:     'Poppins', system-ui, -apple-system, sans-serif;

  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.16);

  --transition:    0.2s ease;

  --container:     1200px;
  --gap:           clamp(1rem, 3vw, 2rem);
}

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

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

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--white);
  overflow-x: hidden;
}

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

/* Prevent CLS: all images must have width + height set in HTML */
img {
  height: auto;
}

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

ul,
ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--charcoal);
}

h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p {
  line-height: 1.7;
  color: var(--text-body);
}

/* ── Layout Utilities ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section--dark {
  background: var(--charcoal);
  color: var(--text-dark);
}

.section--dark h2,
.section--dark h3 {
  color: var(--white);
}

.section--off-white {
  background: var(--off-white);
}

.text-center { text-align: center; }
.text-gold   { color: var(--gold); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

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

@media (min-width: 900px) {
  .grid-3  { grid-template-columns: repeat(3, 1fr); }
  .grid-4  { grid-template-columns: repeat(4, 1fr); }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--gold);
  color: var(--charcoal);
  border-color: var(--gold);
}

.btn--primary:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
}

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

.btn--outline:hover {
  background: var(--white);
  color: var(--charcoal);
}

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

.btn--outline-gold:hover {
  background: var(--gold);
  color: var(--charcoal);
}

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

/* ── Section Header ── */
.section-header {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-header .label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.section-header h2 {
  margin-bottom: 0.75rem;
}

.section-header p {
  color: #555;
  max-width: 600px;
}

.section-header.text-center p {
  margin: 0 auto;
}

/* ── Header / Navigation ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--charcoal);
  border-bottom: 1px solid var(--charcoal-light);
}

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

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-img {
  display: block;
  width: auto;
  height: 72px;
  mix-blend-mode: screen; /* eliminates white background on dark nav/footer */
}

/* Footer logo slightly smaller */
.footer-brand .logo-img {
  height: 58px;
}

/* Hide old SVG/text logo fallback if logo-img is present */
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text .name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
}

.logo-text .tagline {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Desktop Nav */
.site-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--gold);
  background: rgba(176,145,69,0.08);
}

/* Header CTA area */
.header-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-phone {
  display: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: color var(--transition);
}

.header-phone:hover {
  color: var(--gold);
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--charcoal-mid);
  border-top: 1px solid var(--charcoal-light);
  padding: 1rem 0;
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dark);
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  transition: color var(--transition), background var(--transition);
}

.mobile-menu a:hover {
  color: var(--gold);
  background: rgba(176,145,69,0.08);
}

.mobile-menu .btn {
  margin: 0.75rem clamp(1rem, 4vw, 2rem) 0.25rem;
  text-align: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .site-nav    { display: flex; }
  .header-phone { display: block; }
  .hamburger   { display: none; }
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  background: var(--off-white);
  border-bottom: 1px solid #E2DDD5;
  padding: 0.6rem 0;
}

.breadcrumbs nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #888;
}

.breadcrumbs a {
  color: var(--gold);
  font-weight: 500;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs .sep {
  color: #bbb;
}

/* ── Footer ── */
.site-footer {
  background: var(--charcoal);
  color: var(--text-dark);
  padding: clamp(2.5rem, 5vw, 4rem) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--charcoal-light);
}

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

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
}

.footer-brand .site-logo {
  margin-bottom: 1rem;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.footer-nap {
  font-size: 0.88rem;
  line-height: 2;
  color: var(--text-muted);
}

.footer-nap a {
  color: var(--text-dark);
  transition: color var(--transition);
}

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

.footer-col h4 {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-muted);
  transition: color var(--transition);
}

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

/* ── CTA Banner ── */
.cta-banner {
  background: var(--gold);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  text-align: center;
}

.cta-banner h2 {
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.cta-banner p {
  color: var(--charcoal);
  opacity: 0.85;
  margin-bottom: 1.75rem;
  font-size: 1.05rem;
}

.cta-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.cta-banner .btn--primary {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--gold);
}

.cta-banner .btn--primary:hover {
  background: var(--charcoal-mid);
  border-color: var(--charcoal-mid);
}

.cta-banner .btn--outline {
  border-color: var(--charcoal);
  color: var(--charcoal);
}

.cta-banner .btn--outline:hover {
  background: var(--charcoal);
  color: var(--gold);
}

/* ── Trust Badges ── */
.trust-strip {
  background: var(--white);
  border-top: 1px solid #E8E3D9;
  border-bottom: 1px solid #E8E3D9;
  padding: 1.25rem 0;
}

.trust-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem clamp(1.5rem, 4vw, 3rem);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
}

.trust-badge svg,
.trust-badge img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ── Stats Bar ── */
.stats-bar {
  background: var(--charcoal);
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.stats-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 3rem;
  text-align: center;
}

.stat-item {
  flex: 0 0 auto;
  min-width: 130px;
}

.stat-item .number {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-item .label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Star Rating ── */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--gold);
  font-size: 1rem;
}

/* ── Page-load Fade-in Animation ── */
/*
 * Pure CSS on-load animation — no JS, no scroll-reveal.
 * Runs once on page load. Respects prefers-reduced-motion.
 * Every card is fully visible at all times (no opacity:0 default state).
 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .hero-content       { animation: fadeSlideIn 0.5s ease-out 0.05s both; }
  .hero-image         { animation: fadeSlideIn 0.5s ease-out 0.10s both; }
  .section-header     { animation: fadeSlideIn 0.45s ease-out 0.05s both; }

  .service-card:nth-child(1)    { animation: fadeSlideIn 0.4s ease-out 0.05s both; }
  .service-card:nth-child(2)    { animation: fadeSlideIn 0.4s ease-out 0.12s both; }
  .service-card:nth-child(3)    { animation: fadeSlideIn 0.4s ease-out 0.19s both; }
  .service-card:nth-child(4)    { animation: fadeSlideIn 0.4s ease-out 0.26s both; }

  .feature-card:nth-child(1)    { animation: fadeSlideIn 0.4s ease-out 0.05s both; }
  .feature-card:nth-child(2)    { animation: fadeSlideIn 0.4s ease-out 0.12s both; }
  .feature-card:nth-child(3)    { animation: fadeSlideIn 0.4s ease-out 0.19s both; }

  .stat-item:nth-child(1)       { animation: fadeSlideIn 0.4s ease-out 0.05s both; }
  .stat-item:nth-child(2)       { animation: fadeSlideIn 0.4s ease-out 0.12s both; }
  .stat-item:nth-child(3)       { animation: fadeSlideIn 0.4s ease-out 0.19s both; }

  .testimonial-card:nth-child(1){ animation: fadeSlideIn 0.4s ease-out 0.05s both; }
  .testimonial-card:nth-child(2){ animation: fadeSlideIn 0.4s ease-out 0.12s both; }
  .testimonial-card:nth-child(3){ animation: fadeSlideIn 0.4s ease-out 0.19s both; }
}

/* ── Section Patterns ── */

/* Off-white sections — subtle gold dot grid */
.section--off-white {
  background-color: var(--off-white);
  background-image: radial-gradient(circle, rgba(176,145,69,0.14) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}

/* Dark sections (charcoal) — fine cross-hatch grid */
.section--dark {
  background-color: var(--charcoal);
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Stats bar — diagonal weave texture */
.stats-bar {
  background-color: var(--charcoal);
  background-image:
    repeating-linear-gradient(
      -45deg,
      rgba(176,145,69,0.06) 0,
      rgba(176,145,69,0.06) 1px,
      transparent 0,
      transparent 50%
    );
  background-size: 10px 10px;
}

/* CTA banner — diagonal stripe shimmer */
.cta-banner {
  background-color: var(--gold);
  background-image:
    repeating-linear-gradient(
      -55deg,
      rgba(255,255,255,0.07) 0,
      rgba(255,255,255,0.07) 1px,
      transparent 0,
      transparent 50%
    );
  background-size: 8px 8px;
}

/* Site header — subtle dot overlay */
.site-header {
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Footer — same diagonal weave as stats bar */
.site-footer {
  background-color: var(--charcoal);
  background-image:
    repeating-linear-gradient(
      -45deg,
      rgba(176,145,69,0.04) 0,
      rgba(176,145,69,0.04) 1px,
      transparent 0,
      transparent 50%
    );
  background-size: 10px 10px;
}

/* Page hero (inner pages) — refined grid */
.page-hero {
  background-color: var(--charcoal);
  background-image:
    linear-gradient(rgba(176,145,69,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(176,145,69,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Hero section (homepage) — same grid, slightly stronger */
.hero {
  background-color: var(--charcoal);
  background-image:
    linear-gradient(rgba(176,145,69,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(176,145,69,0.07) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Skip to main content (accessibility) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--gold);
  color: var(--charcoal);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}
