/* ==========================================================================
   BASE — typography, layout helpers, buttons, utilities
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* Paints the phone's top safe-area band behind the sticky header */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--ivory);
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.02; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.15; }
h4 { font-size: var(--fs-h4); line-height: 1.2; }
p, ul, ol, dl, figure, blockquote { margin: 0; }

a {
  color: var(--burgundy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.2s ease;
}
a:hover { color: var(--ember-deep); }

em.accent, .accent {
  font-style: italic;
  font-weight: 500;
  color: var(--burgundy);
}

strong { font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}
.band--dark :focus-visible,
.band--emerald :focus-visible,
.site-footer :focus-visible { outline-color: var(--gold-soft); }

main:focus { outline: none; }

/* ---------- Accessibility helpers ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: max(1rem, env(safe-area-inset-left, 0px));
  top: -4rem;
  z-index: 100;
  padding: 0.85rem 1.25rem;
  background: var(--ink);
  color: var(--ivory);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-btn);
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); color: var(--ivory); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}
.container--narrow { max-width: 50rem; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(3rem, 2.5rem + 3vw, 5rem); }

.band--ivory { background: var(--ivory); }
.band--cream { background-color: var(--cream); background-image: var(--grain); }
.band--dark  { background: var(--charcoal); color: var(--on-dark); }
.band--emerald { background: var(--emerald); color: var(--on-dark); }
.band--dark h1, .band--dark h2, .band--dark h3, .band--dark h4,
.band--emerald h1, .band--emerald h2, .band--emerald h3 { color: var(--ivory); }
.band--dark .accent, .band--emerald .accent { color: var(--gold-soft); }
.band--dark a:not(.btn), .band--emerald a:not(.btn) { color: var(--gold-soft); }
.band--dark a:not(.btn):hover, .band--emerald a:not(.btn):hover { color: var(--ivory); }

.section-head {
  display: grid;
  gap: 1rem;
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.stack { display: grid; gap: var(--gap, 1.25rem); align-content: start; }
.stack > * { min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem 1rem; }

.split {
  display: grid;
  gap: clamp(2.5rem, 2rem + 3vw, 5rem);
  align-items: center;
}
.split > * { min-width: 0; }
@media (min-width: 56rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--wide-left { grid-template-columns: 1.15fr 0.85fr; }
  .split--wide-right { grid-template-columns: 0.85fr 1.15fr; }
  .split--top { align-items: start; }
}

/* ---------- Type helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-label);
  font-size: var(--fs-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  line-height: 1.4;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}
.section-head--center .eyebrow::after {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}
.band--dark .eyebrow, .band--emerald .eyebrow { color: var(--gold-soft); }

.lede {
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: var(--measure);
}
.band--dark .lede, .band--emerald .lede { color: var(--on-dark-muted); }

.display-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.45rem, 1.25rem + 0.8vw, 1.9rem);
  line-height: 1.3;
  color: var(--burgundy);
}
.band--dark .display-italic, .band--emerald .display-italic { color: var(--gold-soft); }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.6em; font-size: var(--fs-h3); }
.prose h3 { margin-top: 1.4em; font-size: var(--fs-h4); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); line-height: 1.6; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.8rem 1.75rem;
  font-family: var(--font-label);
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.btn .icon { width: 1.15em; height: 1.15em; flex: none; }
.btn-primary { background: var(--burgundy); color: var(--ivory); }
.btn-primary:hover { background: var(--burgundy-deep); color: var(--ivory); box-shadow: inset 0 0 0 1px var(--gold-soft); }
.btn-outline { background: transparent; color: var(--burgundy); border-color: currentColor; }
.btn-outline:hover { background: rgba(107, 30, 43, 0.06); color: var(--burgundy-deep); }
.btn-gold { background: var(--gold-soft); color: var(--ink); }
.btn-gold:hover { background: #E6CD92; color: var(--ink); box-shadow: 0 0 0 4px rgba(217, 188, 122, 0.18); }
.btn-ghost-light { background: transparent; color: var(--ivory); border-color: rgba(244, 234, 215, 0.55); }
.btn-ghost-light:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.btn-lg { min-height: 3.6rem; padding-inline: 2.25rem; font-size: 1.05rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem 1rem; }
@media (max-width: 34rem) {
  .btn-row > .btn { flex: 1 1 100%; }
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--burgundy);
  padding-block: 0.4rem;
  border-bottom: 1px solid var(--gold);
}
.link-arrow .icon { width: 1.1em; height: 1.1em; transition: transform 0.25s ease; }
.link-arrow:hover .icon { transform: translateX(3px); }
.band--dark .link-arrow, .band--emerald .link-arrow { color: var(--gold-soft); }

.icon { width: 1.5rem; height: 1.5rem; flex: none; }

/* ---------- Ornaments ---------- */
/* Root-line divider: a gold seed with roots spreading beneath */
.rootline {
  width: 15rem;
  max-width: 100%;
  height: 1.5rem;
  margin-inline: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 24' fill='none' stroke='%23B48C43' stroke-width='1' stroke-linecap='round'%3E%3Cpath d='M0 8h102M138 8h102'/%3E%3Cpath d='M120 1.5l5.5 6.5-5.5 6.5-5.5-6.5z' fill='%23B48C43'/%3E%3Cpath d='M120 14.5v8.5M120 16c-1 3.5-4 5.5-8 7M120 16c1 3.5 4 5.5 8 7M102 8c-5 0-8 2.5-11 6.5M138 8c5 0 8 2.5 11 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Fine gold rule with a slow travelling glint */
.gold-rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, #F0D9A0 50%, var(--gold) 80%, transparent) 0 0 / 200% 100%;
  animation: glint 9s ease-in-out infinite;
  opacity: 0.8;
}

/* ---------- Placeholders & owner notes ---------- */
.ph {
  background: rgba(176, 80, 28, 0.12);
  color: var(--ember-deep);
  border-bottom: 1px dashed var(--ember);
  padding: 0 0.2em;
  border-radius: 2px;
  font-style: normal;
}
.band--dark .ph, .band--emerald .ph, .site-footer .ph, .service-card--premium .ph {
  background: rgba(217, 188, 122, 0.16);
  color: var(--gold-soft);
  border-bottom-color: var(--gold-soft);
}
.owner-note {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  border: 1.5px dashed var(--ember);
  border-radius: var(--radius);
  background: #FFF4E8;
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.55;
  text-align: left;
}
.owner-note strong {
  font-family: var(--font-label);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember-deep);
}
.owner-note code {
  font-size: 0.95em;
  background: rgba(176, 80, 28, 0.1);
  padding: 0 0.3em;
  border-radius: 2px;
}

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes glint {
  0%, 100% { background-position: 100% 0; }
  50%      { background-position: 0 0; }
}
@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1, 1); opacity: 1; }
  25%      { transform: translateX(-50%) scale(0.96, 1.04); opacity: 0.94; }
  50%      { transform: translateX(-52%) scale(1.02, 0.97); opacity: 1; }
  75%      { transform: translateX(-49%) scale(0.98, 1.03); opacity: 0.96; }
}
@keyframes glow {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}
@keyframes drift {
  0%   { transform: translateY(0); opacity: 0; }
  20%  { opacity: 0.5; }
  100% { transform: translateY(-18px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
