/* PaulTube — YouTube-inspired channel layout (YouTube-like) */

:root {
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-2: #212121;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f1f1;
  --muted: rgba(255,255,255,0.72);
  --muted-2: rgba(255,255,255,0.65);
  --accent: #ff0033;
  --shadow: rgba(0, 0, 0, 0.35);
  --link: #3ea6ff;

  /* Translucent bar backgrounds (topbar + tabs) */
  --bar-bg: rgba(15, 15, 15, 0.92);
  --tabs-bg: rgba(15, 15, 15, 0.88);

  /* Inputs */
  --input-bg: #121212;

  /* Theme-dependent GitHub fallback thumbnail colors
     (dark mode: white backdrop + black icon; light mode: black backdrop + white icon) */
  --gh-thumb-bg: #ffffff;
  --gh-thumb-fg: #111111;

  /* Card/thumb baseline background */
  --thumb-bg: #111;

  /* Chip (tag) styling */
  --chip-border: rgba(90, 250, 230, 0.55);
  --chip-text: rgba(90, 250, 230, 0.95);
  --chip-bg: rgba(90, 250, 230, 0.06);

  /* Subscribed button (requested inversion per theme) */
  --subscribed-bg: #ffffff;
  --subscribed-text: #0f0f0f;
  --subscribed-border: rgba(255,255,255,0.16);

  /* Gradient tokens (used for icons/avatars) */
  --icon-grad-a: rgba(62,166,255,0.35);
  --icon-grad-b: rgba(255,0,51,0.22);
}

/* Light theme overrides */
:root[data-theme="light"] {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f0f1f3;
  --border: rgba(0, 0, 0, 0.12);
  --text: #121212;
  --muted: rgba(0,0,0,0.66);
  --muted-2: rgba(0,0,0,0.58);
  --shadow: rgba(0, 0, 0, 0.18);
  --link: #0b65d8;

  --gh-thumb-bg: #0b0b0b;
  --gh-thumb-fg: #ffffff;

  --bar-bg: rgba(255, 255, 255, 0.92);
  /* Tabs should blend into the page background in light mode */
  --tabs-bg: var(--bg);
  --input-bg: #ffffff;
  --thumb-bg: #ffffff;

  /* Improve chip contrast in light mode */
  --chip-border: rgba(0, 150, 130, 0.55);
  --chip-text: rgba(0, 120, 105, 0.95);
  --chip-bg: rgba(0, 150, 130, 0.10);

  /* Requested: subscribed should be black pill w/ white text in light mode */
  --subscribed-bg: #0b0b0b;
  --subscribed-text: #ffffff;
  --subscribed-border: rgba(0,0,0,0.18);

  /* Lighter gradient tokens in light mode */
  --icon-grad-a: rgba(62,166,255,0.18);
  --icon-grad-b: rgba(255,0,51,0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial,
    "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Top bar */
.topbar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 600px) 1fr;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Offset the app so content doesn't slide underneath the fixed topbar */
.app {
  padding-top: 60px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-right { justify-content: flex-end; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 26px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  line-height: 1;
}

.brand-mark svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  display: block;
}

.brand-name { font-size: 16px; }

.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search {
  width: 100%;
  height: 38px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 0 14px;
  color: var(--text);
}

.search:disabled { opacity: 0.75; }

/* Search results (YouTube-like list view) */
.search-results {
  position: fixed;
  left: 0;
  right: 0;
  top: 60px; /* below sticky topbar */
  bottom: 0;
  z-index: 45;
  background: var(--bg);
  overflow: auto;
  padding: 18px 16px 24px;
}

/* Keep search results from stretching edge-to-edge on wide screens */
.search-results .section-head,
.search-results .results,
.search-results .no-results {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

/* When search takes over the screen, never show ellipsis chips anywhere. */
.search-results:not([hidden]) .chip.is-ellipsis,
.search-results:not([hidden]) ~ * .chip.is-ellipsis {
  display: none !important;
}

/* (Structural reality) #search-results lives inside the page, so target via body state too. */
body:has(#search-results:not([hidden])) .chip.is-ellipsis {
  display: none !important;
}

/* Hide tab content behind the search takeover */
.search-results[hidden] {
  display: none;
}

/* No-results CTA (centered within the content area where items would appear) */
.no-results-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(24, 24, 24, 0.92);
  backdrop-filter: blur(10px);

  box-shadow: none;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  letter-spacing: 0.1px;
}

:root[data-theme="light"] .no-results-cta {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  color: rgba(0, 0, 0, 0.92);
}

:root[data-theme="light"] .no-results-cta__text {
  color: rgba(0, 0, 0, 0.70);
}

:root[data-theme="light"] .no-results-cta__platform {
  color: rgba(0, 0, 0, 0.92);
}

.no-results-cta[hidden] {
  display: none;
}

/* Wrapper used to position the CTA in the "empty results" area */
.no-results-cta-host {
  /* Center to the viewport horizontally, regardless of the sidebar/max-width page.
     Keep vertical centering within the empty content box. */
  position: relative;
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0 22px;
}

/* The CTA itself is centered to the viewport; the host only provides vertical space. */
.no-results-cta-host > .no-results-cta {
  position: fixed;
  left: 50vw;
  transform: translateX(-50%);
}

.no-results-cta:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(30, 30, 30, 0.94);
}

.no-results-cta__text {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
}

.no-results-cta__platform {
  color: #ffffff;
}

.no-results-cta__logo {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
}

.no-results-cta[data-platform="github"] .no-results-cta__logo {
  background: #111;
}

