:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --paper: #ffffff;
  --paper-soft: #f1f1ee;
  --ink: #151515;
  --muted: #5f625e;
  --faint: #8f938d;
  --line: rgba(20, 20, 18, 0.1);
  --line-strong: rgba(20, 20, 18, 0.18);
  --accent: #2f5f58;
  --accent-soft: rgba(47, 95, 88, 0.1);
  --signal: #8b3d33;
  --shadow: 0 24px 70px rgba(29, 31, 28, 0.08);
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --sans: "Inter", "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10110f;
  --paper: #171815;
  --paper-soft: #20211d;
  --ink: #edeee8;
  --muted: #a4a79d;
  --faint: #73776d;
  --line: rgba(237, 238, 232, 0.1);
  --line-strong: rgba(237, 238, 232, 0.18);
  --accent: #9fbeb7;
  --accent-soft: rgba(159, 190, 183, 0.12);
  --signal: #d59b86;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

html.is-resetting-scroll {
  scroll-behavior: auto;
  scroll-snap-type: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 8%, var(--accent-soft), transparent 25rem),
    linear-gradient(180deg, var(--paper-soft), var(--bg) 22rem);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px);
  z-index: 10;
}

.rail-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  padding: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  background: var(--paper);
}

.taste-rail-button {
  border-radius: 50%;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.taste-rail-button:hover,
.taste-rail-button:focus-visible {
  border-color: var(--accent);
  background: var(--paper);
  transform: translateY(-1px);
}

.rail-nav {
  margin-top: 42px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-nav a,
.rail-action {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--faint);
  border: 1px solid transparent;
  background: transparent;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible,
.rail-action:hover,
.rail-action:focus-visible {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

.rail-nav svg,
.rail-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-nav span,
.rail-action span {
  position: absolute;
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease;
}

.rail-nav a:hover span,
.rail-nav a:focus-visible span,
.rail-action:hover span,
.rail-action:focus-visible span {
  opacity: 1;
}

.theme-button {
  margin-top: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
}

.theme-pull {
  position: fixed;
  top: 0;
  right: 12px;
  z-index: 30;
  width: 42px;
  height: 92px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  justify-items: center;
  align-content: start;
}

.pull-cord {
  width: 1px;
  height: 62px;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
}

.pull-knob {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(29, 31, 28, 0.08);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.theme-pull:hover .pull-knob,
.theme-pull:focus-visible .pull-knob {
  transform: translateY(4px);
  border-color: var(--accent);
  background: var(--paper-soft);
}

.page-switch {
  position: fixed;
  right: clamp(28px, 2.2vw, 42px);
  bottom: 28px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.page-switch span {
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.page-switch.is-up span {
  transform: translateY(2px) rotate(225deg);
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
  border: 1px solid var(--ink);
}

.mobile-top {
  display: none;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-search,
.mobile-taste {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mobile-taste {
  width: 38px;
  padding: 0;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 18px;
  text-transform: none;
}

.mobile-admin {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0 54px 32px;
}

.archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(360px, 22vw, 430px);
  gap: 28px;
  align-items: start;
}

.primary-flow {
  min-width: 0;
}

.home-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.archive-aside {
  position: sticky;
  top: 0;
  max-height: none;
  overflow: visible;
  border-left: 1px solid var(--line);
  padding: 64px 32px 0 22px;
}

.hero {
  position: relative;
  height: clamp(600px, 70vh, 680px);
  min-height: 600px;
  margin: 64px 0 56px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.top-kept-line {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  z-index: 3;
  min-height: 24px;
  width: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  pointer-events: none;
}

.top-kept-line > div {
  max-width: min(660px, calc(100% - 96px));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 24px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--paper) 58%, transparent);
  box-shadow: 0 10px 28px rgba(29, 31, 28, 0.05);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-kept-line span {
  color: var(--accent);
}

.top-kept-line p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-cover {
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  z-index: 0;
  width: 50%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(180deg, var(--paper), var(--paper-soft));
  box-shadow: none;
}

.hero-cover::after {
  content: "";
  position: absolute;
  top: min(300px, 56%);
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--bg) 50%, transparent) 100%
  );
  pointer-events: none;
}

.cover-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, black, transparent 95%);
}

.cover-line {
  position: absolute;
  height: 1px;
  background: var(--line-strong);
  transform-origin: left center;
}

.cover-line-a {
  width: 62%;
  left: 8%;
  top: 35%;
  transform: rotate(-8deg);
}

.cover-line-b {
  width: 48%;
  right: 8%;
  bottom: 30%;
  transform: rotate(14deg);
}

.cover-stamp,
.cover-coordinates {
  position: absolute;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}

.cover-stamp {
  left: 24px;
  top: 24px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border: 1px solid var(--line);
}

.cover-coordinates {
  right: 26px;
  bottom: 24px;
}

.cover-signal {
  position: absolute;
  left: 86%;
  top: 88%;
  width: min(21vw, 214px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.cover-signal::before,
.cover-signal::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.cover-signal::after {
  inset: 42%;
  background: color-mix(in srgb, var(--accent) 68%, var(--signal));
  border: 0;
  opacity: 0.68;
}

.hero-body {
  position: absolute;
  left: 50%;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: end;
  gap: 28px 24px;
  padding: 0 clamp(34px, 3.5vw, 58px) clamp(118px, 11vh, 148px);
  border-bottom: 0;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  isolation: isolate;
}

.hero-body::before {
  content: "";
  position: absolute;
  top: 56px;
  right: 54px;
  width: 78px;
  height: 78px;
  z-index: -1;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  background: transparent;
  pointer-events: none;
}

.identity {
  grid-column: 2;
  align-self: end;
  min-width: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.avatar-wrap {
  grid-column: 1;
  align-self: end;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  backdrop-filter: blur(12px);
  transform: none;
}

.avatar-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.08em;
}

.identity-kicker,
.section-code {
  margin: 0 0 10px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 3.25vw, 50px);
  font-weight: 400;
  line-height: 1.02;
  white-space: nowrap;
}

.identity h1 span {
  white-space: nowrap;
}

.identity-note,
.identity-copy {
  grid-column: 1 / -1;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(16px, 1.08vw, 18px);
  line-height: 1.76;
}

.quick-search {
  position: relative;
  z-index: 4;
  width: 100%;
  margin: 0 0 28px;
  padding-right: 88px;
}

.quick-search label {
  position: relative;
  display: grid;
  gap: 8px;
}

.quick-search label::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 13px;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  opacity: 0.72;
}

.quick-search label::before {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 12px;
  width: 7px;
  height: 1.5px;
  background: var(--accent);
  opacity: 0.72;
  transform: rotate(45deg);
  transform-origin: right center;
}

.quick-search span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-search input {
  width: 100%;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--paper) 92%, transparent), color-mix(in srgb, var(--paper-soft) 88%, transparent));
  color: var(--ink);
  padding: 12px 42px 12px 14px;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent) 16%, transparent);
}

