/* ==========================================================================
   Sapphire Remodeling — Shared Design System
   Bathroom remodeler, Bothell WA / Eastside Seattle
   Tone: Warm | Photography: Balanced | Rhythm: Standard
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color -- brand */
  --color-primary: #0B5BD8;        /* Sapphire Blue -- headers, links, primary CTAs */
  --color-primary-dark: #093f96;   /* hover/active state for primary */
  --color-primary-tint: #EAF1FD;   /* pale blue wash for cards/sections */
  --color-accent: #C8A55E;         /* warm gold -- used sparingly: borders, icons, highlights */
  --color-accent-dark: #a8813d;    /* hover state for gold elements */
  --color-neutral: #F5F4F0;        /* warm off-white -- section backgrounds */

  /* Color -- ink & surfaces */
  --color-ink: #2B2A28;            /* warm charcoal body text, not pure black */
  --color-ink-soft: #55534E;       /* secondary text */
  --color-white: #FFFFFF;
  --color-border: #E4E1D8;         /* warm-toned hairline border */
  --color-success: #1E7A34;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-body: 18px;                 /* bumped up from 16px default for readability */
  --fs-small: 15px;
  --fs-h1: clamp(2.25rem, 4.5vw, 3.4rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h3: clamp(1.3rem, 2vw, 1.6rem);
  --fs-h4: 1.15rem;
  --lh-body: 1.65;
  --lh-heading: 1.2;

  /* Layout */
  --container-width: 1180px;
  --container-pad: 24px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 4px 20px rgba(43, 42, 40, 0.08);
  --shadow-lift: 0 10px 30px rgba(43, 42, 40, 0.14);

  /* Spacing scale */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 28px;
  --space-lg: 48px;
  --space-xl: 80px;
  --space-2xl: 120px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 220ms;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-ink);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { padding-left: 1.2em; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Typography scale
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-family);
  font-weight: 800;
  line-height: var(--lh-heading);
  color: var(--color-primary);
  margin: 0 0 var(--space-sm) 0;
}
h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 700; color: var(--color-ink); }
h4 { font-size: var(--fs-h4); font-weight: 600; color: var(--color-ink); }

p { margin: 0 0 var(--space-sm) 0; max-width: 68ch; }
p.lede { font-size: 1.2rem; color: var(--color-ink-soft); }

.text-center { text-align: center; }
.text-center p { margin-inline: auto; }

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: var(--space-xl) 0;
}
.section--tight { padding: var(--space-lg) 0; }
.section--neutral { background: var(--color-neutral); }
.section--primary { background: var(--color-primary); color: var(--color-white); }
.section--primary h2, .section--primary h3 { color: var(--color-white); }

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

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}
.split--reverse .split__media { order: 2; }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
  text-decoration: none;
  min-height: 48px; /* tap-target size for older/less-precise input */
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
}
.btn--primary:hover { background: var(--color-primary-dark); }

.btn--gold {
  background: var(--color-accent);
  color: var(--color-ink);
}
.btn--gold:hover { background: var(--color-accent-dark); color: var(--color-white); }

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

.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   Header & primary navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 14px var(--container-pad);
  max-width: var(--container-width);
  margin: 0 auto;
}

.site-header__logo img { height: 48px; width: auto; }

.primary-nav { display: flex; align-items: center; gap: var(--space-md); }
.primary-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-nav__list > li { position: relative; }
.primary-nav__list > li > a {
  color: var(--color-ink);
  font-weight: 600;
  padding: 10px 4px;
}
.primary-nav__list > li > a:hover { color: var(--color-primary); text-decoration: none; }

/* Dropdowns -- full list, no truncation, no "view all" */
.has-dropdown > .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: var(--space-sm);
  min-width: 300px;
  max-height: 70vh;
  overflow-y: auto;
  display: none;
  z-index: 50;
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown { display: block; }

.dropdown__group + .dropdown__group { margin-top: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--color-border); }
.dropdown__group-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-ink-soft);
  margin: 0 0 6px 0;
}
.dropdown ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; }
.dropdown ul.dropdown--cols2 { grid-template-columns: repeat(2, 1fr); gap: 0 var(--space-sm); }
.dropdown li a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.dropdown li a:hover { background: var(--color-primary-tint); color: var(--color-primary); text-decoration: none; }

