/* ==========================================================
   SYED RIDWAN HUSAIN & ASSOCIATES — chambers, docketed.
   Palette: ink navy, aged paper, brass, seal maroon.
   ========================================================== */

:root {
  --ink: #101a2c;
  --ink-2: #0a1220;
  --ink-soft: #1a2740;
  --paper: #ece5d3;
  --paper-2: #f6f1e5;
  --brass: #b28a4d;
  --brass-light: #d8b877;
  --maroon: #712f2d;
  --maroon-light: #8f3d38;

  --text-dark: #1c1a12;
  --text-muted-dark: rgba(28, 26, 18, 0.64);
  --text-light: #ece7d9;
  --text-muted-light: rgba(236, 231, 217, 0.62);

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --rule: 1px solid rgba(178, 138, 77, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 88px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  color: inherit;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* Paper grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.95em 1.6em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.btn-solid { background: var(--maroon); color: var(--paper-2); }
.btn-solid:hover { background: var(--maroon-light); transform: translateY(-1px); }
.btn-line { border-color: rgba(28,26,18,0.3); color: var(--text-dark); }
.btn-line:hover { border-color: var(--maroon); color: var(--maroon); }
.btn-ghost { border-color: rgba(236,231,217,0.4); color: var(--text-light); }
.btn-ghost:hover { border-color: var(--brass-light); color: var(--brass-light); }

/* ============ reveal-on-scroll ============ */
.reveal-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal-up.in-view { opacity: 1; transform: translateY(0); }

/* ============ HEADER ============ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, rgba(16,26,44,0.92), rgba(16,26,44,0.65) 80%, transparent);
  transition: height 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  height: 68px;
  background: rgba(10, 18, 32, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(178, 138, 77, 0.25);
}

.header-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brandmark { display: flex; align-items: center; gap: 14px; color: var(--text-light); }
.seal { width: 40px; height: 40px; color: var(--brass-light); flex: none; }
.seal.small { width: 34px; height: 34px; }
.seal svg { width: 100%; height: 100%; }
.seal-letters {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: currentColor;
  letter-spacing: 0.03em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-size: 1.02rem; letter-spacing: 0.01em; }
.brand-sub { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass-light); margin-top: 2px; }

.primary-nav {
  margin-left: auto;
  display: flex;
  gap: 34px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}
.primary-nav a {
  color: var(--text-muted-light);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  position: relative;
  transition: color 0.3s var(--ease);
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--brass-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.primary-nav a:hover { color: var(--text-light); }
.primary-nav a:hover::after { transform: scaleX(1); }

.nav-cta { margin-left: 12px; white-space: nowrap; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px; height: 34px;
  background: none; border: none; cursor: pointer;
  margin-left: auto;
}
.menu-toggle span { width: 100%; height: 1px; background: var(--brass-light); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  top: 68px; left: 0; right: 0;
  background: rgba(10,18,32,0.98);
  z-index: 99;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-light);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease);
  border-bottom: 1px solid rgba(178,138,77,0.25);
}
.mobile-nav.open { max-height: 320px; }
.mobile-nav a { padding: 18px 40px; border-top: 1px solid rgba(178,138,77,0.15); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(120% 90% at 15% 0%, #182742 0%, var(--ink) 45%, var(--ink-2) 100%);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 40px) 40px 80px;
  overflow: hidden;
}

.hero-frame { position: absolute; inset: 22px; pointer-events: none; }
.hero-frame .corner { position: absolute; width: 34px; height: 34px; border-color: rgba(178,138,77,0.5); }
.corner.tl { top: 0; left: 0; border-top: 1px solid; border-left: 1px solid; }
.corner.tr { top: 0; right: 0; border-top: 1px solid; border-right: 1px solid; }
.corner.bl { bottom: 0; left: 0; border-bottom: 1px solid; border-left: 1px solid; }
.corner.br { bottom: 0; right: 0; border-bottom: 1px solid; border-right: 1px solid; }

.hero-inner { max-width: 900px; margin: 0 auto; width: 100%; text-align: left; position: relative; z-index: 2; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-light);
  margin: 0 0 22px;
}

.hero-title {
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 30px;
}
.hero-title span { display: block; }
.hero-title span:nth-child(2) { color: var(--brass-light); font-style: italic; font-weight: 400; }

.signature-wrap { margin: 6px 0 34px; max-width: 460px; }
.signature-svg { width: 100%; height: auto; color: var(--brass-light); }
#sigPath {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-sig 2.4s var(--ease) 0.6s forwards;
}
@keyframes draw-sig { to { stroke-dashoffset: 0; } }
.signature-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted-light);
  margin-top: 6px;
}

.hero-lede {
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text-muted-light);
  max-width: 640px;
  margin-bottom: 40px;
}

.hero-actions { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 66px; }

.hero-ledger {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: var(--rule);
  position: relative;
  z-index: 2;
}
.ledger-item {
  padding: 22px 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: var(--rule);
  padding-left: 24px;
}
.ledger-item:first-child { border-left: none; padding-left: 0; }
.ledger-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted-light); }
.ledger-val { font-family: var(--font-display); font-size: 1.02rem; color: var(--text-light); }

/* ============ SHARED SECTION ============ */
.section { padding: 120px 40px; max-width: 1320px; margin: 0 auto; }
.section-head { max-width: 720px; margin-bottom: 64px; }
.section-eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 18px;
}
.section-eyebrow.light { color: var(--brass-light); }
.section-eyebrow .rule { width: 34px; height: 1px; background: currentColor; opacity: 0.6; }
.section-title {
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
}
.section-title.light { color: var(--text-light); }
.section-sub { margin-top: 18px; color: var(--text-muted-dark); font-size: 1.05rem; max-width: 560px; }

/* ============ ABOUT ============ */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 80px; align-items: start; }
.about-copy p { color: var(--text-dark); font-size: 1.05rem; }
.drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: 3.6rem;
  float: left;
  line-height: 0.8;
  padding: 0.06em 0.09em 0 0;
  color: var(--maroon);
  font-weight: 500;
}

