/* Pacific Bay Financial — identity program */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("assets/fonts/archivo-latin-var.woff2") format("woff2");
}

:root {
  --blue: #004e92;
  --blue-deep: #003a6e;
  --ink: #111418;
  --ink-2: #434a52;
  --gray: #646b73;
  --mist: #eef1f4;
  --line: #d5dbe1;
  --paper: #ffffff;
  --on-blue-2: #c6d6e8;

  --face: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --condensed: 68%;

  --wrap: 1360px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --space-section: clamp(5rem, 10vw, 9rem);
  --header-h: 84px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--blue) var(--mist);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--face);
  font-size: 1.125rem;
  line-height: 1.6;
  font-stretch: 100%;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue); color: var(--paper); }
.group--blue ::selection,
.hero__square ::selection,
.contact ::selection,
.doc-head ::selection,
.footer ::selection { background: var(--paper); color: var(--blue); }

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.hero__square :focus-visible,
.group--blue :focus-visible,
.contact :focus-visible,
.doc-head :focus-visible { outline-color: var(--paper); }

svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; flex: none; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--blue); color: var(--paper); padding: 0.75rem 1rem;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 1rem; }

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

/* ---------- Type system ---------- */

.hero__title,
h2,
h3,
.program dt,
.btn,
.masthead__nav,
.directory a,
.contact__phone,
.monogram {
  font-stretch: var(--condensed);
  text-transform: uppercase;
}

