/* Mt. Blue Sky Consulting — single stylesheet, no external requests. */

/* Montserrat (titles) and Figtree (body), both self-hosted. Each is SIL Open
   Font License 1.1 — see fonts/OFL-Montserrat.txt and fonts/OFL-Figtree.txt —
   so redistributing them from this origin is permitted, and no third party
   sees a request. Both are variable fonts: one file per subset covers every
   weight the site uses.

   Figtree replaces Proxima Nova, which an Adobe Fonts subscription cannot
   deliver here: it permits web use only via Adobe-hosted use.typekit.net,
   which the no-third-party-requests rule forbids. */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Italics are declared but only fetched if italic text ever appears. */
@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --brand: #08b7da;
  --brand-green: #38d2ab;
  --brand-sky: #8be0f2;

  /* Text and focus-indicator cyan. The brand cyan above is a surface color:
     on white it measures 2.4:1, which fails WCAG at any size. This darker
     tint holds the hue at 4.9:1 on --bg and 4.6:1 on --bg-alt. In dark mode
     the brand cyan already passes, so the two tokens converge there. */
  --brand-text: #057c94;

  /* Gradient stops for the accented headline. Same reason: the display
     palette is too light to set text on white, so light mode uses a darkened
     ramp (4.1:1, 4.0:1, 3.6:1 — all clear of the 3:1 large-text floor) that
     keeps the green-to-cyan-to-sky lift. Dark mode keeps the display values. */
  --grad-a: #208d72;
  --grad-b: #068ca7;
  --grad-c: #1493ae;

  --ink: #1f2a30;
  --ink-soft: #60727b;
  --bg: #ffffff;
  --bg-alt: #f4f8fa;
  --line: #dde7ec;
  --shadow: 0 1px 2px rgba(31, 42, 48, 0.06), 0 8px 24px rgba(31, 42, 48, 0.06);

  --font-title: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Avenir Next", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Figtree sets fairly tight by default, so body copy runs a little looser
     than the usual 1.6. Headings keep their own tighter leading. */
  --leading: 1.72;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #44c6e9;
    --brand-green: #32d0ac;
    --brand-sky: #88e0f2;
    --brand-text: #44c6e9;
    --grad-a: #32d0ac;
    --grad-b: #44c6e9;
    --grad-c: #88e0f2;
    --ink: #eef4f7;
    --ink-soft: #a9bcc5;
    --bg: #252424;
    --bg-alt: #1c1c1c;
    --line: #3a3a3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

/* Explicit user choice overrides the system preference in both directions. */
:root[data-theme="light"] {
  --brand: #08b7da;
  --brand-green: #38d2ab;
  --brand-sky: #8be0f2;
  --brand-text: #057c94;
  --grad-a: #208d72;
  --grad-b: #068ca7;
  --grad-c: #1493ae;
  --ink: #1f2a30;
  --ink-soft: #60727b;
  --bg: #ffffff;
  --bg-alt: #f4f8fa;
  --line: #dde7ec;
  --shadow: 0 1px 2px rgba(31, 42, 48, 0.06), 0 8px 24px rgba(31, 42, 48, 0.06);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #44c6e9;
  --brand-green: #32d0ac;
  --brand-sky: #88e0f2;
  --brand-text: #44c6e9;
  --grad-a: #32d0ac;
  --grad-b: #44c6e9;
  --grad-c: #88e0f2;
  --ink: #eef4f7;
  --ink-soft: #a9bcc5;
  --bg: #252424;
  --bg-alt: #1c1c1c;
  --line: #3a3a3a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  font-weight: 700;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

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

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--brand-text);
  outline-offset: 3px;
  border-radius: 3px;
}

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

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

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

section {
  padding-block: clamp(3rem, 8vw, 6rem);
}

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

.lede {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--ink-soft);
  max-width: 46ch;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--gutter);
  top: 0.75rem;
  z-index: 10;
  background: var(--bg);
  color: var(--ink);
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 0.85rem;
}

.brand {
  display: flex;
  flex-direction: column;
  margin-inline-end: auto;
}

.logo {
  display: inline-flex;
}

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

/* Sits under the wordmark, indented so it starts near the "B" of BLUE rather
   than hanging off the small "MT". Mixed case and regular weight, so it reads
   as a descriptor under the logo instead of competing with it. */
.brand-tagline {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--brand-text);
  margin: 0.3rem 0 0 3rem;
  max-width: none;
  white-space: nowrap;
}

/* Two logo files, one per mode. CSS does the swap (rather than <picture>) so
   the manual theme toggle overrides the system preference too. */
.logo .logo--dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .logo .logo--light {
    display: none;
  }
  .logo .logo--dark {
    display: block;
  }
}

:root[data-theme="light"] .logo .logo--light,
:root[data-theme="dark"] .logo .logo--dark {
  display: block;
}

:root[data-theme="light"] .logo .logo--dark,
:root[data-theme="dark"] .logo .logo--light {
  display: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.75rem);
  font-family: var(--font-title);
  font-size: 0.9375rem;
  font-weight: 600;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--brand);
}

