/* ==========================================================================
   Hearth & Home Remodeling — shared stylesheet
   Fictional portfolio demonstration website
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --forest: #173D2B;
  --deep: #102C20;
  --ivory: #F8F6F0;
  --white: #FFFFFF;
  --sand: #E9E1D5;
  --sage: #A9B8A2;
  --charcoal: #242824;
  --gray: #6F746F;
  --muted: #565B56;          /* darker gray for body-size secondary text (AA on ivory/white) */
  --line: #D9D2C5;
  --error: #9B2C2C;
  --error-bg: #FBEFEE;
  --success-bg: #EAF1E6;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(16, 44, 32, .06), 0 2px 8px rgba(16, 44, 32, .06);
  --shadow-md: 0 6px 24px rgba(16, 44, 32, .12);
  --header-h: 76px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--ivory);
  overflow-wrap: break-word;
}

body.modal-open { overflow: hidden; }

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--forest);
  margin: 0 0 .6em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.2rem, 5.5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--forest); text-underline-offset: .2em; }
a:hover { color: var(--deep); }

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

:focus-visible {
  outline: 3px solid #2F7A53;
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible,
.hero :focus-visible,
.site-footer :focus-visible,
.modal-close:focus-visible {
  outline-color: #FFFFFF;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 820px; }

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

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 200;
  background: var(--forest);
  color: var(--white);
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 1rem; color: var(--white); }

/* ---------- 3. Eyebrow, lead, buttons ---------- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 1rem;
}
.on-dark .eyebrow, .hero .eyebrow { color: var(--sage); }

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 62ch;
}
.on-dark .lead, .hero .lead { color: #E6ECE3; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .8rem 1.6rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--white);
  background: var(--forest);
  border: 2px solid var(--forest);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover { background: var(--deep); border-color: var(--deep); color: var(--white); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }

.btn--light { background: var(--ivory); border-color: var(--ivory); color: var(--forest); }
.btn--light:hover { background: var(--white); border-color: var(--white); color: var(--deep); }

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

.btn--outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,.85); }
.btn--outline-light:hover { background: var(--white); color: var(--deep); border-color: var(--white); }

.btn[disabled], .btn[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.75rem; }

.text-link {
  font-weight: 600;
  color: var(--forest);
  text-decoration: none;
  border-bottom: 2px solid var(--sage);
  padding-bottom: 1px;
  transition: border-color .2s ease;
}
.text-link:hover { border-color: var(--forest); }

/* ---------- 4. Demo notice bar ---------- */
.demo-bar {
  background: var(--deep);
  color: #DDE5DA;
  font-size: .8125rem;
  line-height: 1.4;
  text-align: center;
  padding: .5rem var(--gutter);
}
.demo-bar strong { color: var(--white); font-weight: 600; }

/* ---------- 5. Header and navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--forest);
  flex-shrink: 0;
}
.brand:hover { color: var(--deep); }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; }
.brand-text {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.brand-text small {
  display: block;
  margin-top: .2rem;
  font-family: var(--font-sans);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(.9rem, 2vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a:not(.btn) {
  position: relative;
  display: inline-block;
  padding: .5rem 0;
  color: var(--charcoal);
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .1rem;
  height: 2px;
  background: var(--forest);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.site-nav a:not(.btn):hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--forest); font-weight: 700; }
.site-nav .btn { min-height: 44px; padding: .6rem 1.25rem; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: .5rem .9rem;
  font: inherit;
  font-weight: 600;
  color: var(--forest);
  background: transparent;
  border: 2px solid var(--forest);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle-bars { position: relative; width: 20px; height: 14px; }
.nav-toggle-bars span {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 6px; }
.nav-toggle-bars span:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 960px) {
  .header-inner { flex-wrap: wrap; padding-block: .6rem; }
  .brand-text { font-size: 1.15rem; }

  /* Without JavaScript the menu simply wraps beneath the logo and stays usable. */
  .site-nav { flex-basis: 100%; }
  .site-nav ul { flex-wrap: wrap; gap: .25rem 1.25rem; padding-bottom: .5rem; }

  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: .75rem var(--gutter) 1.5rem;
  }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .js .site-nav li { border-bottom: 1px solid var(--line); }
  .js .site-nav li:last-child { border-bottom: 0; padding-top: 1rem; }
  .js .site-nav a:not(.btn) { display: block; padding: .95rem 0; font-size: 1.0625rem; }
  .js .site-nav a:not(.btn)::after { display: none; }
  .js .site-nav a[aria-current="page"] { border-left: 3px solid var(--forest); padding-left: .85rem; }
  .js .site-nav .btn { width: 100%; }
}

