/* ============================================
   Pal & Co. Law Chambers — Design System
   "The Intellectual Curator"
   ============================================ */

:root {
  /* Surface hierarchy */
  --surface: #fffcf7;
  --surface-lowest: #ffffff;
  --surface-low: #fcf9f3;
  --surface-high: #edeae1;
  --surface-highest: #e2dfd6;

  /* Primary */
  --primary: #3a3935;
  --primary-dim: #2c2b28;
  --primary-container: #e5e2e1;
  --on-primary: #faf7f6;

  /* Accent */
  --accent: #b5975a;
  --accent-dim: #9a7f4a;

  /* Text */
  --on-surface: #2d2d28;
  --on-surface-muted: #8d8d82;
  --outline-variant: #babab0;

  /* Typography */
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Manrope', sans-serif;

  /* Spacing */
  --section-padding: 96px;
  --container-max: 1200px;

  /* Elevation */
  --shadow-ambient: 0 20px 40px rgba(56, 56, 49, 0.06);
  --ghost-border: rgba(186, 186, 176, 0.15);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  text-align: justify;
  color: var(--on-surface);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.section {
  padding: var(--section-padding) 48px;
}

.section--surface {
  background-color: var(--surface);
}

.section--high {
  background-color: var(--surface-high);
}

.section--lowest {
  background-color: var(--surface-lowest);
}

/* ---- Eyebrow / Label ---- */

.eyebrow {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

/* ---- Pull Quote ---- */

.pull-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 24px;
  line-height: 1.4;
  color: var(--on-surface);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}

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

.btn-primary {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 16px 32px;
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s linear;
}

.btn-primary:hover {
  background-color: var(--primary-dim);
}

.btn-ghost {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 16px 32px;
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--accent);
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s linear, border-color 0.2s linear;
}

.btn-ghost:hover {
  border-color: var(--accent-dim);
}

.btn-dark {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  padding: 14px 28px;
  background-color: var(--on-surface);
  color: var(--on-primary);
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s linear;
  width: 100%;
  text-align: center;
}

.btn-dark:hover {
  background-color: #1a1a1a;
}

/* ---- Text Link ---- */

.text-link {
  color: var(--on-surface);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: border-color 0.2s linear, color 0.2s linear;
}

.text-link:hover {
  color: var(--accent-dim);
  border-bottom-color: var(--accent-dim);
}

/* ---- Navigation ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  background-color: transparent;
  transition: background-color 0.3s ease;
}

.nav--scrolled {
  background-color: var(--surface);
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav__logo img {
  height: 80px;
  width: auto;
  mix-blend-mode: multiply;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav__link {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  color: var(--on-surface);
  text-decoration: none;
  transition: color 0.2s linear;
}

.nav__link:hover {
  color: var(--accent);
}

.nav__link--active {
  color: var(--accent);
}

.nav__cta {
  margin-left: 8px;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--on-surface);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__hamburger--open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger--open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger--open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Drawer */
.nav__drawer {
  display: none;
  position: fixed;
  top: 80px;
  right: 0;
  bottom: 0;
  width: 300px;
  background-color: var(--surface);
  padding: 32px;
  z-index: 99;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.nav__drawer--open {
  transform: translateX(0);
}

.nav__drawer-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  list-style: none;
}

.nav__drawer-link {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  color: var(--on-surface);
  text-decoration: none;
}

.nav__drawer-link:hover {
  color: var(--accent);
}

/* Drawer overlay */
.nav__overlay {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 98;
}

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

.footer {
  padding: 64px 48px 32px;
  background-color: #d9d6cc;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.5fr;
  gap: 48px;
}

.footer__heading {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--on-surface);
}

.footer__text {
  font-size: 14px;
  color: var(--on-surface-muted);
  line-height: 1.8;
}

.footer__text a {
  color: var(--on-surface-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s linear;
}

.footer__text a:hover {
  color: var(--accent);
}

.footer__nav {
  list-style: none;
}

.footer__nav li {
  margin-bottom: 10px;
}

.footer__nav a {
  font-size: 14px;
  color: var(--on-surface-muted);
  text-decoration: none;
  transition: color 0.2s linear;
}

.footer__nav a:hover {
  color: var(--accent);
}

.footer__copyright {
  text-align: center;
  padding-top: 48px;
  margin-top: 48px;
  font-size: 13px;
  color: var(--on-surface-muted);
}

/* ---- Disclaimer Modal ---- */

.disclaimer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.disclaimer--visible {
  opacity: 1;
  visibility: visible;
}

.disclaimer__box {
  background-color: var(--surface-lowest);
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 48px;
}

.disclaimer__title {
  font-family: var(--font-serif);
  font-size: 28px;
  margin-bottom: 24px;
  color: var(--on-surface);
}

.disclaimer__content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--on-surface-muted);
  margin-bottom: 32px;
}

.disclaimer__content p {
  margin-bottom: 16px;
}

/* ---- Pillar Cards ---- */

