:root {
  --bg: #fdfdfc;
  --text: #1a1a1c;
  --text-muted: #666;
  --pink: #f5a9b8;
  --blue: #5bcefa;
  --border: #eaeaea;
  --nav-height: 48px;
}

#about, #ramblings, #music-section, #work, #projects, #photos {
  position: relative;
  scroll-margin-top: 64px;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  position: relative;
}

html:not(.soft-select) ::selection {
  background: rgba(245, 169, 184, 0.4);
  color: var(--text);
}

html.soft-select ::selection {
  background: transparent;
}

html.soft-select input:not([type=text], [type=search], [type=url], [type=tel])::selection,
html.soft-select textarea::selection {
  background: rgba(245, 169, 184, 0.4);
}

.selection-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  --sel-pink: #fcd9e1;
  --sel-blue: #d3effc;
}

.selection-defs .stop-pink { stop-color: var(--sel-pink); }
.selection-defs .stop-blue { stop-color: var(--sel-blue); }

.selection-blob {
  position: absolute;
  overflow: visible;
  pointer-events: none;
  z-index: 999;
  mix-blend-mode: multiply;
}

.selection-blob:not(.on) {
  display: none;
}

html.dark .selection-defs {
  --sel-pink: #66404a;
  --sel-blue: #1e4a5e;
}

html.dark .selection-blob {
  mix-blend-mode: screen;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .selection-defs {
    --sel-pink: #66404a;
    --sel-blue: #1e4a5e;
  }

  :root:not(.light) .selection-blob {
    mix-blend-mode: screen;
  }
}

@media print {
  .selection-blob { display: none; }
}

/* Top Hero Section */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 900px;
  width: 100%;
  height: 100vh;
  padding: 2rem;
  box-sizing: border-box;
  position: relative;
}

.photo-wrapper {
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(10px) rotate(1deg);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.photo-wrapper.reveal {
  opacity: 1;
  transform: none;
}

.photo-stack {
  position: relative;
  height: clamp(220px, 45vh, 350px);
  aspect-ratio: 3/4;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.1);
  transform: rotate(-2deg);
  background: #141015;
  user-select: none;
}

.photo-doodles,
.photo-drift {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.photo-drift {
  height: 200%;
  animation: doodle-drift 60s linear infinite;
}

.photo-stack img {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  object-fit: cover;
}

.photo-drift .tw { animation: doodle-pulse 2.4s ease-in-out infinite; }
.photo-doodles .ring { animation: doodle-pulse 4s ease-in-out infinite; }
.photo-doodles .ht { animation: doodle-pulse 3s ease-in-out infinite; }

.photo-fx span {
  position: absolute;
  bottom: -24px;
  color: #f59ec0;
  text-shadow: 0 0 8px rgba(245,158,192,0.6);
  animation: photo-float linear infinite;
}

@keyframes doodle-drift {
  to { transform: translateY(-50%); }
}

@keyframes doodle-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes photo-float {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.9; }
  85% { opacity: 0.9; }
  100% { transform: translateY(-400px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-drift, .photo-fx span { animation: none; }
}

.content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1 {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  margin: 0 0 0.2rem 0;
  line-height: 1.1;
}

.subtitle {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: clamp(0.75rem, 1vw, 0.85rem);
  color: var(--text-muted);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.subtitle .pronouns {
  color: var(--text-muted);
}

#subtitle-fade {
  opacity: 0;
}

#subtitle-fade.animate {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.links {
  padding: 0;
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 500;
  font-size: clamp(0.9rem, 1.2vh, 1rem);
}

.links br {
  display: block;
  content: '';
  margin-top: 0.4rem;
}

.links a {
  color: var(--text);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 1.5rem;
}

.links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--pink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  .links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }
}

.links a:nth-of-type(2)::after { background: var(--blue); }
.links a:nth-of-type(3)::after { background: var(--text); }
.links a:nth-of-type(4)::after { background: var(--text); }

.links svg {
  opacity: 0.7;
  transition: opacity 0.2s;
}

@media (hover: hover) {
  .links a:hover svg {
    opacity: 1;
  }
}

@keyframes scrollDownIn {
  from { transform: translateX(-50%) translateY(40px); }
  to { transform: translateX(-50%) translateY(0); }
}

.scroll-down {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0;
}

.scroll-down.animate-in {
  animation: scrollDownIn 0.5s ease-out forwards;
  opacity: 1;
}

