:root {
  --paper: #f4f0e8;
  --paper-deep: #ebe4d7;
  --card: #fffcf7;
  --ink: #1b1a17;
  --ink-soft: #3f3a33;
  --muted: #8b8175;
  --line: rgba(27, 26, 23, 0.11);
  --accent: #a24e38;
  --accent-soft: #ead8cc;
  --olive: #3e4438;
  --shadow: 0 24px 60px rgba(60, 45, 30, 0.14);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(120, 100, 70, 0.045) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 78px;
}

body[data-view="detail"] {
  padding-bottom: 0;
}

main {
  min-height: 60vh;
}

body[data-view="detail"] .site-header,
body[data-view="detail"] .site-footer,
body[data-view="detail"] .tabbar {
  display: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid rgba(162, 78, 56, 0.55);
  outline-offset: 3px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(244, 240, 232, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(50, 40, 30, 0.04);
}

.header-inner {
  max-width: 1120px;
  height: 64px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
  padding-top: 1px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand__name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.1;
}

.brand__en {
  font-size: 7.5px;
  letter-spacing: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
}

.header-nav {
  display: none;
  align-items: center;
  gap: 30px;
  margin-left: auto;
  margin-right: 6px;
}

.header-nav a {
  position: relative;
  padding: 7px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  transition: color 0.25s ease;
}

.header-nav a:hover,
.header-nav a.is-active {
  color: var(--ink);
}

.header-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.header-save {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.6);
  color: var(--ink);
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.header-save:hover {
  background: var(--card);
  border-color: rgba(27, 26, 23, 0.2);
  transform: translateY(-1px);
}

.header-save svg {
  width: 18px;
  height: 18px;
}

.header-save__badge {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  line-height: 17px;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--paper);
}

.header-save__badge[hidden] {
  display: none;
}

/* ---------- hero ---------- */

.hero {
  max-width: 1120px;
  margin: 6px auto 0;
  padding: 0 16px;
}

.hero__card {
  position: relative;
  min-height: clamp(360px, 50vh, 500px);
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: #2a2622;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
  animation: heroIn 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(12, 10, 8, 0.22) 0%, rgba(12, 10, 8, 0) 30%, rgba(12, 10, 8, 0.1) 55%, rgba(12, 10, 8, 0.72) 100%),
    linear-gradient(90deg, rgba(12, 10, 8, 0.18) 0%, rgba(12, 10, 8, 0) 55%);
}

.hero__top {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.hero__vol {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 27px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(20, 18, 15, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero__season {
  font-size: 8.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.hero__content {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 28px 22px 25px;
  color: #fff;
}

.hero__title {
  max-width: 12em;
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(31px, 8.4vw, 52px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.22);
}

.hero__sub {
  max-width: 430px;
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.76);
}

.hero__foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 500;
  transition: transform 0.25s ease, background 0.25s ease;
}

.hero__cta:hover {
  transform: translateY(-2px);
  background: #fffdf9;
}

.hero__cta svg {
  width: 15px;
  height: 15px;
}

.hero__meta {
  display: flex;
  gap: 14px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28);
}

/* ---------- toolbar ---------- */

.toolbar {
  position: sticky;
  top: 64px;
  z-index: 50;
  max-width: 1120px;
  margin: 0 auto;
  padding: 15px 16px 9px;
  background: linear-gradient(180deg, var(--paper) 72%, rgba(244, 240, 232, 0.92) 86%, rgba(244, 240, 232, 0));
}

.toolbar--static {
  position: relative;
  top: auto;
  padding-top: 4px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search__input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink);
  padding: 0 50px 0 48px;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  outline: none;
  box-shadow: 0 6px 20px rgba(60, 45, 30, 0.045);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.search__input::placeholder {
  color: #a79d90;
}

.search__input:focus {
  background: var(--card);
  border-color: rgba(162, 78, 56, 0.42);
  box-shadow: 0 0 0 3px rgba(162, 78, 56, 0.07), 0 8px 24px rgba(60, 45, 30, 0.06);
}

.search__input::-webkit-search-cancel-button {
  display: none;
}

.search__icon {
  position: absolute;
  left: 17px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
}

.search__clear {
  position: absolute;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-soft);
  display: none;
  place-items: center;
  transition: background 0.2s ease;
}

.search__clear:hover {
  background: #e0d6c6;
}

.search.has-value .search__clear {
  display: grid;
}

.search__clear svg {
  width: 13px;
  height: 13px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 3px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.42);
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.chip:hover {
  border-color: rgba(27, 26, 23, 0.22);
  transform: translateY(-1px);
}

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

/* ---------- listing ---------- */

.notes-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 7px 16px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 10px;
}

.section-kicker {
  margin: 0 0 5px;
  font-size: 8.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.2;
}

.result-count {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 12px;
}

.note-card {
  position: relative;
  min-width: 0;
}

.note-card__media {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper-deep);
}

.note-card__link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
}

.note-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.5s ease;
}

.note-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20, 18, 15, 0.14), transparent 32%, transparent 70%, rgba(20, 18, 15, 0.18));
  pointer-events: none;
}

