/* ==========================================================================
   Cascade Coatings Co. — styles.css
   Design direction: "1a · Fieldstone" — warm, unhurried, handmade.
   Tokens, then layout, then components, then responsive overrides.
   ========================================================================== */

:root {
  /* Color tokens */
  --color-bg: #F7F2EA;
  --color-bg-alt: #F1E9DA;
  --color-card: #FFFDF8;
  --color-border: #E4D9C6;
  --color-text: #3A2E22;
  --color-text-muted: #5B4E3E;
  --color-accent: #B5633B;
  --color-stone: #8C7B67;
  --color-badge-bg: #F1E6D3;
  --color-badge-border: #DFCBA6;
  --color-badge-text: #7A5A2E;
  --color-button-text: #FFF8EF;
  --color-success-bg: #DDEBD9;
  --color-success-text: #4E7A46;

  /* Type tokens */
  --font-display: 'Source Serif 4', serif;
  --font-body: 'PT Serif', serif;

  /* Shape / shadow tokens */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-soft: 0 8px 24px rgba(90, 70, 40, 0.12);

  /* Layout tokens */
  --container-max: 1160px;
  --gutter: 56px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

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

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

button { font-family: inherit; cursor: pointer; }

input, select, textarea { font-family: inherit; font-size: 14px; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding: 64px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-size: 30px;
  text-align: center;
  margin: 0 0 32px;
}

.section-title--sm {
  font-size: 26px;
}

.section--center {
  text-align: center;
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  border-bottom: 1px solid var(--color-border);
  gap: 16px;
}

.site-header__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
}

.site-nav a:hover,
.site-header__phone:hover {
  color: var(--color-accent);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge {
  font-size: 11px;
  background: var(--color-badge-bg);
  border: 1px solid var(--color-badge-border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  color: var(--color-badge-text);
  white-space: nowrap;
}

.site-header__phone {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--color-text);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-text);
  position: relative;
}

.nav-toggle__bar::before { position: absolute; top: -6px; }
.nav-toggle__bar::after { position: absolute; top: 6px; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-align: center;
  border: none;
  padding: 15px 28px;
  font-size: 16px;
}

.btn--sm {
  padding: 11px 20px;
  font-size: 14px;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-button-text);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--color-text);
  color: var(--color-text);
}

.btn--full {
  width: 100%;
  border: none;
  padding: 14px;
  font-size: 15px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 80px var(--gutter);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.hero__title {
  font-size: 52px;
  font-weight: 700;
  max-width: 760px;
  line-height: 1.15;
}

.hero__subtitle {
  font-size: 19px;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 560px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   Services
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.card-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.service-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
}

.service-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-badge-bg);
  margin-bottom: 16px;
}

.service-card h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.service-card p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Before / After comparison
   ========================================================================== */

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.compare-card__title {
  font-size: 18px;
  margin: 0 0 12px;
  text-align: center;
}

.compare {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  position: relative;
  aspect-ratio: 820 / 340;
  user-select: none;
  touch-action: none;
}

.compare__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare__after-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
}

.compare__after-wrap .compare__img {
  width: var(--compare-width, 820px);
  max-width: none;
}

.compare__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 5px;
  background: var(--color-button-text);
  transform: translateX(-2.5px);
  box-shadow: 0 0 0 2px var(--color-accent);
  pointer-events: none;
}

.compare__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-button-text);
  border: 2px solid var(--color-accent);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: 14px;
}

/* ==========================================================================
   Stats
   ========================================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}

.stat__value {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  color: var(--color-accent);
}

.stat__value--text {
  font-size: 20px;
}

.stat__label {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Reviews
   ========================================================================== */

.review-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.review-card__stars {
  color: var(--color-accent);
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.review-card p {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.review-card__author {
  font-size: 13px;
  font-weight: 700;
}

/* ==========================================================================
   Service area
   ========================================================================== */

.area-list {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.area-list li {
  background: var(--color-badge-bg);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
}

/* ==========================================================================
   Quote form
   ========================================================================== */

.quote-panels {
  display: flex;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  align-items: stretch;
}

.quote-panel {
  flex: 1;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 28px;
}

.quote-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quote-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field input,
.field select,
.field textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-badge-border);
  font-family: var(--font-body);
  font-size: 14px;
  background: #fff;
  color: var(--color-text);
}

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

.quote-panel--success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.quote-panel__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-stone);
}

.quote-panel__check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-success-text);
  font-size: 24px;
}

.quote-panel--success p {
  font-size: 15px;
  margin: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 48px var(--gutter);
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.site-footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.site-footer__heading {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
}

.payment-badges,
.social-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.payment-badges span {
  border: 1px solid var(--color-badge-border);
  padding: 3px 8px;
  border-radius: 6px;
}

.social-badges a {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-badge-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.social-badges a:hover {
  background: var(--color-accent);
  color: var(--color-button-text);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  :root { --gutter: 24px; }

  .card-grid { grid-template-columns: repeat(2, 1fr); }

  .compare-grid { grid-template-columns: 1fr; max-width: 480px; }

  .stats { grid-template-columns: repeat(1, 1fr); gap: 32px; }

  .site-footer { grid-template-columns: repeat(2, 1fr); }

  .hero__title { font-size: 40px; }

  .quote-panels { flex-direction: column; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 16px;
    z-index: 20;
  }

  .site-nav.is-open { display: flex; }

  .site-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav a:last-child { border-bottom: none; }

  .site-header { position: relative; flex-wrap: wrap; }

  .site-header__badge { display: none; }

  .nav-toggle { display: flex; }

  .site-header__actions .btn--sm { padding: 9px 14px; font-size: 13px; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }

  .hero { padding: 56px 20px; }

  .hero__title { font-size: 32px; }

  .hero__subtitle { font-size: 16px; }

  .hero__actions { flex-direction: column; width: 100%; }

  .hero__actions .btn { width: 100%; }

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

  .section-title { font-size: 24px; }

  .site-footer { grid-template-columns: 1fr; }
}