/* Page Content below Hero */
.page-content {
  position: relative;
  width: 100%;
  max-width: 800px;
  padding: 2rem 2rem 4rem 2rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.section-title {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  background: linear-gradient(to right, var(--border), var(--border) 30%, transparent) bottom / 100% 1px no-repeat;
}

/* About text */
.about-text {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
}

.about-text p {
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* Tech Stack Tags */
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.stack-tag {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  background: #f0f0f0;
  border-radius: 4px;
  color: var(--text);
}

.stack-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.8rem;
  padding: calc(0.2rem - 1px) 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  text-decoration: none;
  user-select: none;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .stack-link:hover {
    color: var(--text);
    border-color: var(--pink);
  }
}

.stack-link:focus-visible {
  outline: none;
  color: var(--text);
  border-color: var(--pink);
}

/* Work items */
.work {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.work-item {
  position: relative;
}

.work-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.work-item strong {
  font-family: ui-serif, 'Georgia', serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
}

.work-item .meta {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.project-shot,
.gallery-item,
.blog-post-img {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  outline: none;
  touch-action: none;
  user-select: none;
}

.lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-img {
  position: fixed;
  transform-origin: 0 0;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
  -webkit-user-drag: none;
}

.lightbox-bar {
  position: fixed;
  top: 16px;
  right: 16px;
  display: none;
  gap: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .lightbox-bar {
    display: flex;
  }
}

.lightbox-bar button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(24, 24, 24, 0.72);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}

.lightbox-bar button:hover:not(:disabled) {
  background: rgba(48, 48, 48, 0.9);
}

.lightbox-bar button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(245, 169, 184, 0.8);
}

.lightbox-bar button:disabled {
  opacity: 0.35;
  cursor: default;
}

.lightbox-img.zoomed {
  cursor: grab;
}

.lightbox-img.panning {
  cursor: grabbing;
}

.lightbox-scrim {
  cursor: zoom-out;
}

.project-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.project-text {
  flex: 1;
  min-width: 0;
}

.project-shot {
  flex: 0 0 260px;
  display: block;
  line-height: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.project-shot img {
  width: 100%;
  height: auto;
}

@media (hover: hover) {
  .project-shot:hover {
    border-color: var(--pink);
  }
}

@media (max-width: 800px) {
  .project-item {
    flex-direction: column;
    gap: 1rem;
  }

  .project-shot {
    flex-basis: auto;
    width: 100%;
  }
}

.work-item span.desc {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  display: block;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.date-group {
  margin-bottom: 2rem;
}

.date-header {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  user-select: none;
}

.daily-vibe {
  font-size: 0.8rem;
  color: var(--text);
  font-style: italic;
}

.blog-post {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.blog-post:last-of-type {
  margin-bottom: 0;
}

.blog-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  user-select: none;
  pointer-events: none;
}

.blog-content-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.blog-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  user-select: none;
}

.blog-time {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-text {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.blog-post.is-summary .blog-text {
  font-style: italic;
  color: var(--text-muted);
}

/* Reactions */
.reaction-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  align-items: center;
  user-select: none;
}

.reaction-btn {
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
  user-select: none;
  color: var(--text);
  height: 24px;
  box-sizing: border-box;
}

@media (hover: hover) {
  .reaction-btn:hover {
    background: rgba(127, 127, 127, 0.2);
  }
}

.reaction-btn.active {
  background: rgba(245, 169, 184, 0.2);
  border-color: rgba(245, 169, 184, 0.4);
}

.reaction-btn.active .count {
  color: var(--pink);
}

.reaction-btn .count {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.add-reaction-btn {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  position: relative;
  height: 24px;
  box-sizing: border-box;
  user-select: none;
}

.add-reaction-btn.open {
  opacity: 1;
}

@media (hover: hover) {
  .blog-post:hover .add-reaction-btn {
    opacity: 1;
  }
}

@media (hover: none) {
  .reaction-container,
  .gallery-reaction-overlay,
  .add-reaction-btn {
    opacity: 1 !important;
  }
}

@media (hover: hover) {
  .add-reaction-btn:hover {
    background: rgba(0, 0, 0, 0.05);
  }
}

.add-reaction-btn svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.tw {
  position: relative;
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  line-height: 1.15em;
  text-align: center;
  vertical-align: -0.2em;
}

.tw img {
  position: absolute;
  top: 0.05em;
  left: 0.05em;
  width: 1.05em;
  height: 1.05em;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.tw > span {
  transition: opacity 0.15s ease;
}

.tw.ok img {
  opacity: 1;
}

.tw.ok > span {
  opacity: 0;
}

.ep-root[hidden],
.ep-root [hidden] {
  display: none !important;
}

.ep-scrim {
  display: none;
}

.ep {
  --ep-bg: rgba(255, 255, 255, 0.98);
  --ep-line: #ececea;
  --ep-hover: rgba(0, 0, 0, 0.05);
  --ep-field: rgba(0, 0, 0, 0.045);
  position: absolute;
  z-index: 999;
  width: 344px;
  display: flex;
  flex-direction: column;
  background: var(--ep-bg);
  border: 1px solid var(--ep-line);
  border-radius: 14px;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  user-select: none;
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
}

html.dark .ep {
  --ep-bg: rgba(27, 27, 27, 0.98);
  --ep-line: #2c2c2c;
  --ep-hover: rgba(255, 255, 255, 0.07);
  --ep-field: rgba(255, 255, 255, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .ep {
    --ep-bg: rgba(27, 27, 27, 0.98);
    --ep-line: #2c2c2c;
    --ep-hover: rgba(255, 255, 255, 0.07);
    --ep-field: rgba(255, 255, 255, 0.06);
  }
}

.ep-head {
  padding: 10px 10px 0;
  border-bottom: 1px solid var(--ep-line);
}

.ep-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--ep-field);
  color: var(--text-muted);
  cursor: text;
  transition: box-shadow 0.15s;
}

.ep-search:focus-within {
  box-shadow: inset 0 0 0 1.5px rgba(245, 169, 184, 0.7);
}

.ep-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
}

.ep-search input::-webkit-search-cancel-button {
  display: none;
}

.ep-tabs {
  position: relative;
  display: flex;
  margin-top: 6px;
  transition: opacity 0.15s;
}

.ep-tabs.dim {
  opacity: 0.5;
}

.ep-tab,
.ep-e,
.ep-big {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', system-ui, sans-serif;
}

.ep-tab {
  flex: 1;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 1.02rem;
  line-height: 1;
  cursor: pointer;
  filter: grayscale(1);
  opacity: 0.5;
  transition: opacity 0.15s, filter 0.15s, background 0.15s;
}

@media (hover: hover) {
  .ep-tab:hover {
    opacity: 0.9;
    background: var(--ep-hover);
  }
}

.ep-tab.on {
  filter: none;
  opacity: 1;
}

.ep-bar {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: var(--pink);
  transition: transform 0.25s ease-out;
}

.ep-body {
  position: relative;
  box-sizing: border-box;
  height: 296px;
  padding: 0 8px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--ep-line) transparent;
}

.ep-body h4 {
  margin: 0;
  padding: 10px 6px 6px;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.ep-found .ep-grid {
  padding-top: 8px;
}

.ep-e {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}

.ep-e:focus-visible {
  background: var(--ep-hover);
  outline: none;
  transform: scale(1.1);
}

@media (hover: hover) {
  .ep-e:hover {
    background: var(--ep-hover);
    outline: none;
    transform: scale(1.1);
  }
}

.ep-e:active {
  transform: scale(0.92);
}

.ep-e.on {
  background: rgba(245, 169, 184, 0.2);
  box-shadow: inset 0 0 0 1.5px rgba(245, 169, 184, 0.75);
}

.ep-found p {
  margin: 28px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ep-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  border-top: 1px solid var(--ep-line);
}

.ep-big {
  font-size: 1.6rem;
  line-height: 1;
}

.ep-name {
  overflow: hidden;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 500px) {
  .ep-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.35);
  }

  .ep {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    width: auto;
    padding-bottom: env(safe-area-inset-bottom);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }

  .ep-scrim,
  .ep-head {
    touch-action: none;
  }

  .ep-head::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    margin: -2px auto 8px;
    border-radius: 2px;
    background: var(--ep-line);
  }

  .ep-body {
    height: min(50vh, 400px);
  }

  .ep-foot {
    display: none;
  }
}