.note-card:hover .note-card__img {
  transform: scale(1.045);
}

.note-card__brand {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  max-width: calc(100% - 58px);
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(20, 18, 15, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.save-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(20, 18, 15, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.save-btn:hover {
  transform: scale(1.06);
}

.save-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: fill 0.2s ease;
}

.save-btn.is-saved {
  background: var(--accent);
  border-color: var(--accent);
}

.save-btn.is-saved svg {
  fill: currentColor;
}

.note-card__body {
  padding: 11px 3px 0;
}

.note-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.note-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.note-card__title a {
  text-decoration: none;
}

.note-card__title.has-sub {
  display: block;
  overflow: hidden;
}

.note-card__title-main {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.note-card__title-sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.8em;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.note-card__sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.note-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(27, 26, 23, 0.06);
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

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

mark {
  padding: 0 0.06em;
  background: linear-gradient(180deg, transparent 56%, rgba(162, 78, 56, 0.24) 56%);
  color: inherit;
}

/* ---------- empty ---------- */

.empty {
  display: none;
  padding: 48px 22px 40px;
  border: 1px dashed rgba(27, 26, 23, 0.16);
  border-radius: 22px;
  background: rgba(255, 252, 247, 0.5);
  text-align: center;
}

.empty.is-visible {
  display: block;
}

.empty__icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 15px;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--muted);
  display: grid;
  place-items: center;
}

.empty__icon svg {
  width: 23px;
  height: 23px;
}

.empty h3 {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.05em;
}

.empty p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.empty button,
.text-btn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.empty button:hover,
.text-btn:hover {
  background: var(--paper-deep);
  transform: translateY(-1px);
}

/* ---------- editorial quote ---------- */

.editorial {
  max-width: 1120px;
  margin: 42px auto 0;
  padding: 0 16px;
}

.editorial__card {
  position: relative;
  padding: 34px 24px 28px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--olive);
  color: var(--paper);
}

.editorial__card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -50px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(244, 240, 232, 0.03), 0 0 0 60px rgba(244, 240, 232, 0.02);
}

.editorial__mark {
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: var(--serif);
  font-size: 100px;
  line-height: 1;
  color: rgba(244, 240, 232, 0.13);
}

.editorial__text {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(19px, 4.8vw, 24px);
  line-height: 1.7;
  letter-spacing: 0.05em;
}

.editorial__by {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(244, 240, 232, 0.55);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ---------- page (saved / about) ---------- */

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 34px 20px 10px;
}

.page--saved {
  max-width: 1120px;
  padding: 26px 0 0;
}

.page--saved .page-head {
  padding: 0 18px;
}

.page__kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 8.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.page__title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(31px, 7.2vw, 48px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.05em;
}

.page__title--sm {
  font-size: clamp(28px, 6.4vw, 40px);
}

.page__lead {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.9;
}

.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 26px 0 30px;
}

.stat {
  flex: 1 1 110px;
  min-width: 100px;
  padding: 14px 14px 13px;
  border-radius: 16px;
  background: var(--paper-deep);
}

.stat strong {
  display: block;
  margin-bottom: 3px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 28px;
}

.about-item {
  padding: 19px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.62);
}

.about-item__no {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.about-item h3 {
  margin: 6px 0 7px;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.05em;
}

.about-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.about-note {
  padding: 18px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 252, 247, 0.55);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.85;
}

.about-note code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--paper-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

/* ---------- detail ---------- */

.detail {
  max-width: 880px;
  margin: 0 auto;
  padding-bottom: 110px;
  animation: fadeIn 0.35s ease both;
}

.detail__hero {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 690px;
  overflow: hidden;
  background: var(--paper-deep);
}

.detail__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;
  animation: heroIn 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.detail__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 13, 10, 0.34) 0%, rgba(15, 13, 10, 0) 22%);
  pointer-events: none;
}

