:root {
  /* Suminagashi paper and traditional ink accents (shared with shusingh.github.io). */
  --paper: #efeae0;
  --sumi: #1a1a1f;
  --ai: #16407a;
  --shu: #c0432e;
  --matsuba: #2e6e52;
  --matcha: #567a26;
  --yamabuki: #cf8d12;
  --line: rgba(26, 26, 31, 0.18);
  --bg-elevated: #f7f3eb;
  --bg-elevated-2: #e6dfd3;
  --border: rgba(26, 26, 31, 0.1);
  --text-primary: var(--sumi);
  --text-secondary: #3a3833;
  --text-tertiary: #67635b;
  --accent: var(--matcha);
  --accent-strong: #435f1d;
  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Hanken Grotesk', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-jp: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --mood1: #8d8a92;
  --mood2: var(--ai);
  --mood3: var(--matsuba);
  --mood4: var(--matcha);
  --mood5: var(--yamabuki);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute must win over display rules like .archive-grid's grid. */
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.42), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(112, 88, 53, 0.045), transparent 42%),
    var(--paper);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Procedural washi from paper.js: an opaque canvas that IS the background,
   exactly as on the portfolio. Without WebGL the page falls back to the
   plain paper colour and washes above. */
.paper-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.kanji-motif {
  position: fixed;
  top: 90px;
  right: 26px;
  writing-mode: vertical-rl;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: clamp(56px, 8vw, 96px);
  letter-spacing: 0.14em;
  color: rgba(26, 26, 31, 0.055);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

@media (max-width: 760px) {
  .kanji-motif { display: none; }
}

::selection { background: rgba(86, 122, 38, 0.85); color: #f7f2e6; }

button { font: inherit; -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.entry:focus-visible, .search:focus-visible { outline: none; }

/* ================= Layout: centred sheet + margin notes ================= */

.column {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 0 auto;
  padding: 72px 28px 64px;
}

/* The margin column lives in the left margin on wide screens (fixed, so the
   sheet stays truly centred and never fights it for attention) and flows
   inline between the composer and the year map on narrow ones. */
.margin {
  display: grid;
  gap: 34px;
  align-content: start;
  font-size: 14px;
}

.m-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.m-title .jp { font-family: var(--font-jp); font-size: 12px; letter-spacing: 0.1em; }

.week-line { display: flex; gap: 9px; align-items: center; }
.week-line i {
  width: 14px;
  height: 14px;
  border-radius: 50% 60% 55% 65%;
  background: rgba(26, 26, 31, 0.06);
}
.week-line i.today { outline: 1.5px solid var(--sumi); outline-offset: 2px; }

.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.m-when {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  display: flex;
  gap: 7px;
  align-items: center;
}
.m-when svg { width: 13px; height: 13px; flex: none; }
.m-entry + .m-entry { margin-top: 16px; }
.m-empty {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-tertiary);
}

.balance-line { display: flex; gap: 14px; flex-wrap: wrap; }
.balance-line > span {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-tertiary);
}
.balance-line svg { width: 19px; height: 19px; }

.rail-link {
  display: inline-flex;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 9px;
  margin: -5px -9px;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}
.rail-link:hover,
.rail-link:focus-visible {
  background: var(--bg-elevated);
  border-color: var(--line);
}

@media (min-width: 1150px) {
  .margin {
    position: fixed;
    top: 168px;
    left: max(24px, calc(50vw - 618px));
    width: 240px;
    z-index: 2;
  }
  /* A hairline that fades at both ends separates margin from sheet. */
  .margin::after {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    right: -38px;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
  }
}

@media (max-width: 1149.98px) {
  .margin {
    margin-top: 84px;
    grid-template-columns: 1fr auto;
    gap: 28px 32px;
    align-items: start;
  }
  .m-flash { grid-column: 1 / -1; }
  .m-link { grid-column: 1 / -1; }
}

/* ================= Header ================= */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--accent); }
.eyebrow .jp { color: var(--text-tertiary); font-family: var(--font-jp); letter-spacing: 0.1em; }

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 5.4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.title .accent { font-style: italic; font-weight: 300; color: var(--accent); }
.date {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.rule {
  height: 1px;
  background: linear-gradient(90deg, var(--line), rgba(26, 26, 31, 0.04));
  margin: 26px 0 0;
}

/* ================= Composer: the room's centrepiece ================= */

.composer { margin-top: 84px; }

.prompt {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 34px;
}

.entry {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--line);
  background: transparent;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 23px;
  line-height: 1.45;
  color: var(--text-primary);
  padding: 6px 2px 12px;
  outline: none;
  transition: border-color 0.25s ease;
}
.entry::placeholder { color: #a49b8a; }
.entry:focus { border-color: var(--sumi); }

.moods { display: flex; gap: 26px; margin-top: 40px; align-items: flex-end; flex-wrap: wrap; }

.moods button {
  background: none;
  border: none;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 4px;
  opacity: 0.5;
  transform: scale(1);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.moods button:hover { opacity: 0.85; transform: scale(1.07); }
.moods button.sel { opacity: 1; transform: scale(1.13); }
.moods button svg { width: 34px; height: 34px; }
.moods .jp-name { font-family: var(--font-jp); font-size: 13px; color: var(--text-secondary); }
.moods .name {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.moods button.sel .name { color: var(--text-primary); }

/* A saved mood blooms briefly, like ink meeting water. */
@keyframes bloom {
  0% { transform: scale(1.13); }
  45% { transform: scale(1.42); }
  100% { transform: scale(1.13); }
}
.moods button.bloom svg { animation: bloom 0.45s ease; }

.actions { display: flex; align-items: center; gap: 18px; margin-top: 40px; }
.save-btn {
  min-width: 120px;
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #f7f2e6;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
.save-btn:hover:not(:disabled) { background: var(--accent-strong); transform: translateY(-1px); }
.save-btn:disabled { opacity: 0.38; cursor: default; }

.hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  user-select: none;
  transition: color 0.3s ease;
}
.hint.saved { color: var(--accent-strong); }

.counter {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
  visibility: hidden;
}
.counter.show { visibility: visible; }
.counter.near { color: var(--shu); }

/* ================= Cards ================= */

.flash {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  position: relative;
}
.flash + .flash { margin-top: 10px; }
.flash .when {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash .when svg { width: 15px; height: 15px; flex: none; }
.flash .mood-dot {
  width: 7px;
  height: 7px;
  border-radius: 50% 60% 55% 50%;
  display: inline-block;
  flex-shrink: 0;
}
.flash .text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16.5px;
  color: var(--text-primary);
}
.flash .text::before { content: '\201C'; color: var(--text-tertiary); }
.flash .text::after { content: '\201D'; color: var(--text-tertiary); }
.flash.empty-note .text::before, .flash.empty-note .text::after { content: ''; }
.flash.empty-note .text { color: var(--text-tertiary); font-size: 14px; font-style: normal; font-family: var(--font-body); }

.today-saved { margin-top: 46px; background: rgba(247, 243, 235, 0.74); }
.today-saved .text { font-size: 17px; }
.today-saved .linklike { margin-top: 7px; margin-right: 6px; }

/* ================= The year, marbled ================= */

.year-map { margin-top: 110px; }

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.section-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  gap: 12px;
}
.stats .streak { color: var(--shu); font-weight: 500; }

.heatmap-scroll {
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-color: rgba(86, 122, 38, 0.28) rgba(26, 26, 31, 0.04);
  scrollbar-width: thin;
}

.month-row {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  width: max-content;
  margin-bottom: 6px;
  padding-right: 5px;
}
.month-row span {
  width: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  overflow: visible;
  white-space: nowrap;
}

.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  width: max-content;
  padding-right: 5px;
  padding-bottom: 3px;
}

/* Ink droplets on water: irregular circles, coloured by mood. */
.cell {
  width: 12px;
  height: 12px;
  border-radius: 50% 60% 55% 65%;
  background: rgba(26, 26, 31, 0.055);
  box-shadow: inset 0 0 0 1px rgba(26, 26, 31, 0.025);
  transition: transform 0.15s ease;
}
.cell.filled { cursor: pointer; }
.cell.filled:hover { transform: scale(1.35); }
.cell.future { background: transparent; box-shadow: none; }
.m1 { background: var(--mood1) !important; }
.m2 { background: var(--mood2) !important; }
.m3 { background: var(--mood3) !important; }
.m4 { background: var(--mood4) !important; }
.m5 { background: var(--mood5) !important; }
.cell.today { outline: 1.5px solid var(--sumi); outline-offset: 2px; }

.legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50% 60% 55% 65%; display: inline-block; }