.post-link {
  color: var(--blue);
  text-decoration: none;
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.post-link:focus-visible {
  background-color: rgba(91, 206, 250, 0.16);
  box-shadow: 0 0 0 2px rgba(91, 206, 250, 0.16);
  outline: none;
}

@media (hover: hover) {
  .post-link:hover {
    background-color: rgba(91, 206, 250, 0.16);
    box-shadow: 0 0 0 2px rgba(91, 206, 250, 0.16);
    outline: none;
  }
}

.blog-post-img {
  max-height: 400px;
  max-width: min(100%, 400px);
  height: auto;
  border-radius: 8px;
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  align-self: flex-start;
  user-select: none;
}

/* Admin UI */
.admin-controls {
  display: none;
  gap: 0.5rem;
  margin-left: auto;
}

.admin-btn {
  background: rgba(255,0,0,0.1);
  color: red;
  border: none;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

@media (hover: hover) {
  .admin-btn:hover { background: rgba(255,0,0,0.2); }
}

/* Pagination */
.load-more-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 0 auto;
  display: block;
  transition: all 0.2s;
}

@media (hover: hover) {
  .load-more-btn:hover {
    background: rgba(0,0,0,0.02);
    color: var(--text);
  }
}

.yt-card {
  container-type: inline-size;
  position: relative;
  max-width: 400px;
  width: 100%;
  aspect-ratio: 16/9;
  margin-top: 0.8rem;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.yt-card.playing {
  max-width: 560px;
}

.yt-card.nsfw .yt-thumb {
  filter: blur(4.5cqw);
}

.yt-card.nsfw .yt-play-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.nsfw-overlay {
  cursor: pointer;
}

.nsfw-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  user-select: none;
  pointer-events: none;
}

.nsfw-icon {
  font-size: 2rem;
}

.nsfw-text {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nsfw-sub {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.legal-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
}

.legal-popup-overlay .legal-popup {
  margin: auto;
}

.legal-popup-overlay.closing {
  opacity: 0;
  transition: opacity 0.2s;
}

.legal-popup {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  position: relative;
}

.legal-popup-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
}

@media (hover: hover) {
  .legal-popup-close:hover {
    background: rgba(0, 0, 0, 0.04);
  }
}

.legal-popup h2 {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--text);
  padding-right: 2rem;
}

