/* ==========================================================================
   Apexmark — global styles
   Ported faithfully from the handoff reference HTML. Do not introduce colours
   outside the design tokens below. Mobile breakpoints (1024px / 768px) added
   per the handoff spec.
   ========================================================================== */

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

:root {
  --green-deep: #2D4A3E;
  --green-mid: #4A7C6F;
  --green-light: #8BB4A8;
  --green-pale: #E8F0ED;
  --bg: #F0F4F2;
  --text: #1C2B26;
  --text-muted: #4A6358;
  --sand: #E8A87C;
  --sand-dark: #C4774A;
  --white: #FFFFFF;
  --border: #C5D9D3;
  --content-max: 1200px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* --- Nav -------------------------------------------------------------- */
nav {
  background: var(--green-deep);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo svg { width: 32px; height: 32px; }
.nav-brand {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
}
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); }
.nav-cta {
  background: var(--sand);
  color: var(--green-deep);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--sand-dark); color: var(--white); }

/* Hamburger (hidden until <=768px) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer (populated below 768px) */
.mobile-menu {
  display: none;
  background: var(--green-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 2.5rem 1.5rem;
  position: sticky;
  top: 64px;
  z-index: 99;
}
.mobile-menu a {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-menu a.nav-cta {
  display: inline-block;
  margin-top: 1rem;
  border-bottom: none;
  color: var(--green-deep);
}
.mobile-menu a.nav-cta:hover { color: var(--white); }

/* --- Hero ------------------------------------------------------------- */
.hero {
  background: var(--green-deep);
  padding: 5rem 2.5rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero-watermark {
  position: absolute;
  right: -1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Fraunces', serif;
  font-size: 14rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.04);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-light);
  margin-bottom: 1.25rem;
}
.hero-headline {
  font-family: 'Fraunces', serif;
  font-size: 3.25rem;
  font-weight: 300;
  color: var(--white);
  line-height: 1.15;
  max-width: 620px;
  margin-bottom: 1.5rem;
}
.hero-headline em { font-style: italic; color: var(--sand); }
.hero-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

.btn-primary {
  background: var(--sand);
  color: var(--green-deep);
  padding: 0.85rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--sand-dark); color: var(--white); }
.btn-ghost {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--white); }
.btn-ghost svg { width: 16px; height: 16px; }

/* --- Trust bar -------------------------------------------------------- */
.trust-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.trust-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.trust-items { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.trust-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-light); }

/* --- Generic section -------------------------------------------------- */
.section { padding: 4rem 2.5rem; }
.section-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: 'Fraunces', serif;
  font-size: 2.25rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2.5rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  transition: border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.service-card:hover { border-color: var(--green-mid); }
