@font-face { font-family: "XB Serif"; src: url("/fonts/serif-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "XB Serif"; src: url("/fonts/serif-900.woff2") format("woff2"); font-weight: 900; font-display: block; }
@font-face { font-family: "XB Num"; src: url("/fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #0b0b0a;
  --bg2: #151513;
  --line: rgba(242, 239, 233, .1);
  --fg: #f2efe9;
  --fg2: #bab4aa;
  --fg3: #77716a;
  --eye: #d6b25a;
  --serif: "XB Serif", "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --num: "XB Num", "DIN Condensed", "Arial Narrow", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(20px, 5vw, 80px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.8 var(--sans); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 1px solid var(--eye); outline-offset: 4px; }
.serif { font-family: var(--serif); font-weight: 700; }
/* SplitText masks are one line-box tall; the serif's strokes reach past that, so give the clip room */
.ch-mask { padding: .1em .02em .16em; margin: -.1em -.02em -.16em; }
/* motion.js: the hero title waits for its entrance (index.html drops this class after 3 s regardless) */
.js-motion .hero-name, .js-motion .hero-lede, .js-motion .bar { visibility: hidden; }
.num { font-family: var(--num); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
@media (hover: hover) and (pointer: fine) { .only-touch { display: none; } }
@media not ((hover: hover) and (pointer: fine)) { .only-fine { display: none; } }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 18px; border-radius: 19px;
  background: transparent; border: 1px solid var(--line); color: var(--fg2);
  font-size: 14px; cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.pill:hover { border-color: rgba(242, 239, 233, .35); color: var(--fg); }

/* ---------------------------------------------------------------- top bar */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 14px var(--pad);
  background: linear-gradient(rgba(11, 11, 10, .8), rgba(11, 11, 10, 0));
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease;
}
.bar.is-solid { background: rgba(11, 11, 10, .86); border-bottom-color: var(--line);
  backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); }
.bar-name { justify-self: start; display: inline-flex; align-items: center; gap: 10px; font-size: 17px; }
.bar-name .serif { letter-spacing: .08em; }
.bar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--eye); box-shadow: 0 0 12px rgba(214, 178, 90, .65); }
.bar-sub { color: var(--fg3); font-size: 14px; letter-spacing: .02em; }
.bar-now { justify-self: center; margin: 0; font-size: 11px; letter-spacing: .28em; color: var(--fg2); white-space: nowrap; }
.bar-index { justify-self: end; position: relative; }
.bar-pill {
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px; border-radius: 18px;
  border: 1px solid var(--line); background: rgba(11, 11, 10, .45); color: var(--fg); font-size: 13px; cursor: pointer;
  transition: border-color .2s;
}
.bar-pill .mono { color: var(--fg3); font-size: 11px; }
.bar-pill:hover, .bar-pill[aria-expanded="true"] { border-color: rgba(242, 239, 233, .35); }
.index-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 268px; margin: 0; padding: 6px; list-style: none;
  background: rgba(21, 21, 19, .97); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.index-menu a { display: flex; justify-content: space-between; align-items: baseline; gap: 28px; padding: 11px 14px; border-radius: 8px; font-size: 15px; }
.index-menu a:hover, .index-menu a:focus-visible { background: rgba(242, 239, 233, .06); }
.index-menu .mono { color: var(--fg3); font-size: 12px; }
@media (max-width: 640px) { .bar { grid-template-columns: 1fr auto; } .bar-now, .bar-sub { display: none; } }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 600px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(42vmax 46vmax at var(--glow-x, 66%) 46%, rgba(214, 178, 90, .075), transparent 70%);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.hero-figure {
  position: absolute; right: 7vw; top: 8vh; top: 8svh; height: 86vh; height: 86svh;
  aspect-ratio: var(--ar, .74); max-width: 56vw; pointer-events: none;
}
.hero-fallback { width: 100%; height: 100%; object-fit: contain; }
.hero-copy { position: absolute; left: var(--pad); bottom: 10vh; bottom: 10svh; max-width: 30em; pointer-events: none; }
.hero-name {
  margin: 0; font-family: var(--serif); font-weight: 900;
  font-size: clamp(110px, 15vw, 248px); line-height: .92; letter-spacing: -.02em;
}
.nw { white-space: nowrap; }
@media (max-width: 760px) { .br-wide { display: none; } }
.hero-lede { margin: 28px 0 0; max-width: 30em; text-wrap: pretty; color: var(--fg2); font-size: 16px; line-height: 1.9; }
.hero-lede .num { color: var(--fg); font-size: 1.2em; }
.tip {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  font-size: 11px; color: var(--fg); background: rgba(13, 13, 12, .85); padding: 3px 8px;
  white-space: nowrap; opacity: 0; transition: opacity .15s;
}
.tip.on { opacity: 1; }
@media (max-aspect-ratio: 1/1) {
  .hero { --glow-x: 50%; }
  .hero-figure { right: auto; left: 50%; transform: translateX(-50%); top: 9svh; height: auto; width: 92vw; max-width: none; max-height: 60svh; }
  .hero-copy { bottom: 6svh; }
  .hero-name { font-size: clamp(84px, 24vw, 140px); }
  .hero-lede { margin-top: 16px; font-size: 15px; }
}

/* ---------------------------------------------------------------- sections */
.sec { padding: clamp(110px, 16vh, 180px) var(--pad) 0; max-width: 1480px; margin: 0 auto; }
.sec-head { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 25em); justify-content: space-between; align-items: end; gap: 14px 48px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.sec-head h2, .pet-copy h2 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(36px, 4.2vw, 64px); line-height: 1.1; letter-spacing: -.01em; }
.sec-note { margin: 0; color: var(--fg2); font-size: 15px; line-height: 1.75; text-align: right; text-wrap: pretty; }
.sec-note .mono { color: var(--fg); }
@media (max-width: 760px) { .sec-head { grid-template-columns: minmax(0, 1fr); } .sec-note { text-align: left; } }

