/* Mini Michael local style preview: MichaelOS × Nous field-note × Hyperframes. */
:root {
  --hf-desktop: #0065a8;
  --hf-desktop-deep: #004c81;
  --hf-title: #000080;
  --hf-paper: #f5ecd8;
  --hf-paper-warm: #fff6d1;
  --hf-chrome: #c0c0c0;
  --hf-ink: #111111;
  --hf-cyan: #25d7e8;
  --hf-teal: #008b8b;
  --hf-green: #2ee66b;
  --hf-yellow: #f4dc4a;
  --hf-red: #960b13;
}

body:is(.hyperframes-live, .hyperframes-preview) {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding: 18px 0 58px;
  color: var(--hf-ink);
  background-color: var(--hf-desktop);
  background-image:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 2%) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 0, rgb(20 190 220 / 18%), transparent 44%),
    linear-gradient(180deg, var(--hf-desktop-deep), var(--hf-desktop));
  font-family: Arial, Helvetica, sans-serif;
}

:is(.hyperframes-live, .hyperframes-preview)::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image: radial-gradient(rgb(255 255 255 / 10%) 0.7px, transparent 0.7px);
  background-size: 5px 5px;
  pointer-events: none;
}

:is(.hyperframes-live, .hyperframes-preview) .skip-link {
  z-index: 200;
  border: 2px solid #fff;
  border-radius: 0;
}

.hf-desktop-icons {
  position: fixed;
  top: 38px;
  left: 24px;
  z-index: 2;
  display: grid;
  gap: 25px;
  width: 104px;
}

.hf-desktop-icon {
  display: grid;
  gap: 6px;
  justify-items: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-shadow: 1px 1px 0 #000;
}

.hf-desktop-icon:hover span:last-child,
.hf-desktop-icon:focus-visible span:last-child {
  color: var(--hf-yellow);
}

.hf-desktop-icon .os-icon {
  display: block;
  width: 40px;
  height: 40px;
  overflow: visible;
  filter: drop-shadow(2px 2px 0 #001426);
  image-rendering: pixelated;
  transition: transform 90ms steps(2, end), filter 90ms steps(2, end);
}

.hf-desktop-icon:hover .os-icon,
.hf-desktop-icon:focus-visible .os-icon {
  filter: drop-shadow(3px 3px 0 #001426) brightness(1.12);
  transform: translate(-1px, -1px);
}

.hf-window-shell {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 178px));
  margin: 0 auto;
  padding: 3px;
  background: var(--hf-chrome);
  border-color: #fff #111 #111 #fff;
  border-style: solid;
  border-width: 2px;
  box-shadow:
    0 0 0 2px #000,
    8px 8px 0 #071f29,
    14px 14px 0 rgb(37 215 232 / 36%);
}

.hf-window-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 31px;
  padding: 3px 4px 3px 7px;
  color: #fff;
  background: var(--hf-title);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.hf-titlebar-copy {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
}

.hf-titlebar-copy::before {
  display: block;
  width: 13px;
  height: 13px;
  content: "";
  background: var(--hf-cyan);
  border: 1px solid #fff;
  box-shadow: inset -2px -2px 0 var(--hf-teal);
}