.day-detail { margin-top: 18px; }
.detail-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}
.detail-close:hover { color: var(--text-primary); }

/* ================= Footer ================= */

.footer-note {
  margin-top: 70px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  text-wrap: balance;
}
/* Links sit flush with the text, then grow an opaque paper pill on hover,
   like the nav links on the portfolio. Negative margins offset the padding
   so nothing shifts when the pill appears. */
.linklike {
  display: inline-block;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(86, 122, 38, 0.4);
  padding: 5px 9px;
  margin: -5px -9px;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    text-decoration-color 0.2s ease;
}
.linklike:hover,
.linklike:focus-visible {
  color: var(--accent-strong);
  background: var(--bg-elevated);
  border-color: var(--line);
  text-decoration-color: var(--accent-strong);
}

/* Maker's mark */
.byline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.byline svg { width: 12px; height: 12px; fill: currentColor; opacity: 0.8; }
.byline {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 9px;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.byline:hover,
.byline:focus-visible {
  color: var(--accent-strong);
  background: var(--bg-elevated);
  border-color: var(--line);
}

/* ================= Memory Archive page ================= */

.page {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 54px 0 64px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 30px;
}
.topbar .title { font-size: clamp(40px, 6vw, 60px); }
.today-link {
  border: 1px solid rgba(86, 122, 38, 0.26);
  border-radius: 999px;
  background: rgba(247, 243, 235, 0.72);
  color: var(--accent-strong);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 13px;
  white-space: nowrap;
}

.archive-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}
.archive-panel {
  background: rgba(247, 243, 235, 0.68);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.archive-rail { position: sticky; top: 22px; padding: 16px; }
.rail-title, .section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.year-stack { display: grid; gap: 7px; margin: 12px 0 20px; }
.year-btn, .month-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.year-btn {
  display: flex;
  justify-content: space-between;
  padding: 8px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.year-btn.active {
  border-color: rgba(86, 122, 38, 0.24);
  background: rgba(86, 122, 38, 0.08);
  color: var(--accent-strong);
}
.month-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.month-btn {
  min-height: 31px;
  border-radius: 999px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.month-btn.active { background: var(--sumi); color: #f7f2e6; }
.month-btn:disabled { opacity: 0.35; cursor: default; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.search {
  width: 100%;
  min-height: 42px;
  border: none;
  border-bottom: 1.5px solid var(--line);
  background: transparent;
  color: var(--sumi);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  outline: none;
  padding: 4px 2px 9px;
}
.search::placeholder { color: #a49b8a; }
.search:focus { border-color: var(--sumi); }
.mood-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mood-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(26, 26, 31, 0.08);
  background: rgba(247, 243, 235, 0.56);
  opacity: 0.62;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mood-btn:hover { opacity: 0.9; }
.mood-btn.active { opacity: 1; outline: 1.5px solid var(--sumi); outline-offset: 2px; }
.mood-btn svg { width: 20px; height: 20px; }
.mood-btn .all {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.memory-stream { display: grid; gap: 12px; }
.month-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin: 10px 0 2px;
}
.month-heading h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.month-heading span { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.memory-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(247, 243, 235, 0.68);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.memory-card:hover, .memory-card.active { background: rgba(247, 243, 235, 0.9); border-color: rgba(86, 122, 38, 0.34); }
.memory-card.active { transform: translateX(2px); }
.date-block { font-family: var(--font-mono); color: var(--text-tertiary); }
.date-block .big-day {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: var(--sumi);
  font-family: var(--font-display);
}
.date-block .weekday {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.memory-copy { display: grid; gap: 8px; }
.memory-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.memory-meta svg { width: 15px; height: 15px; flex: none; }
.memory-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.42;
}
.archive-empty {
  padding: 30px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.pager button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(247, 243, 235, 0.72);
  color: var(--accent-strong);
  cursor: pointer;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pager button:hover:not(:disabled) { border-color: rgba(86, 122, 38, 0.4); background: rgba(247, 243, 235, 0.95); }
.pager button:disabled { opacity: 0.35; cursor: default; }
.pager .leaf { font-family: var(--font-jp); color: var(--text-tertiary); }

.detail { position: sticky; top: 22px; overflow: hidden; }
.detail-hero {
  min-height: 250px;
  padding: 24px;
  display: grid;
  align-content: space-between;
  background:
    radial-gradient(circle at 72% 18%, rgba(86, 122, 38, 0.14), transparent 30%),
    radial-gradient(circle at 20% 80%, rgba(22, 64, 122, 0.09), transparent 34%),
    rgba(247, 243, 235, 0.82);
}
.detail-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.detail-line {
  margin: 24px 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-style: italic;
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
.detail-mood {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.detail-mood svg { width: 22px; height: 22px; }
.mini-calendar { padding: 18px 20px 20px; border-top: 1px solid var(--border); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-top: 14px; }
.calendar-day {
  aspect-ratio: 1;
  border-radius: 50% 60% 55% 65%;
  background: rgba(26, 26, 31, 0.055);
  border: 0;
}
.calendar-day.has { cursor: pointer; }
.calendar-day.sel { outline: 1.5px solid var(--sumi); outline-offset: 2px; }
.insight-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.insight {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(247, 243, 235, 0.58);
}
.insight b {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}
.insight .jp-big { font-family: var(--font-jp); }
.insight span {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ================= Kentō cursor ================= */

/* While the kentō cursor is active, its fine ink dot IS the pointer. */
html.kento-cursor,
html.kento-cursor * { cursor: none !important; }

.kento-corner {
  position: fixed;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: multiply;
  will-change: transform;
  transition: opacity 0.25s ease;
}
.kento-corner::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 0 solid rgba(26, 26, 31, 0.8);
  transition: border-color 0.2s ease;
}
.kento-nw::before { border-top-width: 1.5px; border-left-width: 1.5px; }
.kento-ne::before { border-top-width: 1.5px; border-right-width: 1.5px; }
.kento-sw::before { border-bottom-width: 1.5px; border-left-width: 1.5px; }
.kento-se::before { border-bottom-width: 1.5px; border-right-width: 1.5px; }
.kento-corner.kento-hot::before { border-color: var(--accent); }

.kento-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 3.5px;
  height: 3.5px;
  border-radius: 999px;
  background: var(--sumi);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: multiply;
  will-change: transform;
  transition: opacity 0.2s ease;
}

/* ================= Motion & responsive ================= */

@media (prefers-reduced-motion: reduce) {
  .moods button, .cell, .moods button.bloom svg { transition: none; animation: none; }
}

@media (max-width: 980px) {
  .archive-grid { grid-template-columns: 160px minmax(0, 1fr); }
  .detail { grid-column: 1 / -1; position: static; }
}

@media (max-width: 820px) {
  .column { padding-top: 48px; }
  .composer { margin-top: 56px; }
  .moods { gap: 14px; justify-content: space-between; }
  .moods button { min-width: 48px; }
  .margin { margin-top: 64px; }
  .year-map { margin-top: 72px; }
  .actions { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  .page { width: calc(100vw - 36px); padding-top: 40px; }
  .topbar { display: grid; }
  .today-link { justify-self: start; }
  .archive-grid { grid-template-columns: 1fr; }
  .archive-rail { position: static; }
  .toolbar { grid-template-columns: 1fr; }
  .memory-card { grid-template-columns: 58px minmax(0, 1fr); padding: 14px; }
  .detail-line { font-size: 26px; }
}

@media (max-width: 520px) {
  .prompt { font-size: 27px; }
  .save-btn { min-width: 100px; }
  .stats { align-items: flex-start; }
  .legend { gap: 12px 16px; }
  .footer-note { max-width: 30ch; margin-inline: auto; line-height: 1.8; }
}
