:root {
  --paper: #f2ece4;
  --paper-soft: #f8f4ee;
  --ink: #271f1c;
  --ink-muted: rgba(39, 31, 28, 0.72);
  --accent: #a85a4d;
  --accent-soft: rgba(168, 90, 77, 0.1);
  --line: rgba(112, 98, 86, 0.3);
  --mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle, rgba(67, 55, 47, 0.055) 0.7px, transparent 0.8px),
    radial-gradient(circle, rgba(168, 90, 77, 0.05) 0.6px, transparent 0.7px);
  background-size: 15px 15px, 23px 23px;
  background-position: 0 0, 7px 8px;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

body.has-blob-cursor {
  cursor: none;
}

body.has-blob-cursor a,
body.has-blob-cursor button,
body.has-blob-cursor [role="button"] {
  cursor: none;
}

.blob-cursor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.blob-cursor__blob {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(168, 90, 77, 0.84);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(168, 90, 77, 0.14);
  transition: width 160ms ease, height 160ms ease, border-radius 160ms ease;
}

.blob-cursor__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(168, 90, 77, 0.96);
}

.noise-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
  image-rendering: pixelated;
  opacity: 0.28;
}

.click-spark-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 70;
}

.editorial-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: var(--paper-soft);
  background-image:
    radial-gradient(circle, rgba(67, 55, 47, 0.055) 0.7px, transparent 0.8px),
    radial-gradient(circle, rgba(168, 90, 77, 0.04) 0.6px, transparent 0.7px);
  background-size: 15px 15px, 23px 23px;
  background-position: 0 0, 7px 8px;
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.editorial-loader__frame {
  position: absolute;
  inset: clamp(1rem, 3vw, 2.3rem);
  pointer-events: none;
}

.editorial-loader__frame span {
  position: absolute;
  background: rgba(112, 98, 86, 0.5);
}

.editorial-loader__frame span:nth-child(1),
.editorial-loader__frame span:nth-child(2) {
  left: 0;
  right: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left center;
}

.editorial-loader__frame span:nth-child(1) {
  top: 0;
}

.editorial-loader__frame span:nth-child(2) {
  bottom: 0;
}

.editorial-loader__frame span:nth-child(3),
.editorial-loader__frame span:nth-child(4) {
  top: 0;
  bottom: 0;
  width: 1px;
  transform: scaleY(0);
  transform-origin: top center;
}

.editorial-loader__frame span:nth-child(3) {
  left: 0;
}

.editorial-loader__frame span:nth-child(4) {
  right: 0;
}

.editorial-loader__center {
  position: relative;
  text-align: center;
}

.editorial-loader__micro {
  margin: 0 0 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(39, 31, 28, 0.62);
  opacity: 0;
  transform: translateY(8px);
}

.editorial-loader__monogram {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.08em;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-transform: uppercase;
}

.editorial-loader__monogram span {
  opacity: 0;
  transform: translateY(16px);
}

.editorial-loader__seal {
  width: clamp(74px, 9vw, 108px);
  aspect-ratio: 1;
  margin: 0.4rem auto 0;
  border: 1px solid rgba(168, 90, 77, 0.52);
  border-radius: 50%;
  padding: 0.42rem;
  opacity: 0;
  transform: scale(0.92) rotate(-6deg);
}

.editorial-loader__seal img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  mix-blend-mode: multiply;
  filter: grayscale(0.26) contrast(0.92);
  opacity: 0.46;
}

body.is-loading .editorial-loader__frame span:nth-child(1) {
  animation: frame-x 420ms ease forwards;
}

body.is-loading .editorial-loader__frame span:nth-child(2) {
  animation: frame-x 420ms ease 90ms forwards;
}

body.is-loading .editorial-loader__frame span:nth-child(3) {
  animation: frame-y 420ms ease 190ms forwards;
}

body.is-loading .editorial-loader__frame span:nth-child(4) {
  animation: frame-y 420ms ease 240ms forwards;
}

body.is-loading .editorial-loader__micro {
  animation: loader-fade-up 360ms ease 300ms forwards;
}

body.is-loading .editorial-loader__monogram span:nth-child(1) {
  animation: loader-fade-up 420ms ease 360ms forwards;
}

