/* ==========================================================================
   Dersu Paints — stylesheet
   Palette: navy (#1b2a4a), cream (#f7f2e6), burnt orange (#c85010).
   Chosen so every text/background pairing below clears WCAG AA contrast —
   see README "Accessibility notes" for the worked contrast ratios.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&display=swap");

:root {
  --cream: #f7f2e6;
  --paper: #fffaf1;
  --ink: #201d18;
  --ink-soft: #4a453c;
  --navy: #1b2a4a;
  --navy-deep: #16223c;
  --orange: #c85010;
  --orange-deep: #a5410c;
  --line: #ddd0b1;
  --line-on-navy: rgba(247, 242, 230, 0.22);

  --font-display: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --font-body: "Work Sans", "Segoe UI", system-ui, sans-serif;

  --radius-lg: 1.25rem;
  --radius-md: 0.75rem;
  --content-width: 72rem;

  --shadow-soft: 0 1.25rem 2.5rem -1.5rem rgba(27, 42, 74, 0.35);
  --shadow-lift: 0 1.5rem 3rem -1.25rem rgba(27, 42, 74, 0.45);

  --transition-fast: 160ms ease;
  --transition-med: 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.6em;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.4rem, 4.8vw, 3.75rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1em;
  max-width: 62ch;
}

a {
  color: var(--navy);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--orange-deep);
}

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

button {
  font-family: inherit;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-deep);
  margin-bottom: 0.75rem;
}

.container {
  width: min(100% - 2.5rem, var(--content-width));
  margin-inline: auto;
}

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

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--navy);
  color: var(--cream);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  z-index: 100;
  transition: top var(--transition-fast);
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast);
}

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

.btn-primary {
  background: var(--orange);
  color: var(--cream);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  background: var(--orange-deep);
  color: var(--cream);
}

.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: var(--navy);
}

.btn-ghost:hover {
  background: var(--navy);
  color: var(--cream);
}

.btn-on-navy.btn-ghost {
  color: var(--cream);
}

.btn-on-navy.btn-ghost:hover {
  background: var(--cream);
  color: var(--navy);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: var(--cream);
  border-bottom: 1px solid var(--line-on-navy);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
}

.brand:hover {
  color: var(--cream);
}

.brand img {
  /* The real logo icon (roofline + windows) has finer detail than the old
     abstract mark and reads as a blur/blob at small sizes. 36px, then
     44px, both still read as "tiny" — sized up more decisively. */
  width: 3.25rem;
  height: 3.25rem;
}

.brand-name {
  white-space: nowrap;
}

.brand-tagline {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9b98a;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 2px solid var(--line-on-navy);
  color: var(--cream);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.9rem;
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--cream);
  font-weight: 500;
  text-decoration: none;
  padding: 0.35rem 0.1rem;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  border-bottom-color: var(--orange);
  color: var(--cream);
}

.nav-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nav-phone:hover,
.nav-phone:focus-visible {
  color: var(--orange);
}

.nav-phone svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

@media (max-width: 61.9375rem) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--navy);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line-on-navy);
  }

  .main-nav[hidden] {
    display: none;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.25rem;
  }

  .nav-links a {
    padding: 0.6rem 0.2rem;
    display: block;
  }

  .nav-phone {
    justify-content: center;
    padding: 0.6rem 0.2rem;
    border-top: 1px solid var(--line-on-navy);
    margin-top: 0.5rem;
  }

  .main-nav .btn {
    margin-top: 0.75rem;
    width: 100%;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  /* Solid navy for the section's full height — not a two-tone gradient.
     That gradient used to hard-code a color split partway down the
     section (e.g. "62% navy, then cream"), on the assumption that
     specific content (the ghost button, trust checkmarks, art caption)
     would always land above or below that line. It didn't hold: wrapped
     buttons, taller mobile content, etc. pushed "navy-context" light-on-
     navy text onto the cream part of the gradient (and vice versa),
     making it render as light-on-light or dark-on-dark — invisible. A
     solid background removes the assumption entirely. */
  background: var(--navy);
  color: var(--cream);
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 61.9375rem) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-copy p.lede {
    margin-inline: auto;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-art {
    max-width: 22rem;
    margin-inline: auto;
  }

  .hero-trust {
    justify-content: center;
    text-align: left;
  }
}

