/* Terra Claims: warm boutique editorial with grounded clay and olive. */
:root {
  --terra-ink: #241916;
  --terra-clay: #b85f44;
  --terra-rose: #e7a88b;
  --terra-olive: #6f7d45;
  --terra-paper: #fff4e8;
}

html body {
  color: var(--terra-ink) !important;
  background:
    radial-gradient(circle at 15% 14%, rgba(231, 168, 139, .34), transparent 20rem),
    radial-gradient(circle at 86% 18%, rgba(111, 125, 69, .22), transparent 22rem),
    linear-gradient(180deg, #fff7ee, #f3dfcf) !important;
}

html body::before {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -1 !important;
  pointer-events: none !important;
  opacity: .3 !important;
  background:
    linear-gradient(90deg, rgba(36, 25, 22, .12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 25, 22, .08) 1px, transparent 1px) !important;
  background-size: 38px 38px !important;
}

html body .site-header {
  background: rgba(255, 244, 232, .9) !important;
  border-bottom: 1px solid rgba(36, 25, 22, .16) !important;
}

html body h1,
html body h2,
html body h3 {
  color: var(--terra-ink) !important;
  font-family: Georgia, "Times New Roman", serif !important;
  letter-spacing: 0 !important;
}

html body .hero,
html body .studio-hero,
html body .page-hero,
html body .service-detail-hero {
  padding-inline: clamp(42px, 6vw, 78px) !important;
  border-radius: 4px !important;
  border: 1px solid rgba(36, 25, 22, .2) !important;
  background:
    linear-gradient(135deg, rgba(255, 244, 232, .96), rgba(255, 244, 232, .72)),
    radial-gradient(circle at 90% 14%, rgba(184, 95, 68, .18), transparent 14rem) !important;
  box-shadow: 16px 16px 0 rgba(184, 95, 68, .16) !important;
}

html body .hero h1,
html body .studio-hero h1 {
  max-width: 760px !important;
  font-size: clamp(46px, 6vw, 76px) !important;
  line-height: 1.02 !important;
}

html body .hero h1 {
  word-break: normal !important;
  overflow-wrap: normal !important;
}

html body .card,
html body .card-link,
html body article,
html body .summary-card,
html body .portrait-card,
html body .service-card,
html body .board-card,
html body .contact-panel,
html body .trust-panel {
  color: var(--terra-ink) !important;
  border-radius: 4px !important;
  border: 1px solid rgba(36, 25, 22, .18) !important;
  background: rgba(255, 250, 242, .94) !important;
  box-shadow: 8px 8px 0 rgba(36, 25, 22, .08) !important;
  transition: transform .22s ease, box-shadow .22s ease !important;
}

html body .card:hover,
html body .card-link:hover,
html body article:hover {
  transform: translate(-3px, -3px) !important;
  box-shadow: 13px 13px 0 rgba(184, 95, 68, .22) !important;
}

html body .button,
html body button,
html body a[class*="button"] {
  color: #fffaf2 !important;
  background: var(--terra-clay) !important;
  border: 1px solid var(--terra-clay) !important;
  border-radius: 3px !important;
}

html body .button.secondary {
  color: var(--terra-ink) !important;
  background: transparent !important;
}

html body .eyebrow,
html body .tag,
html body .badge,
html body .pill {
  color: #fffaf2 !important;
  background: var(--terra-olive) !important;
  border-radius: 2px !important;
}

/* Interior layout identity: boutique case-study sheets with editorial sidebar. */
html body .hero {
  border-radius: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, .56fr) minmax(260px, .44fr) !important;
  min-height: 620px !important;
  align-items: stretch !important;
  position: relative !important;
  padding: clamp(42px, 6vw, 78px) clamp(42px, 6vw, 78px) clamp(42px, 6vw, 78px) clamp(118px, 12vw, 180px) !important;
  border-left: 12px solid var(--terra-clay) !important;
}