.founder-card {
  margin-top: 44px;
  padding-top: 36px;
  border-top: var(--rule);
  display: flex;
  gap: 24px;
}
.founder-mark {
  flex: none;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px solid var(--brass);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--maroon);
}
.founder-info h3 { font-size: 1.3rem; margin-bottom: 4px; }
.founder-title { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); margin-bottom: 14px; }
.founder-bio { color: var(--text-muted-dark); font-size: 0.98rem; }

.credentials {
  background: var(--paper-2);
  border: var(--rule);
  padding: 34px 30px;
}
.credentials-heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 20px;
}
.credentials-list li {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid rgba(28,26,18,0.1);
}
.credentials-list li:first-child { border-top: none; padding-top: 0; }
.cred-code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--brass); flex: none; padding-top: 2px; }
.cred-text { font-size: 0.94rem; color: var(--text-dark); line-height: 1.5; }
.cred-text strong { font-family: var(--font-display); font-weight: 500; }

/* ============ PRACTICE ============ */
.practice-groups { display: flex; flex-direction: column; border-top: var(--rule); }
.pg { border-bottom: var(--rule); }
.pg-head {
  width: 100%;
  display: grid;
  grid-template-columns: 70px 1fr auto 24px;
  align-items: center;
  gap: 24px;
  padding: 26px 4px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: var(--text-dark);
}
.pg-code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--brass); }
.pg-title { font-family: var(--font-display); font-size: 1.35rem; transition: color 0.3s var(--ease); }
.pg-head:hover .pg-title { color: var(--maroon); }
.pg-count { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted-dark); letter-spacing: 0.04em; white-space: nowrap; }
.pg-icon { position: relative; width: 16px; height: 16px; justify-self: end; }
.pg-icon::before, .pg-icon::after {
  content: ""; position: absolute; background: var(--maroon);
  transition: transform 0.35s var(--ease);
}
.pg-icon::before { top: 7px; left: 0; width: 16px; height: 1px; }
.pg-icon::after { top: 0; left: 7px; width: 1px; height: 16px; }
.pg-head[aria-expanded="true"] .pg-icon::after { transform: rotate(90deg); }

.pg-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease);
}
.pg-body ul { padding: 0 4px 30px 94px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; }
.pg-body li {
  font-size: 0.95rem;
  color: var(--text-muted-dark);
  padding-left: 16px;
  position: relative;
}
.pg-body li::before {
  content: "";
  position: absolute; left: 0; top: 0.65em;
  width: 6px; height: 1px;
  background: var(--brass);
}