.hero-copy p.lede {
  font-size: 1.2rem;
  color: #e7ddc4;
  max-width: 44ch;
}

.hero h1 {
  color: var(--cream);
}

.hero h1 em {
  color: var(--orange);
  font-style: normal;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-on-navy);
  list-style: none;
}

.hero-trust li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #e7ddc4;
}

.hero-trust svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: var(--orange);
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
}

.hero-art .stroke-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 0.6rem;
  width: 100%;
  transform: rotate(-3deg);
}

.hero-art .stroke-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top center;
  border-radius: calc(var(--radius-lg) - 0.35rem);
}

.hero-art figcaption {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-style: italic;
  color: #e7ddc4;
  text-align: center;
  transform: rotate(-3deg);
}

/* ---------- Reveal-on-scroll (progressive enhancement) ---------- */
.has-js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 640ms ease,
    transform 640ms ease;
}

.has-js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Section rhythm ---------- */
section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

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

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med);
}

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

.service-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  background: var(--navy);
  color: var(--orange);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.service-icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

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

.service-card p {
  color: var(--ink-soft);
  margin-bottom: 0;
  max-width: none;
}

/* ---------- Why band ---------- */
.why {
  background: var(--navy);
  color: var(--cream);
}

.why .section-eyebrow {
  color: #f0b184;
}

.why h2 {
  color: var(--cream);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem 2.5rem;
}

.why-item {
  display: flex;
  gap: 1rem;
}

.why-item svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--orange);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.why-item h3 {
  color: var(--cream);
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
}

.why-item p {
  color: #d9cfb2;
  margin-bottom: 0;
}

/* ---------- Process ---------- */
.process-list {
  /* A centered flex-wrap, not a grid: with 5 steps, a grid's auto-fit
     columns leave a trailing item wrapped alone and left-aligned under
     column 1, with dead space to its right for the rest of the row.
     Centering the wrap keeps a lone last row balanced regardless of the
     step count or viewport width. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem clamp(1.5rem, 4vw, 2.5rem);
  counter-reset: step;
}

.process-step {
  position: relative;
  padding-top: 3.25rem;
  flex: 1 1 12.5rem;
  max-width: 16rem;
}

.process-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--orange);
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
}

.process-step h3 {
  margin-bottom: 0.35rem;
}

.process-step p {
  color: var(--ink-soft);
}

/* ---------- Service area ---------- */
.area-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 61.9375rem) {
  .area-layout {
    grid-template-columns: 1fr;
  }
}

.area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.area-chips li {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
}

.area-note {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- FAQ ---------- */
.faq-list {
  display: grid;
  gap: 1rem;
  max-width: 48rem;
}

.faq-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.25rem 1.25rem;
}

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--navy);
  padding: 1.1rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--orange);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  color: var(--ink-soft);
  padding-bottom: 1.1rem;
  margin: 0;
  max-width: none;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--navy);
  color: var(--cream);
}

.contact .section-eyebrow {
  color: #f0b184;
}

.contact h2 {
  color: var(--cream);
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 61.9375rem) {
  .contact-layout {
    /* Without this, the form was squeezed into a ~183px-wide column at
       phone widths (confirmed by measuring it directly) instead of
       stacking — narrow enough that the submit button's own text
       overflowed past both its column AND the page edge. */
    grid-template-columns: 1fr;
  }
}

.contact-info p {
  color: #d9cfb2;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.contact-detail svg {
  width: 1.4rem;
  height: 1.4rem;
  color: var(--orange);
  flex-shrink: 0;
}

.contact-detail a {
  color: var(--cream);
  font-weight: 600;
  font-size: 1.1rem;
}

