:root {
  --ink: #202625;
  --muted: #7b8380;
  --line: #dfe4de;
  --paper: #f6f7f2;
  --surface: #fbfcf8;
  --soft: #edf1eb;
  --accent: #e66d49;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Manrope", "Noto Sans SC", sans-serif; -webkit-font-smoothing: antialiased; }
body:has(.modal-backdrop) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { border: 0; }
.site-wrap { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }

.site-header { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 33px; height: 33px; place-items: center; background: var(--ink); color: var(--paper); font: 500 16px "DM Mono", monospace; transform: rotate(-7deg); }
.brand-copy strong { display: block; font-size: 14px; letter-spacing: .02em; }
.brand-copy small { display: block; margin-top: 3px; color: var(--muted); font: 8px "DM Mono", monospace; letter-spacing: .08em; }
.site-nav { display: flex; align-items: center; gap: 36px; height: 100%; }
.site-nav a { position: relative; color: var(--muted); font-size: 12px; }
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav a.active::after { position: absolute; right: 0; bottom: -31px; left: 0; height: 2px; background: var(--accent); content: ""; }
.header-action { font: 10px "DM Mono", monospace; }
.header-action span { margin-left: 5px; color: var(--accent); font-size: 15px; }

.intro-section { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 12%; min-height: 405px; padding: 70px 8% 65px; border-bottom: 1px solid var(--line); }
.overline, .side-label { margin: 0; color: var(--muted); font: 9px "DM Mono", monospace; letter-spacing: .12em; }
.pulse { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 22px 0 18px; font-size: clamp(52px, 7vw, 82px); line-height: .98; letter-spacing: -.08em; }
h1 em, h2 em { color: var(--accent); font-style: normal; }
.intro-text { max-width: 430px; margin-bottom: 22px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.intro-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 9px "DM Mono", monospace; }
.intro-meta i { width: 24px; height: 1px; background: var(--accent); }
.intro-note { width: min(100%, 250px); justify-self: end; padding: 20px 22px 18px; background: var(--surface); border: 1px solid var(--line); transform: rotate(2.5deg); }
.note-head, .note-bottom { display: flex; justify-content: space-between; color: var(--muted); font: 9px "DM Mono", monospace; letter-spacing: .04em; }
.note-rule { height: 1px; margin: 20px 0 24px; background: var(--line); }
.intro-note p { margin-bottom: 66px; font-size: 18px; line-height: 1.55; letter-spacing: -.05em; }
.intro-note strong { color: var(--accent); font-weight: 600; }
.note-bottom { color: var(--accent); }
.note-bottom span:last-child { font-size: 20px; }

.workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 84px; padding: 82px 8% 112px; }
.sidebar { border-right: 1px solid var(--line); padding-right: 35px; }
.sidebar-block + .sidebar-block { margin-top: 55px; }
.author-intro { margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.topic-list { margin-top: 15px; }
.topic-item { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 9px 0; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: 12px; }
.topic-item small { color: #a8afab; font: 9px "DM Mono", monospace; }
.topic-item:hover, .topic-item.active { color: var(--ink); }
.topic-item.active { font-weight: 700; }
.topic-item.active::before { width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: var(--accent); content: ""; }
.topic-item.active span { margin-right: auto; }
.side-status { padding-top: 18px; border-top: 1px solid var(--line); }
.status-line { display: flex; align-items: center; gap: 8px; margin: 18px 0 9px; font-size: 11px; }
.status-line span { width: 6px; height: 6px; border-radius: 50%; background: #87a882; box-shadow: 0 0 0 4px #e1ecdf; }
.side-status > p:last-child { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.notes-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 34px; }
.notes-heading h2 { margin: 13px 0 0; font-size: 42px; line-height: 1; letter-spacing: -.07em; }
.notes-count { margin: 0 0 2px; color: var(--muted); font: 9px "DM Mono", monospace; }
.notes-toolbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.current-topic { font-size: 11px; font-weight: 600; }
.current-topic span { margin-left: 7px; color: var(--accent); font: 9px "DM Mono", monospace; }
.search-field { display: flex; align-items: center; gap: 8px; width: 190px; color: var(--muted); }
.search-field span { font-size: 19px; transform: rotate(-20deg); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.search-field input::placeholder { color: #a1a8a3; }
.note-list { border-bottom: 1px solid var(--line); }
.note-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 28px; gap: 18px; align-items: start; padding: 27px 0 25px; border-bottom: 1px solid var(--line); cursor: pointer; transition: padding .2s ease, background .2s ease; }
.note-row:last-child { border-bottom: 0; }
.note-row:hover { margin: 0 -14px; padding-right: 14px; padding-left: 14px; background: var(--surface); }
.note-index { color: var(--accent); font: 11px "DM Mono", monospace; }
.note-meta { display: flex; gap: 13px; margin-bottom: 11px; color: var(--muted); font: 9px "DM Mono", monospace; }
.note-category { color: var(--accent); }
.note-main h3 { margin-bottom: 8px; font-size: 17px; line-height: 1.35; letter-spacing: -.035em; }
.note-main p { max-width: 600px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.note-arrow { align-self: center; color: var(--accent); font-size: 21px; opacity: .6; transition: opacity .2s ease, transform .2s ease; }
.note-row:hover .note-arrow { opacity: 1; transform: translate(3px, -3px); }
.no-results { padding: 55px 0; color: var(--muted); font-size: 12px; text-align: center; }

.about-section { display: grid; grid-template-columns: .75fr 1.5fr .75fr; gap: 40px; padding: 80px 8%; border-top: 1px solid var(--line); background: var(--soft); }
.about-label { display: flex; justify-content: space-between; color: var(--accent); font: 9px "DM Mono", monospace; letter-spacing: .08em; }
.about-label span:last-child { color: var(--muted); }
.about-copy h2 { margin-bottom: 16px; font-size: 37px; line-height: 1.14; letter-spacing: -.07em; }
.about-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.about-details { align-self: end; padding-left: 22px; border-left: 1px solid var(--line); color: var(--muted); font: 9px/1.7 "DM Mono", monospace; }
.about-details strong { display: block; margin-top: 8px; color: var(--ink); font: 600 12px/1.65 "Noto Sans SC", sans-serif; }
.site-footer { display: flex; align-items: center; justify-content: space-between; min-height: 78px; color: var(--muted); font-size: 10px; }
.site-footer strong { color: var(--ink); }
.site-footer span, .site-footer p, .site-footer a { color: var(--muted); font: 9px "DM Mono", monospace; }
.site-footer p { margin: 0; }
.site-footer a { padding-bottom: 2px; border-bottom: 1px solid #b9c1b9; }

.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(32, 38, 37, .46); }
.note-modal { position: relative; width: min(560px, 100%); padding: 34px 38px 27px; background: var(--surface); box-shadow: 0 24px 70px rgba(19, 25, 23, .18); }
.modal-close { position: absolute; top: 17px; right: 20px; width: 28px; height: 28px; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; line-height: 1; }
.note-modal h2 { margin: 32px 0 15px; font-size: 30px; line-height: 1.2; letter-spacing: -.06em; }
.modal-lead { max-width: 460px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.modal-divider { height: 1px; margin: 28px 0 22px; background: var(--line); }
.modal-body { color: var(--muted); font-size: 12px; line-height: 1.9; }
.modal-foot { display: flex; justify-content: space-between; margin-top: 40px; color: var(--muted); font: 9px "DM Mono", monospace; }
.modal-foot span:last-child { color: var(--accent); }

@media (max-width: 850px) {
  .site-wrap { width: min(100% - 40px, 680px); }
  .site-nav { display: none; }
  .intro-section { grid-template-columns: 1fr .72fr; gap: 35px; padding-right: 4%; padding-left: 4%; }
  .workspace { gap: 45px; padding-right: 4%; padding-left: 4%; }
  .sidebar { width: 170px; padding-right: 20px; }
  .about-section { padding-right: 4%; padding-left: 4%; }
}

@media (max-width: 620px) {
  .site-wrap { width: calc(100% - 32px); }
  .site-header { height: 72px; }
  .header-action { font-size: 9px; }
  .intro-section { display: block; min-height: 0; padding: 57px 0 50px; }
  .intro-note { margin: 47px 8px 0 auto; }
  .intro-text { font-size: 12px; }
  .workspace { display: block; padding: 54px 0 72px; }
  .sidebar { width: 100%; padding: 0 0 27px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-block + .sidebar-block { margin-top: 32px; }
  .author-block { display: none; }
  .topic-list { display: flex; gap: 9px; margin-top: 12px; overflow-x: auto; }
  .topic-item { width: auto; flex: 0 0 auto; gap: 7px; padding: 8px 10px; background: var(--surface); }
  .topic-item.active { background: var(--ink); color: var(--paper); }
  .topic-item.active::before { display: none; }
  .topic-item.active span { margin-right: 0; }
  .side-status { display: none; }
  .notes-content { padding-top: 43px; }
  .notes-heading { margin-bottom: 27px; }
  .notes-heading h2 { font-size: 36px; }
  .notes-count { font-size: 8px; }
  .notes-toolbar { display: block; padding-bottom: 15px; }
  .search-field { width: 100%; margin-top: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .note-row { grid-template-columns: 28px minmax(0, 1fr) 18px; gap: 12px; padding: 24px 0; }
  .note-row:hover { margin: 0; padding-right: 0; padding-left: 0; background: transparent; }
  .note-meta { flex-wrap: wrap; gap: 8px; margin-bottom: 9px; font-size: 8px; }
  .note-main h3 { font-size: 16px; }
  .note-main p { font-size: 10px; line-height: 1.7; }
  .about-section { display: block; padding: 55px 0 62px; }
  .about-label { margin-bottom: 35px; }
  .about-copy h2 { font-size: 32px; }
  .about-details { margin-top: 30px; padding: 15px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .site-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; padding: 23px 0; }
  .site-footer p { order: 3; grid-column: 1 / -1; }
  .site-footer a { justify-self: end; }
  .note-modal { padding: 28px 23px 22px; }
  .note-modal h2 { font-size: 25px; }
}