.pillar-card {
  background-color: var(--surface-lowest);
  padding: 32px;
  border-radius: 0;
  transition: background-color 0.2s linear;
}

.pillar-card:hover {
  background-color: var(--surface-highest);
}

.pillar-card__eyebrow {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-muted);
  margin-bottom: 12px;
}

.pillar-card__title {
  font-family: var(--font-serif);
  font-size: 32px;
  margin-bottom: 12px;
  padding-top: 16px;
}

.pillar-card__desc {
  font-size: 15px;
  color: var(--on-surface-muted);
  line-height: 1.6;
}

/* ---- Fade-in Animations ---- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in--delay-1 { animation-delay: 0.1s; }
.fade-in--delay-2 { animation-delay: 0.2s; }
.fade-in--delay-3 { animation-delay: 0.3s; }
.fade-in--delay-4 { animation-delay: 0.4s; }

/* ---- Form Styles ---- */

.form-group {
  position: relative;
  margin-bottom: 32px;
}

.form-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface);
  outline: none;
  transition: border-color 0.2s linear;
  border-radius: 0;
  -webkit-appearance: none;
}

.form-input:focus {
  border-bottom-width: 2px;
  border-bottom-color: var(--accent);
}

.form-input::placeholder {
  color: transparent;
}

.form-label {
  position: absolute;
  top: 12px;
  left: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
  color: var(--on-surface-muted);
  pointer-events: none;
  transition: all 0.2s ease;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
  top: -8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

.form-error {
  font-size: 12px;
  color: #993333;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s linear;
}

.form-error--visible {
  opacity: 1;
}

.form-input--error {
  border-bottom-color: #993333;
}

select.form-input {
  cursor: pointer;
  color: var(--on-surface-muted);
}

select.form-input:valid {
  color: var(--on-surface);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* ---- Practice Areas Sidebar ---- */

.practice-sidebar__item {
  display: block;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  text-wrap: balance;
  color: var(--on-surface-muted);
  text-decoration: none;
  transition: all 0.2s linear;
  cursor: pointer;
}

.practice-sidebar__item:hover {
  color: var(--on-surface);
}

.practice-sidebar__item--active {
  color: var(--on-surface);
  font-weight: 600;
  background-color: var(--surface-lowest);
  border-left: 3px solid var(--accent);
}

.practice-section {
  scroll-margin-top: 120px;
}

/* ---- Partner Portrait ---- */

.partner-portrait {
  overflow: hidden;
}

.partner-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.partner-portrait:hover img {
  transform: scale(1.03);
}

/* ---- Drop Cap ---- */

.drop-cap::first-letter {
  font-family: var(--font-serif);
  font-size: 3.5em;
  float: left;
  line-height: 0.8;
  margin-right: 8px;
  margin-top: 4px;
  color: var(--accent);
}

/* ---- Article Cards ---- */

.article-card {
  padding: 32px 0;
}

.article-card__date {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 8px;
}

.article-card__title {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--on-surface);
  margin-bottom: 8px;
  line-height: 1.3;
}

.article-card__excerpt {
  font-size: 15px;
  color: var(--on-surface-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Consult CTA (practice areas) ---- */

.consult-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background-color: var(--surface-lowest);
  margin-top: 48px;
}

.consult-cta__avatar {
  width: 48px;
  height: 48px;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.consult-cta__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.consult-cta__text {
  flex: 1;
}

.consult-cta__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-muted);
  margin-bottom: 2px;
}

.consult-cta__name {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--on-surface);
}

/* ---- Mobile Practice Tabs ---- */

.practice-tabs {
  display: none;
}

/* ---- Submit Link Style ---- */

.submit-link {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s linear;
}

.submit-link:hover {
  color: var(--accent);
}

/* ---- Gold Divider ---- */

.divider-gold {
  border: none;
  border-top: 1px solid var(--accent);
  opacity: 0.4;
  margin: 0;
}

/* ---- CTA Decorative Rule ---- */

.cta-rule {
  width: 80px;
  border: none;
  border-top: 1px solid var(--accent);
  margin: 0 auto 32px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1023px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .practice-tabs {
    display: flex;
    position: sticky;
    top: 80px;
    z-index: 50;
    background-color: var(--surface);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 24px;
    gap: 0;
    scrollbar-width: none;
  }

  .practice-tabs::-webkit-scrollbar {
    display: none;
  }

  .practice-tabs__item {
    flex-shrink: 0;
    padding: 16px 20px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface-muted);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s linear;
  }

  .practice-tabs__item--active {
    color: var(--on-surface);
    background-color: var(--surface-high);
  }
}

@media (max-width: 767px) {
  :root {
    --section-padding: 64px;
  }

  .nav {
    padding: 0 24px;
  }

  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav__drawer {
    display: block;
  }

  .section {
    padding: var(--section-padding) 24px;
  }

  .footer {
    padding: 48px 24px 24px;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .disclaimer__box {
    padding: 32px 24px;
  }
}