/* A control, not a nav item. Icon-only, smaller than the nav labels, and set
   off by a hairline divider so the eye reads five destinations plus a switch
   rather than six destinations. */
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-inline-start: 0.75rem;
  padding: 0;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  inset-inline-start: -0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 1.35rem;
  background: var(--line);
}

.theme-toggle:hover {
  color: var(--brand-text);
  background: var(--bg-alt);
}

.theme-toggle svg {
  display: block;
  grid-area: 1 / 1;
}

/* Show the icon for the mode you would switch *to*, using the same cascade as
   the logo swap so it is right on first paint without waiting for JS. */
.theme-toggle .icon--sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .theme-toggle .icon--moon {
    display: none;
  }
  .theme-toggle .icon--sun {
    display: block;
  }
}

:root[data-theme="light"] .theme-toggle .icon--moon,
:root[data-theme="dark"] .theme-toggle .icon--sun {
  display: block;
}

:root[data-theme="light"] .theme-toggle .icon--sun,
:root[data-theme="dark"] .theme-toggle .icon--moon {
  display: none;
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 10vw, 7rem);
}

.hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -18%;
  inset-block-start: -35%;
  width: 46rem;
  aspect-ratio: 1;
  background: radial-gradient(
    circle at 50% 50%,
    color-mix(in srgb, var(--brand) 22%, transparent),
    transparent 62%
  );
  pointer-events: none;
}

.hero > .wrap {
  position: relative;
}

.eyebrow {
  font-family: var(--font-title);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-text);
  margin: 0 0 1rem;
}

.hero h1 .accent {
  background: linear-gradient(100deg, var(--grad-a), var(--grad-b), var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--brand);
  color: #06232b;
}

.btn--primary:hover {
  filter: brightness(1.08);
}

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

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

/* Cards ------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  margin-top: 2.5rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

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

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9688rem;
}

.card::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--brand-green), var(--brand));
}

/* Names where a card's link goes when it leaves this site, so the destination
   is visible before the click. */
.card .card-meta {
  margin-top: 0.85rem;
  font-family: var(--font-title);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-text);
}

.follow-note {
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.9063rem;
}

.follow-note a {
  color: var(--brand-text);
  text-underline-offset: 3px;
}

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

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 2.5rem 0 0;
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--brand-text);
  margin-bottom: 0.35rem;
}

.steps h3 {
  margin-bottom: 0.25rem;
}

.steps p {
  color: var(--ink-soft);
  font-size: 0.9688rem;
  margin: 0;
}

/* Cards that link ---------------------------------------------------------- */

.card h3 a {
  text-decoration: none;
  color: inherit;
}

.card h3 a::after {
  /* Stretches the link over the whole card so the entire tile is clickable,
     while the accessible name stays just the heading text. */
  content: "";
  position: absolute;
  inset: 0;
}

.card {
  position: relative;
}

.card:hover {
  border-color: var(--brand);
}

.card h3 a:hover {
  color: var(--brand-text);
}

/* Prose pages -------------------------------------------------------------- */

/* Service pages, articles, papers, and the legal pages: a single column of
   Markdown-generated content. Body copy inherits the 68ch measure from `p`. */

.prose-page {
  display: block;
  padding-block: clamp(3rem, 8vw, 5rem);
}

.prose-page h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
}

.prose-page h3 {
  margin-top: 1.75rem;
}

.prose-page ul,
.prose-page ol {
  max-width: var(--measure);
  padding-left: 1.25rem;
  margin: 0 0 1.25rem;
}

.prose-page li {
  margin-bottom: 0.5rem;
}

.prose-page li::marker {
  color: var(--brand-text);
}

/* :not(.btn) matters — a bare `.prose-page a` rule outranks `.btn--primary`
   on specificity and repaints button labels cyan-on-cyan. */
.prose-page a:not(.btn) {
  color: var(--brand-text);
  text-underline-offset: 3px;
}

.prose-page .actions {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.prose-page .eyebrow a {
  color: inherit;
  text-decoration: none;
}

.prose-page .eyebrow a:hover {
  text-decoration: underline;
}

.article-meta {
  color: var(--ink-soft);
  font-family: var(--font-title);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.disclaimer-note {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9063rem;
}

/* Listings ----------------------------------------------------------------- */

.post-list {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  max-width: var(--measure);
}

.post-list li {
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
}

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

.post-list time {
  display: block;
  font-family: var(--font-title);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.post-list h2 {
  font-size: 1.375rem;
  margin-bottom: 0.35rem;
}

.post-list h2 a {
  text-decoration: none;
}

.post-list h2 a:hover {
  color: var(--brand-text);
}

.post-list p {
  color: var(--ink-soft);
  margin: 0;
}

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

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: inherit;
  text-underline-offset: 3px;
}

.footer-links a:hover {
  color: var(--brand-text);
}

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

.contact-card {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
}

.contact-card div {
  min-width: 12rem;
}

.contact-card dt {
  font-family: var(--font-title);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.contact-card dd {
  margin: 0;
  font-size: 1.0625rem;
}

.contact-card a {
  color: var(--brand-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

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

.site-footer p {
  margin: 0;
}

/* Error page -------------------------------------------------------------- */

.centered {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