.no-results-cta[data-platform="github"] .no-results-cta__logo::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  background: rgba(255,255,255,0.9);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 .5C5.73.5.99 5.24.99 11.52c0 4.86 3.15 8.98 7.51 10.43.55.1.75-.24.75-.53 0-.26-.01-.95-.02-1.86-3.06.66-3.71-1.48-3.71-1.48-.5-1.28-1.22-1.62-1.22-1.62-.99-.68.08-.67.08-.67 1.09.08 1.66 1.12 1.66 1.12 .97 1.65 2.56 1.17 3.18.9 .1-.7.38-1.17.69-1.44-2.44-.28-5.01-1.22-5.01-5.42 0-1.2.43-2.18 1.12-2.95-.11-.27-.49-1.35.11-2.81 0 0 .92-.29 3.02 1.12 .88-.24 1.82-.36 2.76-.36s1.88.12 2.76.36c2.1-1.41 3.02-1.12 3.02-1.12 .6 1.46.22 2.54.11 2.81 .69.77 1.12 1.75 1.12 2.95 0 4.21-2.58 5.13-5.03 5.41 .39.33.74.98.74 1.98 0 1.43-.01 2.58-.01 2.93 0 .29.19.64.75.53 4.36-1.45 7.51-5.57 7.51-10.43C23.01 5.24 18.27.5 12 .5Z"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 .5C5.73.5.99 5.24.99 11.52c0 4.86 3.15 8.98 7.51 10.43.55.1.75-.24.75-.53 0-.26-.01-.95-.02-1.86-3.06.66-3.71-1.48-3.71-1.48-.5-1.28-1.22-1.62-1.22-1.62-.99-.68.08-.67.08-.67 1.09.08 1.66 1.12 1.66 1.12 .97 1.65 2.56 1.17 3.18.9 .1-.7.38-1.17.69-1.44-2.44-.28-5.01-1.22-5.01-5.42 0-1.2.43-2.18 1.12-2.95-.11-.27-.49-1.35.11-2.81 0 0 .92-.29 3.02 1.12 .88-.24 1.82-.36 2.76-.36s1.88.12 2.76.36c2.1-1.41 3.02-1.12 3.02-1.12 .6 1.46.22 2.54.11 2.81 .69.77 1.12 1.75 1.12 2.95 0 4.21-2.58 5.13-5.03 5.41 .39.33.74.98.74 1.98 0 1.43-.01 2.58-.01 2.93 0 .29.19.64.75.53 4.36-1.45 7.51-5.57 7.51-10.43C23.01 5.24 18.27.5 12 .5Z"/></svg>') center / contain no-repeat;
}

.no-results-cta[data-platform="linkedin"] .no-results-cta__logo {
  background: rgba(62,166,255,0.18);
}

.no-results-cta[data-platform="linkedin"] .no-results-cta__logo::before {
  content: "in";
  font-size: 12px;
  font-weight: 900;
  color: rgba(255,255,255,0.92);
  line-height: 1;
}

.results {
  display: grid;
  gap: 12px;
  padding: 6px 0 14px;
}

.result {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
  padding: 8px 0;
}

/* Search result rows are clickable (open the top-priority link) */
.result[role="button"] {
  cursor: pointer;
  border-radius: 14px;
  padding: 10px;
  margin: -2px 0;
}

.result[role="button"]:hover {
  background: rgba(255,255,255,0.04);
}

.result[role="button"]:focus-visible {
  outline: 2px solid rgba(62,166,255,0.55);
  outline-offset: 2px;
}

.result-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  /* Match the default GitHub thumbnail look, and allow theme inversion via vars */
  background: var(--gh-thumb-bg);
}

.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-thumb .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.85);
}

.result-thumb .fallback svg {
  width: 34%;
  height: 34%;
  fill: var(--gh-thumb-fg);
}

.result-meta {
  display: grid;
  gap: 6px;
}

.result-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.result-sub {
  font-size: 13px;
  color: var(--muted);
}

:root[data-theme="light"] .result-sub {
  color: rgba(0,0,0,0.66);
}

.result-desc {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.78);
}

:root[data-theme="light"] .result-desc {
  color: rgba(0,0,0,0.72);
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .result {
    grid-template-columns: 1fr;
  }

  .result-thumb {
    max-width: 640px;
  }
}

