:root {
  --color-bg: #F5F1E4;
  --color-surface: #FFFFFF;
  --color-text: #111111;
  --color-accent: #FFCC00;
  --color-accent-2: #FF3D8B;
  --color-divider: #111111;

  --color-neutral-100: #FFFFFF;
  --color-neutral-200: #F4F1E8;
  --color-neutral-300: #E8E4D6;
  --color-neutral-400: #111111;
  --color-neutral-500: #111111;
  --color-neutral-600: #55534B;
  --color-neutral-700: #33322C;
  --color-neutral-800: #1A1A16;
  --color-neutral-900: #0D0D0B;

  --color-accent-100: #FFF9DB;
  --color-accent-200: #FFF3B0;
  --color-accent-300: #FFE873;
  --color-accent-400: #FFDC58;
  --color-accent-500: #FFCC00;
  --color-accent-600: #E6B800;
  --color-accent-700: #B38F00;
  --color-accent-800: #806600;
  --color-accent-900: #4D3D00;

  --color-accent-2-100: #FFE3EE;
  --color-accent-2-200: #FFC2D9;
  --color-accent-2-300: #FF9EC4;
  --color-accent-2-400: #FF6FA6;
  --color-accent-2-500: #FF3D8B;
  --color-accent-2-600: #E01E6B;
  --color-accent-2-700: #B01555;
  --color-accent-2-800: #800F3D;
  --color-accent-2-900: #4D0925;

  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --font-heading-weight: 700;
  --font-body: "DM Sans", system-ui, sans-serif;

  --space-1: 4.6px;
  --space-2: 9.2px;
  --space-3: 13.8px;
  --space-4: 18.4px;
  --space-6: 27.6px;
  --space-8: 36.8px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 3px 3px 0 #111111;
  --shadow-md: 5px 5px 0 #111111;
  --shadow-lg: 9px 9px 0 #111111;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 30px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent-900); text-underline-offset: 3px; text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--color-accent-2-500); outline-offset: 2px; }
::selection { background: var(--color-accent-400); color: var(--color-text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  font-size: 13.5px; line-height: 1.2; color: var(--color-text);
  background: var(--color-surface); border: 3px solid var(--color-text);
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn svg { display: block; transition: transform .15s ease; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 #111111; }
.btn:hover svg { transform: scale(1.12) rotate(-6deg); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #111111; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--color-accent-400); color: var(--color-text); }
.btn-primary:hover { background: var(--color-accent-500); }
.btn-secondary { background: var(--color-surface); }
.btn-secondary:hover { background: var(--color-neutral-200); }
.btn-ghost { background: var(--color-accent-2-300); border-width: 2px; padding: 6px 12px; box-shadow: 2px 2px 0 #111111; }
.btn-ghost:hover { background: var(--color-accent-2-400); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #111111; }
.btn-ghost:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #111111; }

.icon-x {
  background: transparent; border: none; color: var(--color-text);
  font-size: 16px; padding: 2px 6px; cursor: pointer; line-height: 1;
  transition: transform .18s ease, color .18s ease;
}
.icon-x:hover { transform: rotate(90deg) scale(1.2); color: var(--color-accent-2-600); }

.input {
  width: 100%; min-height: 36px; padding: 8px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent-2-500);
  background: var(--color-surface);
  border: 3px solid var(--color-text); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .12s ease, transform .12s ease;
}
.input:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #111111; }
.input:focus-visible { outline-offset: 0; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--color-accent-2-500); }
textarea.input { min-height: 90px; resize: vertical; }

.tc-group:focus-within { border-color: var(--color-text) !important; box-shadow: 4px 4px 0 var(--color-accent-2-500); }
#removeChipBtn:hover { color: var(--color-accent-2-700); }

.wr-badge {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.wr-badge::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.9) 45%, transparent 80%);
  transform: skewX(-18deg);
  animation: wr-shimmer 3.6s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes wr-shimmer {
  0%   { left: -60%; }
  38%  { left: 130%; }
  100% { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
  .wr-badge::after { animation: none; }
}

#commentsContainer article { transition: transform .15s ease; }
#commentsContainer article:hover { transform: translateX(4px); }
#commentsContainer img { transition: transform .15s ease, box-shadow .15s ease; }
#commentsContainer img:hover { transform: scale(1.06) rotate(-1deg); }

html, body { margin: 0; background: var(--color-bg); }
* { box-sizing: border-box; }
a:hover { color: var(--color-accent-2-600); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #111111; border-radius: 6px; border: 2px solid var(--color-bg); }
::-webkit-scrollbar-track { background: transparent; }

@keyframes skel-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-pulse {
  background: linear-gradient(
    90deg,
    var(--color-neutral-300) 25%,
    var(--color-neutral-200) 50%,
    var(--color-neutral-300) 75%
  );
  background-size: 200% 100%;
  animation: skel-shimmer 1.8s ease-in-out infinite;
}

#videoWrap { position: relative; }
#videoSkeleton {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: var(--color-neutral-200);
  z-index: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#videoSkeleton.skel-hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
}
#videoSkeleton .skel-play {
  width: 54px; height: 54px;
  border: 3px solid var(--color-text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
#videoSkeleton .skel-bar {
  height: 12px; border-radius: 4px;
}
#videoSkeleton .skel-bar-1 { width: 100px; }
#videoSkeleton .skel-bar-2 { width: 64px; }

#videoSkeleton.skel-error .skeleton-pulse {
  animation: none;
  background: var(--color-neutral-300);
}
#videoSkeleton.skel-error .skel-play {
  background: var(--color-accent-2-200);
  box-shadow: var(--shadow-sm);
}
#videoSkeleton .skel-error-title {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 18px; color: var(--color-text);
  text-transform: uppercase; letter-spacing: -0.005em;
}
#videoSkeleton .skel-error-sub {
  font-size: 12.5px; color: var(--color-neutral-700);
  max-width: 34ch; text-align: center; line-height: 1.55;
  margin-top: -4px;
}

.review-skel-row {
  display: grid; grid-template-columns: 76px 1fr; gap: 16px;
  padding: 15px 2px;
}
.review-skel-row + .review-skel-row {
  border-top: 3px solid var(--color-neutral-300);
}
.review-skel-block { border-radius: 4px; }
.review-skel-tc   { height: 14px; width: 54px; margin-bottom: 6px; }
.review-skel-date { height: 10px; width: 42px; }
.review-skel-name { height: 16px; width: 110px; margin-bottom: 8px; }
.review-skel-text { height: 12px; margin-bottom: 6px; }
.review-skel-text.w80 { width: 80%; }
.review-skel-text.w55 { width: 55%; }
.review-skel-text.w40 { width: 40%; }

@keyframes poll-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(31,157,85,0.5); }
  50%      { opacity: 0.45; box-shadow: 0 0 0 5px rgba(31,157,85,0); }
}
.poll-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #1F9D55;
  border: 2px solid var(--color-text);
  border-radius: 50%;
  animation: poll-blink 2.2s ease-in-out infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes spin-full {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.refresh-spinning { pointer-events: none; opacity: 0.72; }
.refresh-spinning .refresh-icon {
  animation: spin-full 0.65s ease-in-out;
}

@keyframes note-slide-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
#commentsContainer article.note-enter {
  animation: note-slide-in 0.38s ease-out both;
}

