/* Mikah Sargent: site and print components. Loads after tokens.css.
   Site parts follow chihuahua.coffee's own CSS: same sizes, rules, and states.
   Print parts are sized in inches and points, and stay in the logo's fixed colors
   in every theme, because paper doesn't change with the screen. */

/* ------------------------------------------------------------------ site */

.ms-page, .ms-page *, .ms-page *::before, .ms-page *::after,
[class^="ms-"], [class*=" ms-"] { box-sizing: border-box; }

.ms-page { background: var(--page); color: var(--ink); font: 400 16px/1.5 var(--font-sans); padding: 40px 24px; }
.ms-page a { color: inherit; text-decoration: none; }
.ms-page :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.ms-page ::selection { background: var(--ink); color: var(--paper); }

.ms-skip { position: absolute; left: 24px; top: -100px; z-index: 5; padding: 12px; background: var(--ink); color: var(--paper); font: 700 14px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.ms-skip:focus { top: 10px; }
.ms-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Reader: the frame, the reading surface inside it, and the bezel under it */
.ms-reader { max-width: var(--layout-max); margin: 0 auto; padding: 32px 26px 24px; background: var(--surface); border: 1px solid var(--trim); border-radius: var(--radius-frame); box-shadow: var(--shadow-frame); }
.ms-screen { position: relative; overflow: hidden; padding: 34px 44px 26px; border: 1px solid var(--edge); border-radius: var(--radius-screen); box-shadow: inset 0 1px 0 var(--inset);
  background: radial-gradient(70% 100% at 50% 104%, var(--glow), transparent) bottom / 100% 260px no-repeat, linear-gradient(var(--shade), transparent) top / 100% 300px no-repeat, var(--paper); }
.ms-bezel { display: flex; justify-content: center; padding-top: 14px; }
.ms-bezel::before { content: ""; width: 40px; height: 4px; border-radius: var(--radius-bezel); background: var(--ledge); }

/* Masthead */
.ms-masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.ms-brand { display: inline-flex; align-items: center; gap: 10px; font: 600 16px/1 var(--font-sans); }
.ms-brand svg { display: block; flex: none; }
.ms-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0; padding: 0; list-style: none; font: 400 13px/1.5 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.ms-nav a:hover, .ms-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

/* Hero: the home page's opening. The signature stands in for the page title. */
.ms-hero { display: grid; gap: 16px; justify-items: start; padding: 43px 0 40px; }
.ms-hero-logo { display: block; color: var(--ink); }
.ms-hero-logo svg { display: block; width: auto; max-width: 100%; }
.ms-lede { margin: 0; max-width: 495px; font: 400 17px/1.7 var(--font-sans); }
.ms-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 8px; }
/* With a portrait: the text on the left, the portrait on the right */
.ms-hero--portrait { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 40px; }
.ms-hero-text { display: grid; gap: 16px; justify-items: start; min-width: 0; }
.ms-hero--portrait > .ms-portrait { width: 220px; }
.ms-portrait { margin: 0; }
/* The default portrait: Mikah's line drawing, drawn in ink through a mask, so
   it's ink on paper in both themes. The frame is on the figure. */
.ms-portrait--drawing { padding: 5px; border: 1px solid var(--ink); border-radius: var(--radius-portrait); color: var(--ink); }
.ms-portrait-drawing { display: block; aspect-ratio: 1; background: currentColor;
  -webkit-mask: url("../images/mikah-portrait.png") center / contain no-repeat; mask: url("../images/mikah-portrait.png") center / contain no-repeat; }
.ms-portrait img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; padding: 5px; border: 1px solid var(--ink); border-radius: var(--radius-portrait); }