.search-btn {
  height: 38px;
  width: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.search-btn:hover {
  filter: brightness(1.05);
}

.search-btn:focus-visible {
  outline: 2px solid rgba(62,166,255,0.55);
  outline-offset: 2px;
}

.search-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Ensure the theme toggle always looks clickable */
.icon.theme-toggle {
  cursor: pointer;
}

.icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.theme-toggle {
  position: relative;
}

.theme-toggle__sun,
.theme-toggle__moon {
  font-size: 16px;
  line-height: 1;
}

/* Replace the sun glyph with a clean icon via mask, force visibility in dark mode */
.theme-toggle__sun {
  width: 18px;
  height: 18px;
  display: inline-block;
  font-size: 0;
  background: rgba(255,255,255,0.92);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.8 1.42-1.42zM1 13h3v-2H1v2zm10-9h2V1h-2v3zm9.66 1.46-1.41-1.41-1.8 1.79 1.42 1.42 1.79-1.8zM20 11v2h3v-2h-3zm-9 12h2v-3h-2v3zm7.24-3.84l1.8 1.79 1.41-1.41-1.79-1.8-1.42 1.42zM4.34 19.19l1.41 1.41 1.8-1.79-1.42-1.42-1.79 1.8zM12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12z"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.8 1.42-1.42zM1 13h3v-2H1v2zm10-9h2V1h-2v3zm9.66 1.46-1.41-1.41-1.8 1.79 1.42 1.42 1.79-1.8zM20 11v2h3v-2h-3zm-9 12h2v-3h-2v3zm7.24-3.84l1.8 1.79 1.41-1.41-1.79-1.8-1.42 1.42zM4.34 19.19l1.41 1.41 1.8-1.79-1.42-1.42-1.79 1.8zM12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12z"/></svg>') center / contain no-repeat;
}

:root[data-theme="light"] .theme-toggle__sun {
  background: rgba(0,0,0,0.88);
}

:root[data-theme="light"] .theme-toggle__sun { display: none; }
:root:not([data-theme="light"]) .theme-toggle__moon { display: none; }

/* Replace the moon glyph with a clean icon via mask */
.theme-toggle__moon {
  width: 18px;
  height: 18px;
  display: inline-block;
  font-size: 0;
  background: rgba(0,0,0,0.88);
  /* Updated moon icon */
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.5 14.9A9 9 0 0 1 9.1 2.5a.9.9 0 0 0-1.1-1.1A10.7 10.7 0 1 0 22.6 16a.9.9 0 0 0-1.1-1.1Z"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.5 14.9A9 9 0 0 1 9.1 2.5a.9.9 0 0 0-1.1-1.1A10.7 10.7 0 1 0 22.6 16a.9.9 0 0 0-1.1-1.1Z"/></svg>') center / contain no-repeat;
}

:root:not([data-theme="light"]) .theme-toggle__moon {
  background: rgba(255,255,255,0.92);
}

/* Main app layout (sidebar + page) */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow: auto;
  padding: 12px 12px;
  border-right: 1px solid var(--border);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 8px 10px 10px;
}

.subs-list {
  display: grid;
  gap: 4px;
}

.sidebar-shower {
  margin-top: 34px;
  padding: 12px 8px 8px;
  border-top: 1px solid var(--border);
}

.sidebar-shower .shower-prompt {
  margin: 8px 0 10px;
  color: rgba(255,255,255,0.88);
  font-size: 12px;
  font-style: italic;
  text-align: left;
}

.sidebar-shower .shower-button {
  width: 100%;
  margin: 0;
}

.sidebar-shower .shower-image {
  width: 100%;
  height: auto;
  max-height: 340px;
  border-radius: 14px;
  /* Don't let global thumbnail hover overlays/darkening affect this image. */
  filter: none !important;
  opacity: 1 !important;
  -webkit-filter: none !important;
}

/* Hard-stop any accidental overlay layers that could visually darken the shower image. */
.sidebar-shower::before,
.sidebar-shower::after,
.sidebar-shower .shower-button::before,
.sidebar-shower .shower-button::after {
  content: none !important;
  display: none !important;
}

/* If the shower widget ever reuses .vthumb markup, disable hover darken + play icon there. */
.sidebar-shower .vthumb::before,
.sidebar-shower .vthumb-play {
  display: none !important;
}

.sidebar-shower .shower-count {
  margin: 10px 0 0;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  text-align: center;
}

:root[data-theme="light"] .sidebar-shower .shower-count {
  color: rgba(0,0,0,0.72);
}

.sub-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
}

.sub-item:hover { background: rgba(255,255,255,0.06); }

:root[data-theme="light"] .sub-item:hover { background: rgba(0,0,0,0.06); }

.sub-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.10);
  background: var(--thumb-bg);
}

.sub-avatar--letter {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: rgba(255,255,255,0.92);
  background: radial-gradient(circle at top left, var(--icon-grad-a), var(--icon-grad-b)), #131313;
}

:root[data-theme="light"] .sub-avatar--letter {
  background: radial-gradient(circle at top left, var(--icon-grad-a), var(--icon-grad-b)), #f4f4f4;
  color: rgba(0,0,0,0.82);
}

.sub-avatar--icon {
  display: grid;
  place-items: center;
  background: var(--thumb-bg);
}

/* Subscription GitHub icon should get the gradient look */
.sub-item[aria-label="Subscribe: GitHub"] .sub-avatar--icon {
  background: radial-gradient(circle at top left, var(--icon-grad-a), var(--icon-grad-b)), var(--thumb-bg);
}

:root[data-theme="light"] .sub-item[aria-label="Subscribe: GitHub"] .sub-avatar--icon {
  background: radial-gradient(circle at top left, var(--icon-grad-a), var(--icon-grad-b)), var(--thumb-bg);
}

/* Substack icon: match the same gradient treatment as other subscription icons */
.sub-item[aria-label="Subscribe: Substack"] .sub-avatar--icon {
  background: radial-gradient(circle at top left, var(--icon-grad-a), var(--icon-grad-b)), var(--thumb-bg);
}

:root[data-theme="light"] .sub-item[aria-label="Subscribe: Substack"] .sub-avatar--icon {
  background: radial-gradient(circle at top left, var(--icon-grad-a), var(--icon-grad-b)), var(--thumb-bg);
}

.sub-avatar--substack svg {
  width: 16px;
  height: 16px;
  fill: var(--text);
}

.sub-avatar--icon svg {
  width: 16px;
  height: 16px;
  fill: var(--text);
}

.sub-name {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Page layout */
.page {
  max-width: 1120px;
  margin: 0;
  padding: 0 16px 48px;
  min-height: calc(100vh - 60px);
  /* Don't stretch the (often-empty) main content area. This caused huge gaps on Home. */
  display: block;
}

/* Channel header */
.channel-hero { margin-top: 16px; }

.banner {
  height: 180px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: url("assets/banner.jpeg") center / cover no-repeat;
}

.channel-meta {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 20px;
  align-items: center;
  margin-top: 16px;
  padding: 0 6px;
}

/* Lift the name/metadata slightly so it sits closer to the banner, like YouTube */
.channel-text {
  margin-top: -10px;
}

.pfp {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  border: 4px solid var(--bg);
  box-shadow: none;
  background: url("assets/pfp.jpg") center / cover no-repeat;
}

.channel-name {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: 0;
}

.channel-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.85);
}

