/* =========================================================
   AppliedESG.ai shared stylesheet
   Every text/background pairing below was checked against
   WCAG 2.2 AA contrast minimums (see README, "Accessibility").
   ========================================================= */

/* ---------- Self-hosted font: IBM Plex Serif for body text and UI (SIL Open Font License) ---------- */
@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/ibm-plex-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/ibm-plex-serif-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Self-hosted font: IBM Plex Sans 600 for headings (SIL Open Font License) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Core palette */
  --navy: #1E3D57;       /* Atlantic slate: header, footer, headings */
  --ocean: #1F5F99;      /* Ocean blue: links, primary buttons */
  --harbor: #3A86C8;     /* Harbor blue: large numerals, accents only */
  --mist: #EEF4F9;       /* Mist: tinted sections */
  --slate: #2E3A46;      /* Slate: body text */
  --accent: #F48C2F;     /* Tangerine: one CTA per page, active tab, focus on navy */
  --white: #FFFFFF;

  /* Supporting colors */
  --foam: #D6E4F2;       /* text on navy */
  --shallows: #8FB9E0;   /* ".ai" in the wordmark */
  --driftwood: #51606F;  /* helper text */
  --field-edge: #6B7886; /* form input borders */
  --alert: #A4262C;      /* error text */
  --alert-wash: #FCEDEE; /* error box background */
  --hairline: #D3DEE9;   /* decorative dividers only */

  /* Type. --text-min is the smallest size allowed anywhere on the site
     (it matches the home-page intro paragraph). */
  --text-min: 1.1875rem;
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --measure: 66ch;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--slate);
  font-family: var(--font-serif);
  font-size: var(--text-min);
  line-height: 1.65;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  letter-spacing: -0.015em;
}

h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.25rem);
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1.35;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

a {
  color: var(--ocean);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--navy);
  text-decoration-thickness: 2px;
}

/* Keyboard focus: ocean blue on light backgrounds, tangerine on navy */
:focus-visible {
  outline: 3px solid var(--ocean);
  outline-offset: 3px;
}

.site-header :focus-visible,
.band--navy :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--accent);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  background: var(--accent);
  color: var(--navy);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

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

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

/* ---------- Header and navigation ---------- */
.site-header {
  background: var(--navy);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.wordmark {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.01em;
  color: var(--white);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--white);
}

.wordmark span {
  color: var(--shallows);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 0.375rem 0;
  border-bottom: 3px solid transparent;
  color: var(--foam);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.375rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--white);
  border-bottom-color: var(--harbor);
}

.site-nav a[aria-current="page"] {
  color: var(--white);
  border-bottom-color: var(--accent);
}

/* On phones, slightly smaller tabs (the site's minimum text size) and tighter spacing
   so all four fit on one row on screens 360px and wider */
@media (max-width: 40rem) {
  .site-nav ul {
    gap: 0.25rem 1rem;
  }

  .site-nav a {
    font-size: var(--text-min);
  }
}

/* ---------- Section bands ---------- */
.band {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}

.band--mist {
  background: var(--mist);
}

.band--navy {
  background: var(--navy);
  color: var(--foam);
}

.band--navy h1,
.band--navy h2 {
  color: var(--white);
}

.band--navy a:not(.button) {
  color: var(--foam);
}

/* Continues the page header's background without a second top gap */
.band--flush-top {
  padding-top: 0;
}

.section-lead {
  font-size: var(--text-min);
}

/* ---------- "Interested in joining the workshop?" band ---------- */
/* The band is a size container so the heading size can follow its width (cqw units) */
.band--cta {
  container-type: inline-size;
}

/* Keep the heading on one line. On wide screens it uses the normal h2 size; on phones
   it shrinks just enough to fit. 16.5 = the heading's one-line width divided by its
   font size (measured at about 16.05), plus a little room to spare. */
.band--cta h2 {
  white-space: nowrap;
  font-size: min(
    clamp(1.75rem, 1.35rem + 1.5vw, 2.25rem),
    calc((100cqw - 2 * var(--gutter)) / 16.5)
  );
}

/* The sentence below uses the full page width and only wraps when it has to */
.band--cta p {
  max-width: none;
}

/* ---------- Home hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 8vw, 7rem) 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

/* Hero text width.
   - Phones: everything wraps within the 36rem column above.
   - About tablet width up: the title stays on one line.
   - With the wave artwork hidden (below 72rem), the rest of the hero text may use
     the full page width, so it only wraps when the screen runs out of room.
   - With the artwork showing, the rest of the hero text stops 1rem short of the point
     where the artwork's fade ends and its lines turn solid (22% into the artwork),
     but never gets narrower than the original 36rem.
   The hero is a size container so the math can use its width (cqw units). */
