/* Page sections and reusable components. Signature element: the specimen tag
   (eyelet ring + tag strip + tabular sample label) and the lab report readout. */

/* Graph-paper backdrop shared by dark heroes */

.hero,
.page-hero {
  position: relative;
  overflow: hidden;
  background-color: var(--slate);
  background-image:
    radial-gradient(60rem 30rem at 85% 0%, rgb(111 174 159 / 22%), transparent 60%),
    linear-gradient(rgb(247 245 240 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(247 245 240 / 5%) 1px, transparent 1px);
  background-size:
    auto,
    28px 28px,
    28px 28px;
  color: var(--paper);
}

.hero a:not(.btn),
.page-hero a:not(.btn) {
  color: var(--paper);
}

/* Home hero */

.hero {
  padding-block: var(--space-xl) var(--space-2xl);
}

.hero__grid {
  display: grid;
  gap: var(--space-l);
  align-items: center;
}

@media (width >= 62em) {
  .hero__grid {
    grid-template-columns: 1.08fr 0.92fr;
    gap: var(--space-xl);
  }
}

.hero h1 {
  max-width: 14ch;
}

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

.hero .lede {
  max-width: 36rem;
  color: var(--on-dark-muted);
}

.hero .btn-row {
  margin-top: var(--space-m);
}

.hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: var(--space-m) 0 0;
  padding: 0;
  list-style: none;
  color: var(--on-dark-muted);
  font-size: var(--step--1);
}

.hero__proof li + li {
  margin-top: 0;
}

.hero__proof li::before {
  content: "✓";
  margin-right: 0.4rem;
  color: var(--amber);
  font-weight: 700;
}

.hero__media {
  position: relative;
  padding-bottom: 9.5rem;
}

.hero__media img {
  width: 100%;
  border-radius: var(--radius-m);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 62% 30%;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 60%);
}

.hero__media .readout {
  position: absolute;
  right: clamp(-0.5rem, -1vw, 0rem);
  bottom: 0;
  left: clamp(1rem, 12%, 5rem);
}

/* Lab report readout */

.readout {
  position: relative;
  padding: var(--space-m) var(--space-m) var(--space-s);
  border-radius: var(--radius-m);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 50px -24px rgb(0 0 0 / 70%);
  font-size: 0.92rem;
}

.readout::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  background: repeating-linear-gradient(90deg, var(--amber) 0 18px, var(--ink) 18px 22px);
}

.readout__title {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.readout__title span {
  color: var(--teal-700);
}

.readout dl {
  margin: 0;
}

.readout div {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding-block: 0.3rem;
}

.readout dt {
  color: var(--muted);
}

.readout div::after {
  content: "";
  order: 1;
  flex: 1;
  min-width: 1rem;
  border-bottom: 2px dotted var(--border);
}

.readout dd {
  order: 2;
  margin: 0;
  font-weight: 700;
  text-align: right;
}

/* Inner page hero */

.page-hero {
  padding-block: var(--space-l) var(--space-xl);
}

.page-hero__grid {
  display: grid;
  gap: var(--space-l);
  align-items: center;
}

@media (width >= 62em) {
  .page-hero__grid--media {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.page-hero h1 {
  max-width: 20ch;
  font-size: var(--step-4);
}

.page-hero .lede {
  max-width: 40rem;
  color: var(--on-dark-muted);
}

.page-hero .btn-row {
  margin-top: var(--space-m);
}

.page-hero__media img {
  width: 100%;
  border-radius: var(--radius-m);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 60%);
}

.page-hero .readout {
  max-width: 28rem;
}

/* Specimen tag cards (link grids for services) */

.tag-grid {
  display: grid;
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-grid > li + li {
  margin-top: 0;
}

@media (width >= 40em) {
  .tag-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width >= 66em) {
  .tag-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tag {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: calc(var(--space-m) + 6px) var(--space-m) var(--space-m);
  border: 2px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.tag::before {
  content: "";
  position: absolute;
  inset: -2px -2px auto;
  height: 8px;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  background: var(--teal-700);
}

a.tag:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
}

.tag__id {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: var(--space-s);
  padding-bottom: var(--space-xs);
  border-bottom: 2px dashed var(--rule);
  color: var(--teal-700);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tag__id::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--mineral);
}

.tag h3 {
  font-size: var(--step-2);
}

.tag p {
  color: var(--muted);
}

.tag__more {
  margin-top: auto;
  color: var(--teal-700);
  font-family: var(--font-display);
  font-weight: 700;
}

.tag__more::after {
  content: " →";
}

.section--mineral .tag {
  background: var(--paper);
}

.tag--feature {
  background: var(--amber-tint);
}

.tag--feature::before {
  background: var(--amber);
}

/* Location and blog card grids */

.card-grid {
  display: grid;
  gap: var(--space-s);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-grid > li + li {
  margin-top: 0;
}

@media (width >= 36em) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width >= 62em) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.loc-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-m);
  border: 2px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.loc-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.loc-card__code {
  color: var(--teal-700);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.loc-card strong {
  display: block;
  margin: 0.2rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.1;
}

.loc-card span:last-child {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.95rem;
}

.section--slate .loc-card {
  border-color: var(--teal-400);
  background: var(--paper);
  color: var(--ink);
}

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 2px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
}

.post-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--space-m);
}