.contact-form {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-lift);
  color: var(--ink);
}

.form-row {
  display: grid;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

.form-row.two-up {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 34rem) {
  .form-row.two-up {
    grid-template-columns: 1fr;
  }
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--navy);
}

.form-field .optional {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 1px;
  border-color: var(--orange);
}

.form-field textarea {
  resize: vertical;
  min-height: 8rem;
}

.field-error {
  color: #a5410c;
  font-size: 0.88rem;
  margin-top: 0.35rem;
  font-weight: 600;
}

.form-field[data-invalid="true"] input,
.form-field[data-invalid="true"] textarea {
  border-color: #a5410c;
}

/* Honeypot: visually hidden and off the tab order for real users, but still
   present in the DOM/markup for bots that fill in every field blindly. */
.honeypot-field {
  /* Same clip-based technique as .visually-hidden below — NOT `left:
     -9999px`. That trick pushes real layout box 9999px off-screen, which
     inflates the document's scrollable area and made the whole page
     horizontally scrollable on mobile (confirmed via a real overflow
     audit: document.documentElement.scrollWidth was 121px wider than the
     viewport, entirely attributable to this element). This technique
     keeps the element at its normal position, just clipped to 1x1px. */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Belt-and-suspenders on top of the wrapper above: a bare <input> defaults
   to an intrinsic width (~185px in Chromium) that turned out to still
   count toward the document's scrollable width even inside a clipped
   1x1px, `overflow: hidden` ancestor — confirmed by measuring
   getBoundingClientRect() directly, not just assumed. Clipping paint
   isn't the same as constraining layout size; this constrains the input
   (and its label) directly instead of relying on the ancestor alone. */
.honeypot-field input,
.honeypot-field label {
  /* `width`/`height` have no effect on a plain `display: inline` element
     per spec — <label> is inline by default, so it silently ignored a
     1px constraint and kept contributing its full text width (~189px) to
     the page's scrollable area. display: block makes a size constraint
     actually apply — and zero (not 1px) because even at 1px, the <input>
     specifically still contributed some residual width to
     document.documentElement.scrollWidth (measured directly), most
     likely its native minimum control size. Zero plus overflow: hidden
     leaves no box for that minimum size to apply to. */
  display: block;
  width: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
}

.cf-turnstile {
  /* Turnstile's default "normal" widget has a fixed native width (~300px)
     that doesn't shrink for narrow viewports on its own — confirmed by
     directly removing the widget and re-measuring: it was single-handedly
     responsible for ~109px of the page's horizontal mobile overflow
     (worse: once ANYTHING forces the layout viewport wider than the
     device width, every other percentage/vw-based measurement on the
     page — even unrelated ones — starts computing against that wider
     viewport too, which is why a misaligned-looking button elsewhere
     turned out to have the exact same root cause). `data-size="flexible"`
     on the widget element (see index.html) is the real fix; this is a
     belt-and-suspenders cap in case that ever fails to apply.
  */
  max-width: 100%;
  overflow: hidden;
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.form-status {
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.5rem 0;
}

.form-status[data-state="success"] {
  color: #2c6e3f;
}

.form-status[data-state="error"] {
  color: #a5410c;
}

.consent-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  max-width: none;
}

/* .consent-note is reused in two different background contexts: inside
   .contact-form (paper/white — the default styling above is correct
   there) and inside .contact-info (navy). The default dark ink-soft text
   and default navy link color are both nearly invisible on navy — the
   link specifically was indistinguishable from its surroundings until
   hovered. Scope a light-on-navy override to the navy context only. */
.contact-info .consent-note {
  color: #d9cfb2;
}

.contact-info .consent-note a {
  color: var(--cream);
}

.contact-info .consent-note a:hover {
  color: var(--orange);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: #b9c2d6;
  padding-block: 2.5rem;
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.site-footer a {
  color: #d9cfb2;
}

.back-to-top {
  color: #d9cfb2;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