/* ---------------------------------------------------------------- habits */
.chapter {
  display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 0 clamp(24px, 3.5vw, 56px);
  align-items: start; padding: 34px 0; border-bottom: 1px solid var(--line);
}
.chapter-head { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.chapter-head h3 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: .02em; }
.chapter-head p { margin: 0; color: var(--fg2); font-size: 14px; line-height: 1.8; text-wrap: pretty; }
.chapter-count { margin-top: 4px; color: var(--fg3); font-size: 12px; letter-spacing: .14em; }
.chapter-count .n { color: var(--eye); }
@media (max-width: 860px) {
  .chapter { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 28px 0; }
  .chapter-head { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
  .chapter-head h3 { font-size: 26px; }
  .chapter-head p { flex-basis: 100%; order: 3; }
}
.strip-wrap { position: relative; min-width: 0; margin-right: calc(var(--pad) * -1); }
.strip {
  display: flex; gap: 8px; overflow-x: auto; padding-right: var(--pad);
  scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab;
}
.strip::-webkit-scrollbar { display: none; }
.strip.is-dragging { cursor: grabbing; }
.strip.is-dragging .shot { pointer-events: none; }
.shot { flex: 0 0 auto; margin: 0; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; }
.shot img {
  height: clamp(220px, 38vh, 380px); width: auto; background: var(--bg2);
  user-select: none; -webkit-user-drag: none; transition: opacity .25s;
}
.strip:hover .shot img { opacity: .72; }
.strip:hover .shot:hover img { opacity: 1; }
.shot .mono { display: block; margin-top: 10px; font-size: 11px; color: var(--fg3); }
.strip-nav {
  position: absolute; top: calc(50% - 14px); transform: translateY(-50%); z-index: 2;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(13, 13, 12, .8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--fg); font-size: 20px; cursor: pointer; opacity: 0; transition: opacity .2s;
}
.strip-wrap:hover .strip-nav:not(:disabled) { opacity: 1; }
.strip-nav:disabled { opacity: 0 !important; pointer-events: none; }
.strip-nav.prev { left: 12px; }
.strip-nav.next { right: calc(var(--pad) + 12px); }
@media not ((hover: hover) and (pointer: fine)) { .strip-nav { display: none; } .strip { cursor: auto; } }

/* ---------------------------------------------------------------- clock */
.clock-body { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); padding-top: 48px; align-items: start; }
.dial-wrap { position: relative; }
#dial { width: 100%; aspect-ratio: 1; display: block; cursor: grab; touch-action: pan-y; border-radius: 50%; }
.dial-slider { display: block; width: 100%; margin: 18px 0 0; -webkit-appearance: none; appearance: none; background: transparent; height: 32px; }
.dial-slider::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
.dial-slider::-moz-range-track { height: 2px; background: var(--line); }
.dial-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -12px; border-radius: 50%; background: var(--eye); border: 3px solid var(--bg); }
.dial-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--eye); border: 3px solid var(--bg); }
#dial:active { cursor: grabbing; }
.dial-hint { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--fg3); letter-spacing: .3em; }
.clock-time { margin: 0; font-size: clamp(72px, 9vw, 128px); line-height: .9; color: var(--fg); }
.clock-line { margin: 18px 0 26px; color: var(--fg2); min-height: 1.8em; }
.clock-line b { color: var(--fg); font-weight: 500; }
.clock-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.clock-photos .shot img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.clock-photos .shot .mono { margin-top: 6px; font-size: 10px; line-height: 1.5; }
#clock-now { margin-top: 24px; }
@media (max-width: 960px) { .clock-body { grid-template-columns: minmax(0, 1fr); } .dial-wrap { max-width: 520px; width: 100%; margin: 0 auto; } }