/* Headings */
.ms-eyebrow { margin: 0 0 12px; color: var(--muted); font: 400 13px/1.5 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.ms-title { margin: 0 0 16px; font: 600 48px/1.05 var(--font-sans); letter-spacing: -.01em; text-wrap: balance; }
.ms-section { padding-top: 23px; }
.ms-section-title { margin: 0 0 16px; font: 600 26px/1.2 var(--font-sans); letter-spacing: -.01em; text-wrap: balance; }

/* Columns: two lists side by side, split by a hairline */
.ms-columns { display: grid; grid-template-columns: 1fr 1fr; column-gap: 42px; border-top: 2px solid var(--ink); }
.ms-columns > * { min-width: 0; }
.ms-columns > * + * { padding-left: 34px; border-left: 1px solid var(--rule); }

/* Button */
.ms-button { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 12px 18px; background: transparent; color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius-none); font: 700 14px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.ms-button:hover { background: var(--ink); color: var(--paper); }
.ms-button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.ms-button:disabled, .ms-button[aria-disabled="true"] { cursor: progress; border-style: dashed; background: transparent; color: var(--ink); }
.ms-button--small { gap: 7px; padding: 7px 11px; border-width: 1px; font-size: 12px; letter-spacing: .08em; }

/* Link card: a destination with a caption, in a 1 px ink box */
.ms-link-cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ms-link-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 61px; padding: 14px 15px; border: 1px solid var(--ink); border-radius: var(--radius-none); font-weight: 600; }
.ms-link-card small { font: 400 12px/1.5 var(--font-mono); color: var(--muted); }
.ms-link-card:hover { background: var(--ink); color: var(--paper); }
.ms-link-card:hover small { color: var(--paper); }

/* Link list: rows split by hairlines. --grid puts short links in two columns. */
.ms-link-list { margin: 0; padding: 0; list-style: none; }
.ms-link-list li { border-bottom: 1px solid var(--rule); }
.ms-link-list li:last-child { border-bottom: 0; }
.ms-link-list a { display: block; padding: 11px 0 12px; }
.ms-link-list strong { display: block; font-size: 16px; font-weight: 500; }
.ms-link-list small { display: block; margin-top: 2px; color: var(--muted); font: 12px/1.6 var(--font-mono); }
.ms-link-list a:hover strong, .ms-link-list--grid a:hover { text-decoration: underline; text-underline-offset: 4px; }
.ms-link-list--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.ms-link-list--grid li, .ms-link-list--grid li:last-child { border-bottom: 1px solid var(--rule); }
.ms-link-list--grid a { display: flex; align-items: center; min-height: 49px; padding: 11px 0; font-size: 15px; }

/* Field */
.ms-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 26px; padding-top: 26px; border-top: 2px solid var(--ink); }
.ms-field { min-width: 0; }
.ms-field--wide, .ms-form-actions { grid-column: 1 / -1; }
.ms-field label { display: block; margin-bottom: 7px; font: 600 15px/1.4 var(--font-sans); }
.ms-hint { margin-left: 4px; color: var(--muted); font: 400 12px var(--font-mono); }
.ms-field input, .ms-field textarea { appearance: none; -webkit-appearance: none; display: block; width: 100%; margin: 0; padding: 11px 12px; background: var(--field); color: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius-none); font: 400 16px/1.5 var(--font-sans); }
.ms-field textarea { min-height: 190px; resize: vertical; }
.ms-field input:focus-visible, .ms-field textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.ms-field [aria-invalid="true"] { padding: 10px 11px; border-width: 2px; }
.ms-field-error { margin: 7px 0 0; font: 13px/1.4 var(--font-mono); }
.ms-field-error::before { content: "— "; }
.ms-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 4px; }
.ms-form-status { margin: 0; max-width: 520px; font: 13px/1.5 var(--font-mono); }

/* Footer */
.ms-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 23px; padding-top: 17px; border-top: 2px solid var(--ink); color: var(--muted); font: 12px/1.6 var(--font-mono); }
.ms-footer-logo { display: block; color: var(--ink); }
.ms-footer-logo svg { display: block; }