.verified svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

:root[data-theme="light"] .verified {
  background: transparent;
  border-color: transparent;
  color: rgba(0,0,0,0.78);
}

/* Name on its own line; handle/stats on the next line */
.channel-name {
  margin-bottom: 10px;
  margin-top: 10px;
  display: flex;
  align-items: center;
}

.channel-handle,
.channel-stats {
  display: inline;
  margin-top: 0px;
}

.channel-handle {
  display: block;
}

.channel-handle {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.channel-stats {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* YouTube-like single-line: handle + stats on one line */
.channel-handle,
.channel-stats {
  display: inline;
  margin-top: 0;
}

.channel-stats::before {
  content: " · ";
  color: rgba(255,255,255,0.55);
  margin: 0;
}

:root[data-theme="light"] .channel-stats::before {
  color: rgba(0,0,0,0.62);
}

.channel-bio {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

/* Single-line bio variant: "Recruiting for Summer 2026 (Resume) ...more" */
.channel-bio--one {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
}

.channel-bio--one > * {
  display: inline;
}

.channel-bio--one .link {
  color: rgba(255,255,255,0.72);
}

:root[data-theme="light"] .channel-bio--one .link {
  color: rgba(0,0,0,0.66);
}

/* Tight like YouTube: a single space before the parens; no extra padding inside () */
.channel-bio--one .paren {
  color: rgba(255,255,255,0.55);
}

:root[data-theme="light"] .channel-bio--one .paren {
  color: rgba(0,0,0,0.62);
}

.channel-bio--one span + .paren {
  margin-left: 6px;
}

/* Keep ")...more" tight (no big gap after the closing paren) */
.channel-bio--one .paren + .more {
  margin-left: 2px;
}

.channel-bio--one .more {
  margin-left: 10px;
  color: rgba(255,255,255,0.92);
  font-weight: 500;
}

/* Make the header "...more" behave like a clickable affordance */
.channel-bio--one .more,
.channel-bio--one .more[role="button"] {
  cursor: pointer;
  user-select: none;
}

.channel-bio--one .more:hover {
  text-decoration: none;
}

.channel-bio--one .more:focus-visible {
  outline: 2px solid rgba(62,166,255,0.55);
  outline-offset: 3px;
  border-radius: 8px;
}

:root[data-theme="light"] .channel-bio--one .more {
  color: rgba(0,0,0,0.92);
}

/* No dot separators in the one-line bio */
.channel-bio--one span + span::before,
.channel-bio--one span + .paren::before {
  content: "" !important;
}

.channel-links {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.channel-links .link { color: var(--link); }
.channel-links .dot { margin: 0 6px; color: rgba(255,255,255,0.55); }

:root[data-theme="light"] .channel-links .dot {
  color: rgba(0,0,0,0.62);
}

/* Keep @handle readable, but don't bold it */
.channel-handle {
  font-weight: 500;
  color: rgba(255,255,255,0.92);
}

:root[data-theme="light"] .channel-handle {
  color: rgba(0,0,0,0.92);
}

/* Keep "... more" readable, but don't bold it */
.channel-links .dot:last-child {
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  margin-left: 0;
}

:root[data-theme="light"] .channel-links .dot:last-child {
  color: rgba(0,0,0,0.92);
}

.channel-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--subscribed-border);
  background: var(--subscribed-bg);
  color: var(--subscribed-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(0.96);
}

/* Light-mode subscribe hover should get lighter (not darker) for black pill */
:root[data-theme="light"] .btn:hover {
  filter: brightness(1.10);
}

/* Optional: make "Subscribed" feel slightly different without changing palette rules */
.btn.is-subscribed {
  cursor: pointer;
}
.btn.ghost { background: transparent; }

/* Tabs */
.channel-tabs {
  position: sticky;
  top: 58px;
  z-index: 40;
  display: flex;
  gap: 18px;
  padding: 0 4px;
  margin-top: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--tabs-bg);
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .channel-tabs {
  backdrop-filter: none;
}

.tab {
  padding: 14px 10px 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

:root[data-theme="light"] .tab {
  color: rgba(0,0,0,0.70);
}

:root[data-theme="light"] .tab:hover {
  color: rgba(0,0,0,0.88);
}

/* Content grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  /* No extra gap under the tabs */
  padding-top: 0;
  margin-top: 0;
}

/* If a section is empty (e.g., Home), don't let it reserve vertical space. */
.grid:empty {
  display: none;
}

/* Explicitly hide any grid sections marked hidden (avoid layout quirks on some browsers). */
section.grid[hidden] {
  display: none !important;
}

/* Override any older global .grid rules later in the file for this layout */
main.page > section.grid {
  margin: 0 !important;
  padding-top: 0 !important;
}

/* Home collage */
.home-collage {
  grid-column: 1 / -1;
  padding: 18px 0 6px;
}

.home-collage-head {
  margin: 8px 0 14px;
}

.home-collage-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.1px;
}

.home-collage-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.photo-wall {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

/* Home story (Kate-Hesse-ish layout) */
.home-story {
  grid-column: 1 / -1;
  padding: 18px 0 24px;
}

.story-hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 26px;
  align-items: center;
  padding: 22px;
  border-radius: 18px;
  /* Keep hero panel subtle: same vibe as the page */
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
}

.story-hero__media {
  position: relative;
  min-height: 320px;
}

.story-hero__main {
  width: 100%;
  max-width: 560px;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  display: block;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.10);
  transform: rotate(-1.2deg);
}

:root[data-theme="light"] .story-hero__main {
  border-color: rgba(0,0,0,0.10);
}

.story-caption {
  margin: 10px 0 0;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  line-height: 1.35;
}

.story-hero__copy h2 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.story-hero__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 52ch;
}