/* ---------------------------------------------------------------- pet */
.pet { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.pet-frame {
  position: relative; height: min(84vh, 820px); aspect-ratio: 3 / 4; max-width: 100%;
  background: var(--bg2); touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.pet-frame:active { cursor: grabbing; }
#fur, .pet-fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.pet-how { margin: 20px 0 0; color: var(--fg2); }
.pet-count { margin: 64px 0 0; display: flex; align-items: baseline; gap: 10px; }
.pet-count .num { font-size: clamp(80px, 10vw, 150px); line-height: .85; color: var(--fg); }
.pet-count span:last-child { color: var(--fg2); font-size: 18px; }
.pet-count-label { margin: 12px 0 32px; color: var(--fg3); font-size: 14px; }
.pet-btns { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 860px) {
  .pet { grid-template-columns: minmax(0, 1fr); }
  .pet-copy { order: -1; }
  .pet-frame { height: auto; width: 100%; }
  .pet-count { margin-top: 32px; }
}

/* ---------------------------------------------------------------- album */
.month { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.month-label { position: sticky; top: 76px; align-self: start; }
.month-label .num { display: block; font-size: 30px; line-height: 1; }
.month-label span:last-child { font-size: 12px; color: var(--fg3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; }
.cell { padding: 0; border: 0; background: var(--bg2); aspect-ratio: 1; overflow: hidden; cursor: zoom-in; }
.cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.cell:hover img { transform: scale(1.07); }
@media (max-width: 760px) {
  .month { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .month-label { position: static; display: flex; align-items: baseline; gap: 10px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
}

/* ---------------------------------------------------------------- notes */
.note-form { display: flex; gap: 16px; align-items: center; max-width: 760px; margin-top: 40px; }
.note-form input:not(.hp) {
  flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 0; font-size: 20px; border-radius: 0;
}
.note-form input:focus { outline: none; border-bottom-color: var(--eye); }
.note-form input::placeholder { color: var(--fg3); }
.note-form .pill { flex: 0 0 auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.note-status { min-height: 1.8em; margin: 10px 0 0; color: var(--fg2); font-size: 14px; }
.note-list { list-style: none; margin: 28px 0 0; padding: 0; max-width: 760px; }
.note-list li { display: flex; gap: 20px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); }
.note-list .text { flex: 1; margin: 0; font-size: 17px; overflow-wrap: anywhere; white-space: pre-wrap; }
.note-list .when { font: 11px var(--mono); color: var(--fg3); }

.foot { display: flex; justify-content: space-between; gap: 20px; padding: 120px var(--pad) 40px; max-width: 1480px; margin: 0 auto; font-size: 12px; color: var(--fg3); }
.foot a:hover { color: var(--fg2); }

/* ---------------------------------------------------------------- lightbox */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(9, 9, 8, .97); color: var(--fg); }
.lightbox::backdrop { background: rgba(9, 9, 8, .9); }
.lb-figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 56px 72px 22px; }
.lb-figure img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-cap { display: flex; gap: 18px; font-size: 13px; color: var(--fg2); }
.lb-cap .mono { font-size: 12px; }
.lb-pos { color: var(--fg3); }
.lb-live { font: 12px/1 var(--sans); letter-spacing: .08em; color: var(--fg2); background: none; border: 1px solid var(--line); border-radius: 3px; padding: 4px 7px; cursor: pointer; }
.lb-live:hover, .lb-live.is-on { color: var(--eye); border-color: rgba(214, 178, 90, .45); }
.lb-like { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: none; border: 0; color: var(--fg2); cursor: pointer; }
.lb-like svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .2s ease; }
.lb-like:hover { color: var(--fg); }
.lb-like.is-on { color: var(--eye); }
.lb-like.is-on svg { fill: currentColor; animation: like-beat .35s ease; }
.lb-like .num { font-size: 15px; min-width: 1ch; }
@keyframes like-beat { 50% { transform: scale(1.35); } }
#lb-img { touch-action: manipulation; }
.lb-pop { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 3; }
.lb-pop svg { position: absolute; left: -48px; top: -48px; width: 96px; height: 96px; fill: var(--eye); opacity: 0; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .45)); }
.lb-pop.go svg { animation: like-pop .9s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes like-pop { 0% { opacity: 0; transform: scale(.3); } 18% { opacity: 1; transform: scale(1.12); } 32% { transform: scale(.95); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.05) translateY(-18px); } }
.cell { position: relative; }
.cell-dur { position: absolute; left: 4px; bottom: 4px; padding: 2px 5px; border-radius: 2px; background: rgba(13, 13, 12, .62);
  color: var(--fg); font: 600 11px/1.2 var(--num); pointer-events: none; }
.lb-movie { position: absolute; z-index: 2; background: #000; object-fit: contain; }
.lb-play { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: none; border: 0; color: var(--fg); cursor: pointer; }
.lb-play-dot { width: 76px; height: 76px; border-radius: 50%; background: rgba(13, 13, 12, .55); border: 1px solid rgba(242, 239, 233, .35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); position: relative; transition: transform .2s ease, background .2s ease; }
.lb-play-dot::after { content: ""; position: absolute; left: 31px; top: 24px; border-style: solid; border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent var(--fg); }
.lb-play:hover .lb-play-dot { transform: scale(1.06); background: rgba(13, 13, 12, .7); }
.lb-play .mono { font-size: 12px; padding: 2px 8px; background: rgba(13, 13, 12, .55); border-radius: 2px; }
.cell-like { position: absolute; right: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 5px; border-radius: 2px;
  background: rgba(13, 13, 12, .62); color: var(--fg); font: 600 11px/1.2 var(--num); pointer-events: none; }
.cell-like svg { width: 10px; height: 10px; fill: var(--eye); }
.lb-dl, .lb-share { font: 12px/1.6 var(--sans); color: var(--fg2); text-decoration: none; border-bottom: 1px solid var(--line); }
.lb-share { background: none; border-top: 0; border-left: 0; border-right: 0; padding: 0; cursor: pointer; }
.lb-dl:hover, .lb-share:hover { color: var(--eye); border-color: rgba(214, 178, 90, .45); }
.lb-vid { position: absolute; object-fit: cover; pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.lb-vid.on { opacity: 1; }
.lb-btn { position: absolute; width: 60px; height: 60px; background: none; border: 0; color: var(--fg2); font-size: 36px; line-height: 1; cursor: pointer; }
.lb-btn:hover { color: var(--fg); }
.lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 6px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 6px; top: 6px; font-size: 32px; }
@media (max-width: 640px) {
  .lb-figure { padding: 56px 8px 18px; }
  .lb-prev, .lb-next { top: auto; bottom: 4px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