.post-card time {
  color: var(--teal-700);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-card strong {
  display: block;
  margin: 0.35rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
}

.post-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Split layout */

.split {
  display: grid;
  gap: var(--space-l);
  align-items: center;
}

@media (width >= 56em) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .split--reverse > :first-child {
    order: 2;
  }
}

.split figure {
  margin: 0;
}

.split img {
  width: 100%;
  border-radius: var(--radius-m);
}

.split figcaption {
  margin-top: var(--space-xs);
  color: var(--muted);
  font-size: var(--step--1);
}

/* Checklist and detail lists */

.checklist {
  margin: 0 0 var(--space-m);
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 2rem;
}

.checklist li + li {
  margin-top: 0.7rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  top: 0.32em;
  left: 0;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid var(--teal-700);
  border-radius: 3px;
  background: linear-gradient(135deg, transparent 45%, var(--teal-700) 45% 60%, transparent 60%);
}

.section--slate .checklist li::before {
  border-color: var(--amber);
  background: linear-gradient(135deg, transparent 45%, var(--amber) 45% 60%, transparent 60%);
}

/* Process steps */

.steps {
  display: grid;
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (width >= 48em) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width >= 66em) {
  .steps--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.steps > li {
  position: relative;
  margin: 0;
  padding-top: var(--space-m);
  border-top: 3px solid var(--ink);
  counter-increment: step;
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--teal-700);
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.section--slate .steps > li {
  border-top-color: var(--amber);
}

.section--slate .steps > li::before {
  color: var(--amber);
}

.steps h3 {
  font-size: var(--step-1);
}

.steps p {
  margin: 0;
}

.section--slate .steps p {
  color: var(--on-dark-muted);
}

/* Comparison table */

.compare-wrap {
  overflow-x: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius-m);
  background: var(--paper);
}

.compare {
  width: 100%;
  min-width: 34rem;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.compare caption {
  padding: var(--space-s);
  text-align: left;
  color: var(--muted);
  font-size: var(--step--1);
}

.compare th,
.compare td {
  padding: 0.85rem var(--space-s);
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  border-top: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
}

.compare thead th:nth-child(2) {
  background: var(--teal-700);
}

.compare tbody th {
  font-weight: 600;
}

.compare td:nth-child(2) {
  background: var(--amber-tint);
  font-weight: 600;
}

/* Certifications */

.cert-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cert-row > li + li {
  margin-top: 0;
}

@media (width >= 48em) {
  .cert-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cert-row figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: var(--space-m) var(--space-s);
  border: 2px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--paper);
  text-align: center;
}

