/* === About === */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; gap: 56px; } }

.about-lede {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}
.about-body { font-size: 17px; line-height: 1.65; color: var(--fg-dim); margin-bottom: 20px; max-width: 56ch; }
.about-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }

.about-facts { display: flex; flex-direction: column; gap: 0; }
.fact-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.fact-k { color: var(--fg-mute); font-size: 11px; }
.fact-v { font-family: var(--serif); font-size: 20px; }

.fact-portrait { margin-top: 32px; }
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-2);
  cursor: none;
}
.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}
.portrait-anime {
  z-index: 1;
  filter: saturate(1.05) contrast(1.02);
}
/* water-ripple canvas reveals the real photo around the cursor */
.portrait-water {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
  /* mask follows the cursor; vars updated in JS */
  -webkit-mask-image: radial-gradient(circle var(--wr, 0px) at var(--wx, 50%) var(--wy, 50%), #000 68%, rgba(0,0,0,0.6) 86%, transparent 100%);
          mask-image: radial-gradient(circle var(--wr, 0px) at var(--wx, 50%) var(--wy, 50%), #000 68%, rgba(0,0,0,0.6) 86%, transparent 100%);
  transition: opacity 0.5s var(--ease-out), --wr 0.45s var(--ease-out);
}
.portrait-frame:hover .portrait-water { opacity: 1; }
.portrait-corner {
  position: absolute; top: 14px; right: 14px;
  z-index: 4;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.portrait-hint {
  position: absolute; bottom: 14px; left: 14px;
  z-index: 4;
  display: flex; align-items: center; gap: 8px;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  transition: opacity 0.4s;
}
.portrait-hint span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  animation: pulse 2s infinite;
}
.portrait-frame:hover .portrait-hint { opacity: 0; }

/* === Marquee === */
.marquee {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 24px 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  animation: scroll 40s linear infinite;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 40px);
  color: var(--fg-dim);
  font-style: italic;
}
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* === Section lede === */
.section-lede {
  font-size: 18px;
  color: var(--fg-dim);
  max-width: 50ch;
  margin: -32px 0 56px;
}

/* === Parallax stack scene === */
.ps-eyebrow {
  position: absolute;
  top: 48px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}
.ps-progress {
  position: absolute;
  right: 32px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 200px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.ps-progress-fill {
  width: 100%;
  background: var(--accent);
  transition: height 0.05s linear;
}

/* play hint flex */
.play-hint { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.play-modes { flex-wrap: wrap; }

/* === Timeline === */
.timeline { position: relative; padding-left: 200px; }
.timeline-rail {
  position: absolute;
  left: 200px;
  top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--line), var(--accent), var(--line));
}
.tl-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 56px;
  padding-left: 48px;
}
.tl-year {
  position: absolute;
  left: -200px; top: 4px;
  width: 160px;
  text-align: right;
  color: var(--fg-mute);
}
.tl-dot {
  position: absolute;
  left: -6px; top: 8px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 16px color-mix(in oklch, var(--accent) 60%, transparent);
}
.tl-card { padding-bottom: 8px; }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tl-role { font-family: var(--serif); font-size: 28px; }
.tl-where { color: var(--fg-mute); }
.tl-org { color: var(--accent); margin: 6px 0 12px; font-size: 12px; }
.tl-body { color: var(--fg-dim); max-width: 60ch; line-height: 1.6; }
@media (max-width: 720px) {
  .timeline { padding-left: 24px; }
  .timeline-rail { left: 24px; }
  .tl-year { position: relative; left: 0; top: 0; width: auto; text-align: left; margin-bottom: 6px; }
  .tl-row { padding-left: 28px; }
  .tl-dot { left: -6px; }
}

/* === Now widgets === */
.now-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(160px, auto);
  gap: 16px;
}
.now-cell { display: flex; }
.now-cell-clock { grid-column: span 2; }
.now-cell-spot { grid-column: span 3; }
.now-cell-gh { grid-column: span 4; }
.now-cell-focus { grid-column: span 3; }
.now-cell:nth-child(2) { grid-column: span 2; } /* weather */
.now-cell:nth-child(5) { grid-column: span 2; } /* reading */
@media (max-width: 880px) {
  .now-grid { grid-template-columns: repeat(2, 1fr); }
  .now-cell, .now-cell-clock, .now-cell-spot, .now-cell-gh, .now-cell-focus,
  .now-cell:nth-child(2), .now-cell:nth-child(5) { grid-column: span 2; }
}

.widget {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.3s, transform 0.3s;
}
.widget:hover { border-color: color-mix(in oklch, var(--fg) 18%, transparent); transform: translateY(-2px); }
.w-label { color: var(--fg-mute); font-size: 10px; }
.w-sub { color: var(--fg-mute); font-size: 10px; margin-top: auto; }
.clock-time { font-family: var(--serif); font-size: clamp(40px, 5vw, 56px); letter-spacing: -0.02em; line-height: 1; }
.weather-row { display: flex; align-items: baseline; gap: 12px; }
.weather-emoji { font-size: 36px; }
.weather-t { font-family: var(--serif); font-size: 44px; letter-spacing: -0.02em; }