@keyframes bump-pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.38) rotate(-4deg); }
  60%  { transform: scale(0.9) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
.count-bump {
  animation: bump-pop 0.4s cubic-bezier(.22,.68,.31,1.3);
}

@keyframes status-pop-in {
  0%   { opacity: 0; transform: translateY(5px) scale(0.9); }
  55%  { opacity: 1; transform: translateY(-2px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
#statusMsg.status-pop {
  display: inline-block;
  animation: status-pop-in 0.3s ease-out;
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}
.saving-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 3px solid var(--color-accent-300);
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: spinner-rotate 0.55s linear infinite;
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-pulse { animation: none; }
  .poll-dot { animation: none; opacity: 1; }
  .refresh-spinning .refresh-icon { animation: none; }
  #commentsContainer article.note-enter { animation: none; }
  .count-bump { animation: none; }
  #statusMsg.status-pop { animation: none; }
  .saving-spinner { animation: none; }
}

@media (max-width: 768px) {
  #projectTitle {
    display: none !important;
  }
  #commentCountLabel {
    display: none !important;
  }
  #footerTagline {
    display: none !important;
  }
  #mainHeader {
    padding-bottom: 12px !important;
    align-items: center !important;
  }
  #mainFooter {
    justify-content: center !important;
    text-align: center;
  }
}
