/* =========================================
   RANDAL SOLUTIONS — STYLESHEET
   Roofing / Storm Damage / Home Improvement
   Design: Warm, solid, conversion-focused
   ========================================= */

:root {
  /* Palette */
  --navy: #1a2735;
  --navy-light: #2d3e50;
  --steel: #4a6572;
  --amber: #f5a623;
  --amber-dark: #e09400;
  --orange: #e8701a;
  --cream: #f7f4ef;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --green: #2d8a4e;
  --red: #dc2626;

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --section-pad: 5rem 0;
  --container-max: 1140px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(26, 39, 53, 0.08);
  --shadow-lg: 0 8px 30px rgba(26, 39, 53, 0.12);
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--navy);
  line-height: 1.65;
  background: var(--white);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* TYPOGRAPHY */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy);
}

h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.3rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

p { font-size: 1.05rem; }

.eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
  margin-bottom: 0.75rem;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
}

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

.section-sub {
  color: var(--steel);
  font-size: 1.1rem;
}

.accent { color: var(--amber); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.8rem;
  font-size: 1.02rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(232, 112, 26, 0.35);
}

.btn-primary:hover {
  background: #d05f10;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 112, 26, 0.4);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
}

.btn-full { width: 100%; }

/* NAV */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97); border-bottom: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
}

#nav.scrolled {
  background: var(--white);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-mark {
  color: var(--orange);
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.logo-words {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.1;
}

.logo-words strong {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.logo-words span {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--steel);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--orange);
}

.nav-cta {
  background: var(--orange);
  color: var(--white) !important;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.nav-cta:hover {
  background: #d05f10;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* HERO */
#hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: url('hero-house.jpg') center center / cover no-repeat;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Lighter overlay — left side darker for text readability, right side shows house */
  background: linear-gradient(to right, rgba(26, 39, 53, 0.88) 0%, rgba(26, 39, 53, 0.6) 40%, rgba(26, 39, 53, 0.15) 70%, rgba(26, 39, 53, 0.05) 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /* Subtle bottom fade only */
  background: linear-gradient(to bottom, transparent 0%, rgba(26, 39, 53, 0.3) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 8rem 1.5rem 4rem;
  /* Push content to left half */
  max-width: 600px;
  margin-left: max(1.5rem, calc((100% - 1200px) / 2 + 0px));
  padding-right: 2rem;
}

.hero-eyebrow {
  color: var(--amber);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}

.hero-content h1 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.hero-sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.2rem;
  max-width: 580px;
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-trust {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-trust span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  font-weight: 500;
}

/* STATS BAR */
#stats {
  background: var(--navy);
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#stats .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--amber);
  line-height: 1;
}

.stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

/* SERVICES */
#services {
  padding: var(--section-pad);
  background: var(--cream);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card.featured {
  border: 2px solid var(--orange);
}

.service-badge {
  position: absolute;
  top: -10px;
  right: 1.5rem;
  background: var(--orange);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

.service-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  margin-bottom: 0.5rem;
}

.service-card p {
  font-size: 0.95rem;
  color: var(--steel);
  margin-bottom: 1rem;
}

.service-card ul li {
  font-size: 0.9rem;
  color: var(--gray-700);
  padding: 0.25rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.service-card ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* ABOUT */
#about {
  padding: var(--section-pad);
  background: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: start;
}

.about-content h2 { margin-bottom: 1.2rem; }

.about-content p {
  color: var(--steel);
  margin-bottom: 1rem;
}

.about-features {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-feature strong {
  display: block;
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.about-feature p {
  font-size: 0.95rem;
  color: var(--steel);
}

.about-visual {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 100px;
}

.about-card {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.about-card-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--amber);
  line-height: 1;
}

.about-card-label {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* GALLERY */
#gallery {
  padding: var(--section-pad);
  background: var(--gray-50);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--steel) 100%);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  padding: 1rem;
  transition: var(--transition);
}

.gallery-placeholder:hover {
  background: linear-gradient(135deg, var(--steel) 0%, var(--navy) 100%);
}

.gallery-placeholder small {
  font-weight: 400;
  font-size: 0.85rem;
  margin-top: 0.3rem;
  opacity: 0.7;
}

.gallery-note {
  text-align: center;
  margin-top: 2rem;
  color: var(--gray-500);
  font-size: 0.92rem;
}

/* REVIEWS */
#reviews {
  padding: var(--section-pad);
  background: var(--white);
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.review-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--gray-200);
}