.site-header__cta { display: flex; align-items: center; gap: var(--space-sm); }
.site-header__phone { font-weight: 700; color: var(--color-primary); white-space: nowrap; }

/* Mobile menu toggle button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
}
.nav-toggle__bar {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  position: relative;
  transition: background var(--duration) var(--ease);
}
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 26px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--duration) var(--ease);
}
.nav-toggle__bar::before { top: -8px; }
.nav-toggle__bar::after { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-8px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Mobile navigation panel
   IMPORTANT: this panel must be placed as a direct child of <body>, OUTSIDE
   the <header> element, in every page's HTML. A backdrop-filter or sticky
   positioning context on .site-header will trap a fixed-position child and
   break the slide-in on mobile. Use the right:-100% / right:0 slide pattern,
   never display:none <-> block for the open state (that breaks the transition
   and has caused base-class-blocks-open bugs before).
   -------------------------------------------------------------------------- */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(86vw, 380px);
  height: 100%;
  background: var(--color-white);
  box-shadow: var(--shadow-lift);
  z-index: 100;
  overflow-y: auto;
  padding: var(--space-md);
  transition: right var(--duration) var(--ease);
}
.mobile-nav.is-open { right: 0; }

.mobile-nav__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  color: var(--color-ink);
}

.mobile-nav__list { list-style: none; margin: var(--space-sm) 0 0 0; padding: 0; }
.mobile-nav__list li { border-bottom: 1px solid var(--color-border); }
.mobile-nav__list a { display: block; padding: 14px 4px; font-weight: 600; color: var(--color-ink); }
.mobile-nav__list a:hover { color: var(--color-primary); text-decoration: none; }

.mobile-nav__section-label {
  font-size: 0.8rem;
  text-transform: none;
  font-weight: 700;
  color: var(--color-primary);
  margin: var(--space-md) 0 4px 0;
}

.mobile-nav__scrim {
  position: fixed;
  inset: 0;
  background: rgba(43, 42, 40, 0.45);
  z-index: 90;
  display: none;
}
.mobile-nav__scrim.is-open { display: block; }

@media (max-width: 880px) {
  .primary-nav { display: none; }
  .nav-toggle { display: inline-flex; order: 3; }
  .site-header__bar { flex-wrap: nowrap; gap: var(--space-xs); }
  .site-header__logo img { height: 36px; }
  .site-header__cta { gap: 6px; }
  .site-header__cta .btn--primary { display: none; } /* CTA lives in the mobile nav panel instead */
}

@media (max-width: 460px) {
  .site-header__phone { font-size: 0.85rem; }
}

/* --------------------------------------------------------------------------
   Hero -- full-bleed photo with a solid-blue semi-circle panel bulging in
   from the left, carrying the headline
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero__panel {
  position: relative;
  z-index: 2;
  width: min(52%, 640px);
  height: 100%;
  min-height: 640px;
  background: var(--color-primary);
  border-radius: 0 50% 50% 0 / 0 42% 42% 0;
  display: flex;
  align-items: center;
  padding: var(--space-2xl) var(--space-xl) var(--space-2xl) var(--container-pad);
  color: var(--color-white);
}
.hero__panel-inner { max-width: 380px; }
.hero__eyebrow {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}
.hero h1 { color: var(--color-white); margin-bottom: var(--space-sm); }
.hero__lede { font-size: 1.15rem; color: rgba(255,255,255,0.9); margin-bottom: var(--space-md); }
.hero__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

@media (max-width: 900px) {
  .hero { min-height: 700px; align-items: stretch; }
  .hero__panel {
    width: 88%;
    max-width: none;
    border-radius: 0 90px 90px 0 / 0 60px 60px 0;
    padding: var(--space-xl) var(--space-lg) var(--space-xl) var(--container-pad);
    min-height: 100%;
  }
  .hero__panel-inner { max-width: 100%; }
}



/* --------------------------------------------------------------------------
   Trust strip
   -------------------------------------------------------------------------- */
.trust-strip {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md) 0;
}
.trust-strip__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  text-align: center;
}
.trust-strip__item strong {
  display: block;
  font-size: 1.4rem;
  color: var(--color-primary);
}
.trust-strip__item span {
  color: var(--color-ink-soft);
  font-size: 0.95rem;
}
@media (max-width: 700px) {
  .trust-strip__grid { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------------------------
   Cards -- services, case studies, testimonials
   -------------------------------------------------------------------------- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-soft);
}