.hero {
  container-type: inline-size;
}

@media (min-width: 48rem) {
  .hero__inner {
    max-width: none;
  }

  .hero__inner > :not(h1) {
    max-width: none;
  }

  .hero h1 {
    white-space: nowrap;
  }
}

@media (min-width: 72.0625rem) {
  .hero__inner > :not(h1) {
    /* Fallback for the few browsers without container units */
    max-width: 36rem;
    /* Edge = where the artwork turns solid, minus where the text starts, minus 1rem.
       Artwork width is min(46%, 42rem) of the hero, anchored to its right edge;
       the fade covers its first 22%, so it turns solid 78% of its width from the right.
       The text starts at the centered page column's left edge plus the side gutter. */
    max-width: max(
      36rem,
      calc(100cqw - 0.78 * min(46cqw, 42rem)
           - max(0px, (100cqw - var(--wrap)) / 2) - var(--gutter) - 1rem)
    );
  }
}

.hero__lead {
  color: var(--foam);
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.375rem);
}

.hero__note {
  margin: 1.75rem 0 0;
  color: var(--foam);
  font-size: var(--text-min);
}

.hero__art {
  position: absolute;
  top: 0;
  right: 0;
  width: min(46%, 42rem);
  height: 100%;
  pointer-events: none;
  /* Fade the image in from its left edge so lines don't start abruptly */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%);
  mask-image: linear-gradient(to right, transparent 0, #000 22%);
}

/* Crop toward the right so the readings and buoy stay in view */
.hero__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 85% center;
}

