/* Manuscript Technical Type Studio · base reset, single 44px top bar, shared atoms, print. */
:root {
  color-scheme: light;
  --paper: #fcfcfc;
  --bar-bg: rgba(252, 252, 252, 0.92);
  --ink-1: #121314;
  --ink-2: #27292c;
  --ink-3: #545652;
  --rule: rgba(18, 19, 20, 0.14);
  --rule-strong: rgba(18, 19, 20, 0.26);
  --tone: rgba(18, 19, 20, 0.06);
  --tone-active: rgba(18, 19, 20, 0.09);
  --f-chrome-mono: "JetBrains Mono", ui-monospace, monospace;
  --chrome-fs: 12px;
  --bar-h: 0px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --print-paper: #ffffff;
  --print-ink-1: #000000;
  --print-ink-2: #1c1d20;
  --print-ink-3: #4a4d54;
}

:is(html[data-theme="dark"], html.dark) {
  color-scheme: dark;
  --paper: #0d0e0f;
  --bar-bg: rgba(13, 14, 15, 0.9);
  --ink-1: #f2f2ef;
  --ink-2: #c8cac6;
  --ink-3: #9a9d98;
  --rule: rgba(242, 242, 239, 0.16);
  --rule-strong: rgba(242, 242, 239, 0.34);
  --tone: rgba(242, 242, 239, 0.08);
  --tone-active: rgba(242, 242, 239, 0.14);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  scroll-padding-top: calc(var(--bar-h) + 12px);
  scroll-padding-bottom: 104px;
}

body {
  margin: 0;
  padding-top: var(--bar-h);
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink-2);
}

h1, h2, h3, h4, p, ul, ol, dl, dt, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: auto;
  text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
  transition: text-decoration-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-color: currentColor;
  }
}

a:focus-visible,
button:focus-visible,
main:focus-visible {
  outline: 2px solid var(--ink-1);
  outline-offset: 3px;
  border-radius: 2px;
}

.studio-bar a:focus-visible,
.studio-bar button:focus-visible {
  outline-offset: -2px;
}

.skip-link {
  position: fixed;
  top: -64px;
  left: 16px;
  z-index: 60;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-1);
  font: 500 var(--chrome-fs)/1 var(--f-chrome-mono);
  text-decoration: none;
  border: 1px solid var(--rule-strong);
}

.skip-link:focus-visible {
  top: 8px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sep {
  white-space: pre;
}

.dr {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  font-variant-numeric: lining-nums tabular-nums;
}

.dr > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dr-sep {
  display: inline-block;
  width: 10px;
  height: 0;
  border-top: 1px solid currentColor;
  opacity: 0.8;
}

.lede-claim {
  color: var(--ink-1);
}

.lede-mute {
  color: var(--ink-3);
}

/* ---------- Floating Top-Right Corner Pills (screen only) ---------- */
.corner-actions {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 11px/1 var(--f-chrome-mono);
  letter-spacing: 0.02em;
}

.sb-print {
  appearance: none;
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--rule);
  background: var(--bar-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-2);
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.sb-ico {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}

.sb-ico-arrow {
  transition: transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .sb-print:hover .sb-ico-arrow {
    transform: translateY(1px);
  }
}

.sb-print::after {
  content: "";
  position: absolute;
  inset: -6px 0;
}

@media (hover: hover) and (pointer: fine) {
  .sb-print:hover {
    background: var(--tone);
    color: var(--ink-1);
    border-color: var(--rule-strong);
  }
}

.sb-print:active {
  transform: scale(0.97);
  transition-duration: 90ms;
}

.sheet-host {
  padding: 40px 24px 160px;
  overflow-wrap: anywhere;
}

.m-error {
  max-width: 480px;
  margin: 64px auto;
  text-align: center;
  font-family: var(--f-chrome-mono);
  color: var(--ink-2);
}

.m-error h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 8px;
}

.m-error p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
  margin-bottom: 20px;
}

@media (max-width: 760px) {
  .corner-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    gap: 6px;
  }

  .sb-eggs,
  .sb-print {
    min-height: 44px;
    min-width: 44px;
    padding: 0 12px;
  }

  .sb-print::after {
    inset: 0;
  }

  .sheet-host {
    padding: 64px 16px 128px;
  }

  .m-contact a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 4px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .sb-print {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .sb-print {
    border: 1px solid ButtonText;
  }
}

@media print {
  @page {
    margin: 14mm 14mm;
  }

  :root {
    --paper: var(--print-paper);
    --ink-1: var(--print-ink-1);
    --ink-2: var(--print-ink-2);
    --ink-3: var(--print-ink-3);
    --rule: rgba(0, 0, 0, 0.24);
    --rule-strong: rgba(0, 0, 0, 0.44);
  }

  body {
    padding: 0;
    background: var(--print-paper) !important;
    color: var(--print-ink-2);
  }

  .corner-actions,
  .skip-link,
  .theme-toggle,
  .cmt-dock,
  .cmt-ui {
    display: none !important;
  }

  .sheet-host {
    padding: 0;
  }

  .m-sheet {
    max-width: 100%;
  }

  .m-sec {
    padding-top: 24px;
  }

  .m-h,
  .m-co-row,
  .m-role > .m-row,
  .m-scope {
    break-after: avoid;
    page-break-after: avoid;
  }

  .m-head,
  .m-list li,
  .m-pat li,
  .m-hon li,
  .m-skills > div,
  .m-foot {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .m-sheet p,
  .m-list li {
    orphans: 3;
    widows: 3;
  }

  a {
    text-decoration: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  .sb-opt,
  .sb-print,
  .tt-track,
  .tt-dot,
  .tt-pip,
  a {
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .sb-opt:active,
  .sb-print:active,
  .theme-toggle:active .tt-track {
    transform: none !important;
  }
}
