/* Stiles Civil Engineering: the one stylesheet.
   Native scrolling only: nothing here moves, snaps, or reacts to scrolling. */

/* ---------- Fonts (self-hosted DM Sans) ---------- */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/DMSans-400.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/DMSans-500.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/DMSans-600.woff2") format("woff2");
}

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

:root {
  --green: #9ace7b;
  --charcoal: #1a1d1c;
  --grey: #4a4f4d;
  --panel: #f4f6f5;
  --hairline: #e6e8e7;
  --white: #ffffff;

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
  --step-3: clamp(1.875rem, 1.35rem + 2.2vw, 2.75rem);

  --wrap: 1100px;
  --gutter: 20px;
  --radius: 4px;
}

/* ---------- Reset ---------- */

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

body,
h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

:where(ul[class], ol[class]) {
  padding: 0;
  list-style: none;
}

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

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

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--charcoal);
  background: var(--white);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 {
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

h2 {
  font-size: var(--step-2);
  font-weight: 500;
}

h3 {
  font-size: var(--step-1);
  font-weight: 600;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

.site-header :focus-visible,
.hero :focus-visible,
.page-head :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--green);
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

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

/* The skip link stays hidden until a keyboard user tabs to it. */
.skip-link:focus {
  top: 0;
  left: 0;
  z-index: 20;
  width: auto;
  height: auto;
  margin: 0;
  padding: 12px 16px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--charcoal);
  color: var(--white);
  font-weight: 500;
  outline: 2px solid var(--green);
  outline-offset: -4px;
}

/* ---------- Header and navigation ---------- */

.site-header {
  position: relative;
  background: var(--charcoal);
  color: var(--white);
  /* Covers the hairline seam scaled screens can show against the charcoal band below. */
  box-shadow: 0 1px 0 var(--charcoal);
}

/* Clear space: the padding and gap around the logo are at least as wide as its
   symbol, which is about 0.93 of the logo's height (41 px here, 48 px wide-screen). */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 44px;
  padding-block: 42px;
}

.logo {
  display: block;
  flex: none;
}

.logo img {
  width: auto;
  height: 44px;
}

.nav-toggle > summary {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-toggle > summary::-webkit-details-marker {
  display: none;
}

.nav-toggle[open] > summary {
  border-color: var(--green);
}

.nav-list a {
  display: block;
  font-weight: 500;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

/* Narrow screens: the Menu toggle opens the list as a panel under the header. */
@media (max-width: 759.98px) {
  .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 8px var(--gutter) 20px;
    background: var(--charcoal);
    border-block: 1px solid var(--grey);
  }

  .nav-toggle:not([open]) + .nav-list {
    display: none;
  }

  .nav-list a {
    padding-block: 12px;
  }
}

/* Wide screens: no toggle, the list sits inline. */
@media (min-width: 760px) {
  .header-inner {
    gap: 48px;
    padding-block: 50px;
  }

  .logo img {
    height: 52px;
  }

  .nav-toggle {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 32px;
  }
}

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

.hero {
  background: var(--charcoal);
  color: var(--white);
}

.hero-inner {
  display: grid;
  gap: 40px;
  padding-top: 24px;
  padding-bottom: 64px;
}

.hero-photo {
  display: none; /* phones: text only; the photo appears from 760px */
  margin: 0;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-bottom: 3px solid var(--green);
}

.eyebrow {
  margin-bottom: 20px;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.hero h1 {
  max-width: 24ch;
}

.lede {
  max-width: 36em;
  margin-top: 24px;
  color: var(--hairline);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

@media (min-width: 760px) {
  .hero-inner {
    grid-template-columns: 1fr 280px;
    align-items: center;
    gap: 64px;
    padding-top: 56px;
    padding-bottom: 80px;
  }

  .hero-photo {
    display: block;
    width: 100%;
    justify-self: end;
  }
}

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

.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

/* On white: charcoal with white text; the secondary is an outline. */
.btn-primary {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--white);
}

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

.btn-ghost {
  border-color: var(--charcoal);
  color: var(--charcoal);
}

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

/* On charcoal: green with charcoal text; the secondary is a white outline. */
.hero .btn-primary,
.page-head .btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--charcoal);
}

.hero .btn-primary:hover,
.page-head .btn-primary:hover {
  background: var(--white);
  border-color: var(--white);
}

.hero .btn-ghost,
.page-head .btn-ghost {
  border-color: var(--white);
  color: var(--white);
}

.hero .btn-ghost:hover,
.page-head .btn-ghost:hover {
  background: var(--grey);
}