body.is-loading .editorial-loader__monogram span:nth-child(2) {
  animation: loader-fade-up 420ms ease 460ms forwards;
}

body.is-loading .editorial-loader__seal {
  animation: loader-seal 620ms cubic-bezier(0.22, 1, 0.36, 1) 470ms forwards;
}

body.is-leaving .editorial-loader {
  opacity: 1;
  visibility: visible;
}

body.is-loaded .editorial-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-reveal {
  opacity: 0;
  transform: translateY(10px);
}

body.is-ready .startup-reveal {
  animation: startup-reveal 340ms ease forwards;
}

body.is-ready .startup-reveal--card {
  animation-delay: 0.04s;
}

body.is-ready .startup-reveal--band {
  animation-delay: 0.08s;
}

body.is-ready .startup-reveal--outline {
  animation-delay: 0.12s;
}

body.is-ready .startup-reveal--content {
  animation-delay: 0.16s;
}

.print-stamp {
  position: absolute;
  width: clamp(90px, 11vw, 144px);
  aspect-ratio: 1;
  border: 1px solid rgba(168, 90, 77, 0.42);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(168, 90, 77, 0.48);
  opacity: 0.58;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.print-stamp::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(168, 90, 77, 0.36);
  border-radius: 50%;
}

.print-stamp--study {
  top: -1rem;
  right: clamp(0.8rem, 3vw, 1.6rem);
  transform: rotate(8deg);
}

.study-shell {
  width: min(96vw, 1360px);
  margin: 1.25rem auto 2rem;
  padding: 1.2rem 1.4rem 1.6rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    var(--paper-soft);
  position: relative;
  overflow: clip;
}

.study-shell::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(168, 90, 77, 0.18);
  pointer-events: none;
}

.study-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.study-topbar__id {
  color: var(--accent);
}

.study-topbar__title {
  min-width: 0;
}

.study-topbar__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.study-topbar__nav a,
.study-band__meta a,
.study-footer__links a {
  transition: color 140ms ease;
}

.study-topbar__nav a:hover,
.study-topbar__nav a:focus-visible,
.study-band__meta a:hover,
.study-band__meta a:focus-visible,
.study-footer__links a:hover,
.study-footer__links a:focus-visible {
  color: var(--accent);
}

.study-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 1.6rem 2rem;
  padding: 1.7rem 0 1.2rem;
  align-items: start;
}

.study-asset {
  position: absolute;
  margin: 0;
  opacity: 0.26;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.study-asset img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.15) sepia(0.18);
}

.study-asset--computer {
  width: clamp(140px, 18vw, 240px);
  top: 0.5rem;
  right: 19rem;
  transform: rotate(-5deg);
}

.study-asset--mouse {
  width: clamp(110px, 16vw, 200px);
  bottom: 0.1rem;
  left: calc(100% - 15rem);
  transform: rotate(7deg);
}

.study-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.study-hero h1,
.study-band h2,
.study-outline h2,
.study-markdown__section-header h2,
.study-note-card h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.study-hero h1 {
  margin-top: 0.55rem;
  max-width: 14ch;
  font-size: clamp(2.3rem, 5.2vw, 4.6rem);
  color: var(--accent);
}

.study-lede {
  margin: 0.9rem 0 0;
  max-width: 56ch;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.66;
}

.study-facts {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  max-width: 44rem;
}

.study-fact {
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
}

.study-fact__label {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.study-fact__value {
  margin: 0.3rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.study-note-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 1.15rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0)),
    linear-gradient(140deg, rgba(168, 90, 77, 0.06), rgba(39, 31, 28, 0.03)),
    #ece3d7;
}

.study-note-card__micro,
.study-band__meta,
.study-outline__link span:first-child,
.study-render__status,
.study-footer p,
.study-footer__links a,
.study-markdown__section-index,
.study-markdown__caption {
  font-family: var(--mono);
}

.study-note-card__micro {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.study-note-card h2 {
  margin-top: 0.9rem;
  max-width: 9ch;
  font-size: clamp(1.8rem, 2.4vw, 2.45rem);
  color: var(--accent);
}

.study-note-card__text {
  margin: 0.7rem 0 0;
  color: var(--ink-muted);
  line-height: 1.62;
}

.study-note-card__list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  border-top: 1px solid rgba(112, 98, 86, 0.26);
}