.spot-head { display: flex; justify-content: space-between; align-items: center; }
.spot-bars { display: inline-flex; gap: 3px; align-items: flex-end; height: 14px; }
.spot-bars span {
  width: 3px; background: var(--accent);
  animation: bars 0.9s ease-in-out infinite;
}
.spot-bars span:nth-child(1) { animation-delay: 0s; height: 60%; }
.spot-bars span:nth-child(2) { animation-delay: 0.2s; height: 100%; }
.spot-bars span:nth-child(3) { animation-delay: 0.1s; height: 40%; }
.spot-bars span:nth-child(4) { animation-delay: 0.3s; height: 80%; }
@keyframes bars { 0%,100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
.spot-track { font-family: var(--serif); font-size: 22px; }
.spot-artist { color: var(--fg-dim); font-size: 13px; }
.spot-bar { height: 2px; background: var(--line); border-radius: 2px; margin: 8px 0; overflow: hidden; }
.spot-fill { height: 100%; background: var(--accent); transition: width 0.2s linear; }
.spot-foot { display: flex; justify-content: space-between; }

.gh-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 2px;
  margin: 8px 0;
  grid-auto-flow: column;
}
.gh-cell { width: 100%; aspect-ratio: 1; border-radius: 2px; background: var(--line); }
.gh-l1 { background: color-mix(in oklch, var(--accent) 25%, var(--bg-2)); }
.gh-l2 { background: color-mix(in oklch, var(--accent) 50%, var(--bg-2)); }
.gh-l3 { background: color-mix(in oklch, var(--accent) 75%, var(--bg-2)); }
.gh-l4 { background: var(--accent); }
.gh-foot { display: flex; justify-content: space-between; align-items: center; }
.gh-legend { display: inline-flex; gap: 2px; }
.gh-legend .gh-cell { width: 10px; height: 10px; }

.book-row { display: flex; gap: 14px; align-items: center; }
.book-cover {
  width: 56px; height: 80px;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent) 60%, var(--accent-2)));
  border-radius: 4px;
  display: grid; place-items: center;
  font-size: 28px;
  box-shadow: 4px 4px 0 var(--line);
}
.book-title { font-family: var(--serif); font-size: 18px; }
.book-author { color: var(--fg-dim); font-size: 13px; }
.book-progress { color: var(--fg-mute); font-size: 10px; margin-top: 4px; }

.focus-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.focus-item { font-size: 14px; color: var(--fg); display: flex; gap: 10px; }
.focus-bullet { color: var(--accent); font-family: var(--mono); }

/* === Playground === */
.play-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  position: relative;
}
.play-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.play-modes { display: flex; gap: 6px; }
.play-mode {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: none;
  transition: all 0.2s;
}
.play-mode.on { border-color: var(--accent); color: var(--fg); background: color-mix(in oklch, var(--accent) 10%, transparent); }
.play-count { display: flex; align-items: center; gap: 12px; color: var(--fg-mute); font-size: 11px; }
.play-count input[type="range"] { width: 140px; accent-color: var(--accent); cursor: none; }
.play-count-num { color: var(--fg); }
.play-canvas {
  width: 100%;
  height: 480px;
  border-radius: 10px;
  background: var(--bg);
  display: block;
  cursor: none;
}
.play-hint { margin-top: 10px; color: var(--fg-mute); font-size: 10px; }

/* === Guestbook === */
.gb-form {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gb-input, .gb-textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  cursor: none;
  resize: none;
  transition: border-color 0.2s;
}
.gb-input:focus, .gb-textarea:focus { border-color: var(--accent); }
.gb-foot { display: flex; justify-content: space-between; align-items: center; }
.gb-count { color: var(--fg-mute); font-size: 10px; }
.gb-submit {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: none;
  transition: all 0.2s;
}
.gb-submit:disabled { opacity: 0.4; }
.gb-submit:not(:disabled):hover { transform: translateX(2px); }

.gb-list { display: flex; flex-direction: column; gap: 14px; }
.gb-entry {
  border-left: 2px solid var(--line);
  padding: 4px 16px 4px 18px;
  transition: border-color 0.3s;
}
.gb-entry:hover { border-left-color: var(--accent); }
.gb-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.gb-name { font-family: var(--serif); font-size: 18px; }
.gb-time { color: var(--fg-mute); font-size: 10px; }
.gb-msg { color: var(--fg-dim); font-size: 15px; line-height: 1.5; }

/* === Contact === */
#contact { padding: 160px 0 120px; }
.contact-card { text-align: center; }
.contact-eyebrow { justify-content: center; margin-bottom: 24px; }
.contact-h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin: 0 auto 56px;
}

.contact-actions { display: flex; justify-content: center; margin-bottom: 56px; }
.email-btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 16px 24px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  cursor: none;
  transition: all 0.3s;
  will-change: transform;
}
.email-btn:hover { border-color: var(--accent); background: var(--bg); }
.email-text { color: var(--fg); }
.email-cta { color: var(--accent); font-size: 11px; letter-spacing: 0.12em; }

.contact-links {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 720px;
  margin: 0 auto;
}
.contact-link {
  flex: 1;
  min-width: 160px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  border-right: 1px solid var(--line);
  transition: color 0.2s, background 0.2s;
  will-change: transform;
}
.contact-link:last-child { border-right: none; }
.contact-link:hover { color: var(--fg); background: color-mix(in oklch, var(--accent) 8%, transparent); }
.contact-link-arrow { transition: transform 0.2s; }
.contact-link:hover .contact-link-arrow { transform: translate(2px, -2px); }
@media (max-width: 720px) {
  .contact-link { min-width: 50%; border-right: none; border-bottom: 1px solid var(--line); }
}
