/* ==========================================================================
   Red Lion Solutions — Heraldic build
   Palette pulled from the crest:
     oxblood   #6E121C   primary brand
     heraldic  #C9A24B   gold, hairlines and marks only
     ivory     #F5EFE1   page ground
     paper     #FBF7EC   subtle warmer ground
     ink       #1A1A1A   body copy
     muted     #6B6357   secondary copy
     rule      #DCD5C4   dividers
     dark      #1A1210   footer only
   Type: Cormorant Garamond (display serif) · Inter (body) · JetBrains Mono (registers)
   ========================================================================== */

:root {
  --oxblood:      #6E121C;
  --oxblood-deep: #4A0C14;
  --gold:         #C9A24B;
  --gold-soft:    #d9b872;
  --ivory:        #F5EFE1;
  --paper:        #FBF7EC;
  --ink:          #1A1A1A;
  --muted:        #6B6357;
  --rule:         #DCD5C4;
  --dark:         #1A1210;
  --dark-rule:    #3A2F2B;

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 88px;
  --space-10: 120px;

  --radius: 0;
  --page-max: 1180px;
  --page-pad: 40px;

  --dur: 220ms;
  --ease: cubic-bezier(.2,.6,.2,1);
}

/* -------- Base -------- */
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
strong { font-weight: 600; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin: 0;
}
h1 { font-size: clamp(40px, 5vw, 60px); line-height: 1.06; }
h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; }
h3 { font-size: 22px; line-height: 1.25; }

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-pad); }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--oxblood);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--gold);
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--oxblood);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn--primary { background: var(--oxblood); color: var(--ivory); }
.btn--primary:hover { background: var(--oxblood-deep); border-color: var(--oxblood-deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--ivory); }
.btn--gold { background: var(--gold); color: #2b1010; border-color: var(--gold); }
.btn--gold:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.btn--ivory-ghost { background: transparent; color: var(--ivory); border-color: var(--ivory); }
.btn--ivory-ghost:hover { background: var(--ivory); color: var(--oxblood); }
.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* -------- Header -------- */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 247, 236, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  width: 40px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand__mark svg,
.brand__mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand__name { line-height: 1; }
.brand__word {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
}
.brand__name small {
  display: block;
  font-family: var(--font-sans);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 6px;
  font-weight: 500;
}
.nav { display: flex; align-items: center; gap: 32px; }
.nav__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
}
.nav__links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 0;
  position: relative;
}
.nav__links a[aria-current="page"]::after,
.nav__links a:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--gold);
}
.header-actions { display: flex; align-items: center; gap: 14px; }

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
}

