/* Like Memo — chloemaillot.fr style: warm minimal, generous whitespace, scrapbook board */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

:root {
  --bg: #faf9f6;
  --bg-board: #f0efec;
  --ink: #1d1d20;
  --ink-2: #71717a;
  --ink-3: #a1a1aa;
  --line: #e7e5e0;
  --hover-bg: #f1efeb;
  --card: #ffffff;
  --accent: #9b3860;
  --accent-bg: #fde3ef;
  --serif: "Instrument Serif", Georgia, serif;
  --hand: "Shantell Sans", cursive;
  --sans: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}
[data-theme="dark"] {
  --bg: #141416;
  --bg-board: #1d1d20;
  --ink: #ece9e2;
  --ink-2: #a8a29a;
  --ink-3: #6e6a64;
  --line: #2a2a2e;
  --hover-bg: #222225;
  --card: #ece9e2;
  --accent: #f2aed0;
  --accent-bg: #462134;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  transition: background .4s ease, color .4s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- page column ---------- */
.page {
  max-width: 40.5rem;
  margin: 0 auto;
  padding: 80px 24px 0;
}
@media (max-width: 640px) { .page { padding-top: 48px; } }

/* ---------- header ---------- */
.site-head { margin-bottom: 56px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; }
.head-left h1 { font-size: 23px; font-weight: 500; letter-spacing: .01em; line-height: 1.3; }
.role { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.head-right { padding-top: 4px; }
.theme-toggle {
  background: none; border: none; cursor: pointer; color: var(--ink-2);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
}
.theme-toggle:hover { background: var(--hover-bg); color: var(--ink); }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
.clock {
  margin-top: 14px; font-family: var(--mono); font-size: 12px;
  color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase;
}
.clock .dot { margin: 0 8px; }

/* ---------- hero ---------- */
.hero { margin-bottom: 64px; }
.hero p + p { margin-top: 16px; }
.lede { font-size: 22px; font-weight: 500; line-height: 1.5; letter-spacing: .01em; }
.hero p:not(.lede) { color: var(--ink-2); }
.hero a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.hero a:hover { text-decoration-color: var(--ink); }

/* fanned chips */
.chips { display: inline-flex; margin-left: 10px; vertical-align: 2px; }
.chip {
  position: relative; width: 24px; height: 24px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line);
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  margin-left: -7px; box-shadow: 0 2px 6px rgba(0,0,0,.08);
  transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .3s;
  cursor: default;
}
.chip:nth-child(1) { transform: rotate(-14deg); }
.chip:nth-child(2) { transform: rotate(-7deg); }
.chip:nth-child(3) { transform: rotate(2deg); }
.chip:nth-child(4) { transform: rotate(9deg); }
.chip:nth-child(5) { transform: rotate(15deg); }
.chips:hover .chip:nth-child(1) { transform: rotate(-20deg) translate(-6px,-3px); }
.chips:hover .chip:nth-child(2) { transform: rotate(-10deg) translate(-3px,-6px); }
.chips:hover .chip:nth-child(3) { transform: rotate(0deg) translateY(-8px) scale(1.12); }
.chips:hover .chip:nth-child(4) { transform: rotate(10deg) translate(3px,-6px); }
.chips:hover .chip:nth-child(5) { transform: rotate(20deg) translate(6px,-3px); }
.chip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px); background: var(--ink); color: var(--bg);
  font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.chip:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.chip:hover { box-shadow: 0 6px 14px rgba(0,0,0,.14); z-index: 2; }

