/*
Theme Name: Gunby & Co
Description: Premium advisory website
Version: 1.0.0
Text Domain: gunbyandco
*/

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #f3f2ee;
  --bg-alt:       #eae9e3;
  --bg-dark:      #1c1b18;
  --text:         #222018;
  --text-mid:     #5e5b56;
  --text-light:   #8c8985;
  --border:       #d4d1cb;
  --btn:          #222018;
  --btn-text:     #f3f2ee;
  --max-w:        1160px;
  --section-v:    clamp(4rem, 8vw, 7rem);
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.1vw, 17px);
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img  { max-width: 100%; height: auto; display: block; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
button, input, textarea, select { font: inherit; }

/* ─── Layout ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.55rem); }

p { max-width: 62ch; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 13px 30px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  background: var(--btn);
  color: var(--btn-text);
  border: 1px solid var(--btn);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.btn:hover, .btn:focus {
  background: #3d3b36;
  border-color: #3d3b36;
  outline: none;
}

.btn--light {
  background: var(--btn-text);
  color: var(--btn);
  border-color: var(--btn-text);
}

.btn--light:hover, .btn--light:focus {
  background: transparent;
  color: var(--btn-text);
  border-color: var(--btn-text);
}

/* ─── Logo lockup ───────────────────────────────────────────── */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.site-logo__mark {
  height: 40px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.site-logo__text {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 400;
  color: #f3f2ee;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo__mark {
  height: 26px;
  width: auto;
  display: block;
  opacity: 0.7;
}

.footer-logo__text {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: rgba(243,242,238,0.6);
  white-space: nowrap;
}

@media (max-width: 780px) {
  .site-logo__mark { display: none; }
}

/* ─── Header / Nav ──────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(28, 27, 24, 0.97);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 400;
  color: #f3f2ee;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-logo:hover { color: #f3f2ee; opacity: 0.85; }

/* WP wraps menu in div.menu — flatten it */
#nav-menu-wrap { display: flex; align-items: center; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.nav-menu li { position: relative; }

.nav-menu a {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 242, 238, 0.72);
  transition: color 0.15s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a,
.nav-menu .current-page-ancestor > a {
  color: #f3f2ee;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
}

.nav-toggle span {
  display: block;
  height: 1px;
  background: #f3f2ee;
  transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}

.nav-toggle span:nth-child(1) { width: 24px; }
.nav-toggle span:nth-child(2) { width: 16px; }
.nav-toggle span:nth-child(3) { width: 20px; }

.nav-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); width: 24px; }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); width: 24px; }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }

  #nav-menu-wrap { display: block; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: rgba(24, 23, 20, 0.99);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem clamp(1.25rem, 5vw, 2.5rem) 1.5rem;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.07);
  }

  .nav-menu.is-open { display: flex; }

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .nav-menu li:last-child { border-bottom: none; }

  .nav-menu a {
    display: block;
    padding: 14px 0;
    font-size: 13px;
    color: rgba(243, 242, 238, 0.8);
  }
}

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding-top: 64px;
  overflow: hidden;
}

.hero--full  { min-height: 100svh; min-height: 100vh; }
.hero--inner { min-height: clamp(320px, 52vh, 520px); }

.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 15, 13, 0.55);
  z-index: 1;
}

.hero__watermark {
  position: absolute;
  right: -2%;
  top: 50%;
  transform: translateY(-50%);
  width: min(52%, 520px);
  z-index: 2;
  pointer-events: none;
  user-select: none;
  mix-blend-mode: screen;
  opacity: 0.13;
}

.hero__watermark img {
  width: 100%;
  height: auto;
  display: block;
}

.hero__content {
  position: relative;
  z-index: 3;
  max-width: 700px;
  padding: clamp(3rem, 8vh, 5.5rem) 0;
}

.hero__content h1 {
  color: #f3f2ee;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero__content p {
  color: rgba(243, 242, 238, 0.78);
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  line-height: 1.78;
  margin-bottom: 0.9rem;
  max-width: 58ch;
}

.hero__content .btn {
  margin-top: 1.25rem;
}

/* ─── Sections ──────────────────────────────────────────────── */
.section       { padding: var(--section-v) 0; }
.section--alt  { background: var(--bg-alt); }
.section--dark {
  background: var(--bg-dark);
  color: #f3f2ee;
}

.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 2.5rem;
}

/* ─── Intro ──────────────────────────────────────────────────── */
.intro-body { max-width: 640px; }

.intro-body .lead {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 1.75rem;
}

.intro-body p {
  color: var(--text-mid);
  margin-bottom: 0.9rem;
}

/* ─── How We Work ───────────────────────────────────────────── */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
}