.review-stars {
  color: var(--amber);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.review-card p {
  font-size: 1rem;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.review-author {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
}

/* CONTACT */
#contact {
  padding: var(--section-pad);
  background: var(--navy);
}

#contact .eyebrow { color: var(--amber); }
#contact h2 { color: var(--white); }
.contact-sub { color: rgba(255, 255, 255, 0.7); margin-bottom: 2rem; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  transition: var(--transition);
}

.contact-detail:hover {
  color: var(--white);
}

.contact-icon {
  font-size: 1.2rem;
}

/* FORM */
.contact-form-wrap {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
}

.contact-form h3 {
  margin-bottom: 1.5rem;
  color: var(--navy);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-family: var(--font);
  color: var(--navy);
  background: var(--white);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 112, 26, 0.12);
}

.contact-form textarea {
  resize: vertical;
}

.form-fineprint {
  font-size: 0.85rem;
  color: var(--gray-500);
  text-align: center;
  margin-top: 0.75rem;
}

.form-success {
  text-align: center;
  padding: 2rem;
}

.form-success h3 {
  color: var(--green);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.about-mockup {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.about-stats-row {
  display: flex;
  gap: 1rem;
}

.about-stats-row .about-card {
  flex: 1;
}

/* CHAT SHOWCASE */
#chat-showcase {
  padding: var(--section-pad);
  background: var(--cream);
}

.chat-showcase-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: center;
}

.chat-showcase-image img {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.chat-showcase-content h2 { margin-bottom: 1rem; }

.chat-showcase-content > p {
  color: var(--steel);
  margin-bottom: 1.5rem;
}

.chat-showcase-features {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.chat-feature strong {
  display: block;
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.chat-feature p {
  font-size: 0.95rem;
  color: var(--steel);
}

/* FOOTER */
footer {
  background: var(--gray-900);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

.footer-brand p {
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.footer-brand .logo-mark {
  margin-bottom: 0.5rem;
}

.footer-links h4,
.footer-contact h4 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-links a,
.footer-contact a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.92rem;
  padding: 0.25rem 0;
  transition: var(--transition);
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* CHAT WIDGET */
.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
}

.chat-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 100px;
  padding: 0.8rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(232, 112, 26, 0.4);
  transition: var(--transition);
  font-family: var(--font);
}

.chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(232, 112, 26, 0.5);
}

.chat-icon { font-size: 1.2rem; }

.chat-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 3rem);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: chatSlideUp 0.3s ease;
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-header {
  background: var(--navy);
  color: var(--white);
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header strong { font-size: 1rem; }

.chat-status {
  font-size: 0.78rem;
  color: #4ade80;
  display: block;
  margin-top: 2px;
}

.chat-header button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 1.1rem;
}

.chat-body {
  padding: 1rem 1.2rem;
  max-height: 260px;
  overflow-y: auto;
}

.chat-message {
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  max-width: 85%;
}

.chat-message.bot {
  background: var(--gray-100);
  color: var(--navy);
}

.chat-message.user {
  background: var(--orange);
  color: var(--white);
  margin-left: auto;
  text-align: right;
}

.chat-input-wrap {
  display: flex;
  border-top: 1px solid var(--gray-200);
}

.chat-input-wrap input {
  flex: 1;
  border: none;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  font-family: var(--font);
  outline: none;
}

.chat-input-wrap button {
  background: var(--orange);
  color: var(--white);
  border: none;
  padding: 0.8rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
}

/* ====================
   RESPONSIVE
   ==================== */

@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid { grid-template-columns: 1fr; max-width: 600px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-visual { flex-direction: column; position: static; }
  .about-card { flex: 1; }
  .chat-showcase-grid { grid-template-columns: 1fr; gap: 2rem; }
  .chat-showcase-image img { max-width: 320px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --section-pad: 3.5rem 0; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hero-content { padding-top: 6rem; max-width: 100%; margin-left: 1.5rem; }
  /* On mobile, go back to darker overlay so text is readable */
  #hero::before {
    background: linear-gradient(135deg, rgba(26, 39, 53, 0.85) 0%, rgba(26, 39, 53, 0.65) 50%, rgba(26, 39, 53, 0.85) 100%);
  }
  .hero-ctas { flex-direction: column; }
  .btn { width: 100%; }
  .hero-trust { flex-direction: column; gap: 0.5rem; }

  #stats .container { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

  .services-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .about-visual { flex-direction: column; }
  .about-stats-row { flex-direction: row; }
  .chat-showcase-grid { grid-template-columns: 1fr; }

  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; }

  .chat-window { width: calc(100vw - 2rem); right: -0.5rem; }
}

@media (max-width: 480px) {
  #stats .container { grid-template-columns: 1fr 1fr; }
  .stat-number { font-size: 1.8rem; }
  .hero-content h1 { font-size: 1.9rem; }
  .hero-sub { font-size: 1.05rem; }
}
