/* ==========================================================================
   Mettle Law — Global
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,340;0,9..144,440;0,9..144,560;0,9..144,600;1,9..144,440;1,9..144,500&family=Inter:wght@400;500;600&display=swap');

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  animation: page-in var(--dur-slow) var(--ease-out) both;
}

@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

::selection { background: var(--brass-500); color: var(--ivory-100); }

:focus-visible {
  outline: 2px solid var(--brass-500);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: var(--lh-tight);
  color: var(--color-ink);
  text-wrap: balance;
}

.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4, .on-dark { color: var(--color-on-dark); }

p { color: var(--color-ink-muted); }
.on-dark p { color: var(--color-on-dark-muted); }

a { transition: color var(--dur-fast) var(--ease-out); }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-pad); position: relative; }
.section--sm { padding-block: var(--section-pad-sm); }
.section--dark { background: var(--color-bg-dark); }
.section--soft { background: var(--color-bg-soft); }
.section--recessed { background: var(--color-bg-recessed); }

/* ---- Eyebrow label ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-accent);
}

/* ---- Brass thread — the signature structural device ---- */
.thread {
  display: block;
  width: 1px;
  height: clamp(48px, 8vw, 96px);
  background: var(--color-accent);
  margin-inline: auto;
}

.thread--sq::after {
  content: '';
  display: block;
  width: 9px;
  height: 9px;
  background: var(--color-accent);
  margin: 10px auto 0;
}

.rule {
  border: none;
  border-top: 1px solid var(--color-border);
  width: 100%;
}
.on-dark .rule, .rule--dark { border-top-color: var(--color-border-dark); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  padding: 0.95rem 1.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  justify-content: center;
  cursor: pointer;
}

.text-link { color: var(--color-accent-strong); font-weight: 600; }
.text-link:hover { color: var(--color-ink); }

.btn svg { flex-shrink: 0; width: 15px; height: 15px; transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }

.btn--primary {
  background: var(--brass-500);
  color: var(--ivory-100);
}
.btn--primary:hover { background: var(--brass-600); }

.btn--outline {
  background: transparent;
  border-color: currentColor;
  color: var(--color-ink);
}
.btn--outline:hover { background: var(--color-ink); color: var(--ivory-100); }

.on-dark .btn--outline { color: var(--ivory-200); border-color: var(--aubergine-600); }
.on-dark .btn--outline:hover { background: var(--ivory-200); color: var(--aubergine-800); }

.btn--ghost {
  padding: 0;
  color: var(--color-accent-strong);
  font-weight: 600;
}
.on-dark .btn--ghost { color: var(--brass-300); }
.btn--ghost:hover { color: var(--color-ink); }
.on-dark .btn--ghost:hover { color: var(--ivory-100); }

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 231, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-header);
}

.header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: var(--header-h);
  padding-block: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-right: auto;
  margin-left: clamp(0rem, 2vw, 2rem);
  min-width: 0;
}

.brand__mark { display: block; width: 46px; height: 46px; flex-shrink: 0; }
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }

.brand__word {
  font-family: var(--font-display);
  white-space: nowrap;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.44rem);
  letter-spacing: 0.06em;
  font-weight: 560;
  line-height: 1;
}

.brand__word span { display: block; font-family: var(--font-body); font-size: 0.6rem; letter-spacing: var(--tracking-wider); font-weight: 500; color: var(--color-accent); margin-top: 6px; }

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

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

.nav__link {
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-ink);
  position: relative;
  padding: 0.4rem 0.05rem;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--color-accent);
  transition: right var(--dur-fast) var(--ease-out);
}

.nav__link:hover::after, .nav__link:focus-visible::after, .nav__link.is-active::after { right: 0; }
.nav__link.is-active { color: var(--color-accent-strong); }

.nav__item--dropdown { position: relative; }

.nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nav__trigger svg { width: 9px; height: 9px; transition: transform var(--dur-fast) var(--ease-out); }
.nav__item--dropdown:hover .nav__trigger svg,
.nav__item--dropdown.is-open .nav__trigger svg { transform: rotate(180deg); }

.nav__dropdown {
  position: absolute;
  top: calc(100% + 1.1rem);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 260px;
  background: var(--ivory-100);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lift);
  padding: 0.6rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility var(--dur-fast);
}

.nav__item--dropdown:hover .nav__dropdown,
.nav__item--dropdown:focus-within .nav__dropdown,
.nav__item--dropdown.is-open .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav__dropdown::before { content: ''; position: absolute; left: 0; right: 0; top: -1.2rem; height: 1.2rem; }

.nav__dropdown a {
  display: block;
  padding: 0.75rem 0.9rem;
  font-size: var(--fs-small);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
}
.nav__dropdown a:hover { background: var(--brass-wash); color: var(--color-accent-strong); }

.header__cta { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }

.nav__cta-mobile { display: none; }

.nav__toggle {
  display: none;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: -9px;
}
.nav__toggle span { display: block; height: 1.5px; width: 24px; background: var(--color-ink); transition: all var(--dur-fast) var(--ease-out); }
.nav__toggle.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.is-active span:nth-child(2) { opacity: 0; }
.nav__toggle.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---- Footer ---- */
.footer { background: var(--color-bg-dark); color: var(--color-on-dark); position: relative; overflow: hidden; }

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 3rem;
  padding-block: var(--section-pad-sm);
}

.footer__brand { max-width: 300px; }
.footer__brand .brand__mark { width: 40px; height: 40px; }
.footer__brand p { margin-top: 1.1rem; font-size: var(--fs-small); }
.footer__top > * { min-width: 0; }
.footer__contact span, .footer__contact a { overflow-wrap: anywhere; }

.footer__heading {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--brass-300);
  margin-bottom: 1.2rem;
}

.footer__list { display: flex; flex-direction: column; gap: 0.8rem; }
.footer__list a { font-size: var(--fs-small); color: var(--color-on-dark-muted); }
.footer__list a:hover { color: var(--ivory-100); }

.footer__contact { display: flex; flex-direction: column; gap: 0.9rem; font-size: var(--fs-small); }
.footer__contact a { color: var(--color-on-dark-muted); }
.footer__contact a:hover { color: var(--ivory-100); }

.footer__bottom {
  border-top: 1px solid var(--color-border-dark);
  padding-block: 1.6rem;
  padding-bottom: max(1.6rem, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--color-on-dark-muted);
}

.footer__monogram-watermark {
  position: absolute;
  right: -4%;
  bottom: -18%;
  width: clamp(260px, 34vw, 480px);
  opacity: 0.05;
  pointer-events: none;
}

/* ---- Reveal-on-scroll ---- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-group > * { transition-delay: calc(var(--i, 0) * 80ms); }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: 1rem; top: -60px;
  background: var(--aubergine-800);
  color: var(--ivory-100);
  padding: 0.8rem 1.2rem;
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 1rem; }
