/* MRM Associates site styles.
   Two brand inks on white. Navy #253D82 and near-black #221E1F both come from
   the client's own artwork; nothing else is invented. Montserrat throughout,
   self-hosted (see fonts.css). Square corners, hairline rules, restrained
   depth. The weight is meant to sit on the photography. */

/* ---------------------------------------------------------------- tokens - */

:root {
  --navy: #253d82;
  --navy-dark: #1b2d61;
  --navy-tint: #e8ecf6;
  --ink: #221e1f;
  --body: #4c5468;
  --line: #dde1ea;
  --surface: #f4f6fa;
  --paper: #fff;

  --measure: 62ch;
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* 1.25 ratio, clamped so headings settle rather than shrink to nothing */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-md: clamp(1.125rem, 0.4vw + 1.03rem, 1.25rem);
  --t-lg: clamp(1.375rem, 0.8vw + 1.19rem, 1.75rem);
  --t-xl: clamp(1.75rem, 1.6vw + 1.38rem, 2.5rem);
  --t-2xl: clamp(2.125rem, 2.8vw + 1.47rem, 3.5rem);

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  --band: clamp(3.5rem, 7vw, 6rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----------------------------------------------------------------- reset - */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  /* Montserrat is the client's own face, drawn in their logo and embedded in
     their business card. It is a brand commitment, not a stylistic pick. */
  /* impeccable-disable-next-line overused-font */
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--t-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); letter-spacing: -0.01em; line-height: 1.3; }

p { margin: 0; }

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

ul, ol { margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--navy);
  color: #fff;
  font-size: var(--t-sm);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

/* ---------------------------------------------------------------- layout - */

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

.section { padding-block: var(--band); }

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

.section__lede,
.hero__lede {
  max-width: var(--measure);
  font-size: var(--t-md);
}

.section > .wrap > h2 + .section__lede { margin-top: var(--s-4); }

/* ---------------------------------------------------------------- header - */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: 4.75rem;
}

.site-header__logo {
  display: block;
  flex: 0 0 auto;
  padding-block: var(--s-3);
}

.site-header__logo img {
  width: auto;
  height: clamp(2rem, 4.4vw, 2.5rem);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--s-4), 3vw, var(--s-6));
}

.site-nav a {
  position: relative;
  padding-block: var(--s-2);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.site-nav a:hover::after,
.site-nav a[aria-current='page']::after { transform: none; }

/* --------------------------------------------------------------- buttons - */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--navy);
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

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

.btn--primary:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
}

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

.btn--ghost:hover {
  background: var(--navy-tint);
}

.btn--onDark {
  background: #fff;
  border-color: #fff;
  color: var(--navy);
}

.btn--onDark:hover {
  background: transparent;
  color: #fff;
}

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

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

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ------------------------------------------------------------ hero+media - */

/* Headline over the photograph, which is the arrangement this kind of site is
   expected to open with. The scrim is doing real work: it guarantees the
   headline stays legible over whatever photograph the client supplies, which
   is not something a photo-dependent hero can otherwise promise. */
.hero {
  display: grid;
  min-height: clamp(26rem, 62vh, 34rem);
  background: var(--ink);
  isolation: isolate;
}

.hero__media {
  grid-area: 1 / 1;
  position: relative;
  overflow: hidden;
}

.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(20, 25, 44, 0.92) 0%,
    rgba(20, 25, 44, 0.78) 42%,
    rgba(20, 25, 44, 0.45) 100%
  );
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__inner {
  grid-area: 1 / 1;
  z-index: 1;
  align-self: center;
  padding-block: clamp(3rem, 8vw, 5rem);
}

.hero__body {
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.88);
}

