/* === defensive base — injected by harden_css.py; do not hand-edit === */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: calc(var(--nav-h, 72px) + 1rem); }
img, svg, video, iframe, canvas, table { display: block; max-width: 100%; }
p, li, h1, h2, h3, h4, blockquote, td, dd, dt { overflow-wrap: anywhere; }
/* === end defensive base === */

/* Fonts are loaded via <link> in each page's <head>. */

/* ===========================================================
   J&M Services — Halethorpe / Baltimore home improvement
   Brand purple is theirs: sampled from their own yard sign and
   business card ("J & M Services" wordmark, violet on white).
   Paired with iron and a warm paper neutral.
   =========================================================== */

:root {
  --iron:        #16151c;
  --iron-2:      #1f1d27;
  --iron-3:      #2b2836;
  --brand:       #4a32b8;
  --brand-lit:   #6b52dd;
  --brand-deep:  #35228c;
  --mortar:      #f3f1ed;
  --mortar-2:    #e5e2db;
  --slate:       #6b6874;
  --slate-lite:  #9b97a6;
  --ink:         #1a1922;

  --nav-h: 74px;
  --wrap: 1200px;
  --r: 3px;

  --ff-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --ff-body: 'Barlow', system-ui, sans-serif;

  /* subtle film grain for the dark bands */
  --grain: 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='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--mortar);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 800;
  line-height: .94;
  letter-spacing: .005em;
  text-transform: uppercase;
  margin: 0;
}

p { margin: 0; }
a { color: inherit; }
img { display: block; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- eyebrow / section headings ---------- */

.eyebrow {
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--brand);
  flex: none;
}
.on-dark .eyebrow { color: #a493ef; }
.on-dark .eyebrow::before { background: #a493ef; }

.section { padding: clamp(3.75rem, 8vw, 7rem) 0; }

.section-head { max-width: 720px; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head h2 {
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  margin-top: .7rem;
}
.section-head p {
  margin-top: 1rem;
  color: var(--slate);
  font-size: 1.05rem;
  max-width: 58ch;
}
.on-dark .section-head p { color: var(--slate-lite); }

.on-dark { background: var(--iron); color: var(--mortar); position: relative; }
.on-dark::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--grain);
  opacity: .045; pointer-events: none; mix-blend-mode: overlay;
}
.on-dark > * { position: relative; z-index: 1; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .95rem 1.55rem;
  border-radius: var(--r);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-lit); }

.btn-iron { background: var(--iron); color: var(--mortar); }
.btn-iron:hover { background: var(--iron-3); }

.btn-ghost {
  background: transparent;
  border-color: rgba(27,26,30,.28);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(27,26,30,.04); }

.on-dark .btn-ghost,
.hero .btn-ghost,
.page-head .btn-ghost,
.btn-ghost-light {
  background: transparent;
  border-color: rgba(243,239,231,.32);
  color: var(--mortar);
}
.on-dark .btn-ghost:hover,
.hero .btn-ghost:hover,
.page-head .btn-ghost:hover,
.btn-ghost-light:hover { border-color: var(--mortar); background: rgba(243,239,231,.07); }