h2 {
  font-size: clamp(2.5rem, 5.6vw, 4.75rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h3 {
  font-size: 1.5rem;
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.caption {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gray);
  line-height: 1.5;
}
.caption--on-blue { color: var(--on-blue-2); }
.nowrap { white-space: nowrap; }

/* The rule: the white line from the logo, drawn in the local ink. */
.rule {
  display: block;
  height: 4px;
  background: currentColor;
  transform-origin: left center;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.5rem;
  padding: 0 1.6rem;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 1.1875rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}
.btn svg { transition: transform 240ms var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }
.btn--sm { min-height: 2.75rem; padding: 0 1.25rem; font-size: 1.0625rem; }

.btn--blue { background: var(--blue); color: var(--paper); }
.btn--blue:hover { background: var(--blue-deep); }

.btn--white { background: var(--paper); color: var(--blue); }
.btn--white:hover { background: var(--mist); }

.btn--ghost { border-color: rgb(255 255 255 / 0.55); color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper); background: rgb(255 255 255 / 0.08); }

.text-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; color: var(--blue);
}
.text-link svg { transition: transform 240ms var(--ease-out); }
.text-link:hover svg { transform: translateX(4px); }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.96);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--header-h);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.masthead__logo img { width: 60px; height: 60px; }
.masthead__nav {
  display: flex;
  gap: 2rem;
  margin-left: auto;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.masthead__nav a { text-decoration: none; color: var(--ink); padding-block: 0.5rem; }
.masthead__nav a:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 2px; }
.masthead__actions { display: flex; align-items: center; gap: 1.5rem; }
.phone-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; color: var(--blue); text-decoration: none; white-space: nowrap;
}
.phone-link:hover { text-decoration: underline; }
.phone-link__short { display: none; }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 7fr 5fr;
  min-height: min(calc(100svh - var(--header-h) - 4.25rem), 860px);
  overflow-x: clip;
  background: var(--blue);
}
.hero__square {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1.25rem, 4vw, 4.5rem) clamp(2.5rem, 4.5vw, 4.5rem);
  padding-left: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  background: var(--blue);
  color: var(--paper);
}
.hero__title {
  font-size: clamp(3.25rem, 7.4vw, 6rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-stretch: 80%;
  max-width: 11ch;
  text-wrap: balance;
}
/* The rule leaves the square and runs across the photograph, as it crosses the mark. */
.hero__rule {
  margin-top: clamp(1.25rem, 2.2vw, 1.75rem);
  margin-bottom: 1.1rem;
  margin-right: calc(-1 * clamp(1.25rem, 4vw, 4.5rem));
  width: calc(100% + clamp(1.25rem, 4vw, 4.5rem) + 41.667vw);
  position: relative;
  z-index: 2;
  color: var(--paper);
}
.hero__lede {
  max-width: 30rem;
  margin-top: 1.75rem;
  font-size: clamp(1.125rem, 1.35vw, 1.3125rem);
  line-height: 1.55;
  color: var(--paper);
  text-wrap: pretty;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

.hero__photo { position: relative; overflow: hidden; background: #8fb3d1; }
.hero__photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 42% 60%;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__rule { animation: draw 1300ms var(--ease-out) 200ms backwards; }
  @keyframes draw { from { transform: scaleX(0); } }
}

/* ---------- Directory ---------- */

.directory {
  background: var(--mist);
  border-bottom: 1px solid var(--line);
}
.directory ul {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.15rem 2rem;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1.25rem var(--gutter);
}
.directory a {
  display: inline-block;
  padding-block: 0.35rem;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.directory a:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- Section heads ---------- */

.section-head { color: var(--blue); }
.section-head h2 { color: var(--blue); }
.section-head .rule { width: min(100%, 22rem); margin-block: 1.5rem 1.1rem; }
.section-head__lede {
  max-width: 38rem;
  margin-top: 1.75rem;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ---------- Loans ---------- */

.loans { padding-top: var(--space-section); }
.loans .section-head { margin-bottom: clamp(3.5rem, 7vw, 6rem); }

.group {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 2rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3.5rem, 6vw, 5.5rem);
  border-top: 4px solid var(--blue);
}
.group__label { align-self: start; position: sticky; top: calc(var(--header-h) + 2rem); }
.group__label h3 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); color: var(--blue); max-width: 12ch; }
.group__label .caption { margin-top: 1rem; }

.programs { display: grid; }
.program {
  display: grid;
  grid-template-columns: minmax(11rem, 5fr) 7fr;
  gap: 0.75rem 2.5rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.program:first-child { padding-top: 0.35rem; }
.program:last-child { border-bottom: 0; }
.program dt {
  font-size: 1.5rem;
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.program dd { color: var(--ink-2); max-width: 36rem; text-wrap: pretty; }
.program:target dt { color: var(--blue); }
.program:target dt::before {
  content: ""; display: inline-block; width: 0.55em; height: 0.55em;
  margin-right: 0.45em; background: currentColor; vertical-align: 0.1em;
}

.group--blue {
  display: block;
  padding: 0;
  border-top: 0;
  background: var(--blue);
  color: var(--paper);
}
.group__inner {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 2rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(4rem, 7vw, 6.5rem);
}
.group--blue .group__label h3,
.group--blue .program dt { color: var(--paper); }
.group--blue .program dd { color: var(--on-blue-2); }
.group--blue .program { border-bottom-color: rgb(255 255 255 / 0.28); }
.group--blue .program:target dt { color: var(--paper); }
.group__note {
  grid-column: 2;
  padding-top: 1.75rem;
  border-top: 1px solid rgb(255 255 255 / 0.28);
  font-size: 1rem;
  color: var(--on-blue-2);
  max-width: 44rem;
}
.group--blue + .group { border-top: 0; }

/* ---------- About ---------- */

.about {
  padding-block: var(--space-section);
  background: var(--mist);
}
.about__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 3rem clamp(2rem, 5vw, 5rem);
}
.about__body { display: grid; gap: 1.25rem; max-width: 40rem; font-size: 1.1875rem; color: var(--ink-2); }
.about__body p { text-wrap: pretty; }

.facts {
  margin-top: 1.25rem;
  width: 100%;
  border-collapse: collapse;
  font-size: 1.0625rem;
}
.facts th,
.facts td { padding: 0.9rem 0; border-top: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.facts tr:last-child th,
.facts tr:last-child td { border-bottom: 1px solid var(--line); }
.facts th {
  width: 9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gray);
}
.facts td { color: var(--ink); font-weight: 600; }

.people {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
.person { display: flex; align-items: center; gap: 1.25rem; }
.person h3 { color: var(--ink); font-size: 1.625rem; }
.person p { margin-top: 0.3rem; font-size: 1rem; color: var(--ink-2); line-height: 1.45; }

/* A monogram cut from the mark: blue square, white caps, the rule beneath. */
.monogram {
  flex: none;
  display: grid;
  align-content: end;
  width: 5.5rem;
  height: 5.5rem;
  padding: 0 0.55rem 0.6rem;
  background: var(--blue);
  color: var(--paper);
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}
.monogram span {
  display: block;
  padding-bottom: 0.35rem;
  border-bottom: 3px solid var(--paper);
  margin-right: -0.55rem;
}

/* ---------- Reviews ---------- */

.reviews { padding-block: var(--space-section); }
.reviews__top {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 3rem clamp(2rem, 5vw, 5rem);
  align-items: end;
}
.pull { max-width: 52rem; }
.pull blockquote p {
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  font-stretch: var(--condensed);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
  text-indent: -0.42em;
}
.pull figcaption,
.quote figcaption {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}
.quotes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-block: clamp(3rem, 6vw, 5rem) 2.5rem;
  border-top: 4px solid var(--blue);
}
.quote {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem 1.75rem 0 0;
}
.quote + .quote { padding-left: 1.75rem; border-left: 1px solid var(--line); }
.quote blockquote p { font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); text-indent: -0.4em; }

/* ---------- Contact ---------- */

.contact {
  padding-block: var(--space-section);
  background: var(--blue);
  color: var(--paper);
}
.contact h2 { color: var(--paper); }
.contact .rule { width: min(100%, 22rem); margin-block: 1.5rem 0; }
.contact__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 3rem clamp(2rem, 5vw, 5rem);
  align-items: end;
}
.contact__lede { margin-top: 1.75rem; max-width: 26rem; font-size: 1.25rem; color: var(--on-blue-2); }
.contact__phone {
  display: block;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
}
.contact__phone:hover { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 0.12em; }
.contact address {
  margin-top: 1.5rem;
  font-style: normal;
  font-size: 1.3125rem;
  line-height: 1.45;
}
.contact address a { text-decoration-color: rgb(255 255 255 / 0.5); }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; }