.detail__topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px calc(12px + env(safe-area-inset-top));
  pointer-events: none;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.detail__topbar.is-scrolled {
  background: rgba(244, 240, 232, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(50, 40, 30, 0.04);
}

.detail__topbar .round-btn {
  pointer-events: auto;
}

.round-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(20, 18, 15, 0.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.round-btn:hover {
  transform: translateY(-1px);
}

.round-btn svg {
  width: 19px;
  height: 19px;
}

.detail__topbar.is-scrolled .round-btn {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
}

.detail__sheet {
  position: relative;
  z-index: 2;
  margin: -28px 0 0;
  padding: 26px 20px 0;
  border-radius: 26px 26px 0 0;
  background: var(--paper);
}

.detail__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 11px;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.detail__eyebrow span {
  color: var(--muted);
}

.detail__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(27px, 7vw, 40px);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

.detail__title-sub {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.66em;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.detail__sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

.detail__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}

.fact {
  padding: 11px 12px 12px;
  background: var(--card);
}

.fact span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.fact strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 24px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.detail__body {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.detail__body p {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 2;
  letter-spacing: 0.02em;
  white-space: pre-line;
}

.detail__body p:first-child {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.95;
  letter-spacing: 0.04em;
}

.detail__figure {
  margin: 28px -20px;
}

.detail__figure img {
  width: 100%;
  height: auto;
  max-height: 640px;
  object-fit: contain;
  background: var(--paper-deep);
}

.detail__figure figcaption {
  padding: 9px 20px 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: center;
}

.detail__gallery {
  margin: 36px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.detail__gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.detail__gallery-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.detail__gallery-head span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.gallery-grid button {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-deep);
  cursor: zoom-in;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gallery-grid button:hover img {
  transform: scale(1.05);
}

.related {
  margin: 38px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.related__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.related__head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.related__head a {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.related-grid .note-card__title {
  font-size: 13px;
}

.related-grid .note-card__sub {
  display: none;
}

.related-grid .note-card__foot {
  margin-top: 7px;
  padding-top: 7px;
}

.detail__end {
  margin: 40px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-align: center;
}

/* ---------- bottom bar ---------- */

.buybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.94);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.buybar__info {
  flex: 1;
  min-width: 0;
}

.buybar__info span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.buybar__info strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.btn-save {
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background 0.25s ease, transform 0.25s ease;
}

.btn-save:hover {
  transform: translateY(-1px);
}

.btn-save svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.btn-save.is-saved {
  background: var(--accent);
}

.btn-save.is-saved svg {
  fill: currentColor;
}

.btn-share {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-share:hover {
  background: var(--paper-deep);
  transform: translateY(-1px);
}

.btn-share svg {
  width: 19px;
  height: 19px;
}

/* ---------- footer ---------- */

.site-footer {
  max-width: 1120px;
  margin: 44px auto 0;
  padding: 0 18px 24px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.14em;
}

.footer-brand span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.22em;
}

.footer-copy {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.8;
}

.footer-meta {
  margin: 0;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

/* ---------- tabbar ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.tab {
  min-width: 64px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab.is-active {
  color: var(--accent);
}

.discover-card {
  aspect-ratio: 3 / 4;
  border: 1px dashed rgba(27, 26, 23, 0.2);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.discover-card:hover {
  background: rgba(255, 252, 247, 0.8);
  border-color: rgba(27, 26, 23, 0.32);
  transform: translateY(-2px);
}

.discover-card__plus {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.discover-card__label {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.08em;
}

.discover-card__sub {
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 13, 10, 0.96);
}

.lightbox.is-open {
  display: flex;
  animation: fadeIn 0.2s ease both;
}

.lightbox__img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: grid;
  place-items: center;
}

.lightbox__nav {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.lightbox__nav button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
}

.lightbox__nav svg {
  width: 17px;
  height: 17px;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  z-index: 150;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- motion ---------- */

.reveal {
  opacity: 1;
  transform: none;
}

@keyframes heroIn {
  from {
    transform: scale(1.035);
    filter: brightness(0.94);
  }
  to {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- responsive ---------- */

@media (min-width: 560px) {
  .hero__card {
    min-height: 560px;
  }

  .hero__content {
    padding: 34px 32px 31px;
  }

  .hero__sub {
    font-size: 13.5px;
  }

  .detail__sheet {
    padding-left: 26px;
    padding-right: 26px;
  }

  .detail__figure {
    margin-left: -26px;
    margin-right: -26px;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .related-grid {
    gap: 18px;
  }
}

@media (min-width: 700px) {
  .hero__img {
    object-position: 50% 18%;
  }

  .header-nav {
    display: flex;
  }

  .note-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 18px;
  }

  .note-card__title {
    font-size: 14.5px;
  }

  .detail__hero {
    aspect-ratio: 16 / 10;
    max-height: 560px;
    margin: 14px 18px 0;
    border-radius: 26px;
  }

  .detail__hero img {
    object-position: 50% 10%;
  }

  .detail__topbar {
    padding-left: max(14px, calc((100vw - 900px) / 2));
    padding-right: max(14px, calc((100vw - 900px) / 2));
  }

  .detail__sheet {
    margin: -34px 40px 0;
    padding: 34px 44px 0;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(60, 45, 30, 0.08);
  }

  .detail__figure {
    margin-left: -44px;
    margin-right: -44px;
  }

  .detail__body p {
    font-size: 15.5px;
  }

  .buybar {
    left: 50%;
    right: auto;
    width: min(780px, calc(100% - 32px));
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .page {
    padding-top: 44px;
  }

  .about-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .about-grid .about-item {
    min-height: 100%;
  }
}

@media (min-width: 900px) {
  .toolbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 18px;
    padding-bottom: 14px;
  }

  .toolbar .search {
    flex: 0 1 560px;
  }

  .toolbar .search__input {
    height: 48px;
  }

  .toolbar .chips {
    flex: 1;
    justify-content: flex-end;
    padding: 0;
    flex-wrap: wrap;
    overflow: visible;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 0 20px;
  }

  .hero__card {
    min-height: 560px;
  }

  .hero__img {
    object-position: 50% 14%;
  }

  .hero__content {
    padding: 40px 42px 38px;
  }

  .note-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 34px 22px;
  }

  .notes-section,
  .toolbar,
  .editorial {
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .page--saved .page-head {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .tabbar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
