/* mikah.co: what the design system's site parts don't cover yet, built from
   its tokens only. Loads after tokens.css, theme-auto.css, and bundle.css.
   No new colors, no new shadows, square corners. */

html { background: var(--page); }
body { margin: 0; }
.ms-page { min-height: 100vh; }
.ms-nav a[aria-current="true"] { text-decoration: underline; text-underline-offset: 4px; }
.ms-brand:hover { text-decoration: underline; text-underline-offset: 4px; }

/* A page that isn't the home page: an eyebrow, the title, then the text. */
.article { padding: 43px 0 8px; }
.article-head { max-width: 760px; }
.article-head .ms-title { margin-bottom: 24px; }

/* Running text. Paragraphs keep to the measure; pictures may run wider. */
.prose { font: var(--text-body); }
.prose > * { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 16px; }
.prose .ms-lede, .prose p.lede { font: var(--text-lede); max-width: 495px; margin-bottom: 24px; }
.prose h2 { margin: 32px 0 12px; font: var(--text-heading); letter-spacing: -.01em; text-wrap: balance; }
.prose h3 { margin: 24px 0 8px; font: var(--text-label); font-size: 17px; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose blockquote { padding-left: 18px; border-left: 2px solid var(--ink); }
.prose hr { max-width: none; margin: 28px 0; border: 0; border-top: 1px solid var(--rule); }
.prose strong { font-weight: 600; }

/* Pictures: full width of the reading area at most, square corners, a
   caption in mono under each. */
.prose figure { max-width: none; margin: 28px 0; }
.prose img, .prose video { display: block; max-width: 100%; height: auto; }
.prose figure.wide img { width: 100%; }
.prose figcaption, .caption { margin-top: 8px; color: var(--muted); font: var(--text-caption); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; max-width: none; margin: 28px 0; padding: 0; list-style: none; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; }
.embed { position: relative; max-width: 720px; aspect-ratio: 16 / 9; margin: 28px 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 1px solid var(--ink); }

/* "All posts" and "All projects" under a page. */
.back { margin: 32px 0 0; padding-top: 17px; border-top: 1px solid var(--rule); font: var(--text-eyebrow); letter-spacing: .09em; text-transform: uppercase; }
.back a::before { content: "← "; }
.back a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* The blog's list of posts. */
.post-list { max-width: 760px; border-top: 2px solid var(--ink); }

/* The portfolio: pictures in a grid, each titled under it. */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 24px; max-width: none; margin: 0; padding: 26px 0 0; border-top: 2px solid var(--ink); list-style: none; }
.project-grid a { display: block; }
.project-grid img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--ink); }
.project-title { display: block; margin-top: 10px; font: var(--text-label); }
.project-grid small { display: block; margin-top: 2px; color: var(--muted); font: var(--text-caption); }
.project-grid a:hover .project-title { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 760px) {
  .article { padding-top: 32px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .gallery { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .project-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
/* The looping animation on /mikah-rocks, with its Pause button under it. */
.motion { display: grid; justify-items: start; gap: 16px; }
[data-motion-toggle][hidden] { display: none; }

/* The design system's ".ms-page a" outranks ".ms-skip", which left the skip
   link's text the same color as its background. */
.ms-page .ms-skip { color: var(--paper); }
/* The theme switch starts hidden and theme.js shows it once it works. The
   design system's .ms-button sets display, which would beat [hidden]. */
[data-theme-switch][hidden] { display: none; }

@media print {
  .ms-page { padding: 0; background: none; }
  .ms-reader { border: 0; box-shadow: none; background: none; padding: 0; }
  .ms-screen { border: 0; box-shadow: none; background: none; padding: 0; }
  .ms-bezel, .ms-skip, [data-theme-switch] { display: none; }
}

/* A post about another article names where it came from, under the title. */
.post-link { margin: -12px 0 24px; color: var(--muted); font: var(--text-caption); }
.post-link a { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* The home page: pronouns under the tagline, then the full bio, beside the portrait. */
.pronouns { margin: -8px 0 0; color: var(--muted); font: var(--text-caption); }
.ms-hero .prose { max-width: var(--measure); margin-top: 4px; }
.ms-hero .ms-hero-logo { margin-bottom: 8px; }
.ms-hero--portrait { align-items: start; }
.portfolio-lede { margin: 0 0 26px; max-width: 495px; font: var(--text-lede); }

/* Lists built by the site inside running text keep their own layout. */
.prose .project-grid, .prose .post-list { padding-left: 0; margin-bottom: 0; }
.prose .project-grid li + li, .prose .post-list li + li { margin-top: 0; }
.prose .project-grid a, .prose .post-list a { text-decoration: none; }
.prose .post-list { margin-bottom: 20px; }

/* Keep a tall poster from running past the screen. */
.prose figure img { max-height: 85vh; width: auto; }

/* The home page bio breaks after "Journalist." On a phone, balance the
   first line's wrap so no word sits alone. */
.ms-hero .ms-lede { text-wrap: balance; }

/* No e-reader frame: no sage case, no bezel, no screen glow or shadow.
   Paper fills the window. */
html, .ms-page { background: var(--paper); }
.ms-page { padding: 0; }
.ms-reader { max-width: none; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.ms-screen { overflow: visible; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; }
.ms-bezel { display: none; }

/* Layout: Sage bands. The masthead runs edge to edge in sage (moss in
   dark). The page and the footer sit on paper in one column, and the
   footer's rule spans only that column. */
.ms-masthead, #main { padding-inline: max(24px, calc((100% - 980px) / 2)); }
.ms-masthead { padding-block: 22px; background: var(--surface); border-bottom: 2px solid var(--ink); }
.ms-footer { margin: 48px max(24px, calc((100% - 980px) / 2)) 0; padding-bottom: 28px; }
@media (max-width: 760px) {
  .ms-masthead, #main { padding-inline: 16px; }
  .ms-masthead { padding-block: 16px; }
  .ms-footer { margin: 36px 16px 0; padding-bottom: 24px; }
}


/* Color: Deep sage. A deeper step of the logo's sage, the same hue, fills
   the masthead band and colors the eyebrows, the 2 px rules, link
   underlines, and link-card hovers. In dark, the band is the design
   system's own moss, a quiet green just above the dark paper, and the
   accent is a light sage. */
:root, [data-theme="light"] { --accent: #465d4a; --band: #465d4a; --on-band: var(--paper); }
[data-theme="dark"] { --accent: #a5c0a9; --band: var(--surface); --on-band: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --accent: #a5c0a9; --band: var(--surface); --on-band: var(--ink); }
}
.ms-masthead { background: var(--band); color: var(--on-band); border-bottom: 0; }
.ms-masthead :focus-visible { outline-color: currentColor; }
.ms-masthead .ms-button { color: inherit; border-color: currentColor; }
.ms-masthead .ms-button:hover { background: var(--on-band); color: var(--band); }
.ms-eyebrow { color: var(--accent); }
.ms-columns, .ms-footer, .post-list, .project-grid { border-top-color: var(--accent); }
.prose a, .ms-link-list a:hover strong, .ms-link-list--grid a:hover, .post-link a { text-decoration-color: var(--accent); }
.ms-link-card:hover { background: var(--accent); color: var(--paper); }
.ms-link-card:hover small { color: var(--paper); }
/* In the band, the mark is the S alone, in the band's text color: paper in light, the light ink in dark. The design system always draws it on a sage tile, so hide the tile here. */
.ms-brand svg > g > rect { display: none; }
.ms-brand svg path { fill: currentColor; }
/* In dark, the portrait keeps its light look: the ink drawing on the logo's
   sage tile, the ground the design system gives the avatar in every theme. */
[data-theme="dark"] .ms-portrait--drawing { background: var(--logo-sage); color: var(--logo-ink); border-color: var(--logo-sage); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ms-portrait--drawing { background: var(--logo-sage); color: var(--logo-ink); border-color: var(--logo-sage); }
}
