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

:root {
  --ink:   #0a0a0a;
  --muted: #999;
  --faint: #eee;
  --max:   620px;
  --side:  24px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: #fff;
  color: var(--ink);
  font-family: "Geist", system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (pointer: coarse) {
  body { cursor: auto; }
}

/* Hide default cursor only on clickable elements — body keeps text cursor */
a, button, .post, .nav-filter, .logo, .back, .back-link {
  cursor: none;
}

@media (pointer: coarse) {
  a, button, .post, .nav-filter, .logo, .back, .back-link {
    cursor: pointer;
  }
}

/* ── Text selection ───────────────────────────────────────── */
::selection {
  background: var(--ink);
  color: #fff;
}

/* ── Cursor ───────────────────────────────────────────────── */
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  margin-top: -2.5px;
  margin-left: -2.5px;
  transition: opacity 0.2s ease, transform 0.05s ease, width 0.15s ease, height 0.15s ease;
  will-change: transform;
}

#cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(10, 10, 10, 0.25);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  margin-top: -14px;
  margin-left: -14px;
  transition:
    opacity 0.2s ease,
    width 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease;
  will-change: transform;
}

#cursor.is-visible    { opacity: 1; }
#cursor-ring.is-visible { opacity: 1; }

/* Hover state — ring grows, dot hides */
#cursor-ring.is-hover {
  width: 44px;
  height: 44px;
  margin-top: -22px;
  margin-left: -22px;
  border-color: rgba(10, 10, 10, 0.15);
}

#cursor.is-hover { opacity: 0; }

/* Click state — ring shrinks tight */
#cursor-ring.is-down {
  width: 18px;
  height: 18px;
  margin-top: -9px;
  margin-left: -9px;
  border-color: rgba(10, 10, 10, 0.5);
}

#cursor.is-down {
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  margin-left: -3.5px;
}

.header,
.about,
.posts-label,
.main,
.footer {
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--side);
  padding-right: var(--side);
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 52px;
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--side);
  padding-right: var(--side);
}

.logo {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: opacity 0.2s ease;
  text-transform: lowercase;
  cursor: none;
}
.logo:hover { opacity: 0.45; }

@media (pointer: coarse) {
  .logo { cursor: pointer; }
}

/* ── Sticky nav ───────────────────────────────────────────── */
.nav-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-sticky.is-stuck {
  border-bottom-color: var(--faint);
  box-shadow: 0 1px 0 var(--faint);
}

.nav-inner {
  display: flex;
  gap: 2px;
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding: 10px var(--side);
}

.nav-filter {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  cursor: none;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-filter:hover { color: var(--ink); background: var(--faint); }
.nav-filter.is-active { color: var(--ink); font-weight: 500; }

@media (pointer: coarse) {
  .nav-filter { cursor: pointer; }
}

/* ── About ────────────────────────────────────────────────── */
.about {
  padding-top: 52px;
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.35s ease;
  max-height: 2000px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
}

.about.is-hidden {
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  padding-top: 0;
}

.about-bio {
  font-size: 14px;
  line-height: 1.7;
  color: #000000;
  font-weight: 400;
  margin-bottom: 14px;
  text-transform: lowercase;
}

/* Regular text light, bold terms dark */
.about-bio--mixed {
  color: #b1b1b1;
}
.about-bio--mixed strong {
  color: #000000;
  font-weight: 400;
}

/* Muted paragraph — all light except "life." */
.about-bio--muted {
  color: #b1b1b1;
}
.about-bio--muted strong {
  color: #000000;
  font-weight: 400;
}

/* Blurred redacted pill */
.redacted {
  display: inline-block;
  background: rgba(175, 175, 175, 0.18);
  border-radius: 4px;
  padding: 1px 6px;
  color: #afafaf;
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
}

/* Image grid — full height, no fixed aspect ratio */
.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 28px;
  height: 320px;
}

.about-img-wrap {
  overflow: hidden;
  border-radius: 3px;
  background: var(--faint);
  height: 100%;
}

.about-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.about-img-wrap:hover .about-img { transform: scale(1.04); }