.story-block {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 22px;
  border-radius: 18px;
  /* Same color as site background so it feels embedded */
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
}

.story-block--photo-right .story-media { order: 2; }
.story-block--photo-right .story-copy { order: 1; }


.story-media img {
  width: 100%;
  max-width: 520px;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  display: block;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 26px 64px rgba(0,0,0,0.48);
}

.story-media .story-caption {
  margin-top: 10px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
}

/* subtle “authentic” rotations */
.rotate-2 { transform: rotate(2deg); transform-origin: 20% 20%; }
.rotate-1 { transform: rotate(1.2deg); transform-origin: 30% 30%; }
.rotate--1 { transform: rotate(-1.2deg); transform-origin: 60% 30%; }
.rotate--2 { transform: rotate(-2deg); transform-origin: 70% 20%; }

.story-copy h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.15px;
}

.story-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 56ch;
}

@media (max-width: 980px) {
  .story-hero {
    grid-template-columns: 1fr;
  }
  .story-hero__media {
    min-height: 300px;
  }
  .story-block {
    grid-template-columns: 1fr;
  }
  .story-block--photo-right .story-media,
  .story-block--photo-right .story-copy {
    order: initial;
  }
}

@media (max-width: 560px) {
  .story-hero,
  .story-block {
    padding: 16px;
  }
}

/* Raw collage rows (no white card) */
.collage-row {
  width: min(1120px, 100%);
  position: relative;
  padding: 12px 0;
}

/* Overlap/stagger: next row starts around the lower quarter of the previous image */
.photo-wall .collage-row + .collage-row {
  margin-top: -100px;
}

/* Alternate which side the image appears on */
.collage-row.is-left { justify-self: start; }
.collage-row.is-right { justify-self: end; }

/* Alternate the image position */
.collage-row.is-left .collage-media { margin-right: auto; }
.collage-row.is-right .collage-media { margin-left: auto; }

.collage-media {
  /* Keep the image at its natural aspect ratio; no cropping */
  max-width: 520px;
}

.collage-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 22px 56px rgba(0,0,0,0.42);
}

.collage-text {
  position: absolute;
  z-index: 2;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 15, 15, 0.86);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 46px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  /* Place text in the negative space between overlapped photos */
  top: 50%;
}

.collage-row.is-left .collage-text {
  /* Image on left -> text sits in the gap on the right */
  right: 10px;
  left: auto;
}

.collage-row.is-right .collage-text {
  /* Image on right -> text sits in the gap on the left */
  left: 10px;
  right: auto;
}

.collage-text h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.1px;
}

.collage-text p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .collage-row {
    width: 100%;
    padding: 10px 0;
  }
  .collage-row.is-right,
  .collage-row.is-left {
    justify-self: start;
  }
  .collage-text {
    position: static;
    max-width: 720px;
    margin-top: 10px;
    top: auto;
    left: auto;
    right: auto;
  }
  .photo-wall .collage-row + .collage-row {
    margin-top: -64px;
  }
}

@media (max-width: 560px) {
  .photo-wall .collage-row + .collage-row {
    margin-top: -44px;
  }
  .collage-media { max-width: 100%; }
}

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
}

/* Videos section container should feel like YouTube: no big rounded "panel" */
.card.wide {
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
  /* Keep the space between tabs and the first row consistent and small */
  padding: 8px 0 0;
}

/* Projects/Internships container should be seam-less (no shadow) */
#projects .card.wide,
#internships .card.wide {
  box-shadow: none;
}

.card.wide { grid-column: 1 / -1; }

.card-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
}

.uploads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.video {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: none;
}

:root[data-theme="light"] .video {
  border-color: rgba(0,0,0,0.12);
}

.thumb {
  height: 112px;
  background:
    linear-gradient(135deg, rgba(255,0,51,0.16), rgba(79, 209, 197, 0.10)),
    linear-gradient(135deg, #232323, #141414);
}

.video-meta { padding: 10px 10px 12px; }

.video-title {
  font-weight: 750;
  font-size: 13px;
  line-height: 1.25;
  margin-bottom: 6px;
}

.video-sub { font-size: 12px; color: var(--muted-2); }

.muted-note {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 13px;
}

/* YouTube-like horizontal rows (used for Projects/Internships) */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.1px;
}

.section-head .hint {
  color: var(--muted);
  font-size: 13px;
}

:root[data-theme="light"] .section-head .hint {
  color: rgba(0,0,0,0.70);
}

.row {
  display: grid;
  /* Wrap to new lines instead of horizontal scrolling */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  overflow: visible;
  /* No extra top gap under the "Videos" header / tabs */
  padding: 0 2px 14px;
}



.vcard {
  display: grid;
  gap: 10px;
}

/* Internships: much smaller + squarer */
.vcard.is-internship.is-text {
  border-radius: 14px;
  padding: 10px;
}

.vcard.is-internship.is-text .vtitle { font-size: 15px; }
.vcard.is-internship.is-text .vsub,
.vcard.is-internship.is-text .vdesc { font-size: 12px; }

