/* ==========================================================================
   Stonewell Financial Management
   Single stylesheet. Sections: tokens, base, layout, components, page bits.
   ========================================================================== */

/* Tokens ---------------------------------------------------------------- */

:root {
  --navy: #12283f;
  --navy-deep: #0a1a2b;
  --slate: #40556b;

  --accent: #a8834f;
  --accent-dark: #86673c;
  --accent-soft: #f4eee4;

  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --border: #e2e6ea;

  --text: #1b2733;
  --text-muted: #5b6a79;
  --text-invert: #eef2f6;

  --font-display: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  --max-width: 1120px;
  --gutter: 1.5rem;
  --radius: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(18, 40, 63, 0.06);
  --shadow-md: 0 4px 16px rgba(18, 40, 63, 0.09);

  --transition: 180ms ease;
}

/* Base ------------------------------------------------------------------ */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
}
h2 {
  font-size: clamp(1.65rem, 3.5vw, 2.2rem);
}
h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--accent-dark);
  text-underline-offset: 2px;
  transition: color var(--transition);
}

a:hover {
  color: var(--navy);
}

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

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

/* Placeholder copy still to be written — remove this rule once the site is
   ready to publish, and search the HTML for any remaining .todo spans. */
.todo {
  background: #fff6d5;
  border-bottom: 1px dashed #c9a227;
  padding: 0 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 760px;
}

.section {
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section__head {
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.eyebrow {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.85rem;
}

.lede {
  font-size: 1.1875rem;
  color: var(--text-muted);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

/* Components ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}

.btn--secondary:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.btn--invert {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--invert:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d2d8df;
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.9688rem;
}

.card a {
  font-weight: 600;
  text-decoration: none;
}

/* Header / nav ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 74px;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--navy);
  flex-shrink: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.15;
}

/* Now carries the tagline rather than the location, so it reads as a phrase
   instead of a label — serif, italic, sentence case. */
.brand__sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

/* Below this the tagline crowds the nav. It still appears in the hero and
   under the About heading, so nothing is lost by dropping it here. */
@media (max-width: 1040px) {
  .brand__sub {
    display: none;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: var(--slate);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--accent);
}

/* Services dropdown. Opens on hover for pointer users and on focus for
   keyboard users; on narrow screens it flattens into the stacked menu. */
.nav__item--has-menu {
  position: relative;
}

.nav__submenu {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 230px;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition),
    visibility var(--transition);
}

.nav__item--has-menu:hover .nav__submenu,
.nav__item--has-menu:focus-within .nav__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__submenu a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.9375rem;
  color: var(--slate);
  text-decoration: none;
}

.nav__submenu a:hover {
  background: var(--bg-alt);
  color: var(--navy);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--navy);
}

/* Hero / page header ---------------------------------------------------- */

.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy-deep), var(--navy) 60%, #17334f);
  color: var(--text-invert);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle at 80% 20%,
    rgba(168, 131, 79, 0.26),
    transparent 55%
  );
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  padding-block: clamp(4rem, 10vw, 7rem);
  max-width: 700px;
}

.hero h1 {
  color: #fff;
  margin-bottom: 1.25rem;
}

.hero .eyebrow {
  color: var(--accent);
}

.hero p {
  font-size: 1.1875rem;
  color: rgba(238, 242, 246, 0.85);
  margin-bottom: 0;
}

.page-header {
  background: var(--navy);
  color: var(--text-invert);
  padding-block: clamp(2.75rem, 7vw, 4.25rem);
}

.page-header h1 {
  color: #fff;
  margin-bottom: 0.6rem;
}

.page-header p {
  color: rgba(238, 242, 246, 0.82);
  font-size: 1.125rem;
  max-width: 620px;
  margin-bottom: 0;
}

/* Steps ----------------------------------------------------------------- */

.steps {
  counter-reset: step;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  padding-top: 1.1rem;
  border-top: 2px solid var(--border);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.steps h3 {
  font-size: 1.0625rem;
}

.steps p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 0;
}

/* CTA band -------------------------------------------------------------- */

.cta-band {
  background: var(--navy);
  color: var(--text-invert);
  text-align: center;
}

.cta-band h2 {
  color: #fff;
}

.cta-band p {
  color: rgba(238, 242, 246, 0.82);
  max-width: 540px;
  margin-inline: auto;
}

.cta-band .btn-row {
  justify-content: center;
}

/* Forms ----------------------------------------------------------------- */

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 131, 79, 0.18);
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.contact-layout {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: 1.4fr 1fr;
  align-items: start;
}

.contact-aside {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.contact-aside dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

.contact-aside dt:first-of-type {
  margin-top: 0;
}

.contact-aside dd {
  margin: 0.25rem 0 0;
}

/* Bios ------------------------------------------------------------------ */

.bio {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: start;
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.bio:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

/* Square, to match how headshots come out of a phone. object-fit keeps a
   non-square photo from stretching. */
.bio__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #dde3ea, #f1f4f7);
  border: 1px solid var(--border);
}

/* A real photo. object-fit needs the element to stay a replaced element, so
   no display change here — setting display:grid on an <img> breaks it. */
img.bio__photo {
  display: block;
  object-fit: cover;
}

/* The grey "photo goes here" box, which does need to center its label. */
div.bio__photo {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.bio h3 {
  font-size: 1.5rem;
  margin-bottom: 0.15rem;
}

.bio__role {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 1.1rem;
}

/* Set off a related party who is not part of the firm. */
.bio--external {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.35rem;
  font-size: 0.9375rem;
  color: var(--slate);
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Callouts always sit apart from what precedes them. A card grid in
   particular gives no trailing space of its own — its gap applies only
   between cards, not after the last row. */
.callout {
  margin-block: 2.5rem;
}

/* When a callout closes a block — the bios, for instance — the container's
   own padding already provides the space below it. */
.callout:last-child {
  margin-bottom: 0;
}

.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--accent);
}

/* Legal pages ----------------------------------------------------------- */

.legal h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}

.legal h2:first-child {
  margin-top: 0;
}

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

.site-footer {
  background: var(--navy-deep);
  color: rgba(238, 242, 246, 0.72);
  font-size: 0.9375rem;
  padding-block: 3.25rem 2rem;
}

.site-footer a {
  color: rgba(238, 242, 246, 0.72);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer__grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1.6fr 1fr 1fr;
  padding-bottom: 2.5rem;
}

.footer__brand .brand__name {
  color: #fff;
}

.footer__brand p {
  margin-top: 1rem;
  max-width: 34ch;
}

.site-footer h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 1rem;
}

.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.75rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(238, 242, 246, 0.55);
}

.footer__legal p {
  margin-bottom: 0.85rem;
}

.footer__legal p:last-child {
  margin-bottom: 0;
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .bio {
    grid-template-columns: 1fr;
  }

  .bio__photo {
    max-width: 220px;
    aspect-ratio: 1 / 1;
  }

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

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav.is-open {
    display: flex;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__link {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav__link:hover,
  .nav__link[aria-current="page"] {
    border-bottom-color: var(--border);
  }

  /* Submenu flattens into the stack rather than floating */
  .nav__submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
    min-width: 0;
  }

  .nav__submenu a {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav .btn {
    margin-top: 1rem;
  }
}

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

  .btn {
    width: 100%;
  }

  .btn-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