.quick-search-results {
  display: grid;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
}

.quick-search-results:empty {
  display: none;
}

.quick-search-results .search-result {
  grid-template-columns: 64px minmax(0, 1fr);
  padding: 10px 0;
}

.quick-search-results .search-result strong {
  font-size: 14px;
  font-weight: 400;
}

.quick-search-results .search-result small {
  display: none;
}

.section {
  padding: 42px 0 0;
}

.desk-section {
  min-height: calc(100vh - 28px);
  margin-top: 0;
  padding-top: 28px;
  scroll-margin-top: 28px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.pinned-section {
  margin-top: -8px;
  position: relative;
  width: clamp(360px, 22vw, 430px);
  display: block;
  padding-top: 8px;
  padding-bottom: 34px;
  transform: translateX(-8px);
}

.archive-aside .pinned-section {
  width: 100%;
  margin: 0;
  padding: 0 0 22px;
  transform: none;
  border-bottom: 1px solid var(--line);
}

.archive-aside .pinned-minimal-head {
  padding: 0 0 13px;
}

.archive-aside .pinned-minimal #pinned-title {
  font-size: 20px;
}

.pinned-section::before {
  display: none;
}

.pinned-minimal {
  border-top: 0;
}

.pinned-minimal-head {
  padding: 12px 0 14px;
}

.pinned-minimal .section-code {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.pinned-minimal #pinned-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}

.pinned-link {
  display: grid;
  gap: 6px;
  padding: 12px 0 13px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  transition: color 160ms ease, padding-left 160ms ease;
}

.pinned-link:hover {
  color: var(--accent);
  padding-left: 6px;
}

.pinned-link span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pinned-link strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.42;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pinned-link small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.48;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.section-head {
  margin-bottom: 24px;
}

.section-head.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-head.compact {
  margin-bottom: 18px;
}

.section h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.12;
}

