/* =========================================
   Esther's Pillar LLC
   ========================================= */

/* --- Tokens --- */
:root {
  --color-bg:       #FAF7F2;
  --color-surface:  #F0EBE3;
  --color-dark:     #1E1E1E;
  --color-text:     #2C2C2C;
  --color-muted:    #5E5A54;
  --color-accent:   #6B4226;
  --color-accent-l: #8B6340;
  --color-pillar:   #C4883A;
  --color-deep:     #2D3A2E;
  --color-cream:    #FAF7F2;

  --font-heading: 'Fraunces', Georgia, serif;
  --font-body:    'Outfit', system-ui, sans-serif;

  --w-page: 72rem;
  --w-narrow: 52rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; padding: 0; }
address { font-style: normal; }

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-deep);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 200;
  border-radius: 0 0 4px 4px;
  font-size: 0.875rem;
}
.skip-link:focus { top: 0; }

/* =========================================
   Header
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.header-inner {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}
.logo-mark {
  display: block;
  width: 3px;
  height: 1.75rem;
  background: var(--color-pillar);
  border-radius: 1px;
}
.logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-dark);
}

/* Nav */
nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
}
nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-muted);
  transition: color 0.2s;
}
nav a:hover,
nav a:focus-visible { color: var(--color-dark); }
.nav-cta {
  background: var(--color-deep);
  color: var(--color-cream) !important;
  padding: 0.5rem 1.25rem;
  border-radius: 3px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--color-accent); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-dark);
  position: absolute;
  left: 0;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle span:first-child { top: 8px; }
.nav-toggle span:last-child { top: 18px; }
.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

/* =========================================
   Hero Slider
   ========================================= */
.hero {
  position: relative;
  overflow: hidden;
}
.hero-slider {
  position: relative;
  height: clamp(28rem, 70vh, 44rem);
}
.hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
  transform: scale(1.03);
}
.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
/* Per-slide positioning to keep the subject visible */
.hero-slide:nth-child(1) img { object-position: 60% 15%; }
.hero-slide:nth-child(2) img { object-position: center 10%; }
.hero-slide:nth-child(3) img { object-position: center 15%; }
.hero-slide-caption {
  position: absolute;
  bottom: 4.5rem;
  right: var(--gutter);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  z-index: 3;
}

/* Overlay with text */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0.15) 40%,
    transparent 70%
  );
  display: flex;
  align-items: end;
  padding: 0 var(--gutter) clamp(4rem, 8vw, 6rem);
}
.hero-content {
  max-width: var(--w-page);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 1.5rem;
  align-items: end;
}
.hero-pillar {
  width: 4px;
  height: clamp(4rem, 10vw, 8rem);
  background: linear-gradient(to bottom, transparent, var(--color-pillar));
  border-radius: 2px;
}
.hero-text h1 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.25;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.hero-lead {
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  line-height: 1.7;
  color: rgba(255,255,255,0.85);
  max-width: 36rem;
}

/* Slider controls */
.hero-controls {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero-prev,
.hero-next {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}
.hero-prev:hover,
.hero-next:hover {
  background: rgba(255,255,255,0.3);
}
.hero-dots {
  display: flex;
  gap: 0.5rem;
}
.hero-dot {
  width: 2rem;
  height: 3px;
  border-radius: 1px;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, width 0.3s;
}
.hero-dot.is-active {
  background: var(--color-pillar);
  width: 2.5rem;
}

/* =========================================
   Opening (continued below hero)
   ========================================= */
.opening {
  padding: clamp(3rem, 6vw, 5rem) var(--gutter);
  max-width: var(--w-page);
  margin: 0 auto;
}
.opening-inner {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 2rem;
  align-items: start;
}
.opening-pillar {
  width: 4px;
  background: linear-gradient(to bottom, var(--color-pillar), var(--color-accent));
  border-radius: 2px;
  min-height: 100%;
  margin-top: 0.25rem;
}
.opening-content > p {
  color: var(--color-muted);
  max-width: 42rem;
  margin-bottom: 1rem;
}
.opening-content > p:last-child { margin-bottom: 0; }

/* =========================================
   Who We Serve
   ========================================= */
.serve {
  background: var(--color-deep);
  color: var(--color-cream);
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter);
}
.serve-inner {
  max-width: var(--w-page);
  margin: 0 auto;
  display: flex;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: baseline;
  flex-wrap: wrap;
}
.serve-label {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.6;
  min-width: 10rem;
}
.serve-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}
.serve-list li {
  font-weight: 300;
  font-size: 1.0625rem;
  position: relative;
  padding-left: 1rem;
}
.serve-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 5px;
  height: 5px;
  background: var(--color-pillar);
  border-radius: 50%;
}

/* =========================================
   Services / Practice Areas
   ========================================= */
.services {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
}
.section-heading {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  color: var(--color-dark);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.01em;
}

.service-block {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.service-block:last-child {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.service-number {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-pillar);
  padding-top: 0.15rem;
}
.service-body h3 {
  font-family: var(--font-heading);
  font-size: 1.3125rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.75rem;
  letter-spacing: -0.005em;
}
.service-body p {
  max-width: 40rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}
.service-body p:last-child { margin-bottom: 0; }
.service-body ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-top: 0.5rem;
}
.service-body li {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.9375rem;
  position: relative;
  padding-left: 0.875rem;
}
.service-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 4px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 50%;
}