.btn-lg { padding: 1.1rem 1.9rem; font-size: .9rem; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  background: rgba(22,21,28,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(243,239,231,.1);
  color: var(--mortar);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--mortar);
  margin-right: auto;
  flex: none;
}
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -.02em;
  border-radius: var(--r);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: .02em;
}
.brand-sub {
  font-size: .58rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--slate-lite);
  margin-top: .22rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(243,239,231,.82);
  transition: color .18s ease;
}
.nav-links a:hover { color: #fff; }

.nav-cta { flex: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(243,239,231,.3);
  border-radius: var(--r);
  width: 42px; height: 42px;
  color: var(--mortar);
  cursor: pointer;
  padding: 0;
  place-items: center;
  flex: none;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 17px; height: 2px;
  background: currentColor;
  transition: transform .22s ease, opacity .22s ease;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before { position: absolute; top: -5.5px; }
.nav-toggle span::after  { position: absolute; top:  5.5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- hero ---------- */

.hero {
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  background: var(--iron);
  color: var(--mortar);
  container-type: inline-size;
  position: relative;
  overflow-x: clip;
  padding-block: clamp(1.5rem, 4cqi, 3rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(105% 78% at 12% 0%, rgba(74,50,184,.42) 0%, transparent 58%),
    radial-gradient(70% 60% at 100% 100%, rgba(107,82,221,.20) 0%, transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--grain);
  opacity: .05; pointer-events: none; mix-blend-mode: overlay;
}
.hero > .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(2rem, 5cqi, 4.5rem);
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(.8rem, 1.9cqi, 1.5rem);
  align-items: flex-start;
}

.hero h1 {
  font-size: clamp(2.65rem, 8.4cqi, 5.5rem);
  line-height: .9;
  max-width: 15ch;
}
.hero h1 .accent { color: var(--brand-lit); }

.hero-sub {
  font-size: clamp(1rem, 1.55cqi, 1.16rem);
  color: rgba(243,239,231,.76);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: clamp(.15rem, .6cqi, .5rem);
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .95rem;
  margin-top: clamp(.3rem, 1cqi, .9rem);
  padding-top: clamp(.7rem, 1.6cqi, 1.2rem);
  border-top: 1px solid rgba(243,239,231,.16);
  width: 100%;
}
.hero-proof span {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: rgba(243,239,231,.72);
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
/* Leading dot on every item, so a wrapped line never starts with an
   orphaned separator. */
.hero-proof span::before {
  content: "";
  width: 4px; height: 4px;
  background: var(--brand-lit);
  border-radius: 50%;
  flex: none;
}

.hero-figure {
  /* margin:0 is load-bearing — the UA default `figure { margin: 1em 40px }`
     makes the margin box wider than its grid track, and justify-self aligns
     the MARGIN box, shoving the image 40px left into the copy column. */
  margin: 0;
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 400px;
}
.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 1px solid rgba(243,239,231,.14);
}
.hero-figure figcaption {
  position: absolute;
  left: -14px; bottom: 18px;
  background: var(--brand);
  color: #fff;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: .5rem .85rem;
  border-radius: var(--r);
}

/* ---------- services ---------- */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--mortar-2);
  border: 1px solid var(--mortar-2);
  border-radius: var(--r);
  overflow: hidden;
}
.svc {
  background: var(--mortar);
  padding: clamp(1.6rem, 3vw, 2.3rem);
  display: flex;
  flex-direction: column;
  gap: .85rem;
  transition: background-color .22s ease;
}
.svc:hover { background: #fff; }
.svc-num {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--brand);
  letter-spacing: .12em;
}
.svc h3 { font-size: 1.7rem; }
.svc p { color: var(--slate); font-size: .97rem; }
.svc ul {
  list-style: none;
  margin: .2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.svc li {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--slate);
  background: var(--mortar-2);
  border-radius: 2px;
  padding: .28rem .6rem;
}

.svc-note {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: clamp(1.35rem, 3vw, 1.9rem);
  background: var(--iron);
  color: var(--mortar);
  border-radius: var(--r);
}
.svc-note p { font-size: 1.02rem; max-width: 60ch; }
.svc-note strong { color: #fff; }

/* ---------- values / how we work ---------- */

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.75rem);
}
.value h3 {
  font-size: 1.35rem;
  margin-bottom: .6rem;
  color: var(--mortar);
}
.value p { color: var(--slate-lite); font-size: .98rem; }
.value-rule {
  width: 34px; height: 3px;
  background: var(--brand-lit);
  margin-bottom: 1.1rem;
}

/* ---------- gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 1000px) {
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.shot {
  margin: 0;
  position: relative;
  aspect-ratio: 443 / 590;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--mortar-2);
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.shot:hover img { transform: scale(1.04); }
.shot figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.6rem .85rem .8rem;
  background: linear-gradient(to top, rgba(23,22,26,.9), transparent);
  color: var(--mortar);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
}

/* ---------- jobs / recent work detail ---------- */

.jobs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
.job {
  background: var(--mortar);
  border: 1px solid var(--mortar-2);
  border-left: 3px solid var(--brand);
  border-radius: var(--r);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.job h3 { font-size: 1.45rem; margin-bottom: .7rem; }
.job p { color: var(--slate); font-size: .97rem; }

/* ---------- visit / contact strip ---------- */

.visit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(1.75rem, 4vw, 3.25rem);
}
.visit-block h3 {
  font-size: 1.25rem;
  margin-bottom: .9rem;
  color: var(--mortar);
}
.visit-block p, .visit-block a {
  color: var(--slate-lite);
  font-size: 1rem;
  text-decoration: none;
  display: block;
}
.visit-block a:hover { color: var(--mortar); }
.phone-link {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.75rem !important;
  color: var(--mortar) !important;
  letter-spacing: .01em;
  margin-bottom: .3rem;
}
.phone-link:hover { color: var(--brand-lit) !important; }

/* ---------- cta band ---------- */