.record-link,
.ghost-button,
.submit-button {
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 15px;
  font-size: 13px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.record-link:hover,
.submit-button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.ghost-button {
  background: transparent;
  color: var(--ink);
}

.ghost-button:hover {
  background: var(--paper);
}

.desk-grid,
.index-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.08fr) minmax(220px, 0.96fr) minmax(220px, 0.96fr);
  gap: 22px;
}

.index-only {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.side-by-side {
  display: grid;
  gap: 28px;
}

.desk-column,
.archive-column,
.echoes {
  border-top: 1px solid var(--line-strong);
  padding-top: 20px;
}

.desk-featured {
  display: grid;
  align-content: start;
  gap: 16px;
}

.desk-card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  padding: 20px;
}

.desk-card + .desk-card {
  margin-top: 0;
}

.desk-type {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.desk-card h4 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.35;
}

.desk-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.82;
}

.aside-panel {
  padding: 22px 0 30px;
}

.aside-panel + .aside-panel {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.archive-aside .section-head {
  margin-bottom: 13px;
}

.archive-aside .section-head.split {
  align-items: center;
}

.archive-aside .section h2,
.archive-aside .aside-panel h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.1;
}

.archive-aside .section-code {
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.archive-aside .ghost-button {
  padding: 8px 11px;
  font-size: 12px;
}

.column-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.column-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
}

.column-head a {
  color: var(--faint);
  font-size: 13px;
  border-bottom: 1px solid transparent;
}

.column-head a:hover {
  color: var(--ink);
  border-bottom-color: currentColor;
}

.archive-row,
.project-row {
  min-height: 88px;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  transition: color 160ms ease, background 160ms ease;
}

.archive-row {
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 14px 0;
}

.project-row {
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 14px 0;
}

.archive-row:hover,
.project-row:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
}

.archive-row time,
.archive-row small,
.project-tags {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
}

.archive-row span,
.project-name {
  color: var(--ink);
  line-height: 1.5;
}

.project-desc {
  line-height: 1.5;
}

.fragment-board {
  display: grid;
  grid-template-columns: 1fr;
}

.fragment-item {
  min-height: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fragment-item:nth-child(2) {
  transform: none;
}

.fragment-item figcaption {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.fragment-item blockquote {
  margin: 28px 0 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.76;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.tab {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tab:last-child {
  border-right: 0;
}

.tab.is-active {
  background: var(--paper);
  color: var(--ink);
}

.taste-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.echo-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
}

.taste-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 12, 0.34);
  backdrop-filter: blur(7px);
}

.echo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 12, 0.32);
  backdrop-filter: blur(6px);
}

.taste-modal {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(760px, 86vh);
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
  padding: 24px;
}

.echo-modal {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  padding: 18px;
}

.taste-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.echo-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.taste-modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
}

.echo-modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
}

.taste-close {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.echo-close {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 7px 10px;
  font-size: 12px;
}

.echo-dialog[hidden],
.taste-dialog[hidden],
.search-dialog[hidden] {
  display: none;
}

.taste-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  border-top: 1px solid var(--line);
}

.taste-row {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  text-align: left;
}

.taste-row:hover,
.taste-row.is-active {
  color: var(--accent);
}

.taste-row strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
}

.taste-row span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.taste-note {
  min-height: 76px;
  margin: 14px 0 0;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--serif);
  line-height: 1.8;
}

.echo-list {
  display: grid;
  gap: 0;
  margin-bottom: 18px;
}

.echo-open {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 12px;
  font-size: 12px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease;
}

.echo-open::after {
  content: "+";
  color: currentColor;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
}

.echo-open:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.echoes {
  border-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.echoes .section-head.compact {
  margin-bottom: 13px;
}

.echoes .section-head.compact h2 {
  font-size: 20px;
  line-height: 1.1;
}

.echo-item {
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 12px 0 13px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.echo-item:last-child {
  border-bottom: 1px solid var(--line);
}

.echo-item:hover,
.echo-item:focus-visible {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--paper) 38%, transparent);
}