/* ============ PRINCIPLES ============ */
.principles { background: var(--ink); color: var(--text-light); max-width: none; padding: 0; }
.principles-inner { max-width: 1320px; margin: 0 auto; padding: 120px 40px; }
.principle-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid rgba(178,138,77,0.3); }
.principle {
  padding: 32px 26px 0 0;
  border-left: 1px solid rgba(178,138,77,0.3);
  padding-left: 26px;
}
.principle:first-child { border-left: none; padding-left: 0; }
.principle::before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--brass-light);
  margin-bottom: 18px;
}
.principle h3 { font-size: 1.15rem; margin: 0 0 10px; }
.principle p { color: var(--text-muted-light); font-size: 0.92rem; }

.pull-quote {
  margin: 80px 0 0;
  padding-top: 44px;
  border-top: var(--rule);
  max-width: 780px;
}
.pull-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.4;
  color: var(--brass-light);
}

/* ============ CONTACT ============ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 0; border-top: var(--rule); border-left: var(--rule); }
.contact-card, .contact-form { padding: 44px 36px; border-right: var(--rule); border-bottom: var(--rule); }
.contact-code { font-family: var(--font-mono); font-size: 0.7rem; color: var(--brass); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px; }
.contact-card h3, .contact-form h3 { font-size: 1.4rem; margin-bottom: 18px; }
.contact-text { color: var(--text-muted-dark); font-size: 0.98rem; margin-bottom: 26px; }
.contact-lines { display: flex; flex-direction: column; gap: 10px; font-family: var(--font-mono); font-size: 0.86rem; }
.contact-lines a { color: var(--text-dark); transition: color 0.3s var(--ease); }
.contact-lines a span { color: var(--text-muted-dark); }
.contact-lines a:hover { color: var(--maroon); }

.field { display: block; margin-bottom: 18px; }
.field span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted-dark);
  margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(28,26,18,0.25);
  background: transparent;
  padding: 8px 2px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text-dark);
  resize: vertical;
  transition: border-color 0.3s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--maroon);
}

.contact-form .btn { margin-top: 8px; position: relative; overflow: hidden; }
.btn-check { display: none; }
.contact-form.sent .btn-text { display: none; }
.contact-form.sent .btn-check { display: inline; }
.contact-form.sent .btn-solid { background: var(--maroon-light); }
.form-note { margin-top: 12px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted-dark); }

/* ============ FOOTER ============ */
.site-footer { background: var(--ink-2); color: var(--text-light); }
.footer-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 56px 40px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  border-top: 1px solid rgba(178,138,77,0.2);
}
.footer-brand { margin-right: auto; }
.footer-nav { display: flex; gap: 26px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted-light); }
.footer-nav a:hover { color: var(--brass-light); }
.footer-meta { width: 100%; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted-light); border-top: 1px solid rgba(178,138,77,0.15); padding-top: 24px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .about-grid { grid-template-columns: 1fr; gap: 50px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card, .contact-form { border-right: none; }
  .principle-list { grid-template-columns: 1fr 1fr; }
  .principle { border-left: none; padding-left: 0; border-top: 1px solid rgba(178,138,77,0.3); padding-top: 26px; margin-top: 26px; }
  .principle:nth-child(1), .principle:nth-child(2) { border-top: none; margin-top: 0; padding-top: 0; }
}

@media (max-width: 860px) {
  .primary-nav, .nav-cta { display: none; }
  .menu-toggle { display: flex; }
  .hero-ledger { grid-template-columns: 1fr; }
  .ledger-item { border-left: none; padding-left: 0; border-top: var(--rule); padding-top: 18px; }
  .ledger-item:first-child { border-top: none; padding-top: 0; }
  .pg-body ul { grid-template-columns: 1fr; padding-left: 24px; }
  .pg-head { grid-template-columns: 40px 1fr 20px; }
  .pg-count { display: none; }
}

@media (max-width: 560px) {
  .section { padding: 84px 22px; }
  .hero { padding: calc(var(--header-h) + 20px) 22px 60px; }
  .header-inner { padding: 0 20px; }
  .hero-frame { display: none; }
  .founder-card { flex-direction: column; }
  .credentials { padding: 26px 20px; }
}