.service-card.featured { border-color: var(--green-mid); border-width: 1.5px; }
.service-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--green-pale);
  color: var(--green-deep);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.service-icon {
  width: 40px;
  height: 40px;
  background: var(--green-pale);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.service-icon svg { width: 20px; height: 20px; stroke: var(--green-deep); fill: none; stroke-width: 1.5; }
.service-name {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.service-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.service-link {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--green-mid);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.service-link svg { width: 14px; height: 14px; stroke: var(--green-mid); fill: none; }

.section-divider { border: none; border-top: 1px solid var(--border); margin: 0 2.5rem; }

/* --- Process ---------------------------------------------------------- */
.process-section { padding: 4rem 2.5rem; background: var(--green-deep); }
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  position: relative;
}
.process-step { padding: 2rem 1.5rem; border-left: 1px solid rgba(255, 255, 255, 0.1); }
.process-step:first-child { border-left: none; }
.step-num {
  font-family: 'Fraunces', serif;
  font-size: 3rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.12);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.step-title {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.step-desc { font-size: 0.85rem; color: rgba(255, 255, 255, 0.55); line-height: 1.65; }

/* --- About strip ------------------------------------------------------ */
.about-strip {
  padding: 4rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.about-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: 0.75rem;
}
.about-title {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 1rem;
}
.about-body {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}
.about-right { display: flex; flex-direction: column; gap: 1rem; }
.about-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.stat-icon {
  width: 36px;
  height: 36px;
  background: var(--green-pale);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 18px; height: 18px; stroke: var(--green-deep); fill: none; stroke-width: 1.5; }
.stat-text strong { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.stat-text span { font-size: 0.8rem; color: var(--text-muted); }

/* --- Articles --------------------------------------------------------- */
.articles-section { padding: 4rem 2.5rem; background: var(--white); }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.article-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  background: var(--bg);
  transition: border-color 0.2s;
}
.article-card:hover { border-color: var(--green-mid); }
.article-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: 0.5rem;
}
.article-title {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
.article-excerpt {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.article-meta { font-size: 0.75rem; color: var(--text-muted); }

/* --- CTA band --------------------------------------------------------- */
.cta-band {
  background: var(--green-mid);
  padding: 3.5rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-band-text h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.9rem;
  font-weight: 300;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.cta-band-text p { font-size: 0.95rem; color: rgba(255, 255, 255, 0.65); }
.btn-cta-band {
  background: var(--sand);
  color: var(--green-deep);
  padding: 0.9rem 2.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-cta-band:hover { background: var(--sand-dark); color: var(--white); }

/* --- Footer ----------------------------------------------------------- */
footer { background: var(--green-deep); padding: 3rem 2.5rem 2rem; color: rgba(255, 255, 255, 0.6); }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-brand {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-tagline { font-size: 0.85rem; line-height: 1.6; max-width: 240px; }
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 0.75rem;
}
.footer-col a { display: block; font-size: 0.875rem; margin-bottom: 0.4rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-legal { font-size: 0.8rem; }
.footer-entity { font-size: 0.8rem; color: rgba(255, 255, 255, 0.35); }

/* --- Stub / "coming soon" pages -------------------------------------- */
.stub {
  padding: 6rem 2.5rem;
  text-align: center;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.stub-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-mid);
}
.stub-message {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
}

/* --- App loading + Blazor error UI ------------------------------------ */
.app-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.app-loading svg { width: 56px; height: 56px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.94); }
}

#blazor-error-ui {
  background: var(--green-deep);
  color: var(--white);
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  font-size: 0.875rem;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
#blazor-error-ui .reload { color: var(--sand); text-decoration: underline; }

/* ==========================================================================
   Content width — cap the page to a centred column while keeping the full-bleed
   coloured bands. The padding trick (min 2.5rem gutter, growing to centre the
   content once the viewport exceeds --content-max) means no wrapper elements are
   needed. Declared after the band rules so padding-inline overrides their
   shorthand; the mobile breakpoints below re-override the gutter to 1.25rem.
   ========================================================================== */
nav,
.hero,
.trust-bar,
.section,
.process-section,
.about-strip,
.articles-section,
.cta-band,
footer,
.stub {
  padding-inline: max(2.5rem, calc((100% - var(--content-max)) / 2));
}
.section-divider {
  margin-inline: max(2.5rem, calc((100% - var(--content-max)) / 2));
}

/* ==========================================================================
   Responsive breakpoints (added per handoff spec)
   ========================================================================== */

/* Below 1024px */
@media (max-width: 1023.98px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .about-strip { grid-template-columns: 1fr; }
}

/* Below 768px */
@media (max-width: 767.98px) {
  nav { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu.open { display: block; }
  .mobile-menu { padding-inline: 1.25rem; }

  .hero { padding: 3.5rem 1.25rem 3rem; }
  .hero-headline { font-size: 2.25rem; }
  .hero-watermark { display: none; }

  .trust-bar { padding: 1rem 1.25rem; }

  .section,
  .process-section,
  .about-strip,
  .articles-section { padding: 2.5rem 1.25rem; }

  .section-divider { margin: 0 1.25rem; }

  .services-grid { grid-template-columns: 1fr; }

  .process-steps { grid-template-columns: 1fr; }
  .process-step { border-left: none; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .process-step:first-child { border-top: none; }

  .about-strip { gap: 2rem; }

  .cta-band { padding: 2.5rem 1.25rem; flex-direction: column; text-align: center; }
  .cta-band-text { display: flex; flex-direction: column; align-items: center; }

  footer { padding: 2.5rem 1.25rem 2rem; }
  .footer-top { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .stub { padding: 4rem 1.25rem; }
}

/* ==========================================================================
   Content templates — service pages, the about page, articles, and contact.
   These build on the existing design tokens and component patterns above; no
   existing rules or tokens are modified. Each new full-bleed band repeats the
   centred-column padding trick so it lines up with the homepage bands.
   ========================================================================== */

/* Shared page hero (service / about / contact) — a compact dark band. */
.page-hero {
  background: var(--green-deep);
  padding: 4.5rem 2.5rem 4rem;
  padding-inline: max(2.5rem, calc((100% - var(--content-max)) / 2));
}
.page-hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-light);
  margin-bottom: 1rem;
}
.page-hero-title {
  font-family: 'Fraunces', serif;
  font-size: 2.75rem;
  font-weight: 300;
  color: var(--white);
  line-height: 1.15;
  max-width: 720px;
  margin-bottom: 1rem;
}
.page-hero-tagline {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Generic centred content band, used to host rendered Markdown. */
.content-section {
  padding: 4rem 2.5rem;
  padding-inline: max(2.5rem, calc((100% - var(--content-max)) / 2));
}
.content-column {
  max-width: 720px;
  margin-inline: auto;
}

/* Article page — a narrower reading column. */
.article-page {
  padding: 4rem 2.5rem 4.5rem;
  padding-inline: max(2.5rem, calc((100% - var(--content-max)) / 2));
}
.article-column {
  max-width: 680px;
  margin-inline: auto;
}
.article-headline {
  font-family: 'Fraunces', serif;
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1.15;
  margin: 0.75rem 0 1rem;
}
.article-meta-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 3rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-mid);
}
.article-back:hover { color: var(--green-deep); }
.article-back svg { width: 14px; height: 14px; }

/* Make the article index cards work as full-card links. */
a.article-card { display: block; color: inherit; }

/* Prose — typography for Markdown-rendered bodies (articles, services, about). */
.prose { color: var(--text); font-size: 1rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose p { margin-bottom: 1.25rem; }
.prose h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.25;
  margin: 2.5rem 0 1rem;
}
.prose h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}
.prose ul, .prose ol { margin: 0 0 1.25rem 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--green-mid); }
.prose a {
  color: var(--green-mid);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover { color: var(--green-deep); }
.prose strong { color: var(--text); font-weight: 600; }
.prose blockquote {
  border-left: 3px solid var(--green-light);
  padding-left: 1.25rem;
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}
.prose code {
  background: var(--green-pale);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Contact — centred Tally embed. The form is transparent and self-sizing, so it
   sits directly on the section background with no frame of its own. */
.contact-embed { max-width: 720px; margin-inline: auto; }
.contact-iframe {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
}
.contact-fallback {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.contact-fallback a {
  color: var(--green-mid);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.contact-fallback a:hover { color: var(--green-deep); }

/* Privacy note — a footnote, quieter than the email fallback above it. */
.contact-privacy {
  margin-top: 0.75rem;
  margin-inline: auto;
  max-width: 46ch;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* --- Content template responsive overrides --------------------------- */
@media (max-width: 767.98px) {
  .page-hero { padding: 3.25rem 1.25rem 2.75rem; }
  .page-hero-title { font-size: 2rem; }

  .content-section { padding: 2.5rem 1.25rem; }
  .article-page { padding: 2.5rem 1.25rem 3rem; }
  .article-headline { font-size: 1.875rem; }
  .article-meta-line { margin-bottom: 1.75rem; }
}