.hf-titlebar-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-preview-stamp {
  color: var(--hf-yellow);
  font-family: "Courier New", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.hf-window-controls {
  display: flex;
  flex: none;
  gap: 2px;
}

.hf-window-controls span {
  display: grid;
  width: 23px;
  height: 22px;
  color: #111;
  background: var(--hf-chrome);
  border-color: #fff #111 #111 #fff;
  border-style: solid;
  border-width: 2px;
  font-size: 0.68rem;
  place-items: center;
}

:is(.hyperframes-live, .hyperframes-preview) .site-shell {
  width: 100%;
  margin: 0;
  padding: 12px;
  background: var(--hf-chrome);
}

:is(.hyperframes-live, .hyperframes-preview) .site-header,
:is(.hyperframes-live, .hyperframes-preview) .search-toolbar,
:is(.hyperframes-live, .hyperframes-preview) .category-nav,
:is(.hyperframes-live, .hyperframes-preview) .results-panel {
  color: var(--hf-ink);
  background-color: var(--hf-paper);
  background-image: radial-gradient(rgb(30 25 10 / 7%) 0.55px, transparent 0.55px);
  background-size: 6px 6px;
  border: 2px solid var(--hf-ink);
  border-radius: 0;
}

:is(.hyperframes-live, .hyperframes-preview) .site-header {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: end;
  padding: clamp(24px, 4vw, 42px);
  box-shadow:
    5px 5px 0 var(--hf-ink),
    10px 10px 0 var(--hf-cyan),
    14px 14px 0 var(--hf-teal);
}

:is(.hyperframes-live, .hyperframes-preview) .site-header::before {
  position: absolute;
  top: -8px;
  left: 18px;
  padding: 3px 7px;
  color: #fff;
  background: var(--hf-ink);
  border: 1px solid var(--hf-cyan);
  content: "HYPERFRAME 01 · LIBRARY HOME";
  font-family: "Courier New", monospace;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

:is(.hyperframes-live, .hyperframes-preview) .eyebrow {
  color: var(--hf-red);
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

:is(.hyperframes-live, .hyperframes-preview) h1 {
  max-width: 780px;
  margin: 0;
  color: var(--hf-title);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: clamp(3.4rem, 6vw, 5.4rem);
  line-height: 0.88;
  letter-spacing: -0.07em;
  text-transform: uppercase;
}

:is(.hyperframes-live, .hyperframes-preview) .header-lede {
  max-width: 700px;
  margin-top: 20px;
  padding: 13px 15px;
  color: #111;
  background: var(--hf-paper-warm);
  border-left: 4px solid var(--hf-title);
  font-family: "Courier New", monospace;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

:is(.hyperframes-live, .hyperframes-preview) .header-actions {
  min-width: 0;
  gap: 7px;
}

:is(.hyperframes-live, .hyperframes-preview) .header-actions a,
:is(.hyperframes-live, .hyperframes-preview) .asset-total {
  min-height: 42px;
  padding: 8px 10px;
  background: var(--hf-chrome);
  border-color: #fff #111 #111 #fff;
  border-radius: 0;
  border-style: solid;
  border-width: 2px;
  box-shadow: 2px 2px 0 #111;
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  font-weight: 800;
}

:is(.hyperframes-live, .hyperframes-preview) .asset-total {
  background: var(--hf-paper-warm);
}

:is(.hyperframes-live, .hyperframes-preview) .header-actions a:hover,
:is(.hyperframes-live, .hyperframes-preview) .header-actions a:focus-visible {
  color: #fff;
  background: var(--hf-title);
}

:is(.hyperframes-live, .hyperframes-preview) main {
  margin-top: 26px;
}

:is(.hyperframes-live, .hyperframes-preview) .search-toolbar {
  position: sticky;
  top: 8px;
  z-index: 20;
  grid-template-columns: minmax(180px, 0.65fr) minmax(280px, 1.5fr) auto;
  padding: 15px 16px;
  box-shadow: 4px 4px 0 var(--hf-ink), 8px 8px 0 var(--hf-teal);
}

:is(.hyperframes-live, .hyperframes-preview) .search-toolbar::after {
  position: absolute;
  right: 14px;
  bottom: -13px;
  padding: 2px 6px;
  color: #fff;
  background: var(--hf-teal);
  border: 1px solid var(--hf-ink);
  content: "SEMANTIC INDEX · READY";
  font-family: "Courier New", monospace;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

:is(.hyperframes-live, .hyperframes-preview) .search-copy h2,
:is(.hyperframes-live, .hyperframes-preview) .results-heading h2,
:is(.hyperframes-live, .hyperframes-preview) .category-heading h2 {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  letter-spacing: -0.045em;
}

:is(.hyperframes-live, .hyperframes-preview) .search-field-wrap input {
  color: #111;
  background: #fffef7;
  border-color: #111 #fff #fff #111;
  border-radius: 0;
  border-width: 2px;
  font-family: "Courier New", monospace;
  font-weight: 700;
}

:is(.hyperframes-live, .hyperframes-preview) .search-shortcut,
:is(.hyperframes-live, .hyperframes-preview) .clear-search {
  border-radius: 0;
}

:is(.hyperframes-live, .hyperframes-preview) .result-status {
  color: #001b24;
  background: #bdf4f4;
  border-radius: 0;
  font-family: "Courier New", monospace;
}

:is(.hyperframes-live, .hyperframes-preview) .search-help,
:is(.hyperframes-live, .hyperframes-preview) .page-summary {
  font-family: "Courier New", monospace;
}

:is(.hyperframes-live, .hyperframes-preview) .gallery-layout {
  gap: 14px;
  margin-top: 22px;
}

@media (min-width: 900px) {
  :is(.hyperframes-live, .hyperframes-preview) .gallery-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  :is(.hyperframes-live, .hyperframes-preview) .category-nav {
    position: sticky;
    top: 124px;
    align-self: start;
  }
}

:is(.hyperframes-live, .hyperframes-preview) .category-nav,
:is(.hyperframes-live, .hyperframes-preview) .results-panel {
  padding: 13px;
  box-shadow: 3px 3px 0 var(--hf-ink);
}

:is(.hyperframes-live, .hyperframes-preview) .category-button,
:is(.hyperframes-live, .hyperframes-preview) .collection-filter button,
:is(.hyperframes-live, .hyperframes-preview) .text-button,
:is(.hyperframes-live, .hyperframes-preview) .pagination button,
:is(.hyperframes-live, .hyperframes-preview) .empty-state button {
  border-radius: 0;
  font-family: "Courier New", monospace;
}

:is(.hyperframes-live, .hyperframes-preview) .collection-filter button {
  color: #111;
  background: var(--hf-chrome);
  border-color: #fff #111 #111 #fff;
  border-radius: 0;
  border-style: solid;
  border-width: 2px;
  box-shadow: 1px 1px 0 #111;
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
}

:is(.hyperframes-live, .hyperframes-preview) .collection-filter button[aria-pressed="true"] {
  color: #fff;
  background: var(--hf-title);
  box-shadow: inset 0 -3px var(--hf-cyan), 1px 1px 0 #111;
}

:is(.hyperframes-live, .hyperframes-preview) .category-button {
  min-height: 38px;
  background: var(--hf-chrome);
  border-color: #fff #111 #111 #fff;
  border-width: 2px;
  box-shadow: 1px 1px 0 #111;
  font-size: 0.75rem;
}

:is(.hyperframes-live, .hyperframes-preview) .category-button[aria-pressed="true"] {
  color: #fff;
  background: var(--hf-title);
}

:is(.hyperframes-live, .hyperframes-preview) .category-button[aria-pressed="true"] strong {
  color: #111;
  background: var(--hf-yellow);
}

:is(.hyperframes-live, .hyperframes-preview) .asset-grid {
  gap: 10px;
}

:is(.hyperframes-live, .hyperframes-preview) .asset-card {
  background: transparent;
  border: 2px solid var(--hf-ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 #7f7a70;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

:is(.hyperframes-live, .hyperframes-preview) .asset-card:hover,
:is(.hyperframes-live, .hyperframes-preview) .asset-card:focus-visible {
  box-shadow: 5px 5px 0 var(--hf-ink), 8px 8px 0 var(--hf-cyan);
  transform: translate(-2px, -2px);
}

:is(.hyperframes-live, .hyperframes-preview) .asset-image-wrap {
  background-color: transparent;
  background-image:
    linear-gradient(90deg, rgb(0 128 128 / 5%) 1px, transparent 1px),
    linear-gradient(rgb(0 128 128 / 5%) 1px, transparent 1px);
  background-size: 16px 16px;
  border-bottom: 2px solid var(--hf-ink);
}

:is(.hyperframes-live, .hyperframes-preview) .asset-card img {
  width: 92%;
  height: 92%;
  background: transparent;
  image-rendering: auto;
  mix-blend-mode: multiply;
  object-fit: contain;
}

:is(.hyperframes-live, .hyperframes-preview) .copy-label {
  color: #111;
  background: var(--hf-chrome);
  border-color: #fff #111 #111 #fff;
  border-radius: 0;
  border-style: solid;
  border-width: 2px;
  font-family: "Courier New", monospace;
}

:is(.hyperframes-live, .hyperframes-preview) .asset-collection-badge {
  color: #111;
  background: var(--hf-yellow);
  border-color: #fff #111 #111 #fff;
  border-radius: 0;
  border-style: solid;
  border-width: 2px;
  box-shadow: 1px 1px 0 #111;
  font-family: "Courier New", monospace;
}

:is(.hyperframes-live, .hyperframes-preview) .asset-card-text {
  min-height: 66px;
  background: var(--hf-paper);
}

:is(.hyperframes-live, .hyperframes-preview) .asset-category {
  color: var(--hf-red);
  font-family: "Courier New", monospace;
}

:is(.hyperframes-live, .hyperframes-preview) .asset-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.83rem;
}

:is(.hyperframes-live, .hyperframes-preview) .pagination {
  border-top: 2px solid var(--hf-ink);
}

.hf-window-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  margin: 0 12px 10px;
  padding: 4px 7px;
  background: var(--hf-chrome);
  border-color: #7f7f7f #fff #fff #7f7f7f;
  border-style: solid;
  border-width: 2px;
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
  font-weight: 800;
}

.hf-status-led {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  background: var(--hf-green);
  border: 1px solid #003b1c;
  box-shadow: inset -1px -1px 0 #00722f;
  vertical-align: -1px;
}

.hf-taskbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 43px;
  padding: 5px 8px;
  background: var(--hf-chrome);
  border-top: 2px solid #fff;
  box-shadow: 0 -2px 0 #777;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
}

.hf-taskbar a,
.hf-task-active,
.hf-task-status {
  min-height: 31px;
  padding: 7px 12px;
  color: #111;
  background: var(--hf-chrome);
  border-color: #fff #111 #111 #fff;
  border-style: solid;
  border-width: 2px;
  text-decoration: none;
}

.hf-taskbar a {
  min-width: 90px;
  text-align: center;
}

.hf-task-active {
  min-width: 240px;
  overflow: hidden;
  color: #fff;
  background: var(--hf-title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-task-status {
  margin-left: auto;
  background: #d7eadf;
  font-family: "Courier New", monospace;
}

@media (max-width: 1180px) {
  .hf-desktop-icons { display: none; }
  .hf-window-shell { width: min(1120px, calc(100% - 28px)); }
}

@media (max-width: 720px) {
  body:is(.hyperframes-live, .hyperframes-preview) {
    padding: 7px 0 51px;
    background-image:
      repeating-linear-gradient(0deg, rgb(255 255 255 / 2%) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, var(--hf-desktop-deep), var(--hf-desktop));
  }

  .hf-window-shell {
    width: calc(100% - 12px);
    padding: 2px;
    box-shadow: 5px 5px 0 #071f29, 8px 8px 0 rgb(37 215 232 / 32%);
  }

  .hf-window-titlebar {
    min-height: 29px;
    padding-left: 5px;
    font-size: 0.68rem;
  }

  .hf-preview-stamp { display: none; }
  .hf-window-controls span { width: 21px; height: 20px; }

  :is(.hyperframes-live, .hyperframes-preview) .site-shell { padding: 6px; }

  :is(.hyperframes-live, .hyperframes-preview) .site-header {
    grid-template-columns: 1fr;
    gap: 17px;
    padding: 24px 16px 17px;
    box-shadow: 3px 3px 0 var(--hf-ink), 6px 6px 0 var(--hf-cyan);
  }

  :is(.hyperframes-live, .hyperframes-preview) .site-header::before {
    top: -7px;
    left: 9px;
    font-size: 0.49rem;
  }

  :is(.hyperframes-live, .hyperframes-preview) h1 {
    max-width: 330px;
    font-size: clamp(2.2rem, 13vw, 3.35rem);
    line-height: 0.9;
  }

  :is(.hyperframes-live, .hyperframes-preview) .header-lede {
    margin-top: 15px;
    padding: 10px 11px;
    font-size: 0.78rem;
  }

  :is(.hyperframes-live, .hyperframes-preview) .header-actions {
    grid-template-columns: 1fr 1fr;
  }

  :is(.hyperframes-live, .hyperframes-preview) .header-actions a:last-child {
    grid-column: 1 / -1;
  }

  :is(.hyperframes-live, .hyperframes-preview) .header-actions a,
  :is(.hyperframes-live, .hyperframes-preview) .asset-total {
    min-height: 40px;
    font-size: 0.67rem;
  }

  :is(.hyperframes-live, .hyperframes-preview) main { margin-top: 18px; }

  :is(.hyperframes-live, .hyperframes-preview) .search-toolbar {
    position: sticky;
    top: 4px;
    z-index: 20;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "copy status"
      "field field"
      "help help";
    gap: 10px 8px;
    padding: 13px 11px;
    box-shadow: 3px 3px 0 var(--hf-ink), 6px 6px 0 var(--hf-teal);
  }

  :is(.hyperframes-live, .hyperframes-preview) .search-toolbar::after { display: none; }
  :is(.hyperframes-live, .hyperframes-preview) .result-status { min-width: 0; font-size: 0.67rem; }
  :is(.hyperframes-live, .hyperframes-preview) .search-field-wrap input { height: 48px; font-size: 0.82rem; }
  :is(.hyperframes-live, .hyperframes-preview) .search-help { font-size: 0.65rem; }

  :is(.hyperframes-live, .hyperframes-preview) .gallery-layout { margin-top: 17px; }
  :is(.hyperframes-live, .hyperframes-preview) .category-nav,
  :is(.hyperframes-live, .hyperframes-preview) .results-panel { padding: 10px; }
  :is(.hyperframes-live, .hyperframes-preview) .category-list { overflow-x: auto; }
  :is(.hyperframes-live, .hyperframes-preview) .category-button { flex: 0 0 auto; }

  :is(.hyperframes-live, .hyperframes-preview) .results-heading { align-items: end; }
  :is(.hyperframes-live, .hyperframes-preview) .results-heading h2 { font-size: 1.7rem; }
  :is(.hyperframes-live, .hyperframes-preview) .page-summary { font-size: 0.66rem; }
  :is(.hyperframes-live, .hyperframes-preview) .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  :is(.hyperframes-live, .hyperframes-preview) .asset-card-text { min-height: 58px; padding: 8px; }
  :is(.hyperframes-live, .hyperframes-preview) .asset-title { font-size: 0.72rem; }
  :is(.hyperframes-live, .hyperframes-preview) .asset-category { font-size: 0.55rem; }

  .hf-window-statusbar {
    margin: 0 6px 6px;
    font-size: 0.56rem;
  }

  .hf-window-statusbar span:last-child { display: none; }

  .hf-taskbar { min-height: 45px; padding: 5px 6px; }
  .hf-taskbar a { min-width: 82px; padding: 7px 8px; }
  .hf-task-active { min-width: 0; flex: 1; padding: 7px 8px; }
  .hf-task-status { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.hyperframes-live, .hyperframes-preview) *,
  :is(.hyperframes-live, .hyperframes-preview) *::before,
  :is(.hyperframes-live, .hyperframes-preview) *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