/* ---------- Documents ---------- */

.doc-head {
  padding-block: clamp(3.5rem, 7vw, 6rem) clamp(3rem, 5vw, 4.5rem);
  background: var(--blue);
  color: var(--paper);
}
.doc-head__title {
  font-size: clamp(2.75rem, 6.4vw, 5.25rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.005em;
  font-stretch: 80%;
  text-transform: uppercase;
  text-wrap: balance;
}
.doc-head .rule { width: min(100%, 22rem); margin-block: 1.5rem 1.1rem; }
.doc-head__lede { max-width: 40rem; margin-top: 1.5rem; font-size: 1.25rem; line-height: 1.55; text-wrap: pretty; }

.doc {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3.5rem, 6vw, 5.5rem) var(--space-section);
}
.doc__toc { align-self: start; position: sticky; top: calc(var(--header-h) + 2rem); }
.doc__toc ol { margin: 1rem 0 0; padding: 0; list-style: none; border-top: 4px solid var(--blue); }
.doc__toc li { border-bottom: 1px solid var(--line); }
.doc__toc a { display: block; padding: 0.6rem 0; font-size: 1rem; font-weight: 600; line-height: 1.35; color: var(--ink); text-decoration: none; }
.doc__toc a:hover { color: var(--blue); text-decoration: underline; }

.doc__body { max-width: 44rem; color: var(--ink-2); }
.doc__body section { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.doc__body section + section { margin-top: 3.25rem; }
.doc__body h2 { margin-bottom: 1.1rem; font-size: clamp(1.625rem, 2.4vw, 2rem); line-height: 1; color: var(--blue); letter-spacing: 0.01em; }
.doc__body h3 { margin: 1.75rem 0 0.5rem; font-size: 1.1875rem; color: var(--ink); }
.doc__body p + p,
.doc__body p + ul,
.doc__body ul + p { margin-top: 1rem; }
.doc__body ul { display: grid; gap: 0.5rem; margin-top: 1rem; }
.doc__body li { position: relative; padding-left: 1.4rem; }
.doc__body li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.45rem; height: 0.45rem; background: var(--blue);
}
.doc__body strong { color: var(--ink); }
.doc__body a { color: var(--blue); }
.doc__terms { margin-top: 0; }
.doc__terms td { font-weight: 500; }
.doc__address { margin-top: 1rem; font-style: normal; color: var(--ink); }

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