.how-step {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.how-step h3 {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.how-step p {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.72;
  max-width: 32ch;
}

@media (max-width: 680px) {
  .how-grid { grid-template-columns: 1fr; gap: 2rem; }
  .how-step p { max-width: none; }
}

/* ─── Pillars ───────────────────────────────────────────────── */
.pillars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}

.pillar {
  padding: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 4rem) clamp(2.5rem, 5vw, 4rem) 0;
}

.pillars-grid .pillar + .pillar {
  padding-left: clamp(2rem, 5vw, 4rem);
  padding-right: 0;
  border-left: 1px solid var(--border);
}

.pillar-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.pillar h2 { margin-bottom: 1rem; }

.pillar p {
  color: var(--text-mid);
  font-size: 0.93rem;
  margin-bottom: 0.85rem;
}

.pillar .btn { margin-top: 1rem; }

@media (max-width: 680px) {
  .pillars-grid { grid-template-columns: 1fr; }
  .pillar { padding: 2.5rem 0; }
  .pillars-grid .pillar + .pillar {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
  }
}

/* ─── Engagement ────────────────────────────────────────────── */
.engagement { max-width: 580px; }

.engagement p {
  color: var(--text-mid);
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

/* ─── CTA section ───────────────────────────────────────────── */
.section--cta {
  background: var(--bg-dark);
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

.cta-inner { max-width: 640px; }

.cta-inner p {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.4;
  color: #f3f2ee;
  margin-bottom: 2rem;
  max-width: none;
}

/* ─── Services (inner pages) ────────────────────────────────── */
.services-list { margin-top: 0.5rem; }

.service-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.75rem, 3vw, 2.5rem) 0;
  border-top: 1px solid var(--border);
}

.service-item:last-child { border-bottom: 1px solid var(--border); }

.service-item h2 {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  color: var(--text);
}

.service-item p {
  color: var(--text-mid);
  font-size: 0.92rem;
  line-height: 1.72;
  max-width: 55ch;
}

@media (max-width: 560px) {
  .service-item {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

/* ─── About ──────────────────────────────────────────────────── */
.about-body { max-width: 620px; }

.about-body p {
  color: var(--text-mid);
  margin-bottom: 1rem;
}

.about-manifesto {
  margin: 1.75rem 0 1.5rem;
  border-left: 2px solid var(--border);
  padding-left: 1.5rem;
}

.about-manifesto p {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

/* ─── Contact ───────────────────────────────────────────────── */
.contact-intro {
  padding: calc(64px + clamp(3.5rem, 7vw, 5.5rem)) 0 clamp(2rem, 4vw, 3rem);
}

.contact-intro h1 {
  margin-bottom: 0.5rem;
}

.contact-intro p {
  color: var(--text-mid);
  font-size: 1rem;
  max-width: none;
}

.contact-form-wrap {
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.contact-form { max-width: 540px; }

.form-field { margin-bottom: 1.5rem; }

.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.5rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--text);
}

.form-field textarea { resize: vertical; min-height: 150px; }

.form-msg {
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 1.5rem;
  border-left: 3px solid;
}

.form-msg--ok  { background: #eff5ef; border-color: #4a7c55; color: #2b5234; }
.form-msg--err { background: #f8efef; border-color: #8b4a4a; color: #5c2d2d; }

.honeypot { display: none; }

/* ─── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-dark);
  padding: clamp(1.75rem, 3vw, 2.5rem) 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: rgba(243, 242, 238, 0.65);
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 242, 238, 0.4);
  transition: color 0.15s ease;
}

.footer-links a:hover { color: rgba(243, 242, 238, 0.78); }

.footer-copy {
  font-size: 12px;
  color: rgba(243, 242, 238, 0.3);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ─── Animations ────────────────────────────────────────────── */

/* Hero entrance — CSS only, fires on load */
@keyframes gco-rise {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__content > * {
  animation: gco-rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.hero__content > *:nth-child(1) { animation-delay: 0.18s; }
.hero__content > *:nth-child(2) { animation-delay: 0.34s; }
.hero__content > *:nth-child(3) { animation-delay: 0.48s; }
.hero__content > *:nth-child(4) { animation-delay: 0.60s; }
.hero__content > *:nth-child(5) { animation-delay: 0.70s; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.75s cubic-bezier(0.22, 0.61, 0.36, 1) var(--reveal-delay, 0s),
    transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) var(--reveal-delay, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Nav link underline draw */
.nav-menu a {
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: rgba(243,242,238,0.7);
  transition: width 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item > a::after,
.nav-menu .current_page_item > a::after {
  width: 100%;
}

/* Header scroll solidify */
.site-header {
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
  background: rgba(24, 23, 20, 0.99);
  border-bottom-color: rgba(255,255,255,0.1);
}

/* Section label slide-in line */
@keyframes gco-line {
  from { width: 0; }
  to   { width: 2rem; }
}

/* Reduced motion — disable everything */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero__content > * {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
  .nav-menu a::after { transition: none; }
  .site-header { transition: none; }
}

/* ─── Utility ───────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
