.header-matrix { display: none; }
body[data-home] .topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: 66px;
  background: #f6f7fc;
  border-color: #d9dfef;
  color: #222654;
}
body[data-home] .stamp { background: #075ee2; color: white; }
body[data-home] .topbar nav { display: none; }
body[data-home] .header-matrix { display: inline-flex; margin-left: auto; }

.blueprint {
  --accent: #075ee2;
  --cover-width: min(86vw, clamp(19rem, 54svh, 33rem));
  --search-size: clamp(4.2rem, 9vmin, 5.25rem);
  --header-height: 66px;
  --scene-height: calc(100svh - var(--header-height));
  --travel: clamp(38rem, 135svh, 84rem);
  min-height: calc(var(--scene-height) + var(--travel));
  color: #222654;
  background: #f6f7fc;
}
.blueprint-frame {
  position: sticky;
  top: var(--header-height);
  height: var(--scene-height);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: clip;
}
.blueprint-scene {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  background-image: linear-gradient(90deg, #aec6ef 1px, transparent 1px), linear-gradient(#aec6ef 1px, transparent 1px);
  background-position: center;
  background-size: var(--cover-width) var(--cover-width);
}
.cover {
  position: absolute;
  z-index: 2;
  width: var(--cover-width);
  aspect-ratio: 1;
  opacity: var(--cover-opacity, 1);
  transform: scale(var(--cover-scale, 1));
  pointer-events: none;
}
.cover-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(1.35rem, 4.6vmin, 3.3rem);
}
.cover-paper { background: #fafbff; border: 1px solid #aec6ef; color: #1249aa; }
.cover-ink {
  background: var(--accent);
  color: white;
  clip-path: inset(calc((1 - var(--ink-fill, 0)) * 100%) 0 0);
}
.cover-copy { opacity: var(--copy-opacity, 1); }
.cover .eyebrow { margin-bottom: clamp(.7rem, 2.8vmin, 1.9rem); }
.cover h1, .cover-title { margin: 0 0 .8rem; font-size: clamp(2.15rem, 5.5vmin, 4.6rem); font-weight: 780; line-height: 1.08; letter-spacing: -.075em; }
.cover h1 span { color: var(--accent); }
.cover-title span { color: #e5f393; }
.cover-description { max-width: 24ch; margin: 0; line-height: 1.6; font-size: clamp(.9rem, 2.1vmin, 1.1rem); }
.cover-mark { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; background: var(--accent); color: white; font: 700 1.15rem ui-monospace, monospace; opacity: var(--copy-opacity, 1); }
.cover-ink .cover-mark { color: var(--accent); background: #e5f393; }
.center-search {
  position: absolute;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .38rem;
  padding: 0;
  width: var(--search-size);
  height: var(--search-size);
  border: 0;
  background: var(--accent);
  color: white;
  font-size: .79rem;
  font-weight: 720;
  white-space: nowrap;
  visibility: var(--search-visibility, hidden);
}
.center-search:hover { background: #004bbc; }
.center-search:focus-visible { outline: 2px solid white; outline-offset: -5px; }
.center-search > span { opacity: var(--search-icon-opacity, 0); }
.search-symbol { width: 1.08rem; height: 1.08rem; border: 2px solid currentColor; border-radius: 50%; position: relative; margin: 0 .19rem .15rem 0; }
.search-symbol::after { content: ''; position: absolute; bottom: -2px; right: -6px; width: .45rem; height: 2px; background: currentColor; transform: rotate(45deg); transform-origin: left; }
.matrix {
  z-index: 1;
  width: min(94%, 84rem);
  height: min(86%, 46rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) var(--search-size) repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) minmax(0, .75fr) var(--search-size) minmax(0, .75fr) minmax(0, 1fr);
  grid-template-areas:
    'learn learn projects projects projects'
    'all all projects projects projects'
    'all all search review review'
    'all all recent recent recent'
    'templates templates templates drafts drafts';
  gap: clamp(.35rem, .75vw, .7rem);
  opacity: var(--matrix-opacity, 0);
  visibility: var(--matrix-visibility, hidden);
}
.module {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: end;
  gap: .28rem;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(.55rem, 2.6vmin, 1.65rem);
  border: 1px solid #22265424;
  background: var(--tile);
  color: var(--tile-text, #24224d);
  text-align: left;
  transform: translate(calc(var(--spread, 1) * var(--dx)), calc(var(--spread, 1) * var(--dy))) scale(var(--tile-scale, .94));
}
.module:hover { background: var(--tile); filter: brightness(1.05); }
.module:focus-visible { outline-offset: -5px; }
.module span { font: 700 clamp(.63rem, 1.2vmin, .82rem)/1.25 ui-monospace, monospace; letter-spacing: .13em; }
.module strong { font-size: clamp(1.05rem, 3.1vmin, 2.1rem); line-height: 1.15; }
.module i { position: absolute; top: .6rem; right: 1rem; z-index: -1; font: normal 700 clamp(2rem, 8vmin, 5.6rem)/1 ui-monospace, monospace; opacity: .29; }
.module-learn { grid-area: learn; --tile: #deef32; --dx: -85px; --dy: -88px; }
.module-projects { grid-area: projects; --tile: #29caf4; --dx: 82px; --dy: -85px; }
.module-all { grid-area: all; --tile: #21398e; --tile-text: white; --dx: -120px; --dy: -24px; }
.module-review { grid-area: review; --tile: #ff7245; --dx: 60px; --dy: 0px; }
.module-recent { grid-area: recent; --tile: #ff9ed9; --dx: 115px; --dy: 55px; }
.module-templates { grid-area: templates; --tile: #28dda5; --dx: -100px; --dy: 90px; }
.module-drafts { grid-area: drafts; --tile: #6521a8; --tile-text: white; --dx: 90px; --dy: 93px; }
.module-review { padding-block: .45rem; }
.module-review i { font-size: clamp(2rem, 6.3vmin, 4rem); top: .25rem; }
.stage-dock { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: relative; gap: .5rem; min-height: 55px; padding: .4rem max(4vw, 1rem); background: #fafbff; border-top: 1px solid #b4c3ee; }
.stage-progress { position: absolute; inset: 0 0 auto; height: 2px; background: var(--accent); transform: scaleX(var(--progress, 0)); transform-origin: left; }
.stage-label, .stage-percent { font: .75rem ui-monospace, monospace; letter-spacing: .08em; }
.stage-percent { justify-self: end; min-width: 4ch; text-align: right; }
.jump-matrix { color: #1249aa; font-size: .875rem; border-color: #a8b8ef; }
.jump-matrix:hover { background: #e9ecfc; }
.collection { scroll-margin-top: 5.5rem; }

@media (max-width: 680px) {
  body[data-home] .topbar { flex-wrap: nowrap; gap: .55rem; padding: .6rem .8rem; }
  body[data-home] .topbar .brand { gap: .42rem; }
  body[data-home] .topbar .brand small { display: none; }
  body[data-home] .topbar .stamp { width: 30px; height: 30px; font-size: 1rem; }
  body[data-home] .search-button, .header-matrix { padding: .45rem .55rem; white-space: nowrap; }
  body[data-home] .search-button kbd { display: none; }
  .matrix {
    grid-template-columns: minmax(0, 1fr) var(--search-size) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr)) var(--search-size) repeat(2, minmax(0, 1fr));
    grid-template-areas:
      'learn learn projects'
      'all all projects'
      'review search recent'
      'review templates templates'
      'drafts drafts drafts';
    height: 88%;
  }
  .module-recent { padding-block: .45rem; }
  .stage-label { visibility: hidden; }
  .stage-dock { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce), (max-height: 450px) {
  .blueprint { --cover-width: min(86vw, 27rem); min-height: 0; }
  .blueprint-frame { position: static; height: auto; overflow: visible; }
  .blueprint-scene { gap: 1.25rem; padding: 1.25rem 0; background-position: center 1.25rem; }
  .cover-ink, .stage-progress, .stage-percent { display: none; }
  .cover { position: relative; grid-row: 1; opacity: 1; transform: none; }
  .cover-copy, .cover-mark { opacity: 1; }
  .center-search { position: relative; grid-row: 2; visibility: visible; scroll-margin-top: 5.5rem; }
  .center-search > span { opacity: 1; }
  .matrix { grid-row: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; grid-template-areas: none; height: auto; opacity: 1; visibility: visible; }
  .module { grid-area: auto; min-height: 6rem; transform: none; }
  .stage-dock { display: none; }
}