.echo-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.echo-item p {
  display: -webkit-box;
  margin: 0 0 7px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.echo-item.is-expanded p {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.echo-item span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.echo-form {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.echo-modal .echo-form {
  border-top: 0;
  padding-top: 0;
}

.echo-form label {
  display: grid;
  gap: 5px;
}

.echo-form label > span {
  color: var(--faint);
  font-size: 12px;
}

.echo-form input[type="text"],
.echo-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 0;
  font-size: 13px;
  resize: vertical;
}

.echo-form textarea {
  min-height: 72px;
  max-height: 124px;
}

.echo-form .submit-button {
  justify-self: start;
  padding: 8px 13px;
  font-size: 12px;
}

.echo-form input:focus,
.echo-form textarea:focus,
.ghost-button:focus-visible,
.submit-button:focus-visible,
.echo-open:focus-visible,
.echo-close:focus-visible,
.theme-button:focus-visible,
.theme-pull:focus-visible,
.page-switch:focus-visible,
.rail-action:focus-visible,
.mobile-search:focus-visible,
.mobile-taste:focus-visible,
.taste-close:focus-visible,
.tab:focus-visible,
.taste-row:focus-visible,
.search-close:focus-visible,
.search-box input:focus,
.quick-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.checkbox-line input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.form-status {
  min-height: 18px;
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.45;
}

.search-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: start center;
  padding: 9vh 24px 24px;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 12, 0.36);
  backdrop-filter: blur(6px);
}

.search-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: 82vh;
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.2);
  padding: 24px;
}

.search-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.search-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
}

.search-close {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.search-box span {
  color: var(--faint);
  font-size: 12px;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 14px;
  font-size: 16px;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-result {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px 14px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.search-result span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.search-result strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.search-result small {
  grid-column: 2;
  color: var(--faint);
  line-height: 1.5;
}

.empty-result {
  margin: 0;
  color: var(--muted);
  padding: 18px 0;
}

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

@media (max-width: 920px) {
  html {
    scroll-snap-type: none;
  }

  .content {
    width: 100%;
    padding: 28px 28px 60px;
  }

  .archive-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    height: auto;
    display: grid;
    grid-template-rows: auto auto;
  }

  .home-screen {
    min-height: auto;
    scroll-snap-align: none;
  }

  .archive-aside {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    padding: 48px 0 0;
    margin-top: 48px;
  }

  .hero-cover {
    right: 0;
    left: 0;
  }

  .index-grid,
  .desk-grid,
  .side-by-side,
  .fragment-board {
    grid-template-columns: 1fr;
  }

  .fragment-item:nth-child(2) {
    transform: none;
  }

  .taste-list {
    grid-template-columns: 1fr;
  }

  .pinned-section {
    display: block;
  }

  .pinned-section .section-head {
    margin-bottom: 24px;
  }

  .pinned-section {
    width: 100%;
  }

  .desk-section {
    min-height: auto;
    padding-top: 58px;
    scroll-snap-align: none;
  }
}

@media (max-width: 760px) {
  .site {
    display: block;
  }

  .rail {
    display: none;
  }

  .mobile-top {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(20px);
  }

  .mobile-top a {
    font-family: var(--serif);
    font-size: 18px;
  }

  .mobile-top .theme-button {
    margin: 0;
    width: 38px;
    height: 38px;
  }

  .theme-pull {
    display: none;
  }

  .page-switch {
    display: none;
  }

  .content {
    width: 100%;
    padding: 18px 18px 48px;
  }

  .hero {
    min-height: auto;
    grid-template-rows: auto auto;
    padding-top: 0;
  }

  .top-kept-line {
    top: 10px;
    min-height: 24px;
    padding: 0 4px;
  }

  .top-kept-line > div {
    max-width: calc(100% - 36px);
    padding: 0 8px;
  }

  .hero-cover {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    min-height: 340px;
    height: auto;
    margin-bottom: -128px;
  }

  .hero-body {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    padding: 54px 0 24px;
  }

  .echo-dialog,
  .taste-dialog {
    padding: 16px;
  }

  .echo-modal,
  .taste-modal {
    padding: 18px;
  }

  .avatar-wrap {
    width: 112px;
    height: 112px;
    transform: none;
  }

  .avatar-mark {
    width: 78px;
    height: 78px;
    font-size: 22px;
  }

  .identity h1 {
    font-size: clamp(28px, 8vw, 40px);
  }

  .identity-note,
  .identity-copy {
    grid-column: 1 / -1;
    font-size: 17px;
  }

  .archive-row,
  .project-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 0;
  }

  .section {
    padding-top: 58px;
  }

  .section-head.split {
    align-items: start;
    flex-direction: column;
  }

  .fragment-item {
    min-height: 180px;
  }
}