.legal-popup h3 {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem 0;
  color: var(--text);
}

.legal-popup p {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 0.5rem 0;
}

.legal-popup a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.yt-thumb-wrapper {
  border-radius: inherit;
  position: absolute;
  inset: 0;
  cursor: pointer;
  overflow: hidden;
}

.yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-play-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.1);
  display: grid;
  grid-template-rows: 56.25cqw;
  place-items: center;
  transition: background 0.3s, opacity 0.25s;
}

@media (hover: hover) {
  .yt-card:hover .yt-play-overlay {
    background: rgba(0,0,0,0.2);
  }
}

.yt-play-btn {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.yt-play-btn svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

@media (hover: hover) {
  .yt-play-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.6);
  }
}

.yt-buttons {
  padding: 0.6rem 0.8rem;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}

.yt-btn {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (hover: hover) {
  .yt-btn:hover {
    color: var(--blue);
  }
}

.yt-btn::before {
  content: '▶';
  font-size: 0.6rem;
}

/* Gallery Enhancements */
.gallery-container {
  columns: 3 240px;
  column-gap: 1.5rem;
  margin-top: 1rem;
}

.gallery-item {
  position: relative;
  break-inside: avoid;
  margin-bottom: 1.5rem;
  display: inline-block;
  width: 100%;
  z-index: 1;
}

@media (hover: hover) {
  .gallery-item:hover {
    z-index: 2;
  }
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  transition: filter 0.3s ease;
  pointer-events: none;
}

.gallery-reaction-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem 1rem 1rem;
  background: none;
  opacity: 1;
  pointer-events: none;
  z-index: 10;
}

.gallery-reaction-overlay .reaction-container {
  pointer-events: auto;
  justify-content: flex-end;
}

.gallery-reaction-overlay .reaction-btn {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.gallery-reaction-overlay .reaction-btn .count {
  color: rgba(255, 255, 255, 0.9);
}

.gallery-reaction-overlay .add-reaction-btn {
  opacity: 0 !important;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.gallery-reaction-overlay .add-reaction-btn.open {
  opacity: 1 !important;
}

@media (hover: hover) {
  .gallery-item:hover .add-reaction-btn {
    opacity: 1 !important;
  }

  .gallery-item:hover .gallery-reaction-overlay .reaction-btn {
    opacity: 1;
  }
}

.gallery-reaction-overlay .add-reaction-btn svg {
  color: #fff;
}

@media (hover: hover) {
  .gallery-reaction-overlay .reaction-btn:hover,
  .gallery-reaction-overlay .add-reaction-btn:hover {
    background: rgba(0, 0, 0, 0.75);
  }
}

.gallery-reaction-overlay .reaction-btn.active {
  background: rgba(245, 169, 184, 0.65);
  border-color: rgba(245, 169, 184, 0.5);
}

.gallery-reaction-overlay .reaction-btn.active .count {
  color: #fff;
}

@media (hover: none) {
  .gallery-reaction-overlay .add-reaction-btn {
    opacity: 1 !important;
  }

  .gallery-reaction-overlay .reaction-btn {
    opacity: 1;
  }
}

#music-section,
#projects {
  --chip: rgba(0, 0, 0, 0.04);
  --chip-hover: rgba(0, 0, 0, 0.07);
  --chip-strong: rgba(0, 0, 0, 0.07);
  --chip-on: rgba(245, 169, 184, 0.22);
  --act-0: #ededec;
  --act-dot: #d9d9d7;
  --act-1: #fad4dc;
  --act-2: #f5a9b8;
  --act-3: #e57d94;
  --act-4: #c9536f;
  --tip: #1a1a1c;
  --tip-text: #fdfdfc;
}

html.dark #music-section,
html.dark #projects {
  --tip: #333;
  --tip-text: #e0e0e0;
  --chip: rgba(255, 255, 255, 0.05);
  --chip-hover: rgba(255, 255, 255, 0.09);
  --chip-strong: rgba(255, 255, 255, 0.1);
  --chip-on: rgba(245, 169, 184, 0.14);
  --act-0: #222;
  --act-dot: #363636;
  --act-1: #5a2f39;
  --act-2: #8a4556;
  --act-3: #c26a7f;
  --act-4: #f5a9b8;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) #music-section,
  :root:not(.light) #projects {
    --tip: #333;
    --tip-text: #e0e0e0;
    --chip: rgba(255, 255, 255, 0.05);
    --chip-hover: rgba(255, 255, 255, 0.09);
    --chip-strong: rgba(255, 255, 255, 0.1);
    --chip-on: rgba(245, 169, 184, 0.14);
    --act-0: #222;
    --act-dot: #363636;
    --act-1: #5a2f39;
    --act-2: #8a4556;
    --act-3: #c26a7f;
    --act-4: #f5a9b8;
  }
}

