/* Ironclad Roofing — bold, high-motion flagship theme. Charcoal + safety-orange. */

:root {
  --ink: #14171b;
  --ink-2: #1d2126;
  /* var() fallback keeps these at their normal defaults until the editor's
     live settings-save patches --obt-color-1/2/3 in place (no page reload). */
  --orange: var(--obt-color-1, #ff5a1f);
  --orange-dark: var(--obt-color-2, #e0470f);
  --amber: var(--obt-color-3, #ffb703);
  --steel: #8a94a6;
  --paper: #f6f4f0;
  --card: #ffffff;
  --line: #e7e3da;
  --muted: #6b6f76;
  --grad: linear-gradient(135deg, var(--orange) 0%, var(--amber) 100%);
  --shadow-lg: 0 24px 55px -18px rgba(20,23,27,0.45);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--paper); line-height: 1.6;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.01em; }
a { color: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.eyebrow { display: block; color: var(--orange-dark); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.82rem; margin-bottom: 0.5rem; }
.section-title { font-size: 2.1rem; }
.section-sub { color: var(--muted); max-width: 560px; }
.center { text-align: center; margin: 0 auto; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.9rem 1.85rem; border-radius: 10px; background: var(--grad); color: #fff;
  text-decoration: none; font-weight: 700; border: none; cursor: pointer; font-size: 1rem;
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--orange) 65%, transparent); transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.4); box-shadow: none; }
.btn-outline:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-lg { padding: 1.1rem 2.25rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-breathe { animation: icBreathe 3s ease-in-out infinite; }
.btn-breathe:hover { animation-play-state: paused; }
@keyframes icBreathe {
  0%, 100% { box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--orange) 65%, transparent); transform: scale(1); }
  50% { box-shadow: 0 14px 36px -8px color-mix(in srgb, var(--orange) 90%, transparent); transform: scale(1.025); }
}

/* ---------- header ---------- */
.site-header { background: var(--ink); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255,255,255,0.08); }
.header-inner { max-width: 1180px; margin: 0 auto; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--grad); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-text { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.2rem; color: #fff; }
.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a { color: rgba(255,255,255,0.8); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.main-nav a:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 1.25rem; }
.phone-link { display: flex; align-items: center; gap: 0.5rem; color: #fff; text-decoration: none; font-weight: 700; }

.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 34px; height: 34px; background: none; border: none; cursor: pointer; padding: 0; }
.hamburger span { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-close { display: none; }
.nav-backdrop { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink); padding: 5.5rem 0 0; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04; mix-blend-mode: overlay;
}
.hero-mesh-wrap { position: absolute; inset: 0; pointer-events: none; }
.hero-mesh {
  position: absolute; inset: -15%; pointer-events: none;
  background:
    radial-gradient(650px 420px at 12% 15%, color-mix(in srgb, var(--orange) 35%, transparent), transparent 60%),
    radial-gradient(600px 460px at 88% 20%, color-mix(in srgb, var(--amber) 22%, transparent), transparent 60%),
    radial-gradient(800px 620px at 55% 100%, rgba(138,148,166,0.18), transparent 60%);
  animation: icDrift 17s ease-in-out infinite;
}
@keyframes icDrift {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-2%, 2%) scale(1.07); }
}
.hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; }
.pill-tag { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); color: #fff; padding: 0.5rem 1.1rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5vw, 3.4rem); }
.hero h1 .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: rgba(255,255,255,0.68); font-size: 1.1rem; max-width: 480px; margin-top: 1.1rem; }
.hero-ctas { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

.hero-photo-wrap { position: relative; }
.hero-photo-frame {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  transition: transform 0.25s ease-out; will-change: transform;
}
.hero-photo-frame img { width: 100%; height: 420px; object-fit: cover; display: block; }
.hero-badge {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(20,23,27,0.65); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18); color: #fff; padding: 0.55rem 1rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; white-space: nowrap; box-shadow: 0 14px 30px -10px rgba(0,0,0,0.5);
  animation: icBadgeBob 5.5s ease-in-out infinite;
}
@keyframes icBadgeBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