@media (max-width: 760px) {
  .ms-page { padding: 16px 10px; }
  .ms-reader { padding: 18px 14px 14px; border-radius: var(--radius-frame-narrow); }
  .ms-screen { padding: 23px 22px 20px; border-radius: 3px; }
  .ms-masthead { flex-wrap: wrap; gap: 12px; padding-bottom: 16px; }
  .ms-hero { padding: 32px 0; }
  .ms-hero--portrait { grid-template-columns: 1fr; row-gap: 24px; }
  .ms-hero--portrait > .ms-portrait { order: -1; width: 140px; }
  .ms-title { font-size: 40px; }
  .ms-lede { font-size: 16px; }
  .ms-columns { grid-template-columns: 1fr; }
  .ms-columns > * + * { padding-left: 0; border-left: 0; border-top: 1px solid var(--ink); }
  .ms-form { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 420px) {
  .ms-screen { padding: 20px 18px; }
  .ms-link-card { flex-direction: column; align-items: flex-start; gap: 3px; }
  .ms-link-list--grid { column-gap: 14px; }
}

/* ----------------------------------------------------------------- print */

/* A sheet at its trimmed size. Inches and points are real here: print the
   page at 100% and they come out true. */
.ms-sheet { position: relative; overflow: hidden; flex: none; background: var(--logo-paper); color: var(--logo-ink); font-family: var(--font-sans); }
.ms-sheet--sage { background: var(--logo-sage); }
.ms-sheet svg { display: block; }
/* Guides, for proofs only: the safe area, 0.125 in inside the trim */
.ms-guides::after { content: ""; position: absolute; inset: var(--print-safe); border: 1px dashed var(--print-rule); pointer-events: none; }
.ms-print-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.ms-print-label { margin-top: 8px; color: var(--muted); font: 12px/1.5 var(--font-mono); }

.ms-print-name { margin: 0; font: 600 9pt/1 var(--font-sans); letter-spacing: .235em; text-transform: uppercase; }
.ms-print-text { margin: 0; font: 400 8pt/11pt var(--font-sans); }
.ms-print-small { margin: 0; color: var(--print-gray); font: 400 7pt/10pt var(--font-mono); letter-spacing: .04em; }

/* Business card: 3.5 x 2 in */
.ms-card { width: 3.5in; height: 2in; }
.ms-card-front .ms-card-logo { position: absolute; left: .43in; top: .225in; }
.ms-card-front .ms-card-logo svg { height: 1.55in; width: auto; }
.ms-card-back { display: flex; flex-direction: column; justify-content: space-between; padding: .25in .28in; }
.ms-card-back .ms-print-text { max-width: 2.6in; margin-top: 6pt; }

/* Letterhead: US Letter */
.ms-letterhead { width: 8.5in; height: 11in; padding: .75in .75in 0; }
.ms-letterhead-head { display: flex; justify-content: space-between; align-items: flex-start; }
.ms-letterhead-head .ms-letterhead-logo svg { height: .72in; width: auto; }
.ms-letterhead-close svg { height: .6in; width: auto; margin: 4pt 0 2pt; }
.ms-letterhead-body { position: absolute; left: 1in; right: 1.25in; top: 2.25in; max-width: 6in; font: 400 10.5pt/15pt var(--font-sans); }
.ms-letterhead-body p { margin: 0 0 10pt; }
.ms-letterhead-foot { position: absolute; left: .75in; right: .75in; bottom: .5in; display: flex; justify-content: space-between; padding-top: 6pt; border-top: .5pt solid var(--print-rule); }

/* Note card: A2, 4.25 x 5.5 in folded */
.ms-notecard { width: 4.25in; height: 5.5in; }
.ms-notecard-front .ms-notecard-logo { position: absolute; left: 0; top: .625in; }
.ms-notecard-front .ms-notecard-logo svg { width: 4.25in; height: 4.25in; }
.ms-notecard-back { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6pt; padding-bottom: .5in; }
.ms-notecard-back svg { height: .5in; width: auto; }

/* Notepad: 107 x 139 mm, one-sided. A sage band with the signature, writing
   lines in sage at college rule (9/32 in), and the site at the foot. */
.ms-notepad { width: 107mm; height: 139mm; }
.ms-notepad.ms-guides::after { inset: 1.5mm; }
.ms-notepad-band { position: absolute; left: 0; right: 0; top: 0; height: .95in; background: var(--logo-sage); }
.ms-notepad-logo { position: absolute; left: .203in; top: .167in; }
.ms-notepad-logo svg { height: .62in; width: auto; }
.ms-notepad-lines { position: absolute; left: .25in; right: .25in; top: calc(1.45in - 9in / 32); height: calc(13 * 9in / 32);
  background: repeating-linear-gradient(to bottom, transparent 0 calc(9in / 32 - .6pt), var(--logo-sage) calc(9in / 32 - .6pt) calc(9in / 32)); }
.ms-notepad-foot { position: absolute; left: .25in; bottom: calc(.3in - 3pt); }

/* Sticker: a 2 in circle */
.ms-sticker { width: 2in; height: 2in; border-radius: var(--radius-round); }
.ms-sticker svg { width: 100%; height: 100%; }

/* On screen, show where an unprinted sheet ends */
@media screen { .ms-sheet { box-shadow: 0 0 0 1px var(--rule); } }

@media print {
  .ms-guides::after, .ms-print-label { display: none; }
  .ms-sheet { break-after: page; }
}