.music-activity {
  --cell: 11px;
  --gap: 3px;
  --days: 32px;
  position: relative;
  margin-bottom: 1.75rem;
  user-select: none;
}

.activity-body {
  width: max-content;
  max-width: 100%;
}

.activity-plot {
  display: grid;
  grid-template-columns: var(--days) auto;
  justify-content: start;
}

.activity-months,
.activity-days,
.activity-legend {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.activity-months {
  grid-column: 2;
  position: relative;
  height: 1.1rem;
}

.activity-months span {
  position: absolute;
  left: calc(var(--w) * (var(--cell) + var(--gap)));
}

.activity-days {
  display: grid;
  grid-template-rows: repeat(3, calc(2 * (var(--cell) + var(--gap))));
  line-height: var(--cell);
}

.activity-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--cell));
  grid-auto-columns: var(--cell);
  gap: var(--gap);
}

.activity-grid i,
.activity-legend i {
  display: block;
  width: var(--cell);
  height: var(--cell);
  border-radius: 3px;
  background: var(--act-0);
}

.activity-grid i.off {
  background: radial-gradient(circle, var(--act-dot) 1.5px, transparent 2px);
}

[data-l="1"] { --act-0: var(--act-1); }
[data-l="2"] { --act-0: var(--act-2); }
[data-l="3"] { --act-0: var(--act-3); }
[data-l="4"] { --act-0: var(--act-4); }

.activity-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gap);
  margin-top: 0.6rem;
}

.activity-legend i:first-of-type {
  margin-left: 0.3rem;
}

.activity-legend i:last-of-type {
  margin-right: 0.3rem;
}

.activity-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: var(--tip);
  color: var(--tip-text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.activity-tip.on {
  opacity: 1;
}

.activity-tip span {
  display: block;
  opacity: 0.7;
}

.activity-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: var(--x);
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: var(--tip);
}

@media (max-width: 800px) {
  .music-activity {
    --cell: 10px;
    --days: 30px;
  }
}

.music-filters {
  margin-bottom: 1rem;
}

.artist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.artist-filter-btn,
.artist-more-btn,
.artist-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  border: 1.5px solid transparent;
  background: var(--chip);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.artist-filter-btn,
.artist-more-btn {
  height: 40px;
  padding: 0 12px 0 4px;
  border-radius: 20px;
}

.artist-filter-btn[hidden],
.artist-more-btn[hidden],
.artist-row[hidden] {
  display: none;
}

@media (hover: hover) {
  .artist-filter-btn:hover,
  .artist-row:hover {
    background: var(--chip-hover);
  }
}

.artist-filter-btn.active,
.artist-row.active {
  border-color: var(--pink);
  background: var(--chip-on);
}

.artist-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--chip-strong);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.artist-avatar::before {
  content: attr(data-i);
}

.artist-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s;
}

.artist-avatar img.loaded {
  opacity: 1;
}

.artist-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-count {
  position: relative;
  min-width: 1.1rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.15s;
}

.artist-filter-btn.active .artist-count {
  color: transparent;
}

.artist-filter-btn .artist-count::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2L2 8' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2L2 8' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  opacity: 0;
  transition: opacity 0.15s;
}

.artist-filter-btn.active .artist-count::after {
  opacity: 1;
}