.footer {
  padding-block: 0 4rem;
  background: var(--blue);
  color: var(--on-blue-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.footer__grid::before {
  content: ""; grid-column: 1 / -1; height: 4px; background: var(--paper); margin-bottom: 1rem;
}
.footer__grid { display: grid; grid-template-columns: 5fr 7fr; gap: 2.5rem clamp(2rem, 5vw, 5rem); }
.footer__id { display: flex; gap: 1.25rem; align-items: flex-start; }
.footer__id img { width: 64px; height: 64px; }
.footer__id p { color: var(--paper); }
.footer__legal { display: grid; gap: 0.75rem; max-width: 42rem; }
.footer strong { color: var(--paper); font-weight: 700; }
.footer a { color: var(--paper); }
.footer :focus-visible { outline-color: var(--paper); }
.footer__eho { display: flex; align-items: center; gap: 0.75rem; }
.footer__eho .eho { width: 30px; filter: brightness(0) invert(1); }
.footer__links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.footer__copy { color: var(--on-blue-2); }

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

@media (max-width: 1180px) {
  .masthead__nav { gap: 1.4rem; }
  .quotes { grid-template-columns: 1fr 1fr; }
  .quote:nth-child(3) { padding-left: 0; border-left: 0; }
  .quote:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 1.75rem; }
}

@media (max-width: 960px) {
  :root { --header-h: 68px; }
  .masthead__inner { gap: 1rem; }
  .masthead__logo img { width: 48px; height: 48px; }
  .masthead__nav { display: none; }
  .masthead__actions { margin-left: auto; gap: 1rem; }

  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__square { padding: 3rem var(--gutter) 3rem; }
  .hero__rule { width: calc(100% + var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
  .hero__photo { aspect-ratio: 16 / 10; }

  .group,
  .group__inner,
  .doc,
  .about__grid,
  .contact__grid,
  .footer__grid { grid-template-columns: 1fr; }
  .group__note,
  .people { grid-column: auto; }
  .group__label,
  .doc__toc { position: static; }
  .reviews__top { grid-template-columns: 1fr; }
  .pull { grid-column: auto; }
  .contact__grid { align-items: start; }
}

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .phone-link__full { display: none; }
  .phone-link__short { display: inline; }
  .phone-link {
    min-height: 2.75rem; padding: 0 0.9rem;
    border: 2px solid var(--blue);
    font-stretch: var(--condensed); text-transform: uppercase; letter-spacing: 0.04em; font-size: 1.0625rem;
  }
  .hero__title { font-size: clamp(3rem, 14.5vw, 4.25rem); }
  .hero__actions .btn,
  .contact__actions .btn { flex: 1 1 100%; }

  .directory ul { grid-template-columns: 1fr 1fr; gap: 0 1rem; padding-block: 1rem; }
  .directory a { font-size: 1rem; }

  .program { grid-template-columns: 1fr; padding-block: 1.5rem; }
  .group__label h3 { max-width: none; }
  .caption { letter-spacing: 0.2em; }
  .people { grid-template-columns: 1fr; gap: 1.5rem; }
  .facts th { width: 7.5rem; letter-spacing: 0.2em; }

  .quotes { grid-template-columns: 1fr; }
  .quote,
  .quote + .quote { padding: 1.75rem 0 0; border-left: 0; }
  .quote + .quote { border-top: 1px solid var(--line); margin-top: 1.75rem; }

  .contact__phone { font-size: clamp(2.75rem, 13.5vw, 4rem); }
  .footer__id { flex-direction: column; }
}