/* =========================================
   Founder
   ========================================= */
.founder {
  background: var(--color-surface);
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
}
.founder-inner {
  max-width: var(--w-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 10rem 1fr 4px;
  gap: 2rem;
  align-items: start;
}
.founder-label {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-muted);
  padding-top: 0.75rem;
}
.founder-content h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  color: var(--color-dark);
  margin-bottom: 0.375rem;
  letter-spacing: -0.01em;
}
.founder-subtitle {
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}
.founder-content p {
  max-width: 38rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}
.founder-content p:last-child { margin-bottom: 0; }
.founder-lede {
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  line-height: 1.5;
  color: var(--color-dark) !important;
  max-width: 38rem;
  margin-bottom: 1.5rem !important;
  padding-left: 1.25rem;
  border-left: 3px solid var(--color-pillar);
}
.founder-more {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 1.5rem;
  max-width: 38rem;
}
.founder-more summary {
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  color: var(--color-accent);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.founder-more summary::-webkit-details-marker { display: none; }
.founder-more summary::after {
  content: "+";
  font-family: var(--font-heading);
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 400;
  transition: transform 0.2s ease;
  display: inline-block;
}
.founder-more[open] summary::after { content: "−"; }
.founder-more summary:hover { color: var(--color-accent-l); }
.founder-more summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}
.founder-fullbio { margin-top: 1.5rem; }
.founder-fullbio p {
  max-width: 38rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}
.founder-closer {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  color: var(--color-dark) !important;
  font-size: 1.0625rem;
}
.founder-pillar {
  width: 4px;
  min-height: 100%;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-pillar));
  border-radius: 2px;
  justify-self: end;
  margin-top: 0.75rem;
}

/* =========================================
   Impact
   ========================================= */
.impact {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
}
.impact-intro {
  max-width: 38rem;
  color: var(--color-muted);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1px;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.06);
}
.impact-item {
  background: var(--color-bg);
  padding: 2rem 1.75rem 1.875rem;
  display: flex;
  flex-direction: column;
}
.impact-stat {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  color: var(--color-accent);
  letter-spacing: -0.01em;
  margin-bottom: 0.375rem;
}
.impact-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--color-dark);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0.875rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.impact-item p:not(.impact-label) {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.65;
}

/* =========================================
   Pull Quote
   ========================================= */
.pullquote {
  background: var(--color-deep);
  padding: clamp(3rem, 6vw, 5rem) var(--gutter);
}
.pullquote blockquote {
  max-width: var(--w-narrow);
  margin: 0 auto;
  position: relative;
  padding-left: 2rem;
  border-left: 3px solid var(--color-pillar);
}
.pullquote p {
  font-family: var(--font-heading);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  line-height: 1.6;
  color: var(--color-cream);
}
.pullquote-hero p {
  font-size: clamp(1.375rem, 3vw, 2rem);
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* =========================================
   Contact / Work With Us
   ========================================= */
.contact {
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
}
.contact-inner {
  max-width: var(--w-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
}
.contact-text h2 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  color: var(--color-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.contact-text p {
  color: var(--color-muted);
  margin-bottom: 2rem;
  max-width: 30rem;
}
.contact-text address {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--color-text);
  margin-bottom: 1rem;
}
.contact-email {
  display: inline-block;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-l);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.contact-email:hover {
  color: var(--color-deep);
  border-color: var(--color-deep);
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}
.optional {
  font-weight: 300;
  color: var(--color-muted);
}
.form-group input,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 3px;
  background: #fff;
  color: var(--color-text);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(107,66,38,0.1);
}
.form-group textarea { resize: vertical; }

.btn-submit {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  background: var(--color-deep);
  color: var(--color-cream);
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}
.btn-submit:hover { background: var(--color-accent); }
.btn-submit:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* =========================================
   Footer
   ========================================= */
.site-footer {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 2rem var(--gutter);
}
.footer-inner {
  max-width: var(--w-page);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.site-footer p {
  font-size: 0.8125rem;
  color: var(--color-muted);
}
.footer-tagline {
  font-family: var(--font-heading);
  font-style: italic;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
  /* Mobile nav */
  .nav-toggle { display: block; }
  nav ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: none;
    padding: 0.5rem 0;
  }
  nav ul.is-open { display: flex; }
  nav ul li { width: 100%; }
  nav ul a {
    display: block;
    padding: 0.75rem var(--gutter);
  }
  .nav-cta {
    border-radius: 0;
    text-align: left;
  }

  /* Hero */
  .hero-slider { height: clamp(24rem, 60vh, 36rem); }
  .hero-slide-caption { display: none; }

  /* Opening */
  .opening-inner {
    grid-template-columns: 3px 1fr;
    gap: 1.5rem;
  }

  /* Founder */
  .founder-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .founder-label {
    padding-top: 0;
  }
  .founder-pillar { display: none; }

  /* Contact */
  .contact-inner {
    grid-template-columns: 1fr;
  }

  /* Serve */
  .serve-inner {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .service-block {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .service-number {
    font-size: 0.75rem;
  }
}

/* --- Focus visible for accessibility --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