.artist-more-btn {
  padding: 0 12px 0 16px;
  justify-content: center;
  background: var(--chip-strong);
  color: var(--text);
}

@media (hover: hover) {
  .artist-more-btn:hover {
    background: var(--chip-hover);
  }
}

.artist-more-btn svg {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.music-filters.open .artist-more-btn svg {
  transform: rotate(180deg);
}

.artist-panel {
  overflow: hidden;
}

.artist-panel-inner {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.artist-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  cursor: text;
}

.artist-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
}

.artist-search input::placeholder {
  color: var(--text-muted);
}

.artist-search input::-webkit-search-cancel-button {
  display: none;
}

.artist-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-content: start;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.artist-row {
  padding: 4px 10px 4px 4px;
  border-radius: 10px;
  background: none;
  font-weight: 400;
  text-align: left;
}

.artist-row .artist-avatar {
  width: 26px;
  height: 26px;
}

.artist-row .artist-count {
  margin-left: auto;
}

.artist-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 800px) {
  .artist-chips {
    gap: 0.4rem;
  }

  .artist-filter-btn,
  .artist-more-btn {
    height: 36px;
    gap: 0.4rem;
    font-size: 0.8rem;
  }

  .artist-filter-btn {
    padding-right: 9px;
  }

  .artist-count {
    min-width: 1rem;
  }

  .artist-filter-btn .artist-avatar {
    width: 26px;
    height: 26px;
  }

  .artist-more-btn span span {
    display: none;
  }
}

.music-n14-notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 0 0.15rem 0;
}

.music-n14-notice strong {
  flex-shrink: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.5;
  align-self: center;
}

.music-n14-notice .n14-warnings {
  display: flex;
  flex-direction: column;
}

.music-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  grid-auto-flow: dense;
}

@media (max-width: 800px) {
  .music-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.music-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  user-select: none;
  -webkit-user-drag: none;
}

.music-card.nsfw .music-thumb-container img {
  filter: blur(4.5cqw);
}

.music-card.nsfw .music-play-overlay {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.music-thumb-container {
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.music-thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

@media (hover: hover) {
  .music-thumb-container:hover img {
    opacity: 0.6;
  }
}

.music-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .music-thumb-container:hover .music-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@media (hover: none) and (pointer: coarse) {
  .music-card.nsfw .music-play-overlay {
    opacity: 1;
  }
}

.music-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.music-thumb-container.mini,
.mini-bar {
  --mini-w: min(340px, 60vw);
  --mini-gap: calc(16px + env(safe-area-inset-bottom));
}

.music-thumb-container.mini {
  position: fixed;
  right: 16px;
  bottom: var(--mini-gap);
  width: var(--mini-w);
  height: auto !important;
  z-index: 950;
  border-radius: 10px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5);
}

.mini-bar {
  position: fixed;
  right: 16px;
  bottom: calc(var(--mini-gap) + var(--mini-w) * 9 / 16 + 8px);
  z-index: 950;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.mini-bar button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .mini-bar button:hover {
    background: rgba(127, 127, 127, 0.15);
    color: var(--text);
  }
}

.music-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
  text-decoration: none;
  max-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 500;
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
}

.music-meta {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}


/* Legal Footer */
.legal-footer {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
  box-sizing: border-box;
  margin: 0 auto;
  text-align: center;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal-footer p { margin: 0; }
.legal-footer p:last-child { margin-top: 0.8rem; }
.legal-footer a { text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) {
  .legal-footer a:hover { color: var(--text); }
}

.rss-popup-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.rss-popup-input-wrap input {
  flex: 1;
  background: var(--border);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  user-select: all;
}

.rss-popup-input-wrap button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

@media (hover: hover) {
  .rss-popup-input-wrap button:hover {
    color: var(--text);
    border-color: var(--text-muted);
  }
}

.rss-popup-input-wrap button.copied {
  color: var(--pink);
  border-color: var(--pink);
}

@media (max-width: 800px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    height: auto;
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
  .photo-stack {
    height: clamp(180px, 30vh, 250px);
    transform: rotate(0deg);
  }
  .links { justify-content: center; }
  .content { align-items: center; }
  .scroll-down { display: none; }
  .gallery-container { columns: 2 150px; }
  .work-item-header { flex-direction: column; }
}

html.light {
  --bg: #fdfdfc;
  --text: #1a1a1c;
  --text-muted: #666;
  --border: #eaeaea;
}

html.dark {
  --bg: #121212;
  --text: #e0e0e0;
  --text-muted: #888;
  --border: #333;
}


@media (prefers-color-scheme: dark) {
  :root:not(.light):not(.dark) {
    --bg: #121212;
    --text: #e0e0e0;
    --text-muted: #888;
    --border: #333;
  }
}

.music-show-more-btn {
  grid-column: 1 / -1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 1.5rem auto 0;
  display: block;
  width: auto;
  transition: background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, box-shadow 0.2s ease-out;
}
@media (hover: hover) {
  .music-show-more-btn:hover {
    background: rgba(0,0,0,0.02);
    border-color: var(--text);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }
}

/* Dark theme additions & overrides */
html.dark .stack-tag {
  background: #2a2a2a;
  color: var(--text);
}
@media (hover: hover) {
  html.dark .music-show-more-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-muted);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
}

