/* ============================================================
   JSM Painting and Construction — styles.css
   Palette
     Primer White  #FAF9F6   page ground
     Ink           #1C1D21   text / dark section
     Tape Blue     #2278BF   single working accent
     Harbor Navy   #2E3D4F   chip / exterior card
     South Shore Sage #7D8C6E, Cedar #8A5A3B, Front Door Red #A63A2B
   Type
     Display: Bricolage Grotesque · Body: Archivo · Utility: IBM Plex Mono
   ============================================================ */

:root {
  --primer: #FAF9F6;
  --ink: #1C1D21;
  --ink-soft: #4A4C55;
  --tape: #2278BF;
  --tape-dark: #1A5E96;
  --navy: #2E3D4F;
  --line: #E3E0D8;
  --card: #FFFFFF;
  --radius: 10px;
  --font-display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--primer);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 800; max-width: 22ch; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { max-width: 58ch; }

a { color: var(--tape); }

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

/* ---------- painter's tape label ---------- */
.tape {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--tape);
  padding: 0.45em 1.2em;
  margin-bottom: 1.25rem;
  transform: rotate(-1.2deg);
  clip-path: polygon(1.5% 8%, 100% 0%, 98.5% 94%, 0% 100%);
  box-shadow: 0 1px 3px rgba(28, 29, 33, 0.18);
}

.section-ink .tape { background: #fff; color: var(--tape-dark); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  border: 2px solid var(--tape);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.btn-solid { background: var(--tape); color: #fff; }
.btn-solid:hover { background: var(--tape-dark); border-color: var(--tape-dark); }

.btn-line { background: transparent; color: var(--tape); }
.btn-line:hover { background: rgba(34, 120, 191, 0.08); }

.btn:active { transform: translateY(1px); }

.btn-wide { width: 100%; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.85rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-chip {
  width: 1.05em;
  height: 1.05em;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--tape) 0 50%, #A63A2B 50% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.wordmark-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  align-self: flex-end;
  padding-bottom: 0.3em;
}

.topnav { display: flex; gap: 1.6rem; margin-left: auto; }

.topnav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}

.topnav a:hover { color: var(--tape); }

.topbar-cta { padding: 0.55em 1.2em; font-size: 0.92rem; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1.25rem, 4vw, 3rem) clamp(4rem, 9vw, 7rem);
  max-width: 1200px;
  margin: 0 auto;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 1.4rem 0 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-note {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

/* ---------- fan deck ---------- */
.deck {
  position: relative;
  height: clamp(280px, 34vw, 380px);
  display: flex;
  justify-content: center;
}

.chip-card {
  position: absolute;
  bottom: 0;
  width: clamp(120px, 13vw, 158px);
  height: clamp(210px, 24vw, 270px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 29, 33, 0.14);
  padding: 8px;
  display: flex;
  flex-direction: column;
  transform-origin: 50% 165%;
  transform: rotate(var(--r));
  animation: fanout 0.7s cubic-bezier(0.22, 1, 0.36, 1) var(--d) backwards;
}

/* fan-deck rivet hole, punched through the color block */
.chip-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 7px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--primer);
  box-shadow: inset 0 1px 2px rgba(28, 29, 33, 0.35);
}

.chip-color {
  flex: 1;
  border-radius: 5px;
  border: 1px solid rgba(28, 29, 33, 0.08);
}

.chip-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.12;
  margin: 2px 4px 0;
  max-width: 82px; /* wraps names to two lines so they clear the next card in the fan */
}

/* "Primer White" just fits one line at 82px — force the wrap so its tail isn't covered */
.chip-card:first-child .chip-name { max-width: 60px; }

.chip-code {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin: 2px 4px 8px;
}

@keyframes fanout {
  from { transform: rotate(0deg) translateY(14px); opacity: 0; }
  to   { transform: rotate(var(--r)) translateY(0); opacity: 1; }
}

/* ---------- sections ---------- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem);
}

.section > h2 { margin-bottom: 2.25rem; }

.section-ink {
  max-width: none;
  background: var(--ink);
  color: var(--primer);
}

.section-ink .wrap {
  max-width: 1104px; /* 1200 − section side padding at max width */
  margin: 0 auto;
}

.section-ink h2 { margin-bottom: 2.25rem; }

/* ---------- services ---------- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}

.svc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.svc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(28, 29, 33, 0.1);
}

.svc-chip {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 72px;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid rgba(28, 29, 33, 0.08);
}

.svc-chip .on-dark { color: rgba(255, 255, 255, 0.92); }

.svc-card h3 { padding: 1.1rem 1.1rem 0.35rem; }

.svc-card p {
  padding: 0 1.1rem 1.3rem;
  font-size: 0.97rem;
  color: var(--ink-soft);
}

/* ---------- process ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem;
}

.steps li {
  counter-increment: step;
  border-top: 3px solid var(--tape);
  padding-top: 1.1rem;
}

.steps li::before {
  content: "Step " counter(step);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9BC4E4;
  margin-bottom: 0.5rem;
}

.steps h3 { color: #fff; margin-bottom: 0.45rem; }

.steps p { font-size: 0.97rem; color: #C6C8CE; }

/* ---------- gallery ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.4rem;
}

.work-grid figure {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(28, 29, 33, 0.06);
}

.work-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.work-grid figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 3px solid var(--tape);
}

/* ---------- service area ---------- */
.towns {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  max-width: 720px;
}

.towns li {
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.towns li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--tape);
  margin-right: 0.6rem;
}

.towns-note {
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- contact ---------- */
.section-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.contact-copy p { color: var(--ink-soft); margin-bottom: 1.75rem; }

.contact-list { list-style: none; display: grid; gap: 0.7rem; }

.contact-list strong {
  display: inline-block;
  min-width: 5.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.contact-list a { color: var(--ink); font-weight: 600; text-decoration-color: var(--tape); }

.contact-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  display: grid;
  gap: 1.1rem;
  box-shadow: 0 10px 30px rgba(28, 29, 33, 0.07);
}

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

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  background: var(--primer);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--tape);
  box-shadow: 0 0 0 3px rgba(34, 120, 191, 0.18);
}

.contact-form textarea { resize: vertical; }

.form-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  font-family: var(--font-body);
}

.hidden-field { display: none; }

/* ---------- footer ---------- */
.footer {
  background: var(--navy);
  color: #D8DCE1;
  text-align: center;
  padding: 2.5rem 1.25rem;
  font-size: 0.95rem;
}

.footer strong { color: #fff; }

.footer p + p { margin-top: 0.4rem; }

.footer-fine { font-size: 0.8rem; color: #99A3AE; margin-top: 1rem; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chip-card { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .svc-card { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .deck { height: clamp(240px, 52vw, 320px); margin-top: 1rem; }
  .chip-card { width: clamp(104px, 22vw, 140px); height: clamp(180px, 38vw, 240px); }
  .section-contact { grid-template-columns: 1fr; }
  .topnav { display: none; }
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .wordmark-sub { display: none; }
}