/* On narrow screens the text needs the full width, so the lines go */
@media (max-width: 72rem) {
  .hero__art {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.35rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: 600 var(--text-min)/1.2 var(--font-serif);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Accent: the single most important action on a page */
.button--accent {
  background: var(--accent);
  color: var(--navy);
}

.button--accent:hover {
  color: var(--navy);
}

/* Light: secondary action on navy. White fill, Ocean blue label (6.66:1),
   Shallows border (decorative; the white fill already stands out from navy) */
.button--light {
  background: var(--white);
  border-color: var(--shallows);
  color: var(--ocean);
}

/* Hover: Mist fill with a navy label (10.18:1) */
.button--light:hover {
  background: var(--mist);
  color: var(--navy);
}

/* Primary: main action on light backgrounds */
.button--primary {
  background: var(--ocean);
  color: var(--white);
}

.button--primary:hover {
  background: var(--navy);
  color: var(--white);
}

.button[disabled] {
  cursor: progress;
}

/* ---------- Home: "why" list ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 4rem;
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  /* Keeps the section heading in view while the list scrolls past */
  .split > :first-child {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

.point-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.point-list li {
  padding: 1.25rem 0;
  border-top: 1px solid var(--hairline);
}

.point-list li:last-child {
  border-bottom: 1px solid var(--hairline);
}

.point-list h3 {
  margin-bottom: 0.35rem;
}

.point-list p {
  margin: 0;
}

/* ---------- Home: three approach blocks ---------- */
.trio {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

@media (min-width: 52rem) {
  .trio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.trio li {
  padding-top: 1.25rem;
  border-top: 3px solid var(--ocean);
}

.trio p {
  margin: 0;
}

/* ---------- Home: people ---------- */
.people {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 3rem;
  margin-top: 2rem;
}

/* On phones, the photo sits above the name */
@media (max-width: 30rem) {
  .person {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 44rem) {
  .people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.person {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

/* Round headshot; the photo files are 400 x 400 pixels */
.person__photo {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--mist);
}

.person h3 {
  margin-bottom: 0.15rem;
}

.person__role {
  margin-bottom: 0.5rem;
  color: var(--driftwood);
  font-size: var(--text-min);
}

/* ---------- Inner page header ---------- */
.page-head {
  background: var(--mist);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.page-head p {
  font-size: 1.1875rem;
  /* Run the full width of the page column (the same width as the module rules on the
     Syllabus page and the two-column bios on About us) before wrapping */
  max-width: none;
}

/* About us: the intro paragraphs line up on the left with the title. On phones they use
   the standard reading width; once the bios sit side by side (44rem and up) the text runs
   to where the name "Sean McPhillips" ends in the right-hand bio:
   half the page column, minus half the 3rem bios gap, plus that gap, plus the 7rem photo
   and 1.25rem spacing, plus the name's measured width (154px = 9.625rem)
   = 50% + 19.375rem. If the bios layout or name changes, update this number. */
.page-head--about p {
  max-width: var(--measure);
}

@media (min-width: 44rem) {
  .page-head--about p {
    max-width: calc(50% + 19.375rem);
  }
}

.draft-note {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.9rem;
  border-left: 4px solid var(--accent);
  background: var(--white);
  color: var(--navy);
  font-size: var(--text-min);
}

/* ---------- Syllabus: module groups ----------
   Each group (Foundations, The core craft, ...) is one row: the group name
   on the left and its modules on the right, like the home page's "why" list.
   On narrow screens the name sits above the modules. */
.module-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem 4rem;
  padding-top: 1.25rem;
  border-top: 3px solid var(--ocean);
}

.module-group + .module-group {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.module-group__range {
  margin: 0 0 0.25rem;
  color: var(--driftwood);
  font-size: var(--text-min);
}

.module-group__head h2 {
  margin-bottom: 0;
}

@media (min-width: 56rem) {
  .module-group {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }

  /* Keeps the group name in view while its modules scroll past */
  .module-group__head {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

/* The group's blue rule already marks where each group starts, so drop the
   first module's top hairline and the last module's bottom hairline */
.module-group .module:first-child {
  border-top: 0;
  padding-top: 0.75rem;
}

.module-group .module:last-child {
  border-bottom: 0;
}

/* ---------- Syllabus: module list ---------- */
.modules {
  max-width: 56rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.module {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--hairline);
}

.module:last-child {
  border-bottom: 1px solid var(--hairline);
}

/* 32px numerals count as large text, so Harbor blue (3.87:1) qualifies */
.module__num {
  padding-top: 0.05rem;
  color: var(--harbor);
  font: 600 2rem/1 var(--font-serif);
}

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

.module p {
  margin: 0;
}

/* ---------- Syllabus: outcomes ---------- */
.outcomes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem 3rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

@media (min-width: 48rem) {
  .outcomes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.outcomes h3 {
  margin-bottom: 0.35rem;
}

.outcomes p {
  margin: 0;
}

/* When outcomes sit inside a module group, line them up with the first module */
.module-group .outcomes {
  margin-top: 0;
  padding-top: 0.75rem;
}

/* ---------- Register: form ---------- */
.form-panel {
  max-width: 42rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--white);
}

.field {
  margin: 0 0 1.5rem;
}

fieldset.field {
  border: 0;
  padding: 0;
  min-width: 0;
}

.field-label,
.field legend {
  display: block;
  margin-bottom: 0.4rem;
  padding: 0;
  color: var(--navy);
  font-size: var(--text-min);
  font-weight: 600;
}

.field-optional {
  color: var(--driftwood);
  font-weight: 400;
}

.hint {
  margin: -0.15rem 0 0.5rem;
  color: var(--driftwood);
  font-size: var(--text-min);
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--field-edge);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate);
  font: inherit;
  font-size: var(--text-min);
}

.field textarea {
  min-height: 7rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--ocean);
  outline-offset: 1px;
  border-color: var(--ocean);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.25rem 1rem;
}

.field .choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.3rem 0;
  color: var(--slate);
  font-size: var(--text-min);
  font-weight: 400;
}

.field .choice input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  accent-color: var(--ocean);
}

.field--error input[type="text"],
.field--error input[type="email"],
.field--error textarea {
  border-color: var(--alert);
}

.field-error {
  margin: 0.4rem 0 0;
  color: var(--alert);
  font-size: var(--text-min);
}

.turnstile-slot {
  min-height: 65px;
  margin: 0.5rem 0 1.25rem;
}

.privacy-note {
  color: var(--driftwood);
  font-size: var(--text-min);
}

.form-status {
  margin: 1rem 0 0;
}

.form-status:empty {
  display: none;
}

.form-status--error {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--alert);
  background: var(--alert-wash);
  color: var(--alert);
}

.form-success {
  max-width: 42rem;
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--ocean);
  background: var(--mist);
}

.form-success h2 {
  font-size: 1.5rem;
}

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

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.5rem 0;
  /* Separates the footer from a navy section directly above it */
  border-top: 1px solid var(--ocean);
  background: var(--navy);
  color: var(--foam);
  font-size: var(--text-min);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2.5rem;
}

.site-footer a {
  color: var(--foam);
}

.site-footer a:hover {
  color: var(--white);
}

.site-footer .wordmark {
  color: var(--white);
  font-size: 1.375rem;
  text-decoration: none;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer p {
  margin: 0;
}

/* ---------- Visually hidden text for screen readers ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