.cert-row img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.cert-row figcaption {
  margin-top: var(--space-xs);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

/* FAQ */

.faq {
  border-top: 2px solid var(--ink);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  gap: var(--space-s);
  justify-content: space-between;
  padding: var(--space-m) 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

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

.faq details > div {
  max-width: var(--measure);
  padding-bottom: var(--space-m);
}

.faq details p:last-child {
  margin-bottom: 0;
}

/* Callout note */

.note {
  margin: var(--space-m) 0;
  padding: var(--space-m);
  border-left: 6px solid var(--amber);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  background: var(--amber-tint);
  color: var(--ink);
}

.note strong:first-child {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--amber-dark);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note p:last-child {
  margin-bottom: 0;
}

/* Statement band (independence pledge) */

.pledge {
  display: grid;
  gap: var(--space-l);
  align-items: center;
}

@media (width >= 56em) {
  .pledge {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.pledge blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.pledge blockquote span {
  color: var(--amber);
}

/* Final CTA band */

.cta-band {
  padding-block: var(--space-xl);
  background: var(--amber);
  color: var(--ink);
}

.cta-band__inner {
  display: grid;
  gap: var(--space-m);
  align-items: center;
}

@media (width >= 56em) {
  .cta-band__inner {
    grid-template-columns: 1.3fr 0.7fr;
  }
}

.cta-band h2 {
  font-size: var(--step-3);
}

.cta-band p {
  margin: 0;
  max-width: 40rem;
}

.cta-band__phone {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.cta-band__phone:hover {
  text-decoration: underline;
}

.cta-band small {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--step--1);
}

/* Two-column prose with sidebar */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl);
}

@media (width >= 62em) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) 20rem;
  }
}

.sidebar {
  align-self: start;
}

@media (width >= 62em) {
  .sidebar {
    position: sticky;
    top: 6.5rem;
  }
}

.side-card {
  margin-bottom: var(--space-m);
  padding: var(--space-m);
  border: 2px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--paper);
}

.side-card--dark {
  border-color: var(--slate);
  background: var(--slate);
  color: var(--paper);
}

.side-card--dark p {
  color: var(--on-dark-muted);
}

.side-card h2 {
  font-size: var(--step-1);
}

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

.side-card li + li {
  margin-top: 0.5rem;
}

.side-card .btn {
  width: 100%;
}

.side-links a {
  display: block;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
}

.side-links a:hover {
  border-color: var(--ink);
}

/* Long-form prose */

.prose {
  max-width: var(--measure);
  overflow-wrap: break-word;
}

.prose h2 {
  margin-top: var(--space-l);
  font-size: var(--step-3);
}

.prose h3 {
  margin-top: var(--space-m);
  font-size: var(--step-1);
}

.prose > :first-child {
  margin-top: 0;
}

.prose li::marker {
  color: var(--teal-700);
}

.prose figure img {
  width: 100%;
  border-radius: var(--radius-m);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  color: var(--on-dark-muted);
  font-size: var(--step--1);
}

.post-hero-img {
  margin: 0 0 var(--space-l);
}

.post-hero-img img {
  width: 100%;
  max-height: 32rem;
  border-radius: var(--radius-m);
  object-fit: cover;
  box-shadow: var(--shadow-card);
}

/* 404 */

.error-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 3rem + 10vw, 11rem);
  font-weight: 800;
  line-height: 0.9;
  color: var(--amber);
}

/* Lead form: request a call back (Web3Forms, see js/form.js) */

.request__grid {
  align-items: start;
}

.request__copy p:not(.label) {
  color: var(--on-dark-muted);
}

.request__copy .lede {
  color: var(--paper);
}

.request__phone {
  display: inline-block;
  margin-top: var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.request__card {
  padding: var(--space-m);
  border-radius: var(--radius-m);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 50px -24px rgb(0 0 0 / 70%);
}

.section--slate .request__card a:not(.btn) {
  color: var(--teal-700);
}

.form-grid {
  display: grid;
  gap: var(--space-s);
}

@media (width >= 40em) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-field--full {
    grid-column: 1 / -1;
  }
}

.form-field {
  display: grid;
  gap: var(--space-2xs);
}

.form-field label {
  font-weight: 700;
}

.form-field__optional {
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 400;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65em 0.8em;
  border: 2px solid var(--border);
  border-radius: var(--radius-s);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

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

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

.form-field [aria-invalid="true"] {
  border-color: #a3261b;
}

.form-field__error {
  display: none;
  color: #a3261b;
  font-size: var(--step--1);
  font-weight: 700;
}

.form-field__error.is-visible {
  display: block;
}

.lead-form__submit {
  width: 100%;
  margin-top: var(--space-m);
}

.lead-form__submit:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

.lead-form__note {
  margin: var(--space-xs) 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.form-status {
  display: none;
  margin-top: var(--space-s);
  padding: var(--space-xs) var(--space-s);
  border-left: 4px solid #a3261b;
  background: #fbe9e7;
  font-weight: 700;
}

.form-status.is-visible {
  display: block;
}

.form-thankyou:focus {
  outline: none;
}

.form-thankyou h3 {
  margin-top: 0;
  font-size: var(--step-2);
}