/* ---------- notes ---------- */
.notes { margin-bottom: 96px; }
.notes h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; letter-spacing: .01em; }
.note-list { list-style: none; padding: 0; }
.note-row {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 12px; margin: 0 -12px; border-radius: 12px;
  text-decoration: none; transition: background .25s;
}
.note-row:hover { background: var(--hover-bg); }
.note-row:hover .note-title { color: var(--ink); }
.note-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); transition: color .25s; }
.note-row time { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.new-pill {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: var(--accent); background: var(--accent-bg);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
/* mini sketched-document thumbnail */
.thumb {
  flex: none; width: 46px; height: 46px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 2px 5px rgba(0,0,0,.07);
  display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 11px 10px;
  transform: rotate(var(--tilt, 6deg));
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.note-row:hover .thumb { transform: rotate(0deg) scale(1.1); }
.thumb i { display: block; height: 2px; border-radius: 2px; background: var(--ink-3); opacity: .55; }
.thumb i:nth-child(2) { width: 75%; } .thumb i:nth-child(3) { width: 55%; }
[data-theme="dark"] .thumb i { background: #8a857c; }

/* ---------- scrapbook board ---------- */
.board-outer { max-width: 1040px; margin: 0 auto 40px; padding: 0 24px; }
@media (max-width: 640px) { .board-outer { display: none; } }
.board {
  position: relative; height: 744px; border-radius: 24px;
  background: var(--bg-board);
  background-image: radial-gradient(rgba(0,0,0,.07) 1px, transparent 1.4px);
  background-size: 22px 22px;
  box-shadow: inset 0 0 90px rgba(60,50,40,.09);
  overflow: hidden; perspective: 900px; touch-action: none;
  transition: background .4s ease;
}
[data-theme="dark"] .board { background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1.4px); }

.card {
  position: absolute; margin: 0; padding: 8px 8px 10px;
  background: var(--card); border-radius: 6px;
  box-shadow: 0 10px 24px rgba(50,40,30,.16), 0 2px 6px rgba(50,40,30,.1);
  transform: rotate(var(--r, 0deg));
  transition: transform .5s cubic-bezier(.22,1,.36,1), filter .5s ease, box-shadow .4s;
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
  filter: blur(5px) saturate(.78) brightness(.94);
}
.card:hover, .card.dragging {
  filter: none; z-index: 50;
  transform: rotate(0deg) scale(1.07) perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  box-shadow: 0 22px 44px rgba(50,40,30,.22), 0 4px 10px rgba(50,40,30,.12);
}
.card.dragging { cursor: grabbing; transition: filter .3s; }
.card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 2px; pointer-events: none; }
.card figcaption {
  font-family: var(--serif); font-style: italic; font-size: 13px; color: #6e6a64;
  text-align: center; padding: 7px 2px 1px; pointer-events: none;
}
/* film grain */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background-image: var(--grain); opacity: .5; mix-blend-mode: overlay; pointer-events: none;
}
/* holographic sheen following cursor */
.sheen {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  transition: opacity .4s;
  background: conic-gradient(from 0deg at var(--mx, 50%) var(--my, 50%),
    rgba(242,174,208,0), rgba(242,174,208,.4), rgba(190,227,255,.4),
    rgba(255,236,190,.4), rgba(242,174,208,0));
  mix-blend-mode: soft-light;
}
.card:hover .sheen { opacity: 1; }
/* video cards */
.kind-video-circle { padding: 0; background: transparent; box-shadow: none; border-radius: 50%; }
.kind-video-circle::after { border-radius: 50%; }
.kind-video-circle video {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 50%;
  border: 6px solid var(--card); box-shadow: 0 10px 24px rgba(50,40,30,.16);
  pointer-events: none;
}
.kind-video video { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 2px; pointer-events: none; }
/* postage stamps */
.kind-stamp { padding: 10px; }
.kind-stamp::after { display: none; }
.stamp-inner { display: block; position: relative; background: var(--card); padding: 6px; }
.stamp-inner::before {
  content: ""; position: absolute; inset: 3px; border: 1.5px dashed #d8d2c8;
  pointer-events: none; z-index: 2;
}
.kind-stamp img { aspect-ratio: 2/3; filter: sepia(.28) contrast(1.02); }
.kind-stamp figcaption { font-size: 12px; }

/* ---------- mobile photo feed (board is desktop-only) ---------- */
.m-gallery { display: none; }
@media (max-width: 640px) {
  html, body { overflow-x: hidden; } /* rotated cards may poke past the edge */
  .m-gallery { display: block; padding: 4px 0 12px; }
  .m-gallery .card {
    position: relative; left: auto; top: auto;
    width: 76%; max-width: 300px; margin: 0 0 34px;
    cursor: default; touch-action: pan-y;
    transform: rotate(var(--r, 0deg));
    filter: blur(5px) saturate(.78) brightness(.94);
  }
  .m-gallery .card:nth-child(odd) { margin-left: 2%; margin-right: auto; }
  .m-gallery .card:nth-child(even) { margin-left: auto; margin-right: 2%; }
  .m-gallery .card.in-focus {
    filter: none; z-index: 2;
    transform: rotate(0deg) scale(1.04);
    box-shadow: 0 18px 38px rgba(50,40,30,.2), 0 4px 10px rgba(50,40,30,.12);
  }
  .m-gallery .card:hover { transform: rotate(var(--r, 0deg)); }
}

/* ---------- footer ---------- */
.site-foot { padding: 40px 0 72px; text-align: right; }
.signature {
  font-family: var(--hand); font-size: 30px; font-weight: 500;
  color: var(--accent); transform: rotate(-4deg); display: inline-block;
}
.foot-links { margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.foot-links a { color: var(--ink-3); text-decoration: none; margin: 0 2px; }
.foot-links a:hover { color: var(--ink); }
.foot-links .dot { margin: 0 6px; }

/* ---------- post pages ---------- */
.post { padding-bottom: 80px; }
.post-header { margin-bottom: 36px; }
.post-header h1 { font-size: 26px; font-weight: 600; line-height: 1.4; letter-spacing: .01em; }
.post-date { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); letter-spacing: .1em; }
.post-body { color: var(--ink); }
.post-body p + p, .post-body ul, .post-body ol { margin-top: 18px; }
.post-body p { color: var(--ink-2); }
.post-body h2, .post-body h3 { color: var(--ink); font-weight: 600; margin: 34px 0 12px; line-height: 1.5; }
.post-body h2 { font-size: 20px; } .post-body h3 { font-size: 17px; }
.post-body blockquote { border-left: 2px solid var(--line); padding-left: 18px; color: var(--ink-3); font-family: var(--serif); font-style: italic; font-size: 18px; margin: 26px 0; }
.post-body code { font-family: var(--mono); font-size: .86em; background: var(--hover-bg); padding: 2px 6px; border-radius: 6px; }
.post-body pre { background: var(--hover-bg); padding: 18px; border-radius: 12px; overflow-x: auto; margin-top: 20px; }
.post-body pre code { background: none; padding: 0; }
.post-body img { border-radius: 12px; margin: 24px 0; }
.post-footer { margin-top: 56px; }
.post-footer .back { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.post-footer .back:hover { color: var(--ink); }

/* ---------- entrance ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.stagger-1 { animation: rise .7s cubic-bezier(.22,1,.36,1) both; }
.stagger-2 { animation: rise .7s .09s cubic-bezier(.22,1,.36,1) both; }
.stagger-3 { animation: rise .7s .18s cubic-bezier(.22,1,.36,1) both; }
.stagger-5 { animation: rise .7s .3s cubic-bezier(.22,1,.36,1) both; }
.stagger-8 { animation: rise .7s .45s cubic-bezier(.22,1,.36,1) both; }
@media (prefers-reduced-motion: reduce) {
  .stagger-1, .stagger-2, .stagger-3, .stagger-5, .stagger-8 { animation: none; }
  .card { filter: none; }
}

/* ---------- 404 ---------- */
.nf { text-align: center; padding: 120px 24px; }
.nf h1 { font-family: var(--serif); font-style: italic; font-size: 64px; color: var(--ink-3); }
.nf p { color: var(--ink-2); margin: 16px 0 28px; }
.nf a { color: var(--ink); }