.hero h1 { color: #fff; }

.hero__lede { margin-top: var(--s-5); }

.hero .actions { margin-top: var(--s-6); }

/* Placeholder frames stand in for client photography. They are deliberately
   plain and clearly labelled. A real image drops into the same box without
   any layout change. See the TODO comments in the markup for what each needs. */
.placeholder {
  display: grid;
  place-items: center;
  background: var(--navy-tint);
  border: 1px solid var(--line);
}

.placeholder__label {
  color: var(--navy);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* The hero placeholder fills its band rather than holding an aspect ratio. The
   band's height is set by the headline, exactly as a photograph cropped to
   cover would be. It still carries the same marked frame as every other
   placeholder so it reads as a reserved slot, not an empty band. */
.placeholder--hero {
  height: 100%;
  background: var(--navy);
  border: 0;
  /* Corner, not centre. The headline occupies the middle of this band. */
  place-items: end;
  padding: var(--s-5);
}

.placeholder--hero .placeholder__label {
  padding: var(--s-2) var(--s-4);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  opacity: 0.8;
}

/* Frames follow the proportions of the thing being photographed, so the grid
   describes printed matter whether a photograph has arrived or not. The same
   three ratios apply to a real image and to a placeholder standing in for one,
   which is why swapping between them changes nothing about the layout. */
.placeholder--portrait,
.img--portrait { aspect-ratio: 3 / 4; }

.placeholder--wide,
.img--wide { aspect-ratio: 16 / 9; }

.placeholder--feature,
.img--feature { aspect-ratio: 3 / 2; }

.img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  /* Holds the frame's colour while the image decodes, so nothing flashes white. */
  background: var(--navy-tint);
}

.placeholder--onDark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

.placeholder--onDark .placeholder__label { color: #fff; opacity: 0.85; }


/* -------------------------------------------------------------- services - */

/* Three upright pieces, then the two large-format ones across the full width.
   The rows differ on purpose: a book and an exhibition banner are not the
   same shape, and a grid of identical tiles says nothing about either. */
.services {
  display: grid;
  gap: var(--s-7) var(--s-5);
  margin-top: var(--s-7);
  list-style: none;
}

@media (min-width: 40rem) {
  .services { grid-template-columns: repeat(6, 1fr); }
  .service { grid-column: span 3; }
}

@media (min-width: 60rem) {
  .service { grid-column: span 2; }
  .service--wide { grid-column: span 3; }
}

.service h3 { margin-top: var(--s-4); }

.service p { margin-top: var(--s-2); }

/* --------------------------------------------------------------- feature - */

.feature {
  padding-block: var(--band);
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
}

.feature h2 { color: #fff; }

.feature__inner {
  display: grid;
  gap: var(--s-7);
  align-items: center;
}

.feature__body > p { margin-top: var(--s-4); max-width: 46ch; }

.feature .actions { margin-top: var(--s-6); }

@media (min-width: 52rem) {
  .feature__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
  }
}

/* ----------------------------------------------------------------- steps - */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--s-6);
  margin-top: var(--s-7);
  list-style: none;
  counter-reset: none;
}

.step { border-top: 2px solid var(--navy); padding-top: var(--s-4); }

/* The number is the sequence, so it is sized to be read as one rather than
   sitting over the heading as a label. */
