/* ==========================================================
   Kylas Associates — site styles
   Calm, warm, understated. No frameworks.
   ========================================================== */

:root {
  --cream:        #FBF8F3; /* main background */
  --slate:        #ABB6BC; /* alternate section backgrounds, footer */
  --copper:       #A96B3A; /* firm name, small uppercase labels, buttons, links */
  --charcoal:     #2E3B3F; /* headings and body text */
  --deep-teal:    #2C494F; /* accents, active nav item */
  --steel:        #788A90; /* secondary text, captions, thin dividers */
  --soft-white:   #F7FBFA; /* text on slate sections */

  /* Copper at #A96B3A gives ~4.2:1 on cream — fine for large text,
     short of AA (4.5:1) for small text. This darker tone (~5.6:1)
     is used for small copper text, links and button labels. */
  --copper-text:  #8A5428;
  /* Steel grey is ~3.5:1 on cream; a darker steel is used for small
     secondary text so it meets AA. */
  --steel-text:   #5C6E74;

  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --serif:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:    "Jost", "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --space: clamp(3.5rem, 9vw, 6.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
}

/* While the disclaimer is open, the page is hidden behind it. */
html.disclaimer-pending body > *:not(.disclaimer) { visibility: hidden; }
html.disclaimer-pending { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--charcoal);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.4rem, 2.6vw, 1.7rem); }
h4 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; text-align: justify; hyphens: auto; }
p:last-child { margin-bottom: 0; }

a { color: var(--copper-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--deep-teal); }

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

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--deep-teal); color: var(--soft-white);
  padding: 0.6rem 1rem; font-family: var(--sans); font-size: 0.85rem;
}
.skip-link:focus { top: 1rem; color: var(--soft-white); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 46rem; }

/* ---------- Labels ---------- */
.label {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--copper-text);
  margin-bottom: 0.9rem;
}
.num {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--copper-text);
  display: block;
  margin-bottom: 0.4rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--steel);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.5rem;
}
.brand {
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--copper);
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand:hover { color: var(--copper); }
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel-text);
  margin-top: 0.15rem;
}

.nav-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: none; border: 1px solid var(--steel); color: var(--charcoal);
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 0.55rem 0.8rem; cursor: pointer;
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  display: block; width: 18px; height: 1px; background: currentColor; position: relative;
}
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -5px; }
.nav-toggle .bars::after { top: 5px; }

.site-nav { display: none; }
.site-nav.open {
  display: block;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--cream);
  border-bottom: 1px solid var(--steel);
}
.site-nav ul { list-style: none; margin: 0; padding: 0.5rem var(--gutter) 1rem; }
.site-nav a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(120, 138, 144, 0.35);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--charcoal);
}
.site-nav li:last-child a { border-bottom: 0; }
.site-nav a:hover { color: var(--copper-text); }
.site-nav a[aria-current="page"] { color: var(--deep-teal); font-weight: 600; }

@media (min-width: 1080px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open { display: block; position: static; border: 0; background: none; }
  .site-nav ul { display: flex; gap: 1.6rem; padding: 0; }
  .site-nav a { border: 0; padding: 0.4rem 0; font-size: 0.74rem; border-bottom: 1px solid transparent; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--deep-teal); }
}

/* ---------- Sections ---------- */
.section { padding: var(--space) 0; }
.section + .section:not(.band) { border-top: 1px solid rgba(120, 138, 144, 0.5); }
.band + .section, .section + .band { border-top: 0; }

.band { background: var(--slate); color: var(--charcoal); }
/* Soft White on slate is only 1.98:1 (fails WCAG AA), so text on slate uses
   Charcoal (5.6:1) and Deep Teal (4.67:1); Soft White is kept for divider lines. */
.band h1, .band h2, .band h3, .band h4 { color: var(--charcoal); }
.band .label, .band .num { color: var(--deep-teal); }
.band a { color: var(--deep-teal); }
.band a:hover { color: var(--charcoal); }
.band hr, .band .rule { border-color: rgba(247, 251, 250, 0.7); }


.page-head { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3rem); }
.page-head h1 { margin-bottom: 0.4em; }
.page-head p.lead { max-width: 46rem; }

.lead { font-size: 1.15rem; }
.muted { color: var(--steel-text); }

/* ---------- Hero ---------- */
.hero { padding: clamp(4rem, 12vw, 8rem) 0 clamp(3rem, 8vw, 5rem); }
.hero h1 {
  color: var(--copper);
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 500;
  margin-bottom: 0.25em;
}
.hero .tagline { font-size: clamp(1.1rem, 2.2vw, 1.3rem); max-width: 48rem; }
.hero .intro { max-width: 44rem; color: var(--charcoal); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }

.contact-bar {
  border-top: 1px solid var(--steel);
  border-bottom: 1px solid var(--steel);
  padding: 1rem 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem;
}
.contact-bar a { color: var(--charcoal); text-decoration: none; }
.contact-bar a:hover { color: var(--copper-text); text-decoration: underline; }

