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

body {
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(245, 169, 184, 0.04), transparent 40%),
              radial-gradient(circle at 80% 20%, rgba(91, 206, 250, 0.04), transparent 40%);
  z-index: -1;
  pointer-events: none;
}

::selection {
  background: rgba(245, 169, 184, 0.4);
  color: var(--text);
}

/* 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;
}

.photo-wrapper img {
  height: clamp(220px, 45vh, 350px);
  width: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.1);
  transform: rotate(-2deg);
}

.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: clamp(1.2rem, 2.5vh, 2rem);
  letter-spacing: 0.05em;
}

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

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

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

.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;
}

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

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

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

.links a:hover svg {
  opacity: 1;
}

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

/* Page Content below Hero */
.page-content {
  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-serif, 'Georgia', serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

/* 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: #333;
}

.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);
}

/* 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);
}

.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;
}

/* Blog / Message layout */
#live-status-container {
  min-height: 1.2rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
}

.live-status {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  background: none;
  border: none;
}

.live-status.offline {
  color: var(--text-muted);
}

.pulse {
  width: 6px;
  height: 6px;
  background-color: #ff4757;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 rgba(255, 71, 87, 0.4);
  animation: pulse 2s infinite;
  user-select: none;
}

.live-status.offline .pulse {
  background-color: var(--text-muted);
  animation: none;
  box-shadow: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255, 71, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.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;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  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(0, 0, 0, 0.04);
  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;
}

.reaction-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.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);
  font-weight: 600;
}

.reaction-btn .count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Add Reaction Button (Always visible on hover, or if emojis exist) */
.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;
}

.blog-post:hover .add-reaction-btn {
  opacity: 1;
}

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

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

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

/* Emoji Picker Popup */
.emoji-picker {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 10px;
  display: none;
  grid-template-columns: repeat(7, 36px);
  gap: 4px;
  width: max-content;
  max-width: calc(100vw - 40px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  user-select: none;
  transform-origin: bottom center;
  scrollbar-width: none;
}

@media (min-width: 501px) {
  /* No specific gallery override needed anymore since it's centered */
}

.emoji-picker::-webkit-scrollbar {
  display: none;
}

.emoji-category-title {
  grid-column: 1 / -1;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 4px 4px 4px;
  user-select: none;
}

.emoji-picker.show {
  display: grid;
  z-index: 1000;
  animation: appleShow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes appleShow {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.85); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.gallery-item:has(.emoji-picker.show),
.blog-post:has(.emoji-picker.show) {
  z-index: 101;
}

.picker-emoji {
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.4rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.picker-emoji:hover {
  background: rgba(0,0,0,0.05);
  transform: scale(1.15);
}

.picker-emoji:active {
  transform: scale(0.9);
}

@media (max-width: 500px) {
  .emoji-picker {
    position: fixed;
    bottom: 24px;
    left: 12px;
    right: 12px;
    margin: 0 auto;
    width: auto;
    max-width: 360px;
    grid-template-columns: repeat(7, 1fr);
    padding: 12px;
    border-radius: 20px;
    z-index: 10000;
    transform: none;
    transform-origin: bottom center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  .emoji-picker.show {
    animation: appleShowMobile 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  }

  @keyframes appleShowMobile {
    0% { opacity: 0; transform: translateY(40px) scale(0.85); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }

  .picker-emoji {
    width: 100%;
    height: 44px;
    font-size: 1.6rem;
  }
}

.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;
}

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

.bookmark-manager {
  display: none;
  background: #fff;
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.bookmark-manager input { margin-right: 0.5rem; }

/* 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;
}

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

.yt-card {
  position: relative;
  max-width: 440px;
  width: 100%;
  aspect-ratio: 16/9;
  margin-top: 0.8rem;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: border-color 0.2s ease;
}

.yt-card:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.yt-thumb-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  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: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.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;
  margin-left: 2px;
}

.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;
}

.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;
}

.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-item:hover .gallery-reaction-overlay {
  /* always 1 now */
}

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

.gallery-reaction-overlay .reaction-btn {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

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

.gallery-reaction-overlay .add-reaction-btn {
  opacity: 0 !important;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

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

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

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

/* Legal Footer */
.legal-footer {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
  box-sizing: border-box;
  margin: 0 auto 4rem 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; }

@media (max-width: 800px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    height: auto;
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
  .photo-wrapper img {
    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; }
}