.step__num {
  display: block;
  color: var(--navy);
  font-size: var(--t-lg);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.step h3 { margin-top: var(--s-2); }

.step p { margin-top: var(--s-3); font-size: var(--t-sm); }

/* ------------------------------------------------------------------- cta - */

.cta { padding-block: var(--band); border-top: 1px solid var(--line); }

.cta__inner > p { margin-top: var(--s-4); max-width: var(--measure); }

.cta .actions { margin-top: var(--s-6); }

/* ------------------------------------------------------------ page heads - */

.page-head {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.page-head__lede {
  max-width: var(--measure);
  margin-top: var(--s-4);
  font-size: var(--t-md);
}

.page-head .actions { margin-top: var(--s-6); }

/* ------------------------------------------------------------- contact -- */

.contact {
  display: grid;
  gap: var(--s-8);
  align-items: start;
}

@media (min-width: 56rem) {
  .contact {
    grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 1fr);
    gap: var(--s-9);
  }
}

.contact__direct h2,
.form h2 { font-size: var(--t-lg); }

.details {
  margin: var(--s-5) 0 0;
  padding-top: var(--s-5);
  border-top: 2px solid var(--navy);
}

.details dt {
  color: var(--ink);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.details dd {
  margin: var(--s-1) 0 var(--s-5);
  font-size: var(--t-md);
  overflow-wrap: anywhere;
}

.details dd a {
  display: inline-block;
  padding-block: var(--s-1);
}

.details dd:last-child { margin-bottom: 0; }

.contact__direct .pending { color: var(--body); }

.note {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.note h3 { font-size: var(--t-base); }

.note p { margin-top: var(--s-2); font-size: var(--t-sm); }

/* ----------------------------------------------------------------- form - */

.field { margin-top: var(--s-5); }

/* The row owns the spacing so that stacking on a phone does not add the grid
   gap on top of each field's own margin. */
.field-row {
  display: grid;
  gap: var(--s-5);
  margin-top: var(--s-5);
}

.field-row .field { margin-top: 0; }

@media (min-width: 34rem) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

label {
  display: block;
  margin-bottom: var(--s-2);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 700;
}

.req { color: var(--navy); }

.opt {
  color: var(--body);
  font-weight: 400;
  font-size: var(--t-xs);
}

input[type='text'],
input[type='email'],
input[type='tel'],
textarea {
  display: block;
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid #b9c0d0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-base);
  line-height: 1.5;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

textarea { resize: vertical; min-height: 9rem; }

input:hover,
textarea:hover { border-color: #8d97ae; }

input:focus,
textarea:focus {
  outline: 0;
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}

input:focus-visible,
textarea:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.field--invalid input,
.field--invalid textarea { border-color: #a51f1f; }

.field--invalid input:focus,
.field--invalid textarea:focus { box-shadow: inset 0 0 0 1px #a51f1f; }

.field__hint {
  margin-top: var(--s-2);
  font-size: var(--t-sm);
}

.field__error {
  margin-top: var(--s-2);
  color: #a51f1f;
  font-size: var(--t-sm);
  font-weight: 700;
}

.form > .btn { margin-top: var(--s-6); }

.form__note {
  margin-top: var(--s-4);
  font-size: var(--t-sm);
}

.form__status {
  margin-top: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--navy);
  background: var(--navy-tint);
  color: var(--ink);
  font-size: var(--t-sm);
}

.form__status--error {
  border-color: #a51f1f;
  background: #fbecec;
}

.form__status h3 { font-size: var(--t-base); }

.form__status p { margin-top: var(--s-2); }

.form__status a { color: inherit; }

/* Visually hidden but still submitted, so a bot fills it and a person cannot.
   Not display:none, because some bots skip those. */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.is-sending { cursor: progress; }

/* ---------------------------------------------------------------- footer - */

.site-footer {
  padding-top: var(--band);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--t-sm);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--s-7);
  padding-bottom: var(--s-8);
}

.site-footer__brand img { width: auto; height: 2.25rem; }

.site-footer__brand p {
  margin-top: var(--s-4);
  max-width: 34ch;
}

.site-footer h2 {
  color: #fff;
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.plain { list-style: none; }

.site-footer__col ul { margin-top: var(--s-3); }

/* Footer links are standalone list items rather than links inside a sentence,
   so they need to clear the 24px minimum target height on their own. */
.site-footer__col li a,
.site-footer__col li .pending {
  display: inline-block;
  padding-block: var(--s-1);
  min-height: 1.5rem;
}

.site-footer a { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.4); }

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

.site-footer :focus-visible { outline-color: #fff; }

/* Details the client has not confirmed yet. Visible on purpose so they cannot
   ship unnoticed. See the TODO comments in the markup and the README.
   No italic: only the roman weights of Montserrat are self-hosted, and asking
   for one would get a synthetic oblique rather than a drawn italic. */
.pending { color: rgba(255, 255, 255, 0.78); }

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-1) var(--s-5);
  padding-block: var(--s-4);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.site-footer__legal p { font-size: var(--t-xs); }

/* Build credit. Deliberately quieter than the copyright it sits beside. It is
   there to be found, not noticed. Still holds 5.2:1 against the footer ground,
   so "quiet" never means "unreadable". */
.credit { color: rgba(255, 255, 255, 0.5); }

.site-footer__legal .credit a {
  display: inline-block;
  padding-block: var(--s-1);
  color: inherit;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

.site-footer__legal .credit a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

/* Available to screen readers, removed from the visual layout. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- motion - */

/* One authored moment: the hero settles as the page opens. Everything is
   already in its final position. This animates from a visible state, so a
   failed animation leaves the page perfectly readable. */
@media (prefers-reduced-motion: no-preference) {
  .hero__body > * {
    animation: settle 0.7s var(--ease) backwards;
  }

  .hero__body > :nth-child(2) { animation-delay: 0.07s; }
  .hero__body > :nth-child(3) { animation-delay: 0.14s; }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}
