/* ---------------------------------------------------------------------------
   Community page and Edit (Layers) page, following the reference layouts.
   --------------------------------------------------------------------------- */

.cm, .ed {
  --cm-page: #0f1113;
  --cm-surface: #17181b;
  --cm-line: #ffffff14;
  --cm-lime: #d1fe17;
  --cm-secondary: #898a8b;
  --cm-grotesk: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --cm-inter: "Inter", ui-sans-serif, system-ui, sans-serif;
  display: block;
  background: var(--cm-page);
  color: #fff;
  font-family: var(--cm-inter);
  min-height: calc(100vh - 52px);
}
.cm *, .cm *::before, .cm *::after, .ed *, .ed *::before, .ed *::after { box-sizing: border-box; }
.cm h1, .cm h2, .cm p, .cm figure, .ed h1, .ed h2, .ed p, .ed figure { margin: 0; }
.cm a, .ed a { color: inherit; text-decoration: none; }
.cm button, .ed button { font: inherit; color: inherit; cursor: pointer; }
.cm-i, .ed-i { width: 1rem; height: 1rem; flex: none; }
.cm-container { width: 100%; max-width: 90rem; margin: 0 auto; padding-inline: 1rem; }

.cm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 2.75rem;
  padding-inline: 1.25rem; border: 0; border-radius: 0.75rem; font-size: 0.9375rem; font-weight: 600;
  white-space: nowrap; transition: filter 0.15s;
}
.cm .cm-btn-lime {
  background-color: var(--cm-lime); color: #1a1a1a;
  background-image: linear-gradient(180deg, rgba(255, 255, 20, 0) 0%, #ffff14 100%), linear-gradient(90deg, var(--cm-lime), var(--cm-lime));
  box-shadow: inset 0 -3px 0 0 #829b19;
}
.cm .cm-btn-lime:hover { filter: brightness(1.05); }
.cm .cm-btn-glass {
  height: 2.5rem; padding-inline: 1rem; font-size: 0.875rem; border-radius: 0.625rem;
  background: rgba(20, 22, 24, 0.72); border: 1px solid var(--cm-line); backdrop-filter: blur(8px);
}
.cm .cm-btn-glass:hover { background: rgba(32, 35, 38, 0.85); }

/* sub-nav */
.cm-tabs { display: flex; justify-content: center; gap: 0.25rem; padding: 0.75rem 1rem; }
.cm-tabs a {
  height: 2rem; display: inline-flex; align-items: center; padding-inline: 0.875rem; border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 500; color: var(--cm-secondary); transition: background-color 0.15s, color 0.15s;
}
.cm-tabs a:hover { color: #fff; }
.cm-tabs a[data-active] { background: #26292d; color: #fff; }

/* contest hero */
.cm-hero { position: relative; height: 42rem; overflow: hidden; isolation: isolate; }
@media (max-width: 767px) { .cm-hero { height: 34rem; } }
.cm-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.cm-hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.15) 100%);
}
.cm-hero-body {
  position: absolute; left: 3rem; top: 50%; transform: translateY(-50%); max-width: 34rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1rem;
}
@media (max-width: 767px) { .cm-hero-body { left: 1rem; right: 1rem; } }
.cm-hero-pill {
  display: inline-flex; align-items: center; gap: 0.375rem; height: 2rem; padding-inline: 0.75rem;
  border-radius: 9999px; background: rgba(209, 254, 23, 0.14); border: 1px solid rgba(209, 254, 23, 0.3);
  color: var(--cm-lime); font-size: 0.8125rem; font-weight: 600;
}
.cm-hero h1 { display: flex; flex-direction: column; gap: 0.25rem; }
.cm-hero-amount {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--cm-grotesk); font-weight: 700; font-size: 3rem; line-height: 1;
  background: linear-gradient(180deg, #ffe9a8, #c99a3a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cm-laurel { width: 1.75rem; height: 1.75rem; color: #c99a3a; }
.cm-hero-title {
  font-family: var(--cm-grotesk); font-weight: 700; text-transform: uppercase;
  font-size: 3rem; line-height: 1.05; letter-spacing: -0.03em; color: #d8d8d8;
}
@media (max-width: 767px) { .cm-hero-amount, .cm-hero-title { font-size: 2rem; } }
.cm-hero-sub { font-size: 1rem; line-height: 1.5rem; color: rgba(255, 255, 255, 0.72); }
.cm-hero-dates { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: rgba(255, 255, 255, 0.72); }
.cm-hero-thumbs { position: absolute; right: 3rem; bottom: 12rem; display: flex; gap: 1rem; }
@media (max-width: 1279px) { .cm-hero-thumbs { display: none; } }
.cm-hero-thumb { width: 13.75rem; height: 7.5rem; border-radius: 0.5rem; overflow: hidden; background: #1c1e21; }
.cm-hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cm-hero-thumb:nth-child(2) { opacity: 0.7; }
.cm-hero-thumb:nth-child(3) { opacity: 0.45; }
.cm-hero-nav { position: absolute; right: 3rem; top: 50%; transform: translateY(-50%); display: flex; gap: 0.75rem; }
@media (max-width: 767px) { .cm-hero-nav { display: none; } }
.cm-hero-nav button {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  border: 1px solid var(--cm-line); background: rgba(20, 22, 24, 0.6); backdrop-filter: blur(8px); color: #fff;
}
.cm-hero-nav button:hover { background: rgba(40, 43, 46, 0.8); }
.cm-hero-progress { position: absolute; left: 3rem; right: 3rem; bottom: 2.5rem; display: flex; gap: 0.5rem; }
.cm-hero-progress span { flex: 1; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
.cm-hero-progress span[data-active] { background: #fff; }

/* rows */
.cm-row { margin-top: 3.5rem; }
.cm-row-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.cm-row-head h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.cm-seeall {
  display: inline-flex; align-items: center; gap: 0.375rem; height: 2.25rem; padding-inline: 0.875rem;
  border: 1px solid var(--cm-line); border-radius: 0.625rem; background: var(--cm-surface);
  font-size: 0.8125rem; font-weight: 500;
}
.cm-seeall:hover { background: #22252a; }
.cm-row-body { position: relative; max-height: 34rem; overflow: hidden; }
.cm-row-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 12rem; display: grid; place-items: end center;
  padding-bottom: 2rem; pointer-events: none; background: linear-gradient(to top, var(--cm-page) 30%, transparent);
}
.cm-row-fade > * { pointer-events: auto; }

.cm-grid { display: grid; gap: 1rem; }
.cm-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023px) { .cm-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cm-poster { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 0.75rem; overflow: hidden; background: var(--cm-surface); }
.cm-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.cm-poster:hover img { transform: scale(1.04); }
.cm-poster-name {
  position: absolute; left: 0.75rem; bottom: 0.75rem; right: 0.75rem; font-size: 0.8125rem; font-weight: 600;
  opacity: 0; transition: opacity 0.15s; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.cm-poster:hover .cm-poster-name { opacity: 1; }

.cm-card { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 0.75rem; overflow: hidden; background: var(--cm-surface); }
.cm-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.cm-card:hover img { transform: scale(1.04); }
.cm-card-shade {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.15s;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent 55%);
}
.cm-card:hover .cm-card-shade, .cm-card:hover .cm-card-info { opacity: 1; }
.cm-card-info {
  position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; display: flex; flex-direction: column;
  gap: 0.25rem; opacity: 0; transition: opacity 0.15s;
}
.cm-card-title { font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.75rem; color: rgba(255, 255, 255, 0.75); }
.cm-card-stats { display: inline-flex; gap: 0.75rem; }
.cm-card-stats span { display: inline-flex; align-items: center; gap: 0.25rem; }
.cm-card-stats .cm-i { width: 0.875rem; height: 0.875rem; }

/* shots masonry */
.cm-masonry { columns: 5; column-gap: 1rem; }
@media (max-width: 1279px) { .cm-masonry { columns: 3; } }
@media (max-width: 767px) { .cm-masonry { columns: 2; } }
.cm-shot { position: relative; break-inside: avoid; margin-bottom: 1rem; border-radius: 0.75rem; overflow: hidden; background: var(--cm-surface); }
.cm-shot img { width: 100%; height: auto; display: block; }
.cm-shot figcaption {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 0.625rem; opacity: 0;
  transition: opacity 0.15s; background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 45%);
}
.cm-shot:hover figcaption { opacity: 1; }
.cm-shot-author { font-size: 0.75rem; font-weight: 500; }

/* ---- Edit (Layers) page -------------------------------------------------- */

.ed {
  position: relative;
  background:
    radial-gradient(60% 40% at 50% 22%, rgba(255, 255, 255, 0.05), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255, 255, 255, 0.025) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, 0.025) 23px 24px),
    var(--cm-page);
}
.ed-hero { display: flex; flex-direction: column; align-items: center; padding: 2rem 1rem 3rem; text-align: center; }
.ed-carousel { position: relative; height: 17rem; width: 100%; max-width: 78rem; }
.ed-card {
  position: absolute; left: 50%; top: 50%; width: 20rem; aspect-ratio: 16 / 10; margin: 0;
  border-radius: 0.75rem; overflow: hidden; background: #1c1e21; border: 1px solid var(--cm-line);
  transform: translate(calc(-50% + var(--o) * 15rem), -50%) scale(0.74);
  opacity: 0.45; filter: saturate(0.6); z-index: 1; cursor: pointer;
  transition: transform 0.35s ease, opacity 0.35s ease, filter 0.35s ease;
}
.ed-card[data-active] { transform: translate(-50%, -50%) scale(1); opacity: 1; filter: none; z-index: 3; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.ed-card video { width: 100%; height: 100%; object-fit: cover; }
.ed-card figcaption {
  position: absolute; left: 0.5rem; top: 0.5rem; display: inline-flex; align-items: center; gap: 0.375rem;
  height: 1.5rem; padding-inline: 0.5rem; border-radius: 0.5rem; background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px); font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.ed-card figcaption .ed-i { width: 0.75rem; height: 0.75rem; }
.ed-nav { display: flex; gap: 0.75rem; margin-top: 1rem; }
.ed-nav button {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9999px;
  border: 1px solid var(--cm-line); background: rgba(20, 22, 24, 0.6); color: #fff;
}
.ed-nav button:hover { background: #262a2e; }
.ed-pill {
  display: inline-flex; align-items: center; gap: 0.375rem; height: 1.875rem; margin-top: 2.5rem;
  padding-inline: 0.75rem; border-radius: 9999px; border: 1px solid var(--cm-line); background: var(--cm-surface);
  font-family: var(--cm-grotesk); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.ed h1 {
  margin-top: 1.5rem; font-family: var(--cm-grotesk); font-weight: 700; text-transform: uppercase;
  font-size: 2.25rem; line-height: 2.25rem; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff, #b9bbbd); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ed-hero > p { margin-top: 1rem; font-size: 1rem; line-height: 1.5rem; color: var(--cm-secondary); }
.ed-upload {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.75rem;
  height: 3.25rem; padding-inline: 2rem; border: 0; border-radius: 0.75rem; color: #1a1a1a;
  font-size: 1.0625rem; font-weight: 600;
  background-color: var(--cm-lime);
  background-image: linear-gradient(180deg, rgba(255, 255, 20, 0) 0%, #ffff14 100%), linear-gradient(90deg, var(--cm-lime), var(--cm-lime));
  box-shadow: inset 0 -3px 0 0 #829b19, 0 6px 24px rgba(209, 254, 23, 0.2);
}
.ed-upload:hover { filter: brightness(1.05); }
.ed-projects { max-width: 90rem; margin: 0 auto; padding: 0 1rem 4rem; }
.ed-projects h2 { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 1.125rem; font-weight: 600; }
.ed-empty {
  display: grid; place-items: center; margin-top: 1rem; min-height: 12rem;
  border: 1px dashed var(--cm-line); border-radius: 1rem; color: var(--cm-secondary); font-size: 0.875rem;
}