.vcard.is-internship.is-text .chips { margin-top: 12px; gap: 8px; }
.vcard.is-internship.is-text .chip { padding: 6px 10px; border-radius: 10px; font-size: 12px; }

/* Default GitHub thumbnail (white background + black mark) */
.vthumb.is-gh {
  background: var(--gh-thumb-bg);
  border-color: rgba(0,0,0,0.10);
}

.vthumb.is-gh svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44%;
  height: 44%;
  fill: var(--gh-thumb-fg);
}

.vthumb.is-gh::after {
  content: none;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
}

.modal.is-open { display: grid; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.82);
}

.modal-panel {
  position: relative;
  /* Smaller overall popup */
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  margin: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(24,24,24,0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 90px rgba(0,0,0,0.65);
}

/* (Deprecated) modal-close button: kept for backward compatibility if present */
.modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  color: rgba(255,255,255,0.92);
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.modal-body {
  padding: 10px 16px 18px;
}

/* Light mode: ensure the modal uses light surfaces and readable text */
:root[data-theme="light"] .modal-backdrop {
  background: rgba(0,0,0,0.55);
}

:root[data-theme="light"] .modal-panel {
  border-color: rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.96);
  box-shadow: none;
}

/* Light mode: force modal content to use readable dark text by default */
:root[data-theme="light"] .modal-panel {
  color: rgba(0,0,0,0.90);
}

:root[data-theme="light"] .modal-panel a {
  color: var(--link);
}

:root[data-theme="light"] .modal-panel .pill {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
}

:root[data-theme="light"] .modal-panel .pill.primary {
  background: rgba(11, 101, 216, 0.12);
  border-color: rgba(11, 101, 216, 0.22);
}

:root[data-theme="light"] .detail-sub {
  color: rgba(0,0,0,0.66);
}

:root[data-theme="light"] .detail-desc {
  color: rgba(0,0,0,0.72);
}

:root[data-theme="light"] .detail-x {
  border: 0;
  background: transparent;
  color: rgba(0,0,0,0.88);
}

:root[data-theme="light"] .detail-x:hover {
  background: rgba(0,0,0,0.08);
}

:root[data-theme="light"] .modal-panel .vsub,
:root[data-theme="light"] .modal-panel .video-sub,
:root[data-theme="light"] .modal-panel .muted-note {
  color: rgba(0,0,0,0.66);
}

/* Detail modal layout (big centered square-style card) */
.detail {
  display: grid;
  gap: 14px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.1px;
  line-height: 1.15;
}

.detail-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.detail-x {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.92);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.detail-x:hover {
  background: rgba(255,255,255,0.10);
}


.detail-media .vthumb {
  border-radius: 16px;
  /* Full-width thumbnail, but shorter height inside the smaller popup */
  aspect-ratio: 16 / 7;
}

.detail-info {
  display: grid;
  gap: 12px;
}

.detail-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.detail-tags .chips,
.detail-tags {
  display: block;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* YouTube-like "About" popup (used when clicking header ...more) */
.about-modal {
  padding: 10px 2px 4px;
}

/* Make the about popup slimmer (wrap description sooner, like YouTube) */
.modal-panel:has(.about-modal) {
  max-width: 520px;
}

.about-modal__title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.1px;
  line-height: 1.15;
}

.about-modal__sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.about-modal__section {
  margin-top: 16px;
}

.about-modal__section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1px;
}

.about-modal__desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.about-modal__list {
  display: grid;
  gap: 10px;
}

.about-modal__row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
}

.about-modal__icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
}

.about-modal__icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.about-modal__label {
  font-weight: 800;
  font-size: 14px;
  margin: 0;
}

/* Link titles (e.g., Resume/GitHub/LinkedIn) should look like plain titles in light mode */
:root[data-theme="light"] .about-modal__label a {
  color: rgba(0,0,0,0.92);
}

.about-modal__value {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.about-modal__value a {
  color: var(--link);
}

/* Light theme tweaks */
:root[data-theme="light"] .about-modal__icon {
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.88);
}

:root[data-theme="light"] .about-modal__desc,
:root[data-theme="light"] .about-modal__sub,
:root[data-theme="light"] .about-modal__value {
  color: rgba(0,0,0,0.72);
}

@media (max-width: 860px) {
  /* Stacked layout already works on mobile */
}

.modal-body .vcard {
  gap: 12px;
}

.modal-body .vcard.is-text {
  box-shadow: none;
}

/* No-image cards (match screenshot style) */
.vcard.is-text {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: radial-gradient(1200px 420px at 0% 0%, rgba(62,166,255,0.14), rgba(0,0,0,0) 55%),
    rgba(255,255,255,0.03);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}

:root[data-theme="light"] .vcard.is-text {
  border-color: rgba(0,0,0,0.12);
  background: var(--surface);
  box-shadow: none;
}

.vcard.is-text .vtitle {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.vcard.is-text .vsub {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.72);
}

.vcard.is-text .vdesc {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.72);
}

:root[data-theme="light"] .vcard.is-text .vsub,
:root[data-theme="light"] .vcard.is-text .vdesc {
  color: rgba(0,0,0,0.72);
}

.chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
}

.chip.is-hidden { display: none; }

.chip.is-ellipsis {
  border-color: var(--chip-border);
  color: var(--chip-text);
  background: var(--chip-bg);
  cursor: pointer;
  position: relative;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
}

/* Custom tooltip: compact light-grey square showing all hidden chips */
.chip-pop {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  width: max-content;
  max-width: min(360px, 80vw);
  max-height: min(260px, 55vh);
  overflow: auto;
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 44px rgba(0,0,0,0.55);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
}