.facts {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0; grid-template-columns: 1fr;
}
.facts li { padding: 1.4rem 0; border-top: 1px solid rgba(247, 251, 250, 0.7); }
.facts li:last-child { border-bottom: 1px solid rgba(247, 251, 250, 0.7); }
.facts .num { margin-bottom: 0.3rem; }
.facts p { font-family: var(--display); font-size: 1.45rem; line-height: 1.35; color: var(--charcoal); margin: 0; text-align: left; hyphens: manual; }
@media (min-width: 768px) {
  .facts { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .facts li, .facts li:last-child { border-bottom: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--copper-text);
  background: transparent;
  border: 1px solid var(--copper);
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover, .btn:focus-visible { background: var(--copper-text); border-color: var(--copper-text); color: var(--cream); }
.band .btn { color: var(--charcoal); border-color: var(--charcoal); }
.band .btn:hover, .band .btn:focus-visible { background: var(--charcoal); color: var(--cream); }

/* ---------- Generic layouts ---------- */
.split { display: grid; gap: 2.5rem; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 2fr; gap: 4rem; }
  .split.even { grid-template-columns: 1fr 1fr; }
}

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 0.7rem 0; border-top: 1px solid rgba(120, 138, 144, 0.5); }
.list-plain li:last-child { border-bottom: 1px solid rgba(120, 138, 144, 0.5); }
.band .list-plain li { border-color: rgba(247, 251, 250, 0.7); }

.approach { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; }
@media (min-width: 768px) { .approach { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 3rem; } }
.approach h3 { margin-bottom: 0.3em; }

/* ---------- Founder ---------- */
.founder { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .founder { grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 4rem; } }
.founder-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.founder-photo figcaption { margin-top: 0.8rem; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--steel-text); }
.founder .role {
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--steel-text); margin-bottom: 1.8rem;
}
.founder-details { display: grid; gap: 2.5rem; margin-top: 2.5rem; }
@media (min-width: 768px) { .founder-details { grid-template-columns: 1fr 2fr; } }
.founder-details h3 { font-size: 1.3rem; }

/* ---------- Team ---------- */
.team-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 2.5rem 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }

.card { display: flex; flex-direction: column; }
.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--slate);
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%);
}
.photo .initials { /* decorative (aria-hidden); charcoal for legibility */
  color: var(--charcoal);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: clamp(3rem, 8vw, 4.5rem);
  letter-spacing: 0.05em;
}
.photo img + .initials { display: none; }
.photo.no-photo img { display: none; }
.photo.no-photo .initials { display: flex; }

.card .num { margin-bottom: 0.2rem; }
.card h3 { margin-bottom: 0.15em; font-size: 1.5rem; }
.card .designation {
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--steel-text); margin-bottom: 0.8rem;
}
.card .quals { font-size: 0.95rem; line-height: 1.6; color: var(--charcoal); margin-bottom: 1.1rem; }
.card .quals a { word-break: break-word; }
.card .btn { align-self: flex-start; margin-top: auto; padding: 0.7rem 1.2rem; }

.bio {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--steel);
  font-size: 0.98rem;
}
.bio[hidden] { display: none; }

.placeholder {
  white-space: nowrap;
  background: #FFF3B0;
  color: var(--charcoal);
  padding: 0 0.25em;
  font-family: var(--sans);
  font-size: 0.85em;
  outline: 1px dashed var(--copper);
}

/* ---------- Practice areas ---------- */
.areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
@media (min-width: 900px) { .areas { grid-template-columns: repeat(2, 1fr); column-gap: 4rem; } }
.areas li { padding: 2rem 0; border-top: 1px solid rgba(120, 138, 144, 0.5); }
.areas h2 { font-size: clamp(1.45rem, 2.6vw, 1.75rem); margin-bottom: 0.5em; }

/* ---------- Courts ---------- */
.forum-group { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .forum-group { grid-template-columns: 1fr 2fr; gap: 4rem; } }
.forum-group h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.forum-list { list-style: none; margin: 0; padding: 0; }
.forum-list li { padding: 1.1rem 0; border-top: 1px solid rgba(120, 138, 144, 0.5); }
.band .forum-list li { border-color: rgba(247, 251, 250, 0.7); }
.forum-list strong { font-weight: 600; }