@media (prefers-color-scheme: dark) {
  .stack-tag {
    background: #2a2a2a;
    color: var(--text);
  }
  @media (hover: hover) {
    .music-show-more-btn:hover {
      background: rgba(255,255,255,0.05);
      border-color: var(--text-muted);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
  }
}

html.light .stack-tag {
  background: #f0f0f0;
  color: var(--text);
}
@media (hover: hover) {
  html.light .music-show-more-btn:hover {
    background: rgba(0,0,0,0.02);
    border-color: var(--text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }
}


#music-section {
  overflow: hidden;
}

/* GSAP Expansion Rules */
.music-card {
  border-radius: 8px;
  overflow: hidden;
}
.text-fly {
  position: absolute;
  transform-origin: 0 0;
  pointer-events: none;
  user-select: none;
  z-index: 11;
}

.music-card.expanded {
  grid-column: 1 / -1;
  z-index: 10;
  overflow: visible;
}

.music-card.music-spare {
  display: none;
}

@media (min-width: 801px) {
  .music-list:has(> .expanded) > .music-card.music-spare {
    display: flex;
  }
}

.video-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
  user-select: none;
  font-family: system-ui, -apple-system, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) {
  .video-close-btn:hover {
    background: rgba(0, 0, 0, 0.75);
  }
}


@media (max-width: 800px) {
  .video-close-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}

@media (max-width: 800px) {
  .music-card.expanded .music-title {
    padding-right: 2.75rem;
  }
}

@media (min-width: 801px) {
  .music-card.expanded .music-title {
    font-size: 1.25rem;
    margin-top: 0.8rem;
    font-weight: 600;
  }
}

@keyframes navSlideIn {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.peek-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  pointer-events: none;
  height: var(--nav-height);
  transform: translateY(-100%);
}

.peek-nav.animate-in {
  animation: navSlideIn 0.5s ease-out forwards;
}

.peek-nav-bar {
  pointer-events: auto;
  height: 100%;
  background: transparent;
  transform: translateY(0);
  transition: background 0.3s ease;
  position: relative;
}

.peek-nav-bar.scrolled {
  background: var(--bg);
}

.peek-nav-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--nav-line, var(--border));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  mask: linear-gradient(to right, transparent calc(50% - 560px), #000 calc(50% - 368px), #000 calc(50% + 368px), transparent calc(50% + 560px));
}

.peek-nav-bar.scrolled::after {
  opacity: 1;
}

@media (max-width: 800px) {
  .peek-nav-bar::after {
    mask: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  }
}

.peek-nav-inner {
  max-width: calc(736px + 1.5rem);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0;
  position: relative;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.75rem;
  height: 100%;
  display: flex;
  align-items: center;
  user-select: none;
  transition: color 0.2s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .theme-toggle:hover {
    color: var(--text);
  }
}

.peek-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  min-width: 0;
}

.peek-nav-links::-webkit-scrollbar {
  display: none;
}