/* Light mode: tag popup should not inherit dark-mode panel styling */
:root[data-theme="light"] .chip-pop,
:root[data-theme="light"] .chip-pop-portal .chip-pop {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0,0,0,0.12);
  box-shadow: none;
  color: rgba(0,0,0,0.90);
}

/* Keep teal chips consistent inside popup */
.chip-pop .chip {
  /* Match regular chip styling (auto-sized, teal) */
  border: 1px solid var(--chip-border);
  color: var(--chip-text);
  background: var(--chip-bg);
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
}

.chip.is-ellipsis.is-open .chip-pop {
  opacity: 1;
  pointer-events: auto;
}

/* Portal-based popover (reliable: escapes overflow clipping). */
.chip-pop-portal {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  display: none;
}

.chip-pop-portal .chip-pop {
  position: relative;
  left: 0;
  top: 0;
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

/* The inline (inside-chip) popover isn't used for showing anymore. */
.chip.is-ellipsis .chip-pop { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--chip-border);
  color: var(--chip-text);
  background: var(--chip-bg);
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 12px;
}

.vcard.is-text .vlinks { margin-top: 18px; }

.vthumb {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--thumb-bg);
  position: relative;
}

/* Make modal thumbnails feel like YouTube thumbnails: clickable + hover affordance */
.vthumb--clickable {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--thumb-bg);
  padding: 0;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.vthumb--clickable:focus-visible {
  outline: 2px solid rgba(62,166,255,0.55);
  outline-offset: 2px;
}

.vthumb img,
.vthumb--clickable img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Base thumbnail gradient (keep always-on) */
.vthumb::after,
.vthumb--clickable::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55));
  pointer-events: none;
  z-index: 1;
}

/* Hover affordance: darken thumbnail + show play icon overlay (like YouTube) */
/* Hover darken layer */
.vthumb::before,
.vthumb--clickable::before,
.result-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
  z-index: 2;
}

.vthumb .play-overlay,
.result-thumb .play-overlay {
  display: none;
}

/* Play icon overlay (we attach to a new dedicated element, not ::after, so we don't overwrite vthumb's gradient) */
.vthumb,
.vthumb--clickable,
.result-thumb {
  position: relative;
}

.vthumb::marker { content: none; }

.vthumb-play,
.result-thumb-play {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 40px;
  transform: translate(-50%, -50%) scale(0.98);
  border-radius: 12px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 26px rgba(0,0,0,0.55);
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
  z-index: 3;
  /* Triangle play icon (white) */
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>') center / 64% 64% no-repeat;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>') center / 64% 64% no-repeat;
  background-color: rgba(255,255,255,0.92);
}

/* Only reveal on hovering the whole card/result row */
.vcard:hover .vthumb::before,
.vcard:focus-within .vthumb::before,
.vthumb--clickable:hover::before,
.vthumb--clickable:focus-visible::before,
.result[role="button"]:hover .result-thumb::before,
.result[role="button"]:focus-within .result-thumb::before {
  opacity: 1;
}

.vcard:hover .vthumb-play,
.vcard:focus-within .vthumb-play,
.vthumb--clickable:hover .vthumb-play,
.vthumb--clickable:focus-visible .vthumb-play,
.result[role="button"]:hover .result-thumb-play,
.result[role="button"]:focus-within .result-thumb-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.vmeta { display: grid; gap: 4px; }

.vactions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  min-width: 0;
  overflow: visible;
}

/* Keep the actions row visually consistent: pills stay on one line and chips clamp. */
.vactions .vlinks { flex-wrap: nowrap; }

.vactions .chips {
  flex: 1;
}

.vtitle {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.vsub {
  font-size: 12px;
  color: var(--muted);
}

.vlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.vactions .vlinks { margin-top: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 700;
}

.pill.primary {
  background: rgba(62,166,255,0.18);
  border-color: rgba(62,166,255,0.35);
}

.footer {
  position: fixed;
  left: 16px;
  bottom: 14px;
  z-index: 20;
  margin: 0;
  color: var(--muted-2);
  font-size: 13px;
  padding: 0;
}

/* Always keep copyright in the left-most column (viewport left). */

/* Responsive */
@media (max-width: 1040px) {
  .app { grid-template-columns: 88px 1fr; }
  .sub-name { display: none; }
  .sidebar-title { display: none; }
  .sidebar { padding: 10px 8px; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  .topbar {
    /* Row 1: brand (left) + icons (right)
       Row 2: search spanning full width */
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
  }
  .topbar-left { order: 1; justify-content: flex-start; }
  .topbar-center {
    order: 3;
    grid-column: 1 / -1;
  }
  .topbar-right { order: 2; justify-content: flex-end; }

  /* Narrow screens: tabs should NOT follow you down (i.e., not sticky) */
  .channel-tabs {
    position: static;
    top: auto;
  }

  .uploads { grid-template-columns: 1fr; }
}

/* (Tabs hide-on-scroll removed) On narrow screens we keep tabs in-flow (non-sticky)
   so users can always scroll back up to them. */

@media (max-width: 520px) {
  .channel-meta {
    grid-template-columns: 72px 1fr;
    margin-top: 12px;
  }
  .pfp {
    width: 72px;
    height: 72px;
  }
  .banner { height: 150px; }
}


.about-main {
  flex: 1;
  min-width: 0;
}

/* Shower Counter */
.shower-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 320px;
  max-width: 340px;
  box-shadow: 0 10px 30px var(--shadow);
}

.shower-prompt {
  margin: 0 0 24px 0;
  font-size: 18px;
  color: #1a1a1a;
  text-align: center;
  font-style: italic;
  font-weight: 500;
}

.shower-button {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0 0 24px 0;
  transition: transform 160ms ease;
}

.shower-button:hover:not(:disabled) {
  transform: scale(1.05);
}

.shower-button:active:not(:disabled) {
  transform: scale(0.95);
}

.shower-button:disabled {
  cursor: pointer;
  opacity: 0.6;
  pointer-events: none;
}

.shower-image {
  width: 280px;
  height: 280px;
  display: block;
  border-radius: 16px;
}

.shower-image.splash {
  animation: none;
}

@keyframes splash {
  0% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.shower-count {
  margin: 0;
  font-size: 16px;
  color: #1a1a1a;
  text-align: center;
  font-weight: 600;
}

.shower-count span {
  font-weight: 600;
}

.section-heading {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  margin: 32px 0 16px 0;
  letter-spacing: 0.3px;
}

.section-heading em {
  font-style: italic;
  font-weight: 400;
}

.section-heading:first-child {
  margin-top: 8px;
}

.experience-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  margin-left: 24px;
  line-height: 1.6;
  position: relative;
}

.experience-item::before {
  content: '↳';
  position: absolute;
  left: -20px;
  color: var(--muted);
  font-size: 14px;
}

.section-heading::before {
  content: '■';
  margin-right: 8px;
  color: var(--text);
  font-size: 8px;
  vertical-align: middle;
}

.company-logo-inline {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  vertical-align: middle;
  margin: 0 6px 0 4px;
  display: inline-block;
}

.experience-content {
  flex: 1;
  margin-left: 0;
}

.company-link-separator {
  color: var(--muted);
  margin: 0 4px;
}

.company-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 160ms ease;
}