/* ---------- Steps & FAQ ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps li { padding: 1.5rem 0; border-top: 1px solid rgba(247, 251, 250, 0.7); display: grid; gap: 0.3rem; }
@media (min-width: 768px) { .steps li { grid-template-columns: 4rem 14rem 1fr; gap: 1.5rem; align-items: baseline; } }
.steps h3 { margin: 0; font-size: 1.45rem; }

.faq { border-bottom: 1px solid rgba(120, 138, 144, 0.5); }
.faq-item { border-top: 1px solid rgba(120, 138, 144, 0.5); }
.faq-item h3 { margin: 0; font-size: 1.35rem; }
.faq-q {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: none; border: 0; padding: 1.3rem 0; cursor: pointer; text-align: left;
  font: inherit; font-family: var(--display); font-size: inherit; font-weight: 500; color: var(--charcoal);
}
.faq-q:hover { color: var(--copper-text); }
.faq-q .sign { flex: none; width: 14px; height: 14px; position: relative; }
.faq-q .sign::before, .faq-q .sign::after {
  content: ""; position: absolute; background: var(--copper); left: 0; top: 6px; width: 14px; height: 1.5px;
  transition: transform 0.2s;
}
.faq-q .sign::after { transform: rotate(90deg); }
.faq-q[aria-expanded="true"] .sign::after { transform: rotate(0deg); }
.faq-a { padding: 0 0 1.5rem; max-width: 46rem; }
.faq-a[hidden] { display: none; }

/* ---------- Contact ---------- */
.offices { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; }
@media (min-width: 900px) { .offices { grid-template-columns: repeat(3, 1fr); } }
.office { border-top: 1px solid var(--steel); padding-top: 1.4rem; display: flex; flex-direction: column; }
.office h2 { font-size: 1.8rem; margin-bottom: 0.4em; }
.office address { font-style: normal; margin-bottom: 0.8rem; }
.office .map {
  margin-top: auto; padding-top: 1rem;
}
.office iframe { width: 100%; height: 240px; border: 1px solid var(--steel); display: block; filter: grayscale(35%); }

.form { display: grid; gap: 1.2rem; max-width: 46rem; }
.form .two { display: grid; gap: 1.2rem; }
@media (min-width: 768px) { .form .two { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.35rem; }
.field label {
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--charcoal);
}
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit; font-size: 1rem;
  color: var(--charcoal);
  background: var(--soft-white);
  border: 1px solid var(--steel);
  border-radius: 0;
  padding: 0.75rem 0.85rem;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--deep-teal); outline-offset: 0; border-color: var(--deep-teal); }
.form .btn { justify-self: start; }
.band .field input, .band .field select, .band .field textarea { border-color: var(--deep-teal); }
.notice { font-size: 0.95rem; max-width: 46rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(247, 251, 250, 0.7); }

.call-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  background: var(--deep-teal); color: var(--soft-white);
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 1.3rem;
  border: 1px solid var(--deep-teal);
}
.call-fab:hover { color: var(--soft-white); background: var(--charcoal); }
@media (min-width: 900px) { .call-fab { display: none; } }

/* ---------- Legal text ---------- */
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.8rem; margin-top: 1.6em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--slate); color: var(--charcoal); padding: 3.5rem 0 2rem; font-size: 0.95rem; }
.site-footer .brand { font-size: 1.7rem; color: var(--charcoal); }
.site-footer .brand small { color: var(--charcoal); }
.footer-grid { display: grid; gap: 2rem; margin-top: 2rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.site-footer h2 {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--deep-teal); margin-bottom: 0.6rem;
}
.site-footer .footer-sub { margin-top: 1.2rem; }
.site-footer address { font-style: normal; }
.site-footer a { color: var(--charcoal); }
.site-footer a:hover { color: var(--deep-teal); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.footer-base {
  margin-top: 2.5rem; padding-top: 1.4rem;
  border-top: 1px solid rgba(247, 251, 250, 0.8);
  display: grid; gap: 0.4rem; font-size: 0.88rem;
}

/* ---------- Disclaimer modal ---------- */
.disclaimer {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--cream);
  overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.disclaimer[hidden] { display: none; }
.disclaimer-box {
  max-width: 44rem; width: 100%;
  border-top: 1px solid var(--steel);
  border-bottom: 1px solid var(--steel);
  padding: 2.2rem 0;
}
.disclaimer .brand { display: inline-block; font-size: 2rem; margin-bottom: 1.5rem; }
.disclaimer h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.disclaimer ul { padding-left: 1.2rem; margin: 0 0 1.8rem; }
.disclaimer li { margin-bottom: 0.7rem; }
.disclaimer .actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.disclaimer .btn.secondary { border-color: var(--steel); color: var(--steel-text); }
.disclaimer .btn.secondary:hover { background: var(--steel-text); border-color: var(--steel-text); color: var(--cream); }

/* ---------- 404 ---------- */
.notfound { min-height: 55vh; display: flex; align-items: center; }

@media print {
  .site-header, .site-footer, .call-fab, .disclaimer { display: none !important; }
  html.disclaimer-pending body > * { visibility: visible !important; }
}

/* ---------- Utilities ---------- */
.pt-0 { padding-top: 0 !important; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
figure { margin: 0; }
.founder-photo { max-width: 22rem; }