/* -------- Hero -------- */
.hero {
  padding: 90px 0 100px;
  position: relative;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 80px;
  align-items: center;
}
.hero h1 { margin: 0 0 26px; }
.hero h1 em {
  color: var(--oxblood);
  font-style: italic;
  font-weight: 500;
}
.hero__sub, .hero__lead {
  font-size: 17px;
  color: #3a3630;
  max-width: 52ch;
  margin: 0 0 32px;
  line-height: 1.6;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.hero__crest {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__crest img { width: 100%; max-width: 380px; }

/* Compact hero variant for About */
.hero--about { padding-top: 80px; padding-bottom: 90px; }
.hero--about h1 { font-size: clamp(38px, 4.6vw, 54px); }

/* -------- Section scaffold -------- */
.section {
  padding: 90px 0;
  border-top: 1px solid var(--rule);
}
.section--tint { background: #F0E9D6; }

.sect-head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  margin-bottom: 56px;
}
.sect-head .mono { padding-top: 10px; }
.sect-head h2 { margin: 0 0 14px; max-width: 22ch; }
.sect-head p { color: var(--muted); max-width: 60ch; margin: 0; font-size: 15.5px; }

/* Doctrine section header allows title-only variant */
.sect-head--titleonly h2 { max-width: 30ch; }

/* -------- Services / Tiles ledger -------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}
.tile {
  padding: 40px 32px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: transparent;
}
.tile:last-child { border-right: 0; }
.tile__no {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 14px;
}
.tile h3 { margin: 0 0 12px; font-size: 24px; }
.tile p { color: #3a3630; font-size: 14.5px; margin: 0 0 22px; }
.tile__tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile__tags li {
  font-size: 12.5px;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}
.tile__tags li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 1px;
  background: var(--gold);
}

/* Two-column tile grid (About credentials, 6 items) */
.tiles--proof {
  grid-template-columns: repeat(3, 1fr);
}

/* -------- Signal Loop (ledger) -------- */
.loop {
  border: 1px solid var(--rule);
  background: #ffffff;
}
.loop__row {
  display: grid;
  grid-template-columns: 60px 220px 1fr;
  gap: 24px;
  padding: 22px 28px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
.loop__row:last-child { border-bottom: 0; }
.loop__n {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.loop__k {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
}
.loop__v { font-size: 14px; color: #3a3630; }

/* -------- Doctrine table -------- */
.doctrine {
  border: 1px solid var(--rule);
  background: #ffffff;
}
.doctrine__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}
.doctrine__row:last-child { border-bottom: 0; }
.doctrine__cell {
  padding: 22px 26px;
  font-size: 14.5px;
  line-height: 1.55;
}
.doctrine__cell + .doctrine__cell {
  border-left: 1px solid var(--rule);
  color: var(--muted);
}
.doctrine__row--head .doctrine__cell {
  background: var(--oxblood);
  color: var(--ivory);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.doctrine__row--head .doctrine__cell + .doctrine__cell {
  background: #3a2226;
  color: #c8c1b0;
}

/* -------- About: failure modes register -------- */
.failmodes {
  border: 1px solid var(--rule);
  background: #ffffff;
  margin: 22px 0;
}
.failmodes > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.failmodes > div:last-child { border-bottom: 0; }
.failmodes__k {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.failmodes__v { font-size: 14px; color: #3a3630; }

/* -------- About: prose -------- */
.about__layout {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 56px;
  align-items: start;
}
.section__head h2 { max-width: 24ch; margin: 0 0 14px; }
.section__head--wide h2 { max-width: 34ch; }
.section__head p { color: var(--muted); font-size: 15.5px; max-width: 60ch; margin: 0; }
.prose p { font-size: 15.5px; color: #2f2b25; line-height: 1.65; margin: 0 0 18px; max-width: 66ch; }

/* -------- About: phases -------- */
.phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}
.phase {
  padding: 36px 30px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.phase:last-child { border-right: 0; }
.phase__no {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 12px;
}
.phase h3 { margin: 0 0 12px; font-size: 22px; }
.phase p { font-size: 14.5px; color: #3a3630; margin: 0 0 18px; }
.phase__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.phase__list li {
  font-size: 12.5px;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}
.phase__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 1px;
  background: var(--gold);
}

/* -------- About: principles -------- */
.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule);
  background: transparent;
}
.principles article {
  padding: 32px 30px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.principles article:nth-child(2n) { border-right: 0; }
.principles__no {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 12px;
}
.principles h3 { margin: 0 0 10px; font-size: 22px; }
.principles p { font-size: 14.5px; color: #3a3630; margin: 0; max-width: 52ch; }

/* -------- CTA slab -------- */
.cta {
  background: var(--oxblood);
  color: var(--ivory);
  padding: 100px 0;
  text-align: center;
  position: relative;
  border-top: 0;
}
.cta::before, .cta::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--gold);
  opacity: 0.55;
  position: absolute;
  left: 40px;
  right: 40px;
}
.cta::before { top: 22px; }
.cta::after  { bottom: 22px; }
.cta .flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 26px;
}
.cta .flourish::before, .cta .flourish::after {
  content: "";
  width: 60px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}
.cta .flourish .diamond {
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}
.cta h2 {
  color: var(--ivory);
  max-width: 24ch;
  margin: 0 auto 20px;
}
.cta p {
  color: #e8dfc9;
  max-width: 52ch;
  margin: 0 auto 32px;
  font-size: 16px;
  line-height: 1.6;
}
.cta__btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* -------- Footer -------- */
.footer {
  background: var(--dark);
  color: #c9c1ae;
  padding: 60px 0 32px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer .brand { color: var(--ivory); }
.footer .brand__name small { color: #a49b87; }
.footer__meta {
  color: #a49b87;
  font-size: 13.5px;
  max-width: 44ch;
  margin: 16px 0 0;
  line-height: 1.6;
}
.footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer__links a {
  color: #c9c1ae;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.footer__links a:hover { color: var(--gold); }
.footer__bottom {
  border-top: 1px solid var(--dark-rule);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  color: #7d7361;
  text-transform: uppercase;
}

/* -------- Reveal animation (safe / progressive) -------- */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 500ms var(--ease), transform 500ms var(--ease);
  }
  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* -------- Responsive -------- */
@media (max-width: 960px) {
  :root { --page-pad: 28px; }
  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .hero__crest { order: -1; }
  .hero__crest img { max-width: 260px; }
  .sect-head { grid-template-columns: 1fr; gap: 8px; margin-bottom: 40px; }
  .sect-head .mono { padding-top: 0; }
  .about__layout { grid-template-columns: 1fr; gap: 24px; }
  .tiles, .tiles--proof, .phases { grid-template-columns: 1fr; }
  .tile, .phase { border-right: 0; }
  .principles { grid-template-columns: 1fr; }
  .principles article { border-right: 0; }
  .loop__row { grid-template-columns: 44px 1fr; }
  .loop__v { grid-column: 1 / -1; padding-left: 68px; }
  .doctrine__row { grid-template-columns: 1fr; }
  .doctrine__cell + .doctrine__cell { border-left: 0; border-top: 1px solid var(--rule); }
  .doctrine__row--head .doctrine__cell + .doctrine__cell { border-top: 1px solid var(--dark-rule); }
  .failmodes > div { grid-template-columns: 1fr; gap: 4px; }
  .nav__links { display: none; }
  .header-actions .btn { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav--open .nav__links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--paper);
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }
  .nav--open .nav__links li { border-top: 1px solid var(--rule); }
  .nav--open .nav__links a { display: block; padding: 14px 28px; }
  .hero { padding: 60px 0 70px; }
  .section, .cta { padding: 70px 0; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; gap: 8px; }
}
@media (max-width: 560px) {
  h1 { font-size: 38px; }
  h2 { font-size: 28px; }
  .brand__mark { width: 34px; height: 38px; }
  .brand__word { font-size: 17px; }
  .cta::before, .cta::after { left: 20px; right: 20px; }
}

/* -------- Skip link -------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.sr-only:focus {
  position: absolute;
  width: auto; height: auto;
  padding: 10px 14px; margin: 8px;
  clip: auto; white-space: normal;
  background: var(--oxblood); color: var(--ivory);
  z-index: 100;
}
