/* ==========================================================================
   Cox & Rose Consultancy — main stylesheet
   See docs/BRAND.md for the design tokens.
   ========================================================================== */

/* Tokens ------------------------------------------------------------------- */

:root {
  --bg:        #ffffff;
  --bg-soft:   #fdfdfb;
  --ink:       #1f1d1a;
  --ink-mute:  #6b665e;
  --brand:     #cac3b5;
  --brand-deep:#bdb9ad;
  --rule:      #e8e4db;

  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-display: 3.25rem;
  --fs-h2:      2rem;
  --fs-h3:      1.375rem;
  --fs-body:    1.0625rem;
  --fs-small:   0.875rem;
  --fs-eyebrow: 0.75rem;

  --max-w:  1120px;
  --gutter: 24px;
  --section-y: 96px;
}

/* Reset (small, opinionated) ----------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink-mute); }
button { font: inherit; cursor: pointer; }

/* Typography -------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: -0.005em;
}
h1 { font-size: var(--fs-display); line-height: 1.05; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 1em; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 1rem;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-mute);
  max-width: 38em;
}

/* Layout primitives -------------------------------------------------------- */

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section + .section { border-top: 1px solid var(--rule); }

/* Alternate content panels using the same warm off-white as the footer. */
main > .section:nth-of-type(even) { background: var(--bg-soft); }

/* Site header / nav -------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand img { width: 40px; height: auto; }
.brand:hover { color: var(--ink); }

.nav {
  display: flex;
  gap: 28px;
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
}
.nav a {
  position: relative;
  padding: 6px 0;
  color: var(--ink);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 720px) {
  .nav { display: none; }
  .nav.is-open {
    display: flex;
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 12px var(--gutter) 18px;
  }
  .nav.is-open a { padding: 12px 0; border-top: 1px solid var(--rule); }
  .nav-toggle { display: inline-flex; }
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  padding-block: 48px;
  color: var(--ink-mute);
  font-size: var(--fs-small);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 12px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer__brand { max-width: 320px; }
.site-footer__brand p { margin: 0; }

/* Hero --------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: calc(var(--section-y) * 0.8);
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero h1 { max-width: 11ch; }
.hero .lede { margin-top: 1.25rem; }
.hero__actions {
  margin-top: 2rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero__image {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 8px;
  background: var(--bg);
  box-shadow:
    18px 24px 45px -28px rgba(31, 29, 26, 0.38),
    0 8px 18px -14px rgba(31, 29, 26, 0.22);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transform: perspective(1400px) rotateX(1deg) rotateY(-3deg) rotateZ(-0.35deg);
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 300ms ease, box-shadow 300ms ease;
}
@media (hover: hover) {
  .hero__image:hover {
    transform: perspective(1400px) rotateX(0deg) rotateY(-1.5deg) rotateZ(0deg) translateY(-4px);
    box-shadow:
      20px 30px 52px -28px rgba(31, 29, 26, 0.42),
      0 12px 22px -14px rgba(31, 29, 26, 0.24);
  }
}
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-block: 56px; }
}

/* Buttons ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 2px;
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn--primary {
  background: var(--ink);
  color: #fff;
}
.btn--primary:hover { background: #000; color: #fff; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: #fff; }

/* Pillars (3-up grid) ------------------------------------------------------ */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
.pillar h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.pillar p { color: var(--ink-mute); }
.pillar__mark {
  display: inline-block;
  width: 32px; height: 1px;
  background: var(--brand);
  margin-bottom: 18px;
}
@media (max-width: 880px) { .pillars { grid-template-columns: 1fr; gap: 32px; } }

/* Services list ------------------------------------------------------------ */

.services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.services__image {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 8px;
  background: var(--bg);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  position: sticky;
  top: 100px;
  transform: perspective(1400px) rotateX(1deg) rotateY(3deg) rotateZ(0.35deg);
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  box-shadow:
    -18px 24px 45px -28px rgba(31, 29, 26, 0.38),
    0 8px 18px -14px rgba(31, 29, 26, 0.22);
  transition: transform 300ms ease, box-shadow 300ms ease;
}
@media (hover: hover) {
  .services__image:hover {
    transform: perspective(1400px) rotateX(0deg) rotateY(1.5deg) rotateZ(0deg) translateY(-4px);
    box-shadow:
      -20px 30px 52px -28px rgba(31, 29, 26, 0.42),
      0 12px 22px -14px rgba(31, 29, 26, 0.24);
  }
}
.services__list { display: grid; gap: 28px; }
.service {
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.service:last-child { border-bottom: 1px solid var(--rule); }
.service h3 { margin-bottom: 0.4rem; }
.service p { color: var(--ink-mute); margin: 0; }
@media (max-width: 880px) {
  .services { grid-template-columns: 1fr; gap: 32px; }
  .services__image { position: static; }
}

/* Two-column split (about) ------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}
.split h2 { max-width: 12ch; }
.split__body p { color: var(--ink-mute); }
.split__body ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.split__body li {
  padding-left: 24px;
  position: relative;
  color: var(--ink-mute);
}
.split__body li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7em;
  width: 12px; height: 1px;
  background: var(--brand);
}
@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
}

/* Contact ------------------------------------------------------------------ */

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.contact__form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label {
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field input,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 160ms ease;
}
.field input:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--ink);
}
.field textarea { min-height: 140px; resize: vertical; }
.contact__details p { color: var(--ink-mute); }
.contact__details a { border-bottom: 1px solid var(--brand); }
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; gap: 32px; } }

/* Page header (non-home) -------------------------------------------------- */

.page-header {
  padding-block: calc(var(--section-y) * 0.7);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
}
.page-header h1 { max-width: 18ch; }
.page-header .lede { max-width: 42em; }

/* Utility ------------------------------------------------------------------ */

.text-mute { color: var(--ink-mute); }
.center-text { text-align: center; }
.mt-3 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

/* Reduced motion ----------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