.service-card h3 a { color: var(--color-ink); }
.service-card h3 a:hover { color: var(--color-primary); }
.service-card p { margin-bottom: 0; }

/* Styled service card -- photo top, italic category-style name, description, button */
.service-tile {
  background: var(--color-white);
}
.service-tile__media {
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  margin-bottom: var(--space-sm);
  background: var(--color-primary-tint);
}
.service-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.service-tile__media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-md);
}
.service-tile__media--placeholder span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  opacity: 0.7;
}

/* Alternating arch rhythm on desktop rows of 3: outer tiles arch outward,
   middle tile stays square -- matches the reference layout. Collapses back
   to a uniform arch below the 3-column breakpoint since the row grouping
   no longer applies. */
@media (min-width: 901px) {
  #services .grid--3 .service-tile:nth-child(3n+1) .service-tile__media,
  #services .grid--3 .service-tile:nth-child(3n+1) .service-tile__media--placeholder {
    border-radius: 160px 0 0 0;
  }
  #services .grid--3 .service-tile:nth-child(3n+2) .service-tile__media,
  #services .grid--3 .service-tile:nth-child(3n+2) .service-tile__media--placeholder {
    border-radius: 0;
  }
  #services .grid--3 .service-tile:nth-child(3n) .service-tile__media,
  #services .grid--3 .service-tile:nth-child(3n) .service-tile__media--placeholder {
    border-radius: 0 160px 0 0;
  }
}
.service-tile__name {
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-accent-dark);
  margin: 0 0 6px 0;
}
.service-tile__name a { color: inherit; }
.service-tile__name a:hover { text-decoration: none; color: var(--color-primary); }
.service-tile p {
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
}
.service-tile .btn--tile {
  display: inline-block;
  background: var(--color-accent-dark);
  color: var(--color-white);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
}
.service-tile .btn--tile:hover { background: var(--color-primary); text-decoration: none; }

.section-heading { margin-bottom: var(--space-lg); }
.section-heading__kicker {
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--color-ink-soft);
  margin-bottom: 2px;
}
.section-heading h2 {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.testimonial-card {
  background: var(--color-neutral);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.testimonial-card p { font-size: 1.05rem; color: var(--color-ink); margin-bottom: var(--space-sm); }
.testimonial-card cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  color: var(--color-primary);
}

.case-study-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
  background: var(--color-neutral);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
@media (max-width: 900px) {
  .case-study-preview { grid-template-columns: 1fr; }
}
.case-study-preview img { border-radius: var(--radius-md); }

/* --------------------------------------------------------------------------
   Process steps
   -------------------------------------------------------------------------- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}
.process-step { text-align: left; }
.process-step__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

/* --------------------------------------------------------------------------
   FAQ (details/summary)
   -------------------------------------------------------------------------- */
.faq-list { max-width: 760px; }
.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--color-primary);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: var(--space-sm); color: var(--color-ink-soft); }

.faq-category { margin-bottom: var(--space-lg); }
.faq-category h3 { color: var(--color-primary); }

/* --------------------------------------------------------------------------
   CTA section
   -------------------------------------------------------------------------- */
.cta-section {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
}
.cta-section h2 { color: var(--color-white); }
.cta-section p { color: rgba(255,255,255,0.9); margin: 0 auto var(--space-md); }

.form-placeholder {
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  color: var(--color-white);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Generic form styling (contact page, embedded forms)
   -------------------------------------------------------------------------- */
.form-field { margin-bottom: var(--space-sm); text-align: left; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 1rem;
  background: var(--color-white);
  color: var(--color-ink);
}
.form-field textarea { min-height: 120px; resize: vertical; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-ink);
  color: rgba(255,255,255,0.85);
  padding: var(--space-xl) 0 var(--space-md);
}
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: var(--color-accent); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.footer-col h4 { color: var(--color-white); margin-bottom: var(--space-sm); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 6px; }

.footer-nap p { margin-bottom: 6px; }
.footer-tagline { color: rgba(255,255,255,0.65); margin-top: 4px; }

.footer-map {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}
.footer-map iframe { width: 100%; height: 220px; border: 0; display: block; }

.footer-legal {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: var(--space-sm);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}
.footer-legal ul { list-style: none; display: flex; gap: var(--space-sm); margin: 0; padding: 0; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; }
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