.company-link:hover {
  color: var(--accent);
}

.experience-date {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.card {
  background: radial-gradient(100% 100% at 100% 0%, #171820 0%, var(--card) 70%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 40px var(--shadow);
  padding: clamp(16px, 3.2vw, 24px);
}

.intro {
  margin-bottom: 24px;
}

h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: clamp(20px, 2.8vw, 24px);
}

h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: clamp(18px, 2.4vw, 20px);
}

.stats {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.stats .label {
  color: var(--muted);
  margin-right: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.list {
  margin: 0;
  padding-left: 18px;
}

.overview {
  margin: 8px 0 0;
  padding-left: 18px;
}

.overview > li { margin: 6px 0; }
.overview em { color: var(--muted); font-style: italic; }

.links a {
  color: var(--accent);
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

.highlights {
  margin-top: 24px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.highlight {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #181a22, #14151a);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
}

.highlight .metric {
  font-weight: 700;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--accent);
}

.highlight .desc {
  color: var(--muted);
  font-size: 12px;
}

.site-footer {
  position: fixed;
  bottom: 16px;
  left: 16px;
  color: var(--muted);
  font-size: 12px;
}

/* Projects Section */
.projects-container {
  width: 100%;
}

.search-box {
  position: relative;
  margin-bottom: 24px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 160ms ease, background 160ms ease;
}

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

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.05);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.search-icon svg {
  width: 100%;
  height: 100%;
  fill: white;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

/* A grid item that forces a break between rows when inserted by JS */
.row-break {
  grid-column: 1 / -1;
  height: 0;
  width: 100%;
}

.project-card {
  background: radial-gradient(100% 100% at 100% 0%, #171820 0%, var(--card) 70%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 40px var(--shadow);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 24px 48px rgba(79, 209, 197, 0.15);
}

.project-card { cursor: pointer; }

.project-image {
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.1), rgba(79, 209, 197, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.project-image.no-photo {
  height: 96px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.project-image.no-photo .project-title {
  font-size: 14px;
  color: var(--muted);
}

.project-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Ensure project cards that include images always occupy a full grid row */
.project-card.has-image {
  grid-column: 1 / -1;
}

.project-title {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.project-date {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.project-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  display: inline-block;
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.tag.overflow {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 4px 0;
}

.project-links {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease;
}

.project-link:hover {
  background: rgba(79, 209, 197, 0.15);
  border-color: var(--accent);
}

.project-link svg {
  width: 14px;
  height: 14px;
}

.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.no-results p {
  margin: 0 0 16px 0;
  font-size: 15px;
}

.github-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  transition: background 160ms ease;
}

.github-link:hover {
  background: rgba(79, 209, 197, 0.15);
}

/* Internships Section - Reuse Projects Styles */
.internships-container {
  width: 100%;
}

.internships-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.internship-card {
  background: radial-gradient(100% 100% at 100% 0%, #171820 0%, var(--card) 70%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 40px var(--shadow);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.internship-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 24px 48px rgba(79, 209, 197, 0.15);
}

.internship-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.1), rgba(79, 209, 197, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.internship-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.internship-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.internship-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}

.internship-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.internship-company {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

.internship-location {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.internship-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

.internship-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.internship-links {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .highlights-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  /* Stack shower counter below on mobile */
  .about-layout {
    flex-direction: column;
    gap: 32px;
  }
  
  .shower-counter {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .social-nav {
    bottom: 12px;
    right: 12px;
  }
  .icon-link {
    width: 32px;
    height: 32px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-image { height: 180px; }
}

/* Legacy v1 mobile rules removed: they hid the PaulTube brand on small screens and
   targeted v1-only classes (.site-header/.primary-nav/.tab-button/.social-nav). */

/* --- Seamless mode: remove remaining box shadows across the UI --- */
.modal,
.modal-card,
.chip-pop,
.video,
.vcard,
.story-hero,
.story-block {
  box-shadow: none !important;
}