.study-note-card__list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(112, 98, 86, 0.2);
  font-size: 0.78rem;
}

.study-note-card__list span {
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.study-note-card__list strong {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.study-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem 0 1.15rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.study-band h2 {
  margin-top: 0.45rem;
  max-width: 19ch;
  font-size: clamp(1.85rem, 3.3vw, 3.4rem);
}

.study-band__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.study-main-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
  padding-top: 1.35rem;
  min-width: 0;
}

.study-main-content {
  min-width: 0;
  display: grid;
  gap: 1.35rem;
  padding: 0 0.85rem 0 0.45rem;
}

@media (max-width: 1480px) {
  .study-hero {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .study-note-card {
    width: min(100%, 34rem);
  }

  .study-asset--computer {
    width: clamp(110px, 14vw, 180px);
    top: 1.2rem;
    right: 0.8rem;
    opacity: 0.18;
  }

  .study-asset--mouse {
    display: none;
  }
}

@media (max-width: 1320px) {
  .study-main-grid {
    grid-template-columns: minmax(240px, 285px) minmax(0, 1fr);
    gap: 1rem;
  }

  .study-hero h1 {
    max-width: 12ch;
    font-size: clamp(2rem, 4.6vw, 3.8rem);
  }

  .study-facts {
    max-width: 100%;
  }

  .study-band h2 {
    max-width: 16ch;
    font-size: clamp(1.55rem, 2.8vw, 2.5rem);
  }
}

.study-outline {
  position: sticky;
  top: 1rem;
  align-self: start;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  padding: 1rem 1rem 1rem 0.9rem;
  max-height: calc(100dvh - 4.5rem);
  overflow: hidden;
  border: 1px solid rgba(168, 90, 77, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
    rgba(248, 244, 238, 0.92);
  box-shadow: 0 18px 42px rgba(39, 31, 28, 0.08);
  backdrop-filter: blur(8px);
  z-index: 3;
}

.study-outline h2 {
  margin-top: 0.42rem;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
}

.study-outline__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.study-outline__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 5.8rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(168, 90, 77, 0.28);
  background: rgba(168, 90, 77, 0.06);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.study-outline__lede {
  margin: 0.8rem 0 0;
  color: var(--ink-muted);
  line-height: 1.58;
}

.study-outline__home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 0.85rem;
  padding: 0.48rem 0.72rem;
  border: 1px solid rgba(168, 90, 77, 0.2);
  background: rgba(255, 255, 255, 0.2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

.study-outline__home:hover,
.study-outline__home:focus-visible {
  border-color: rgba(168, 90, 77, 0.38);
  background: rgba(168, 90, 77, 0.07);
  transform: translateX(2px);
}

.study-outline__list {
  display: grid;
  gap: 0.3rem;
  min-height: 0;
  max-height: none;
  overflow: auto;
  margin-top: 1rem;
  padding: 0.2rem 0.35rem 0.35rem 0.35rem;
  padding-bottom: 0.35rem;
}

.study-outline__empty {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.study-outline__link {
  position: relative;
  display: grid;
  grid-template-columns: 3.3rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.5rem 0.6rem;
  border: 1px solid transparent;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.study-outline__link::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 140ms ease;
}

.study-outline__link span:first-child {
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.study-outline__link span:last-child {
  font-size: 0.86rem;
  line-height: 1.45;
}

.study-outline__link:hover,
.study-outline__link:focus-visible,
.study-outline__link.is-active {
  border-color: rgba(168, 90, 77, 0.3);
  background: rgba(168, 90, 77, 0.06);
  color: var(--accent);
  transform: translateX(2px);
  box-shadow: 0 10px 20px rgba(168, 90, 77, 0.08);
}

.study-outline__link:hover::before,
.study-outline__link:focus-visible::before,
.study-outline__link.is-active::before {
  transform: scaleY(1);
}

.study-render {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}

.study-render__status {
  padding-bottom: 1rem;
  color: var(--ink-muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.study-markdown {
  display: grid;
  gap: 1.55rem;
  min-width: 0;
  max-width: 100%;
}

.study-markdown__section {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  min-width: 0;
  max-width: 100%;
}

.study-markdown__section-header {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.study-markdown__section-index {
  padding-top: 0.22rem;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.study-markdown__section-header h2 {
  margin-top: 0.12rem;
  font-size: clamp(1.7rem, 2.8vw, 2.55rem);
}

.study-markdown__section-body {
  margin-top: 0.95rem;
  padding-left: 5.15rem;
  min-width: 0;
  max-width: 100%;
}

.study-markdown h3,
.study-markdown h4 {
  margin: 1.2rem 0 0.45rem;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.study-markdown h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  color: var(--accent);
}

.study-markdown h4 {
  font-size: 1rem;
  color: var(--ink);
}

.study-markdown p,
.study-markdown li {
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.72;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.study-markdown p {
  margin: 0.72rem 0 0;
  max-width: 72ch;
  overflow-wrap: anywhere;
}

.study-markdown ul,
.study-markdown ol {
  margin: 0.85rem 0 0;
  padding-left: 1.1rem;
  max-width: 72ch;
  min-width: 0;
}

.study-markdown li + li {
  margin-top: 0.3rem;
}

.study-shell code {
  padding: 0.05rem 0.3rem;
  border: 1px solid rgba(168, 90, 77, 0.14);
  background: rgba(168, 90, 77, 0.06);
  border-radius: 0.2rem;
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.study-code {
  margin: 1rem 0 0;
  border: 1px solid rgba(112, 98, 86, 0.24);
  background: #ebe2d5;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.study-markdown__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(112, 98, 86, 0.22);
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.study-code pre {
  margin: 0;
  padding: 0.95rem 1rem 1.05rem;
  overflow: auto;
  max-width: 100%;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.7;
  tab-size: 2;
}

.study-code pre code {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  font-size: inherit;
  line-height: inherit;
  white-space: inherit;
}

.study-markdown__error {
  padding: 1rem;
  border: 1px solid rgba(168, 90, 77, 0.28);
  background: rgba(168, 90, 77, 0.06);
  color: var(--ink);
}

.study-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.study-footer p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.study-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.study-footer__links a {
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-shell {
  width: min(94vw, 1280px);
  margin: 0.75rem auto 1rem;
  padding: 0.85rem 1rem 1rem;
}

.notes-shell .study-topbar {
  padding-bottom: 0.55rem;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
}

.notes-shell .study-topbar__nav {
  gap: 0.7rem;
}

.notes-command-bar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) auto;
  gap: 1rem 1.2rem;
  align-items: end;
  padding: 1rem 0 0.9rem;
  border-bottom: 1px solid var(--line);
}

.notes-command-bar__brand,
.notes-command-bar__center,
.notes-command-bar__actions {
  min-width: 0;
}

.notes-command-bar__brand h1 {
  margin: 0.35rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 4vw, 3.35rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--accent);
}

.notes-command-bar__summary,
.notes-command-bar__status,
.notes-preview-pane__intro,
.notes-empty p,
.notes-preview__excerpt,
.notes-preview__points li {
  color: var(--ink-muted);
}

.notes-command-bar__summary {
  margin: 0.55rem 0 0;
  font-size: 0.96rem;
  line-height: 1.45;
}

.notes-command-bar__center {
  display: grid;
  gap: 0.4rem;
}

.notes-command-bar__path,
.notes-preview-pane__meta,
.notes-control__label,
.notes-note-card__eyebrow,
.notes-note-card__meta,
.notes-note-card__submeta,
.notes-rail-section__count,
.notes-toc-card__count,
.notes-preview-card__path {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-command-bar__path,
.notes-stage__path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  color: var(--ink-muted);
}

.notes-command-bar__status {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.notes-command-bar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.notes-toolbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(168, 90, 77, 0.2);
  background: rgba(168, 90, 77, 0.04);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease,
    color 140ms ease;
}

.notes-toolbar-action:hover,
.notes-toolbar-action:focus-visible {
  border-color: rgba(168, 90, 77, 0.3);
  background: rgba(168, 90, 77, 0.08);
  color: var(--accent);
  transform: translateY(-1px);
}

.notes-toolbar-action--muted {
  background: transparent;
  border-color: rgba(112, 98, 86, 0.18);
}

.notes-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 36%) minmax(0, 64%);
  gap: 1rem 1.2rem;
  align-items: start;
  padding-top: 0.95rem;
}

.notes-rail {
  position: sticky;
  top: 0.85rem;
  display: grid;
  gap: 0.85rem;
}

.notes-panel {
  padding: 1rem;
  border: 1px solid rgba(112, 98, 86, 0.18);
  background: rgba(255, 255, 255, 0.16);
}

.notes-panel__header h2 {
  margin: 0.32rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.4rem, 2.1vw, 1.9rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.notes-panel--controls {
  display: grid;
  gap: 0.85rem;
}

.notes-control {
  display: grid;
  gap: 0.4rem;
}

.notes-control__label {
  margin: 0;
  font-size: 0.68rem;
  color: var(--ink-muted);
}

.notes-input,
.notes-select {
  width: 100%;
  min-height: 2.55rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(112, 98, 86, 0.2);
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  font: inherit;
}

.notes-input::placeholder {
  color: rgba(39, 31, 28, 0.52);
}

.notes-input:focus,
.notes-select:focus,
.notes-filter-chip:focus,
.notes-note-card:focus {
  outline: 2px solid rgba(168, 90, 77, 0.18);
  outline-offset: 1px;
}

.notes-control-group {
  display: grid;
  gap: 0.45rem;
}

.notes-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.notes-filter-chip {
  min-height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(112, 98, 86, 0.18);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.notes-filter-chip:hover,
.notes-filter-chip:focus-visible,
.notes-filter-chip.is-active {
  border-color: rgba(168, 90, 77, 0.28);
  background: rgba(168, 90, 77, 0.06);
  color: var(--accent);
}

.notes-select-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.notes-panel--sections {
  display: grid;
  gap: 0.95rem;
}

.notes-rail-section {
  display: grid;
  gap: 0.55rem;
}

.notes-rail-section__header,
.notes-toc-card__header,
.notes-preview-card__header,
.notes-preview-pane__eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.notes-rail-section__count,
.notes-toc-card__count,
.notes-preview-card__path,
.notes-preview-pane__meta {
  color: var(--ink-muted);
}

.notes-note-card {
  position: relative;
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem 0.8rem 1rem;
  border: 1px solid rgba(112, 98, 86, 0.18);
  background: rgba(255, 255, 255, 0.18);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.notes-note-card::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 140ms ease;
}

.notes-note-card:hover,
.notes-note-card:focus-visible,
.notes-note-card.is-active {
  border-color: rgba(168, 90, 77, 0.26);
  background: rgba(168, 90, 77, 0.05);
  transform: translateX(1px);
}

.notes-note-card:hover::before,
.notes-note-card:focus-visible::before,
.notes-note-card.is-active::before {
  opacity: 1;
}

.notes-note-card__top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.notes-note-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(168, 90, 77, 0.18);
  background: rgba(168, 90, 77, 0.04);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.notes-note-card__eyebrow {
  color: var(--accent);
}

.notes-note-card h3 {
  margin: 0.15rem 0 0;
  font-size: 1.03rem;
  line-height: 1.3;
}

.notes-note-card__meta,
.notes-note-card__submeta {
  margin: 0;
  font-size: 0.66rem;
}

.notes-list-empty {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.notes-preview-pane {
  min-width: 0;
  display: grid;
  gap: 0.9rem;
}

.notes-preview-pane__header {
  display: grid;
  gap: 0.35rem;
  padding: 0.1rem 0 0.75rem;
  border-bottom: 1px solid var(--line);
}

.notes-preview-pane__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.notes-preview-pane__title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--accent);
}

.notes-preview-pane__intro {
  margin: 0;
  max-width: 58ch;
  font-size: 1rem;
  line-height: 1.55;
}

.notes-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.1rem;
}

.notes-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.6rem;
  border: 1px solid rgba(112, 98, 86, 0.16);
  background: rgba(255, 255, 255, 0.24);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-preview-tags[hidden] {
  display: none;
}

.notes-preview-pane__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(230px, 0.88fr);
  gap: 0.85rem;
}

.notes-preview-pane__grid[hidden] {
  display: none;
}

.notes-preview-card,
.notes-toc-card,
.notes-empty {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(112, 98, 86, 0.18);
  background: rgba(255, 255, 255, 0.16);
}

.notes-preview__excerpt {
  margin-top: 0.65rem;
  max-width: 60ch;
  font-size: 0.98rem;
  line-height: 1.58;
}

.notes-preview__points {
  margin: 0.75rem 0 0;
  padding-left: 1rem;
}

.notes-preview__points[hidden] {
  display: none;
}

.notes-preview__points li {
  font-size: 0.92rem;
  line-height: 1.58;
}

.notes-preview__points li + li {
  margin-top: 0.32rem;
}

.notes-toc {
  display: grid;
  gap: 0;
  margin-top: 0.6rem;
}

.notes-toc__link {
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(112, 98, 86, 0.15);
  color: var(--ink-muted);
  transition: color 140ms ease;
}

.notes-toc__link:first-child {
  border-top: 0;
  padding-top: 0;
}

.notes-toc__link:hover,
.notes-toc__link:focus-visible {
  color: var(--accent);
}

.notes-empty[hidden] {
  display: none;
}

.notes-empty h3 {
  margin: 0.3rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.notes-empty p {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.notes-shell .study-footer {
  margin-top: 0.15rem;
  padding-top: 0.75rem;
}

.notes-shell--minimal {
  width: min(92vw, 760px);
  margin: 0.9rem auto 1.2rem;
  padding: 0.95rem 1rem 1.1rem;
}

.notes-minimal {
  padding-top: 1rem;
}

.notes-minimal__header h1 {
  margin: 0.35rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--accent);
}

.notes-subjects {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.notes-subject {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

.notes-subject__toggle {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.notes-subject__title {
  min-width: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.35rem, 2.8vw, 1.95rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.notes-subject__count,
.notes-subject__note-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.notes-subject__panel {
  display: none;
  padding-top: 0.65rem;
}

.notes-subject.is-open .notes-subject__panel {
  display: block;
}

.notes-subject__notes {
  display: grid;
  gap: 0.45rem;
}

.notes-subject__note {
  display: grid;
  gap: 0.14rem;
  padding: 0.7rem 0.8rem;
  min-width: 0;
  border: 1px solid rgba(112, 98, 86, 0.18);
  background: rgba(255, 255, 255, 0.18);
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

.notes-subject__note:hover,
.notes-subject__note:focus-visible {
  border-color: rgba(168, 90, 77, 0.26);
  background: rgba(168, 90, 77, 0.04);
  transform: translateX(1px);
}

.notes-subject__note-title {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.notes-subject__empty {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

@keyframes frame-x {
  to {
    transform: scaleX(1);
  }
}

@keyframes frame-y {
  to {
    transform: scaleY(1);
  }
}

@keyframes loader-fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loader-seal {
  0% {
    opacity: 0;
    transform: scale(0.92) rotate(-6deg);
  }

  65% {
    opacity: 1;
    transform: scale(1.02) rotate(1deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes startup-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .study-shell {
    width: min(98vw, 1360px);
  }

  .study-main-grid,
  .study-hero,
  .study-band,
  .notes-workbench {
    grid-template-columns: 1fr;
  }

  .study-band__meta {
    justify-content: flex-start;
  }

  .study-outline {
    display: block;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 1rem;
    backdrop-filter: none;
  }

  .study-outline__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .study-note-card {
    width: 100%;
  }

  .notes-command-bar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .notes-command-bar__actions {
    justify-content: flex-start;
  }

  .notes-rail {
    position: static;
  }

  .notes-preview-pane__grid {
    grid-template-columns: 1fr;
  }

  .notes-shell--minimal {
    width: min(96vw, 760px);
  }

  .study-asset--computer {
    right: 1rem;
  }

  .study-asset--mouse {
    left: auto;
    right: 0.6rem;
  }
}

@media (max-width: 780px) {
  .study-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-left: 0;
    border-right: 0;
    padding: 1rem 1rem 1.4rem;
  }

  .study-shell::before {
    inset: 0;
    border-left: 0;
    border-right: 0;
  }

  .study-topbar {
    grid-template-columns: 1fr;
    align-items: start;
    min-width: 0;
  }

  .study-topbar__nav {
    flex-wrap: wrap;
    max-width: 100%;
    gap: 0.55rem 0.75rem;
  }

  .study-topbar__nav a,
  .study-topbar__title,
  .study-topbar__id {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .study-facts,
  .study-outline__list {
    grid-template-columns: 1fr;
  }

  .study-outline {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 0.9rem);
    left: 1rem;
    right: auto;
    width: auto;
    max-width: calc(100dvw - 2rem);
    max-height: calc(100dvh - 1.8rem);
    padding: 0.5rem;
    border-color: rgba(168, 90, 77, 0.28);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.68)),
      rgba(248, 244, 238, 0.97);
    box-shadow: 0 16px 34px rgba(39, 31, 28, 0.14);
    backdrop-filter: blur(14px);
    z-index: 12;
  }

  .study-main-content {
    padding: 0;
  }

  .study-outline__header {
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
  }

  .study-outline__toggle {
    display: inline-flex;
    min-width: 0;
    padding: 0.62rem 0.9rem;
    background: rgba(168, 90, 77, 0.09);
    box-shadow: 0 8px 16px rgba(168, 90, 77, 0.08);
  }

  .study-outline .study-kicker,
  .study-outline h2,
  .study-outline__lede,
  .study-outline__home {
    display: none;
  }

  .study-outline__list {
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    transition: max-height 220ms ease, opacity 180ms ease, margin-top 180ms ease;
  }

  .study-outline.is-open {
    width: min(18.5rem, calc(100dvw - 2rem));
    padding: 0.75rem;
  }

  .study-outline.is-open .study-kicker,
  .study-outline.is-open h2,
  .study-outline.is-open .study-outline__lede,
  .study-outline.is-open .study-outline__home {
    display: block;
  }

  .study-outline.is-open .study-outline__header {
    justify-content: space-between;
    gap: 0.8rem;
    align-items: end;
  }

  .study-outline.is-open .study-outline__lede {
    margin-top: 0.65rem;
  }

  .study-outline.is-open .study-outline__home {
    width: 100%;
    margin-top: 0.65rem;
    text-align: center;
  }

  .study-outline.is-open .study-outline__list {
    margin-top: 0.85rem;
    max-height: min(60vh, 26rem);
    overflow: auto;
    opacity: 1;
    pointer-events: auto;
    padding: 0.2rem 0.2rem 0.25rem 0.2rem;
  }

  .study-markdown__section-header,
  .study-markdown__section-body {
    padding-left: 0;
  }

  .study-markdown,
  .study-markdown__section,
  .study-markdown__section-body,
  .study-markdown p,
  .study-markdown li,
  .study-markdown ul,
  .study-markdown ol,
  .study-code {
    min-width: 0;
    max-width: 100%;
  }

  .study-markdown__section-header {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    min-width: 0;
  }

  .study-markdown__section-index {
    padding-top: 0;
  }

  .study-hero h1,
  .study-markdown__section-header h2,
  .study-markdown h3,
  .study-markdown h4,
  .study-lede,
  .study-band__meta,
  .study-footer,
  .study-footer__links {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .study-facts {
    min-width: 0;
  }

  .study-fact {
    min-width: 0;
  }

  .study-code pre {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .study-code pre code {
    white-space: inherit;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .notes-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.75rem 0.85rem 0.95rem;
  }

  .notes-shell::before {
    inset: 0;
    border-left: 0;
    border-right: 0;
  }

  .notes-command-bar {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 0.75rem 0 0.7rem;
    background:
      linear-gradient(180deg, rgba(248, 244, 238, 0.96), rgba(248, 244, 238, 0.88)),
      var(--paper-soft);
  }

  .notes-command-bar__brand h1 {
    font-size: clamp(1.75rem, 7vw, 2.3rem);
  }

  .notes-select-grid {
    grid-template-columns: 1fr;
  }

  .notes-preview-pane__eyebrow {
    align-items: start;
  }

  .notes-preview-pane__title {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .notes-preview-pane__meta {
    gap: 0.35rem;
  }

  .notes-stage__path,
  .notes-command-bar__path {
    gap: 0.25rem;
  }

  .notes-preview-card,
  .notes-toc-card,
  .notes-panel,
  .notes-empty {
    padding: 0.85rem;
  }

  .notes-toolbar-action {
    min-height: 2rem;
    padding: 0 0.75rem;
  }

  .notes-shell--minimal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.8rem 0.85rem 0.95rem;
  }

  .notes-subject__toggle {
    gap: 0.6rem;
  }

  .study-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .study-asset {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