/* ---------- Inner page head ---------- */

.page-head {
  padding: 16px 0 56px;
  background: var(--charcoal);
  color: var(--white);
}

.page-head p {
  max-width: 40em;
  margin-top: 16px;
  font-size: var(--step-1);
  color: var(--hairline);
}

/* ---------- Sections and grids ---------- */

.section {
  padding-block: 56px;
}


.section > .wrap > h2 {
  margin-bottom: 32px;
}

/* Services page: paragraph, "What's included" heading, and list inside each section. */
.section[id] + .section[id] {
  border-top: 1px solid var(--hairline);
}

.section[id] > .wrap > p {
  max-width: 44em;
}

.section[id] h3 {
  margin-top: 28px;
  margin-bottom: 12px;
}

.section[id] ul {
  max-width: 44em;
  margin: 0;
  padding-left: 1.25em;
}

.section[id] li + li {
  margin-top: 6px;
}

.section[id] li::first-letter {
  text-transform: uppercase;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 24px;
}

@media (min-width: 600px) {
  .section {
    padding-block: 80px;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

.grid-3 p,
.panel p {
  margin-top: 10px;
  color: var(--grey);
}

.panel {
  padding: 28px;
  background: var(--panel);
  border-radius: var(--radius);
}

.panel h3 a {
  text-decoration-color: var(--grey);
}

.rule {
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 16px;
  background: var(--green);
}

.more {
  margin-top: 32px;
  font-weight: 500;
}

/* ---------- Experience cards ---------- */

.section .wrap .group-heading {
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cards {
  display: grid;
  gap: 24px;
}

.cards + .group-heading {
  margin-top: 56px;
}

@media (min-width: 600px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
}

.card > :not(.card-band) {
  margin-inline: 24px;
}

.card > :last-child {
  margin-bottom: 24px;
}

/* Charcoal band with the green symbol centered; a photo inside covers it. */
.card-band {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  background: var(--charcoal);
}

.card-mark {
  width: auto;
  height: 40px;
}

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

.card-title {
  margin-top: 20px;
  font-size: var(--step-1);
  font-weight: 600;
}

.card-meta {
  margin-top: 4px;
  font-size: var(--step--1);
  color: var(--grey);
}

.card-scope {
  margin-top: 12px;
}

.card-role {
  margin-top: auto;
  padding-top: 16px;
  font-size: var(--step--1);
  font-weight: 500;
}

.card-role::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  margin-right: 10px;
  vertical-align: middle;
  background: var(--green);
}

.additional {
  max-width: 44em;
  color: var(--grey);
}

/* ---------- Facts list ---------- */

.facts {
  border-top: 1px solid var(--hairline);
}

.facts li {
  padding-block: 12px;
  border-bottom: 1px solid var(--hairline);
}

/* About page: headshot (4:5, never distorted) and the name, title, and bio. */
.about-photo {
  width: min(100%, 360px);
}

.about-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-bottom: 3px solid var(--green);
}

/* Firm-first sections above the Leadership block. */
.about-para {
  max-width: 44em;
  margin-bottom: 48px;
}

.about-text h3 {
  font-size: 1.35rem;
  line-height: 1.2;
}

.firm-line {
  margin-top: 40px;
  color: var(--grey);
}

.title {
  margin-top: 4px;
  color: var(--grey);
}

.bio {
  margin-block: 20px 28px;
  max-width: 44em;
}

@media (min-width: 600px) {
  .about {
    grid-template-columns: 2fr 3fr;
    gap: 56px;
    align-items: start;
  }
}

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

.contact-band {
  padding-block: 56px;
  background: var(--panel);
}

.contact-band p {
  max-width: 40em;
  margin-top: 12px;
  font-size: var(--step-1);
}

.contact-band a {
  font-weight: 500;
  white-space: nowrap;
}

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

.site-footer {
  padding-block: 48px;
  background: var(--charcoal);
  color: var(--white);
  font-size: var(--step--1);
}

.footer-inner {
  display: grid;
  gap: 24px;
  align-items: center;
}

.footer-logo {
  width: auto;
  height: 22px;
}

.footer-legal {
  color: var(--hairline);
}

/* Wrap the legal line only between its three parts. */
.footer-legal span {
  white-space: nowrap;
}

.footer-contact a {
  display: inline-block;
  padding-block: 4px;
  font-weight: 500;
}

@media (min-width: 760px) {
  .footer-inner {
    grid-template-columns: auto 1fr auto;
    gap: 40px;
  }

  .footer-contact {
    text-align: right;
  }
}