html body .hero::before {
  content: "Case Study\A Revenue Notes\A Service Menu" !important;
  white-space: pre-line !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: clamp(78px, 9vw, 120px) !important;
  display: flex !important;
  align-items: flex-end !important;
  padding: 22px 16px !important;
  color: #fffaf2 !important;
  background: var(--terra-clay) !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 18px !important;
  line-height: 1.25 !important;
  z-index: 0 !important;
}

html body .hero-copy,
html body .summary-card {
  margin: 0 !important;
  position: relative !important;
  z-index: 1 !important;
}

html body .summary-card {
  align-self: end !important;
}

html body .about-grid,
html body .service-list,
html body .support-grid,
html body .systems-grid,
html body .trust-grid {
  display: grid !important;
  grid-template-columns: minmax(240px, .34fr) minmax(0, .66fr) !important;
  gap: 22px !important;
  align-items: start !important;
}

html body .service-list article,
html body .support-grid article,
html body .systems-grid article,
html body .trust-grid article {
  border-radius: 0 !important;
  min-height: 210px !important;
}

html body .service-list article:first-child,
html body .support-grid article:first-child,
html body .systems-grid article:first-child,
html body .trust-grid article:first-child {
  grid-row: span 2 !important;
  min-height: 430px !important;
}

html body:not(.vitalweb-remix) main {
  width: min(1120px, calc(100% - 34px)) !important;
}

html body:not(.vitalweb-remix) .intro-block {
  max-width: 760px !important;
  padding: 28px 0 !important;
  border-top: 2px solid rgba(36, 25, 22, .28) !important;
  border-bottom: 2px solid rgba(36, 25, 22, .28) !important;
}

html body:not(.vitalweb-remix) .grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr)) !important;
  gap: 18px !important;
  border: 1px solid rgba(36, 25, 22, .22) !important;
  padding: 18px !important;
}

html body:not(.vitalweb-remix) main .grid .card {
  min-height: 250px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 1px solid rgba(36, 25, 22, .18) !important;
}

html body:not(.vitalweb-remix) main .grid .card:nth-child(1) {
  grid-column: auto !important;
  grid-row: auto !important;
  min-height: 250px !important;
  background: var(--terra-clay) !important;
  justify-content: space-between !important;
}

html body:not(.vitalweb-remix) main .grid .card:nth-child(1),
html body:not(.vitalweb-remix) main .grid .card:nth-child(1) * {
  color: #fffaf2 !important;
}

html body:not(.vitalweb-remix) main .grid .card:nth-child(1) strong {
  margin-top: auto !important;
  color: #fffaf2 !important;
}

html body:not(.vitalweb-remix) main .grid .card:nth-child(1) p,
html body:not(.vitalweb-remix) main .grid .card:nth-child(1) a {
  color: #fffaf2 !important;
  opacity: 1 !important;
}

@media (max-width: 820px) {
  html body:not(.vitalweb-remix) .grid {
    grid-template-columns: 1fr !important;
  }

  html body:not(.vitalweb-remix) main .grid .card:nth-child(1) {
    grid-row: auto !important;
    grid-column: auto !important;
    min-height: 260px !important;
  }
}

/* Card spacing safety pass: keeps text from hugging card borders on all sample pages. */
html body :where(.card, .card-link, .summary-card, .portrait-card, .service-card, .specialty-card, .resource-card, .testimonial-card, .fit-card, .process-card, .detail-card, .board-card, .contact-panel, .trust-panel, .detail-module, .detail-console),
html body :where(.service-list, .support-grid, .systems-grid, .trust-grid, .mosaic-grid, .reason-stack, .fit-ribbon) > article,
html body :where(.process-lane) li {
  box-sizing: border-box !important;
  padding: clamp(20px, 2.4vw, 30px) !important;
}

/* Form spacing safety pass: keeps labels and controls comfortably inside contact forms. */
html body :where(form, .lead-form, .quote-form, .managed-form) {
  box-sizing: border-box !important;
  padding: clamp(22px, 2.6vw, 34px) !important;
}