/* ---------- 6. Image treatments ---------- */
.media {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--sand);       /* fallback while loading / if the image fails */
  border-radius: var(--radius);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x2 { aspect-ratio: 3 / 2; }
.media--4x5 { aspect-ratio: 4 / 5; }
.media--wide { aspect-ratio: 16 / 10; }

.img-failed img { visibility: hidden; }
.img-failed::after {
  content: "Image unavailable";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.media-caption {
  font-size: .8125rem;
  color: var(--muted);
  margin-top: .6rem;
}

/* ---------- 7. Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(520px, 78vh, 720px);
  color: var(--white);
  background: var(--deep);
  isolation: isolate;
  overflow: hidden;
}
.hero-bg, .hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}
.hero-bg img { object-fit: cover; object-position: center; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(16,44,32,.88) 0%, rgba(16,44,32,.66) 48%, rgba(16,44,32,.30) 100%);
}
.hero-inner { padding-block: clamp(4rem, 10vw, 7rem); }
.hero h1 { color: var(--white); max-width: 16ch; margin-bottom: .45em; }
.hero .lead { max-width: 52ch; margin-bottom: 0; }

@media (max-width: 640px) {
  .hero { min-height: 0; }
  .hero::before { background: rgba(16,44,32,.74); }
  .hero-inner { padding-block: 3.5rem 3rem; }
  .hero .btn-row { flex-direction: column; }
  .hero .btn-row .btn { width: 100%; }
}

/* Inner-page hero */
.page-hero {
  background: var(--sand);
  padding-block: clamp(2.25rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { max-width: 22ch; margin-bottom: .4em; font-size: clamp(2rem, 4.6vw, 3.25rem); }
.page-hero .lead { margin-bottom: 0; }

/* ---------- 8. Sections ---------- */
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.page-hero + .section { padding-top: clamp(2rem, 4vw, 3rem); }
.section--white { background: var(--white); }
.section--sand { background: var(--sand); }
.section--dark { background: var(--deep); color: #E6ECE3; }
.section--dark h2, .section--dark h3 { color: var(--white); }

.section-head { max-width: 680px; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .lead { margin-inline: auto; }
.section-head p:last-child { margin-bottom: 0; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.split--reverse > :first-child { order: 2; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse > :first-child { order: 0; }
}

/* ---------- 9. Principles ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  list-style: none;
  padding: 0;
  margin: 0;
}
.principle { border-top: 2px solid var(--forest); padding-top: 1.25rem; }
.principle-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: .5rem;
}
.principle h3 { font-size: 1.3rem; margin-bottom: .4em; }
.principle p { color: var(--muted); margin: 0; font-size: 1rem; }

@media (max-width: 1000px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .principles { grid-template-columns: 1fr; } }

/* ---------- 10. Cards ---------- */
.grid { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--featured { grid-template-columns: repeat(12, 1fr); }
.grid--featured > :nth-child(4n+1), .grid--featured > :nth-child(4n+4) { grid-column: span 7; }
.grid--featured > :nth-child(4n+2), .grid--featured > :nth-child(4n+3) { grid-column: span 5; }
.grid--featured .media { aspect-ratio: auto; height: clamp(240px, 24vw, 330px); }
@media (max-width: 1100px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px)  { .grid--featured > * { grid-column: span 12 !important; } .grid--featured .media { height: auto; aspect-ratio: 16 / 10; } }
@media (max-width: 640px)  { .grid--4, .grid--2 { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card .media { border-radius: 0; }
.card .media img { transition: transform .5s ease; }
.card:hover .media img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.4rem 1.4rem 1.6rem; }
.card-body h3 { margin-bottom: .35em; }
.card-body p { color: var(--muted); font-size: 1rem; }
.card-body .text-link, .card-body .btn { margin-top: auto; align-self: flex-start; }
.card { position: relative; }
.card .text-link { display: inline-block; padding-block: .35rem; }
.card .text-link::after { content: ""; position: absolute; inset: 0; }
.card:focus-within { outline: 3px solid #2F7A53; outline-offset: 3px; }
.card .text-link:focus-visible { outline: none; }
.card .view-btn { position: relative; z-index: 1; }
.card-cat {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 .5rem;
}
.card:target { outline: 3px solid var(--sage); outline-offset: 4px; }
.card.is-highlighted { outline: 3px solid var(--sage); outline-offset: 4px; }

/* ---------- 11. Process ---------- */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.process li {
  counter-increment: step;
  position: relative;
  padding-top: 3.4rem;
}
.process li::before {
  content: counter(step);
  position: absolute;
  top: 0; left: 0;
  display: grid;
  place-items: center;
  width: 2.6rem; height: 2.6rem;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
}
.process li::after {
  content: "";
  position: absolute;
  top: 1.3rem; left: 3.3rem; right: -1rem;
  height: 1px;
  background: var(--sage);
}
.process li:last-child::after { display: none; }
.process h3 { font-size: 1.25rem; margin-bottom: .35em; }
.process p { color: var(--muted); font-size: 1rem; margin: 0; }

@media (max-width: 1000px) {
  .process { grid-template-columns: repeat(2, 1fr); }
  .process li::after { display: none; }
}
@media (max-width: 560px) { .process { grid-template-columns: 1fr; } }

/* ---------- 12. Value lists ---------- */
.check-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.check-list li { position: relative; padding-left: 1.6rem; margin-bottom: .55rem; }
.check-list li::before {
  content: "";
  position: absolute;
  left: .1rem; top: .62em;
  width: .6rem; height: .6rem;
  background: var(--forest);
  transform: rotate(45deg);
}
.two-col-list { columns: 2; column-gap: 2rem; }
.two-col-list li { break-inside: avoid; }
@media (max-width: 560px) { .two-col-list { columns: 1; } }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); }
.pillar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.9rem; }
.pillar h3 { font-size: 1.3rem; }
.pillar p { color: var(--muted); font-size: 1rem; margin: 0; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- 13. Service rows ---------- */
.service-row { scroll-margin-top: calc(var(--header-h) + 1rem); }
.service-row + .service-row { margin-top: clamp(3.5rem, 8vw, 6rem); }
.service-row h2 { margin-bottom: .45em; }
.service-row .lead { font-size: 1.0625rem; }

/* ---------- 14. CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .container { max-width: 760px; }
.cta-band p { color: #E6ECE3; font-size: 1.125rem; }
.cta-band .btn-row { justify-content: center; }

/* ---------- 15. Disclosure notes ---------- */
.notice {
  display: flex;
  gap: .9rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  border-radius: var(--radius);
  font-size: .9375rem;
  color: var(--muted);
}
.notice p { margin: 0; }
.notice strong { color: var(--charcoal); }
.section--sand .notice { background: var(--ivory); }

/* ---------- 16. Footer ---------- */
.site-footer {
  background: var(--deep);
  color: #D3DCD0;
  padding-top: clamp(3rem, 6vw, 4.5rem);
  font-size: .9875rem;
}
.site-footer a { color: #D3DCD0; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; text-underline-offset: .2em; }
.site-footer h2 {
  font-family: var(--font-sans);
  font-size: .8125rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: 2.5rem;
}
.footer-brand .brand { color: var(--white); margin-bottom: 1rem; }
.footer-brand .brand-text small { color: var(--sage); }
.footer-brand p { max-width: 34ch; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .1rem; }
.footer-links a { display: inline-block; padding-block: .4rem; }
.footer-contact { font-style: normal; }
.footer-contact p { margin-bottom: .55rem; }
.demo-tag {
  display: inline-block;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--deep);
  background: var(--sage);
  padding: .15rem .5rem;
  border-radius: 2px;
  margin-bottom: .75rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.16);
  padding-block: 1.4rem;
  font-size: .875rem;
  color: #B9C5B5;
}
.footer-bottom p { margin: 0 0 .4rem; }
.footer-bottom p:last-child { margin: 0; }

@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem 1.25rem; }
  .footer-grid > :first-child, .footer-grid > :last-child { grid-column: 1 / -1; }
}

/* ---------- 17. Project modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(.75rem, 3vw, 2rem);
}
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16,44,32,.78); }
.modal-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  width: 100%;
  max-width: 1000px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  background: var(--ivory);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.modal-panel:focus { outline: none; }
.modal-media { background: var(--sand); min-height: 260px; position: relative; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.modal-body { padding: clamp(1.5rem, 4vw, 2.75rem); }
.modal-body h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.modal-close {
  position: absolute;
  top: .75rem; right: .75rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  padding: .45rem .95rem;
  font: inherit;
  font-weight: 600;
  color: var(--white);
  background: var(--deep);
  border: 2px solid var(--deep);
  border-radius: var(--radius);
  cursor: pointer;
}
.modal-close:hover { background: var(--forest); border-color: var(--forest); }
.modal-close span[aria-hidden] { font-size: 1.4rem; line-height: 1; }
.modal-detail dl { margin: 0 0 1.25rem; }
.modal-detail dt {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--forest);
  margin-top: .9rem;
}
.modal-detail dd { margin: .15rem 0 0; color: var(--muted); font-size: 1rem; }
.modal-disclosure { font-size: .8125rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }

@media (max-width: 760px) {
  .modal-panel { grid-template-columns: 1fr; }
  .modal-media { min-height: 0; aspect-ratio: 16 / 10; }
  .modal-body { padding-top: 1.5rem; }
}

/* Project details: visible inline without JavaScript, moved into the modal with it. */
.project-detail { margin-top: .75rem; font-size: .9375rem; color: var(--muted); }
.project-detail dl { margin: 0; }
.project-detail dt { font-weight: 700; color: var(--charcoal); margin-top: .5rem; }
.project-detail dd { margin: 0; }
.js .project-detail { display: none; }
.view-btn { display: none; }
.js .view-btn { display: inline-flex; }

/* ---------- 18. Contact page and forms ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 960px) { .contact-layout { grid-template-columns: 1fr; } }

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
.form-card h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.25rem; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field--full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.field label, .field .label {
  font-weight: 600;
  font-size: .9375rem;
  margin-bottom: .4rem;
  color: var(--charcoal);
}
.req { color: var(--error); font-weight: 700; margin-left: .15rem; }
.opt { font-weight: 400; color: var(--muted); font-size: .875rem; }
.hint { font-size: .8125rem; color: var(--muted); margin: .35rem 0 0; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  font: inherit;
  font-size: 1rem;            /* prevents iOS zoom on focus */
  color: var(--charcoal);
  background: var(--ivory);
  border: 1.5px solid #9AA09A;
  border-radius: var(--radius);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field textarea { min-height: 150px; resize: vertical; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23173D2B' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--forest); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid #2F7A53;
  outline-offset: 1px;
  border-color: var(--forest);
  background: var(--white);
}
.field [aria-invalid="true"] { border-color: var(--error); background: var(--error-bg); }
.field-error {
  margin: .4rem 0 0;
  font-size: .875rem;
  font-weight: 600;
  color: var(--error);
}
.field-error:empty { display: none; }

.field--check { flex-direction: row; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.field--check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.4rem; height: 1.4rem;
  margin: .15rem 0 0;
  accent-color: var(--forest);
}
.field--check label { flex: 1 1 0; min-width: 0; font-weight: 400; margin: 0; }
.field--check .field-error { flex-basis: 100%; margin-left: 2.15rem; }

.form-status {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 500;
}
.form-status[hidden] { display: none; }
.form-status.is-success { background: var(--success-bg); border-color: var(--sage); color: var(--deep); }
.form-status.is-error { background: var(--error-bg); border-color: #E3B5B2; color: var(--error); }
.form-status:focus { outline: 3px solid #2F7A53; outline-offset: 2px; }

.demo-mode-note { margin-bottom: 1.5rem; }
.form-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.form-actions .hint { margin: 0; max-width: 40ch; }

.info-card {
  background: var(--sand);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.info-card + .info-card { margin-top: 1.5rem; }
.info-card h2, .info-card h3 { font-size: 1.35rem; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { padding-block: .85rem; border-bottom: 1px solid rgba(23,61,43,.18); }
.info-list li:last-child { border-bottom: 0; }
.info-list .k {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--forest);
}
.info-list a { font-weight: 600; }

/* ---------- 19. Utilities & misc ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.stack-lg > * + * { margin-top: 1.5rem; }
.footnote { font-size: .875rem; color: var(--muted); }

/* Prevent any accidental horizontal overflow */
html, body { max-width: 100%; overflow-x: clip; }

/* ---------- 20. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .card:hover { transform: none; }
  .card:hover .media img { transform: none; }
}

/* ---------- 21. Print ---------- */
@media print {
  .site-header, .demo-bar, .nav-toggle, .modal, .btn-row { display: none !important; }
  body { background: #fff; }
}

.hero-bg.img-failed::after { content: none; }

@media (max-width: 480px) {
  .cta-band .btn-row .btn, .section .btn-row .btn { width: 100%; }
  .card-body { padding: 1.25rem; }
}