.cta-band {
  background: var(--brand);
  color: #fff;
  padding: clamp(3.25rem, 7vw, 5.5rem) 0;
  position: relative;
  overflow-x: clip;
}
.cta-band::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--grain);
  opacity: .06; pointer-events: none; mix-blend-mode: overlay;
}
.cta-inner { position: relative; z-index: 1; text-align: center; }
.cta-inner h2 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  max-width: 20ch;
  margin-inline: auto;
}
.cta-inner p {
  margin: 1.1rem auto 0;
  max-width: 52ch;
  color: rgba(255,255,255,.88);
  font-size: 1.06rem;
}
.cta-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
}
.cta-band .btn-ghost-light { border-color: rgba(255,255,255,.55); color: #fff; }
.cta-band .btn-ghost-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ---------- footer ---------- */

.footer {
  background: var(--iron);
  color: var(--slate-lite);
  padding: clamp(2.75rem, 5vw, 4rem) 0 2rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(243,239,231,.12);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  list-style: none;
  margin: 0; padding: 0;
}
.footer-links a {
  text-decoration: none;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.footer-links a:hover { color: var(--mortar); }
.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  justify-content: space-between;
  font-size: .82rem;
}

/* ---------- contact page ---------- */

.page-head {
  background: var(--iron);
  color: var(--mortar);
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  position: relative;
  overflow-x: clip;
}
.page-head::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(90% 75% at 8% 0%, rgba(74,50,184,.40) 0%, transparent 60%);
  pointer-events: none;
}
.page-head > .wrap { position: relative; z-index: 1; }
.page-head h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  margin-top: .8rem;
  max-width: 18ch;
}
.page-head p {
  margin-top: 1.1rem;
  color: rgba(243,239,231,.76);
  max-width: 54ch;
  font-size: 1.06rem;
}

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

.form-card {
  background: #fff;
  border: 1px solid var(--mortar-2);
  border-radius: var(--r);
  padding: clamp(1.6rem, 3.5vw, 2.6rem);
}
.form-card h2 { font-size: 1.85rem; margin-bottom: .5rem; }
.form-card > p { color: var(--slate); margin-bottom: 1.75rem; font-size: .98rem; }

.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: .45rem;
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--ff-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--mortar);
  border: 1px solid var(--mortar-2);
  border-radius: var(--r);
  padding: .8rem .9rem;
  transition: border-color .18s ease, background-color .18s ease;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.field input::placeholder,
.field textarea::placeholder { color: #a8a4ad; }

#estimate-form .btn { width: 100%; }
#estimate-form .btn[disabled] {
  background: var(--iron);
  color: var(--mortar);
  cursor: default;
  opacity: 1;
}

.form-status {
  margin-top: 1.1rem;
  padding: .95rem 1.1rem;
  border-radius: var(--r);
  font-size: .97rem;
  font-weight: 500;
  border-left: 3px solid var(--brand);
  background: var(--mortar);
  color: var(--ink);
}
.form-status.is-ok { border-left-color: #2f7d4f; }
.form-status.is-err { border-left-color: var(--brand); }

.form-fine {
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--slate);
}

.contact-aside { display: flex; flex-direction: column; gap: 1.75rem; }
.aside-block {
  border-top: 2px solid var(--ink);
  padding-top: 1.1rem;
}
.aside-block h3 {
  font-size: 1.3rem;
  margin-bottom: .7rem;
}
.aside-block p { color: var(--slate); font-size: .98rem; }
.aside-block a { color: var(--ink); font-weight: 600; text-decoration: none; }
.aside-block a:hover { color: var(--brand); }
.aside-phone {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.9rem;
  display: block;
  line-height: 1.15;
  letter-spacing: .01em;
}

/* ---------- scroll reveal (below the fold only) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .75s ease, transform .75s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .contact-grid { grid-template-columns: 1fr; }
  /* Keep the photo beside the copy on tablet, but smaller so the
     whole hero still clears the fold. */
  .hero-figure { max-width: 290px; }
  .hero-grid { gap: clamp(1.25rem, 3cqi, 2rem); }
}

@media (max-width: 700px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { display: none; }
}

@media (max-width: 900px) {
  :root { --nav-h: 66px; }

  .nav-toggle { display: grid; }
  .nav-cta { display: none; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--iron-2);
    border-bottom: 1px solid rgba(243,239,231,.12);
    padding: .5rem 0 1.1rem;
    max-height: calc(100svh - var(--nav-h));
    overflow-y: auto;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { padding: 0 clamp(1.15rem, 4vw, 2.5rem); }
  .nav-links a {
    display: block;
    padding: .85rem 0;
    border-bottom: 1px solid rgba(243,239,231,.08);
    font-size: .9rem;
  }
  .nav-links .nav-mobile-cta { padding-top: 1rem; }
  .nav-links .nav-mobile-cta a {
    border-bottom: 0;
    background: var(--brand);
    color: #fff;
    text-align: center;
    border-radius: var(--r);
    padding: .95rem 1rem;
  }

  .footer-top { flex-direction: column; }
}

@media (min-width: 901px) {
  .nav-links .nav-mobile-cta { display: none; }
}

/* Cloudflare Turnstile widget (injected by ensure_turnstile.py) */
.turnstile-box { margin-bottom: 1.25rem; min-height: 65px; }