/* Mobile fit pass: collapse editorial ledger layouts before text gets squeezed. */
@media (max-width: 760px) {
  html body main,
  html body .studio-hero,
  html body .summary-card,
  html body .service-mosaic,
  html body .mosaic-grid,
  html body .reason-stack,
  html body .support-grid,
  html body .trust-grid,
  html body .systems-grid,
  html body .detail-module,
  html body .detail-card,
  html body .trust-contact,
  html body .contact-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  html body .studio-hero,
  html body .service-mosaic,
  html body .mosaic-grid,
  html body .reason-stack,
  html body .support-grid,
  html body .trust-grid,
  html body .systems-grid,
  html body .trust-contact,
  html body .process-lane,
  html body .process-lane ol {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  html body p,
  html body li,
  html body dd,
  html body .summary-card *,
  html body article * {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  html body ul,
  html body ol {
    padding-left: 1.2rem !important;
  }
}

/* Final readability/media safety pass: keeps page images contained and tiny marks readable. */
html body img {
  max-width: 100% !important;
}

html body :where(.brand-mark, .tag, .badge, .label, .kicker) {
  opacity: 1 !important;
  text-shadow: none !important;
}

html body :where(.brand-mark) {
  color: #102326 !important;
  background: #f7fff9 !important;
  border: 1px solid rgba(16, 35, 38, .14) !important;
}

html body:not(.vitalweb-remix) main .grid .card,
html body:not(.vitalweb-remix) main .grid .card:visited {
  color: inherit !important;
  overflow: hidden !important;
}

html body:not(.vitalweb-remix) main .grid .card * {
  opacity: 1 !important;
  text-shadow: none !important;
}

html body .button,
html body button,
html body a[class*="button"] {
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Final mobile override: remove side rail and force readable single-column cards. */
@media (max-width: 760px) {
  html body .hero::before {
    display: none !important;
  }

  html body main,
  html body .hero,
  html body .hero-copy,
  html body .summary-card,
  html body .about-grid,
  html body .service-list,
  html body .support-grid,
  html body .systems-grid,
  html body .trust-grid,
  html body .reason-stack,
  html body .trust-contact,
  html body .photo {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
  }

  html body .summary-card {
    align-self: stretch !important;
  }

  html body .service-list article,
  html body .support-grid article,
  html body .systems-grid article,
  html body .trust-grid article,
  html body .service-list article:first-child,
  html body .support-grid article:first-child,
  html body .systems-grid article:first-child,
  html body .trust-grid article:first-child {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
  }

  html body .photo img,
  html body img {
    width: 100% !important;
    max-width: 100% !important;
  }

  html body p,
  html body li,
  html body dd,
  html body article *,
  html body .summary-card * {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
}

/* Contact form safety pass: keeps compact demo forms readable on every page. */
html body form.contact-panel,
html body .contact-panel:is(form) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px !important;
  align-content: start !important;
}

html body form.contact-panel label,
html body .contact-panel:is(form) label {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 7px !important;
  min-width: 0 !important;
  color: inherit !important;
  font-weight: 700 !important;
}

html body form.contact-panel input,
html body form.contact-panel select,
html body form.contact-panel textarea,
html body .contact-panel:is(form) input,
html body .contact-panel:is(form) select,
html body .contact-panel:is(form) textarea {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 44px !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  font: inherit !important;
}

html body form.contact-panel textarea,
html body .contact-panel:is(form) textarea {
  min-height: 116px !important;
  resize: vertical;
}

/* Form field readability pass: prevents dark inherited controls on light contact layouts. */
html body form.contact-panel input,
html body form.contact-panel select,
html body form.contact-panel textarea,
html body .contact-panel:is(form) input,
html body .contact-panel:is(form) select,
html body .contact-panel:is(form) textarea {
  color: #172126 !important;
  background: rgba(255, 255, 255, .96) !important;
  border-color: rgba(23, 33, 38, .22) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82) !important;
}

html body form.contact-panel input::placeholder,
html body form.contact-panel textarea::placeholder,
html body .contact-panel:is(form) input::placeholder,
html body .contact-panel:is(form) textarea::placeholder {
  color: #6c757d !important;
  opacity: 1 !important;
}