.peek-nav-link {
  position: relative;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0 0.75rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.peek-nav-link[data-section="hero"] {
  margin-right: auto;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

@media (hover: hover) {
  .peek-nav-link:hover {
    color: var(--text);
  }
}

.peek-nav-link.active {
  color: var(--text);
}

.peek-nav-link:focus-visible,
.theme-toggle:focus-visible {
  outline: none;
  color: var(--text);
  box-shadow: inset 0 0 0 2px rgba(245, 169, 184, 0.5);
  border-radius: 8px;
}

.peek-nav-indicator {
  position: absolute;
  bottom: 8px;
  height: 2px;
  background: var(--pink);
  border-radius: 1px;
  pointer-events: none;
  will-change: transform, width;
  opacity: 0;
  transition: transform 0.25s ease-out, width 0.25s ease-out, opacity 0.3s ease-out 0.25s;
}

.peek-nav.animate-in .peek-nav-indicator {
  opacity: 1;
}

@media (max-width: 800px) {
  .peek-nav-inner {
    padding-left: 0.25rem;
  }

  .peek-nav-links {
    gap: 0;
    mask: linear-gradient(to right, transparent, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 0px)), transparent);
  }

  .peek-nav-link {
    padding: 0 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }

  .peek-nav-link[data-section="hero"] {
    font-size: 0.8rem;
    letter-spacing: 0;
  }

  .theme-toggle {
    padding: 0 0.75rem 0 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .peek-nav-bar,
  .peek-nav-bar::after {
    transition: none;
  }
}


html.dark .peek-nav-bar.scrolled {
  --nav-line: rgba(255, 255, 255, 0.15);
}

html.light .peek-nav-bar.scrolled {
  --nav-line: var(--border);
}

@media (prefers-color-scheme: dark) {
  .peek-nav-bar.scrolled {
    --nav-line: rgba(255, 255, 255, 0.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .peek-nav-bar {
    transition: none;
  }

  .peek-nav-indicator {
    transition: none;
    opacity: 1;
  }
}



.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text);
  text-decoration: underline;
  cursor: pointer;
}

.music-thumb-container.gated,
.yt-card.gated {
  aspect-ratio: auto;
  cursor: default;
}

.music-thumb-container.gated > img {
  position: absolute;
  inset: 0;
}

.music-card .music-thumb-container.gated > img,
.yt-card.gated .yt-thumb {
  filter: blur(4.5cqw) brightness(0.45);
}

@media (hover: hover) {
  .music-thumb-container.gated:hover img {
    opacity: 1;
  }
}

.music-thumb-container.gated .music-play-overlay,
.yt-card.gated .yt-play-overlay {
  opacity: 0;
  pointer-events: none;
}

.gate-fly {
  position: absolute;
  transform-origin: 0 0;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: normal;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1001;
}

.inline-gate {
  position: relative;
  z-index: 3;
  display: flex;
  width: 100%;
  aspect-ratio: 16/9;
  box-sizing: border-box;
  border-radius: inherit;
  overflow: clip;
  color: #fff;
  text-align: center;
  container-type: inline-size;
  opacity: 0;
  pointer-events: none;
}

.inline-gate.show {
  opacity: 1;
  pointer-events: auto;
  animation: gate-in 0.3s ease-out backwards;
}

.inline-gate.swap {
  animation-delay: 0.1s;
}

.inline-gate.leaving {
  position: absolute;
  top: 0;
  left: 0;
  aspect-ratio: auto;
  transform-origin: 0 0;
  pointer-events: none;
  animation: none;
}

@keyframes gate-in {
  from { opacity: 0; }
}

.inline-gate-body {
  position: relative;
  margin: auto;
  max-width: 30rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.inline-gate-title {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.inline-gate p {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

.inline-gate p.lt {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.inline-gate-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.inline-gate-buttons button {
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

@media (hover: hover) {
  .inline-gate-buttons button:hover {
    background: rgba(255, 255, 255, 0.14);
  }
}

.inline-gate-buttons button.primary {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
  letter-spacing: 0.02em;
}

@media (hover: hover) {
  .inline-gate-buttons button.primary:hover {
    background: #e74c3c;
    border-color: #e74c3c;
  }
}

.inline-gate-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  user-select: none;
}

.inline-gate-remember input {
  margin: 0;
  accent-color: #c0392b;
}

.inline-gate p.inline-gate-note {
  margin-top: -0.35rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.inline-gate .link-btn {
  color: inherit;
}

@container (max-width: 480px) {
  .inline-gate-body { gap: 0.4rem; padding: 0.7rem 0.6rem; }
  .inline-gate-title { font-size: 0.95rem; }
  .inline-gate p { font-size: 0.78rem; line-height: 1.4; }
  .inline-gate p.lt { font-size: 0.74rem; }
  .inline-gate-buttons { gap: 0.4rem; margin-top: 0.2rem; }
  .inline-gate-buttons button { padding: 0.45rem 0.7rem; font-size: 0.78rem; }
  .inline-gate-remember { font-size: 0.74rem; }
  .inline-gate p.inline-gate-note { margin-top: -0.25rem; font-size: 0.7rem; }
}

.music-more {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.music-more .music-show-more-btn {
  margin: 0;
  text-decoration: none;
}

.music-sentinel {
  height: 1px;
}

.music-page-head {
  width: 100%;
  max-width: 800px;
  box-sizing: border-box;
  padding: 1rem 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.music-page-head .theme-toggle {
  height: 2.5rem;
  padding-right: 0;
}

.music-page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.85rem;
  user-select: none;
  transition: color 0.2s ease;
}

@media (hover: hover) {
  .music-page-back:hover {
    color: var(--text);
  }
}