.about-quote {
  margin-top: 20px;
  text-align: center;
}
.about-quote-jp {
  font-size: 13px;
  color: black;
  line-height: 1.8;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.about-quote-en {
  font-size: 12px;
  color: #bbb;
  line-height: 1.6;
}

.about-since {
  font-size: 11px;
  color: #ccc;
  margin-top: 14px;
}

/* ── Posts label ──────────────────────────────────────────── */
.posts-label {
  font-size: 11px;
  color: #ccc;
  letter-spacing: 0.04em;
  padding-top: 44px;
  padding-bottom: 0;
}

/* ── Main / post list ─────────────────────────────────────── */
.main {
  flex: 1;
  padding-top: 16px;
  padding-bottom: 80px;
}

.state {
  font-size: 13px;
  color: var(--muted);
  padding: 20px 0;
}

.post {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 24px 0;
  border-top: 1px solid var(--faint);
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.4s ease forwards;
  animation-delay: calc(var(--i, 0) * 55ms);
  transition: opacity 0.2s ease;
}
.post:last-child { border-bottom: 1px solid var(--faint); }
.post:hover { opacity: 0.55; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.post-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  margin-bottom: 14px;
}

.post-eyebrow {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  text-transform: lowercase;
}

.post-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 6px;
  text-transform: lowercase;
}

.post-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  text-transform: lowercase;
}

/* ── Article page ─────────────────────────────────────────── */
.is-post .main {
  padding-top: 48px;
}

.back {
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  transition: color 0.15s ease, transform 0.2s ease;
}
.back:hover { color: var(--ink); transform: translateX(-3px); }

.article { animation: rise 0.4s ease forwards; }

.article-head { margin-bottom: 32px; }

.article-title {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 10px 0 12px;
  text-transform: lowercase;
}

.article-lede {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  text-transform: lowercase;
}

.article-cover {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  margin-bottom: 44px;
}

/* ── Article body ─────────────────────────────────────────── */
.article-body {
  font-size: 15px;
  line-height: 1.78;
  color: #1a1a1a;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
  margin: 40px 0 12px;
}
.article-body h1 { font-size: 20px; }
.article-body h2 { font-size: 17px; }
.article-body h3 { font-size: 15px; }
.article-body h4 { font-size: 13px; color: var(--muted); }

.article-body p { margin-bottom: 20px; }

.article-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #ccc;
  transition: text-decoration-color 0.15s ease;
}
.article-body a:hover { text-decoration-color: var(--ink); }

.article-body strong { font-weight: 600; }
.article-body em { color: #555; font-style: italic; }

.article-body blockquote {
  border-left: 2px solid var(--faint);
  padding: 2px 0 2px 18px;
  color: var(--muted);
  font-style: italic;
  margin: 24px 0;
}
.article-body blockquote p { margin-bottom: 0; }

.article-body ul,
.article-body ol {
  padding-left: 18px;
  margin-bottom: 20px;
}
.article-body li { margin-bottom: 5px; }

.article-body code {
  font-family: monospace;
  font-size: 12px;
  background: #f5f5f5;
  border-radius: 3px;
  padding: 2px 5px;
}

.article-body pre {
  background: #f5f5f5;
  border-radius: 5px;
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 20px;
}
.article-body pre code { background: none; padding: 0; }

.article-body img {
  width: 100%;
  height: auto;
  border-radius: 3px;
  display: block;
  margin: 24px 0;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--faint);
  margin: 32px 0;
}

.article-foot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--faint);
}

.back-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  transition: color 0.15s ease, transform 0.2s ease;
}
.back-link:hover { color: var(--ink); transform: translateX(-3px); }

.post-err {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 40px;
}
.post-err p { font-size: 13px; color: var(--muted); }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  padding-top: 20px;
  padding-bottom: 40px;
  font-size: 11px;
  color: #ccc;
}
.footer a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer a:hover { color: var(--ink); }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header { padding-top: 36px; }

  .about-grid {
    grid-template-columns: repeat(2, 1fr);
    height: 480px;
  }

  .article-title { font-size: 20px; }
}