/* ---------- floating 3D roof badge ---------- */
.ic-house-badge { position: absolute; pointer-events: none; perspective: 500px; animation: icHouseBob 6s ease-in-out infinite; }
.ic-house-spin-y { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; animation: icSpinY 13s linear infinite; }
.ic-house-spin-x { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; animation: icSpinX 8s linear infinite; }
@keyframes icSpinY { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
@keyframes icSpinX { from { transform: rotateX(0deg); } to { transform: rotateX(360deg); } }
@keyframes icHouseBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.ic-roof-face {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin-left: -24px; margin-top: -17px;
  border-left: 24px solid transparent; border-right: 24px solid transparent; border-bottom: 35px solid transparent;
  transform-origin: 50% 100%;
}
.ic-roof-1 { border-bottom-color: var(--orange); transform: rotateY(0deg) translateZ(24px) rotateX(42deg); }
.ic-roof-2 { border-bottom-color: var(--amber); transform: rotateY(90deg) translateZ(24px) rotateX(42deg); }
.ic-roof-3 { border-bottom-color: var(--amber); transform: rotateY(180deg) translateZ(24px) rotateX(42deg); }
.ic-roof-4 { border-bottom-color: var(--orange); transform: rotateY(270deg) translateZ(24px) rotateX(42deg); }

/* ---------- marquee ticker ---------- */
.ticker { background: var(--orange); overflow: hidden; padding: 0.9rem 0; position: relative; z-index: 1; }
.ticker-track { display: flex; gap: 3rem; white-space: nowrap; animation: icMarquee 22s linear infinite; width: max-content; }
.ticker-track span { color: #fff; font-weight: 800; font-size: 0.92rem; letter-spacing: 0.04em; text-transform: uppercase; }
@keyframes icMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- how it works ---------- */
.how { padding: 6rem 0; }
.how-steps { display: flex; align-items: flex-start; justify-content: center; gap: 1.5rem; margin-top: 3rem; flex-wrap: wrap; }
.how-step { flex: 1; min-width: 220px; max-width: 260px; text-align: center; }
.how-arrow { color: var(--line); flex-shrink: 0; margin-top: 24px; }
.how-badge { width: 3rem; height: 3rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.2rem; color: #fff; margin: 0 auto 1rem; }
.how-badge-1 { background: var(--orange); }
.how-badge-2 { background: var(--amber); color: var(--ink); }
.how-badge-3 { background: var(--ink); }

/* ---------- stats ---------- */
.stats { background: var(--ink); padding: 5rem 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; }
.stat-num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 3.2rem; color: #fff; position: relative; display: inline-block; }
.stat-num .stat-underline { position: absolute; left: 0; bottom: 4px; height: 10px; width: 100%; background: var(--orange); z-index: -1; opacity: 0.5; transform: scaleX(0); transform-origin: left; transition: transform 0.6s ease; }
.stat-num.is-visible .stat-underline { transform: scaleX(1); }
.stat-label { color: rgba(255,255,255,0.6); font-size: 0.95rem; margin-top: 0.5rem; }

/* ---------- services ---------- */
.services { padding: 6rem 0; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.75rem; }
.service-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.service-tile:hover { transform: perspective(700px) rotateX(3deg) translateY(-4px); box-shadow: var(--shadow-lg); }
.tile-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.tile-ember .tile-icon { background: var(--orange); }
.tile-amber .tile-icon { background: var(--amber); }
.tile-charcoal .tile-icon { background: var(--ink); }
.service-tile h3 { font-size: 1.15rem; }
.service-tile p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ---------- gallery ---------- */
.gallery { background: var(--ink); padding: 6rem 0; }
.gallery .section-title, .gallery .eyebrow { color: #fff; }
.gallery .section-sub { color: rgba(255,255,255,0.55); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 2.75rem; }
.gallery-item { margin: 0; position: relative; border-radius: 12px; overflow: hidden; }
.gallery-item img { width: 100%; height: 230px; object-fit: cover; display: block; }
.gallery-item figcaption { position: absolute; bottom: 0; left: 0; right: 0; padding: 0.9rem 1rem; background: linear-gradient(0deg, rgba(0,0,0,0.75), transparent); color: #fff; font-weight: 700; font-size: 0.85rem; }

/* ---------- quote form ---------- */
.quote { padding: 6rem 0; }
.quote-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.5rem; margin-top: 2.5rem; box-shadow: var(--shadow-lg); }
.form-row { display: flex; gap: 1.25rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.form-field { flex: 1; min-width: 220px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 0.4rem; font-size: 0.9rem; }
input[type=text], input[type=tel], input[type=email], select, textarea {
  width: 100%; padding: 0.8rem 0.9rem; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 15%, transparent); }
.checkbox-legend { display: block; font-weight: 700; margin-bottom: 0.6rem; font-size: 0.9rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.6rem; }
.checkbox-pill { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; font-size: 0.9rem; cursor: pointer; }
.checkbox-pill:has(input:checked) { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 6%, transparent); }

/* ---------- find us ---------- */
.find-us { background: var(--ink); padding: 5.5rem 0 6rem; position: relative; overflow: hidden; }
.find-us::before {
  content: ''; position: absolute; top: -140px; right: -120px; width: 380px; height: 380px;
  background: radial-gradient(circle, color-mix(in srgb, var(--orange) 35%, transparent), transparent 70%); pointer-events: none;
}
.find-us::after {
  content: ''; position: absolute; bottom: -160px; left: -100px; width: 320px; height: 320px;
  background: radial-gradient(circle, color-mix(in srgb, var(--amber) 18%, transparent), transparent 70%); pointer-events: none;
}
.find-us-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.find-us .eyebrow, .find-us .section-title { color: #fff; }
.find-us-address { color: rgba(255,255,255,0.55); margin-top: 0.6rem; font-size: 0.98rem; }
.find-us-phone {
  display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff; font-weight: 800; font-size: 1.4rem; text-decoration: none; line-height: 1;
  padding: 0.9rem 1.6rem; border-radius: 999px; box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--orange) 55%, transparent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.find-us-phone:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -10px color-mix(in srgb, var(--orange) 70%, transparent); }
.find-us-phone-icon { font-size: 1.15rem; }
.find-us-email { margin: 1rem 0 0; }
.find-us-email .text-link { color: rgba(255,255,255,0.7); }
.obt-settings-hint { color: rgba(255,255,255,0.4); font-size: 0.82rem; margin-top: 1.5rem; }
.obt-settings-link {
  background: none; border: 1px solid rgba(255,255,255,0.3); color: #fff; font-weight: 700;
  font-size: 0.82rem; padding: 0.2rem 0.65rem; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.obt-settings-link:hover { background: rgba(255,255,255,0.12); }
.text-link { color: var(--orange-dark); text-decoration: none; font-weight: 700; }
.map-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); position: relative; z-index: 1; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.55); padding: 3rem 0 2rem; font-size: 0.88rem; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; text-align: center; }
.footer-inner .logo { justify-content: center; }
.footer-tag { margin: 0.75rem 0; }
.footer-nav { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; }
.footer-nav a { color: rgba(255,255,255,0.65); text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.footer-fine { margin: 0; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-visible { animation: icReveal 0.6s ease forwards; animation-delay: var(--reveal-delay, 0s); }
@keyframes icReveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hero-mesh, .ic-house-badge, .ic-house-spin-y, .ic-house-spin-x, .hero-badge, .btn-breathe, .ticker-track { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo-wrap { max-width: 480px; margin: 0 auto; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .find-us-inner { grid-template-columns: 1fr; }
  .ic-house-badge { width: 52px !important; height: 52px !important; top: 4% !important; right: 4% !important; }
}
@media (max-width: 860px) {
  .main-nav {
    position: fixed; top: 0; right: -320px; height: 100vh; width: 300px; background: var(--ink);
    flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0;
    padding: 5.5rem 1.5rem 2rem; transition: right 0.3s ease; z-index: 60;
  }
  .main-nav.open { right: 0; }
  .main-nav a { padding: 0.9rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); width: 100%; }
  .nav-close { display: block; position: absolute; top: 1.25rem; right: 1.5rem; background: none; border: none; color: #fff; font-size: 1.8rem; cursor: pointer; }
  .nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 55; }
  .nav-backdrop.open { display: block; }
  .hamburger { display: flex; flex-shrink: 0; }
  .header-actions { gap: 0.6rem; }
  .phone-link { display: none; }
  .logo-text { font-size: 1rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-actions .btn { display: none; }
  .how-arrow { display: none; }
}
@media (max-width: 600px) {
  .services-grid, .gallery-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero-photo-frame img { height: 280px; }
  .hero-badge { font-size: 0.72rem; padding: 0.45rem 0.8rem; }
  .hero-badge-1 { top: -10px !important; left: -8px !important; }
  .hero-badge-2 { right: -8px !important; left: auto !important; }
  .hero-badge-3 { left: -8px !important; top: 44% !important; }
  .ic-house-badge { width: 40px !important; height: 40px !important; }
  .ticker-track { gap: 1.75rem; }
  .ticker-track span { font-size: 0.78rem; }
  .stat-num { font-size: 2.6rem; }
}

/* Editor mode: keep the site header clear of the fixed toolbar above it, and
   give each service tile room for its floating +Add/Remove toggle button. */
body.is-editable .site-header { top: 44px; }
body.is-editable .main-nav { top: 44px !important; }
body.is-editable .service-tile { position: relative; padding-top: 2.5rem; }
body.is-editable .obt-service-toggle { position: absolute; top: 0.85rem; right: 0.85rem; z-index: 2; }
