/* ============ THE HIVE ============ */
:root {
  --bg: #0d0a05;
  --bg2: #171106;
  --panel: #1d1509;
  --line: rgba(255, 179, 0, 0.16);
  --honey: #ffb300;
  --honey2: #ffd54d;
  --honey-glow: rgba(255, 179, 0, 0.35);
  --cream: #f7ecd4;
  --dim: #a8987a;
  --ink: #191006;
  --danger: #ff5d45;
  --font-ui: "Space Grotesk", "Segoe UI", sans-serif;
  --font-display: "Bungee", "Arial Black", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-ui);
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--honey); color: var(--ink); }

::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--honey), #7a5200);
  border-radius: 6px; border: 2px solid var(--bg);
}

/* ---------- parallax honeycomb background ---------- */
.comb-bg {
  position: fixed; inset: -10%;
  z-index: 0; pointer-events: none;
  perspective: 900px;
}
.comb-layer {
  position: absolute; inset: -20%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='194' viewBox='0 0 112 194'%3E%3Cg fill='none' stroke='%23ffb300' stroke-width='2'%3E%3Cpath d='M56 2 L108 32 L108 96 L56 126 L4 96 L4 32 Z'/%3E%3Cpath d='M56 130 L108 160 L108 194 M56 130 L4 160 L4 194'/%3E%3C/g%3E%3C/svg%3E");
  will-change: transform;
}
.comb-far  { opacity: 0.045; background-size: 300px; transform: translateZ(-420px) scale(1.9); }
.comb-mid  { opacity: 0.06;  background-size: 190px; transform: translateZ(-220px) scale(1.5); }
.comb-near { opacity: 0.075; background-size: 120px; transform: translateZ(-60px)  scale(1.15); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  padding: 12px 26px;
  background: rgba(13, 10, 5, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  font-size: 20px; letter-spacing: 1px;
  color: var(--cream); text-decoration: none;
  display: flex; align-items: center;
}
.brand em { color: var(--honey); font-style: normal; }
.brand-hex {
  color: var(--honey); margin-right: 8px; font-size: 24px;
  display: inline-block; animation: hex-spin 9s linear infinite;
}
@keyframes hex-spin { to { transform: rotateY(360deg); } }

.topbar-links { display: flex; gap: 18px; flex: 1; }
.nav-link {
  color: var(--dim); text-decoration: none; font-weight: 700;
  font-size: 13px; letter-spacing: 2px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--honey2); }

.topbar-tools { display: flex; align-items: center; gap: 14px; }
.save-status {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--honey2); opacity: 0; transition: opacity 0.3s;
}
.save-status.show { opacity: 1; }
.save-status.err { color: var(--danger); }

.edit-toggle {
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: 1px;
  color: var(--ink); background: linear-gradient(180deg, var(--honey2), var(--honey));
  border: none; border-radius: 10px;
  padding: 10px 16px; cursor: pointer;
  box-shadow: 0 4px 0 #7a5200, 0 8px 22px rgba(0,0,0,0.5);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.2s;
}
.edit-toggle:hover { filter: brightness(1.08); }
.edit-toggle:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a5200; }
.edit-toggle .et-on { display: none; }
body.editing .edit-toggle .et-on { display: inline; }
body.editing .edit-toggle .et-off { display: none; }
body.editing .edit-toggle {
  background: repeating-linear-gradient(-45deg, var(--honey) 0 14px, var(--ink) 14px 28px);
  color: var(--cream); text-shadow: 0 1px 3px #000;
}

/* ---------- edit banner ---------- */
.edit-banner {
  position: sticky; top: 57px; z-index: 40;
  max-height: 0; overflow: hidden;
  text-align: center; font-size: 13px; letter-spacing: 0.5px;
  background: repeating-linear-gradient(-45deg, rgba(255,179,0,.16) 0 16px, rgba(255,179,0,.05) 16px 32px), var(--bg2);
  border-bottom: 0 solid var(--line);
  color: var(--honey2);
  transition: max-height 0.3s ease, padding 0.3s ease;
}
body.editing .edit-banner { max-height: 60px; padding: 9px 16px; border-bottom-width: 1px; }
.edit-banner b { color: var(--cream); }

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 1;
  min-height: 78vh;
  display: grid; place-items: center;
  padding: 60px 20px 80px;
  perspective: 1100px;
  overflow: hidden;
}
.hero-3d {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.15s ease-out;
}
.hero-inner {
  text-align: center;
  transform-style: preserve-3d;
}
.hero-kicker {
  font-weight: 700; letter-spacing: 7px; font-size: 13px;
  color: var(--dim);
  transform: translateZ(30px);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 168px);
  line-height: 0.95;
  margin: 12px 0 6px;
  transform: translateZ(80px);
  color: var(--cream);
  text-shadow:
    0 1px 0 #6b4a00, 0 2px 0 #63451f, 0 3px 0 #57401c, 0 4px 0 #4c3819,
    0 5px 0 #413016, 0 6px 0 #362813, 0 7px 0 #2b2010, 0 8px 0 #20180c,
    0 14px 30px rgba(0, 0, 0, 0.7);
}
.honey-word {
  background: linear-gradient(180deg, #ffe082 8%, var(--honey) 55%, #c97e00 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 0 #4c3200) drop-shadow(0 16px 34px rgba(255, 179, 0, 0.35));
}
.hero-sub {
  letter-spacing: 5px; font-size: clamp(11px, 2vw, 15px); font-weight: 500;
  color: var(--dim);
  transform: translateZ(45px);
}
.hero-stats {
  display: flex; gap: 34px; justify-content: center;
  margin: 40px 0 34px;
  transform: translateZ(60px);
}
.stat { text-align: center; }
.stat b {
  display: block; font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 36px); color: var(--honey);
}
.stat span { font-size: 11px; letter-spacing: 2.5px; color: var(--dim); font-weight: 700; }

.hero-cta {
  display: inline-block;
  font-family: var(--font-display); font-size: 15px; letter-spacing: 1px;
  color: var(--ink); text-decoration: none;
  background: linear-gradient(180deg, var(--honey2), var(--honey));
  padding: 15px 30px; border-radius: 14px;
  box-shadow: 0 5px 0 #7a5200, 0 16px 34px rgba(255, 179, 0, 0.25);
  transform: translateZ(70px);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.2s;
}
.hero-cta:hover { filter: brightness(1.1); transform: translateZ(70px) scale(1.04); }
.hero-cta:active { transform: translateZ(70px) translateY(4px); box-shadow: 0 1px 0 #7a5200; }

.hero-hex-a, .hero-hex-b {
  position: absolute; pointer-events: none;
  width: 190px; height: 190px;
  background: linear-gradient(160deg, rgba(255, 213, 77, 0.16), rgba(255, 179, 0, 0.03));
  border: 1px solid var(--line);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.hero-hex-a {
  left: -160px; top: -40px;
  transform: translateZ(-120px) rotate(14deg);
  animation: float-a 7s ease-in-out infinite;
}
.hero-hex-b {
  right: -180px; bottom: -30px; width: 240px; height: 240px;
  transform: translateZ(-160px) rotate(-9deg);
  animation: float-b 9s ease-in-out infinite;
}
@keyframes float-a {
  0%, 100% { transform: translateZ(-120px) rotate(14deg) translateY(0); }
  50% { transform: translateZ(-120px) rotate(19deg) translateY(-22px); }
}
@keyframes float-b {
  0%, 100% { transform: translateZ(-160px) rotate(-9deg) translateY(0); }
  50% { transform: translateZ(-160px) rotate(-14deg) translateY(26px); }
}

/* ---------- the bee ---------- */
.bee {
  position: absolute; width: 74px; height: 62px;
  top: 0; left: 0; z-index: 5; pointer-events: none;
  offset-path: path("M -80 140 C 150 -60, 420 260, 640 90 C 780 -10, 900 190, 1120 120 C 1240 80, 1300 200, 1440 160");
  offset-rotate: auto;
  animation: bee-fly 17s linear infinite;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}
@keyframes bee-fly {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}
.bee-body-group { animation: bee-bob 0.9s ease-in-out infinite; transform-origin: 58px 58px; }
@keyframes bee-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-3deg); }
}
.bee-wing {
  fill: rgba(247, 236, 212, 0.75);
  stroke: rgba(255, 213, 77, 0.7); stroke-width: 2;
  transform-origin: 55px 42px;
  animation: flap 0.12s ease-in-out infinite alternate;
}
.bee-wing-r { animation-delay: 0.06s; opacity: 0.8; }
@keyframes flap {
  from { transform: rotate(-14deg) scaleY(1); }
  to { transform: rotate(16deg) scaleY(0.72); }
}

/* ---------- gallery sections ---------- */
main { position: relative; z-index: 1; }
.gallery { padding: 30px clamp(16px, 4vw, 56px) 30px; }
.section-head {
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  margin: 26px 0 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 34px);
  color: var(--honey);
  text-shadow: 0 3px 0 #4c3200, 0 8px 20px rgba(0, 0, 0, 0.6);
}
.section-head p { color: var(--dim); font-size: 12px; letter-spacing: 2.5px; font-weight: 700; }

.grid {
  display: grid; gap: 18px;
  perspective: 1400px;
}
.grid-shorts { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

/* ---------- cards ---------- */
.card {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0) rotateY(0);
  transition: transform 0.18s ease-out;
  cursor: pointer;
  opacity: 0;
}
.card.revealed { opacity: 1; animation: card-in 0.6s cubic-bezier(0.2, 0.8, 0.25, 1) both; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(46px) rotateX(-24deg) scale(0.9); }
  to { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

.card-cell {
  position: relative; overflow: hidden;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 10px), 0 10px);
  transform: translateZ(24px);
  transition: box-shadow 0.2s;
}
.grid-shorts .card-cell { aspect-ratio: 9 / 16; }
.grid-wide .card-cell { aspect-ratio: 16 / 9; }

.card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.35s ease, filter 0.3s;
  filter: saturate(0.92) brightness(0.94);
}
.card:hover img { transform: scale(1.07); filter: saturate(1.1) brightness(1.05); }
.card:hover .card-cell {
  box-shadow: 0 0 0 2px var(--honey), 0 18px 44px rgba(0, 0, 0, 0.65), 0 0 38px var(--honey-glow);
}

.card-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; transition: opacity 0.2s;
  background: radial-gradient(circle at 50% 55%, rgba(13, 10, 5, 0.0) 30%, rgba(13, 10, 5, 0.55));
}
.card:hover .card-play { opacity: 1; }
.card-play span {
  width: 52px; height: 52px; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--honey2), var(--honey));
  color: var(--ink); font-size: 20px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  padding-left: 3px;
}

.card-dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(13, 10, 5, 0.8);
  color: var(--honey2);
  border: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 20px;
  backdrop-filter: blur(4px);
}
.card-num {
  position: absolute; left: 8px; top: 8px;
  font-family: var(--font-display); font-size: 11px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--honey2), var(--honey));
  padding: 3px 8px;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
  opacity: 0; transform: translateY(-4px); transition: opacity 0.2s, transform 0.2s;
}
body.editing .card-num, .card:hover .card-num { opacity: 1; transform: translateY(0); }

.card-titlebar {
  margin-top: 9px;
  transform: translateZ(36px);
}
.card-title {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 6px;
  padding: 3px 6px;
}
.grid-wide .card-title { font-size: 14px; }

.card-tools {
  position: absolute; top: 7px; right: 7px;
  display: flex; gap: 4px;
  z-index: 3;
}

.card-rename {
  width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center;
  font-size: 12px; line-height: 1;
  color: var(--honey2);
  background: rgba(13, 10, 5, 0.82);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.card:hover .card-rename, body.editing .card-rename { opacity: 1; }
.card-rename:hover { background: var(--honey); color: var(--ink); }

.card-del {
  width: 24px; height: 24px; padding: 0;
  display: none; place-items: center;
  font-size: 11px; line-height: 1;
  color: var(--danger);
  background: rgba(13, 10, 5, 0.82);
  border: 1px solid rgba(255, 93, 69, 0.45);
  border-radius: 7px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s, color 0.2s;
}
body.editing .card-del { display: grid; }
.card-del:hover { background: var(--danger); color: #fff; }

.card-removing {
  animation: card-out 0.22s ease-in forwards !important;
  pointer-events: none;
}
@keyframes card-out {
  to { opacity: 0; transform: scale(0.82) translateY(-10px); }
}

/* ---------- undo bar ---------- */
.undo-bar {
  position: fixed; left: 50%; bottom: 26px; z-index: 90;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 179, 0, 0.12);
  font-size: 13px; font-weight: 500;
  color: var(--cream);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.undo-bar.show { opacity: 1; transform: translate(-50%, 0); }
.undo-bar button {
  font-family: var(--font-display); font-size: 12px; letter-spacing: 1px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--honey2), var(--honey));
  border: none; border-radius: 8px;
  padding: 7px 14px; cursor: pointer;
  box-shadow: 0 3px 0 #7a5200;
}
.undo-bar button:active { transform: translateY(2px); box-shadow: none; }

/* ---------- edit mode ---------- */
body.editing .card { cursor: grab; }
body.editing .card:active { cursor: grabbing; }
body.editing .card-cell { outline: 2px dashed rgba(255, 179, 0, 0.5); outline-offset: -2px; }
/* wobble lives on the inner cell so it never clashes with the card's reveal animation */
body.editing .card-cell { animation: wobble 0.34s ease-in-out infinite; }
body.editing .card:nth-child(2n) .card-cell { animation-delay: 0.09s; }
body.editing .card:nth-child(3n) .card-cell { animation-delay: 0.17s; animation-duration: 0.31s; }
@keyframes wobble {
  0%, 100% { transform: translateZ(24px) rotate(-0.7deg); }
  50% { transform: translateZ(24px) rotate(0.8deg); }
}
body.editing .card:hover .card-cell { animation-play-state: paused; }

body.editing .card-title {
  cursor: text;
  background: rgba(255, 179, 0, 0.09);
  outline: 1px dashed rgba(255, 179, 0, 0.4);
}
.card-title:focus {
  outline: 2px solid var(--honey) !important;
  background: var(--ink) !important;
  white-space: normal;
  animation: none;
}

.card.dragging { opacity: 0.35; }
.card.dragging .card-cell { animation: none !important; }
.card.drop-left .card-cell { box-shadow: -6px 0 0 var(--honey), 0 0 30px var(--honey-glow); }
.card.drop-right .card-cell { box-shadow: 6px 0 0 var(--honey), 0 0 30px var(--honey-glow); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 6, 2, 0.9);
  backdrop-filter: blur(10px);
}
.lb-shell {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 30px;
}
.lb-frame {
  position: relative; z-index: 2;
  max-width: min(92vw, 1400px);
  animation: lb-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes lb-in {
  from { transform: scale(0.85) rotateX(10deg); opacity: 0; }
  to { transform: scale(1) rotateX(0); opacity: 1; }
}
.lb-frame video {
  display: block;
  max-width: min(92vw, 1300px); max-height: 82vh;
  border-radius: 14px;
  border: 2px solid var(--honey);
  box-shadow: 0 0 60px var(--honey-glow), 0 30px 80px rgba(0, 0, 0, 0.8);
  background: #000;
}
.lb-title {
  text-align: center; margin-top: 14px;
  font-family: var(--font-display); font-size: 16px; letter-spacing: 1px;
  color: var(--honey2); text-shadow: 0 2px 8px #000;
}
.lb-close, .lb-prev, .lb-next {
  position: relative; z-index: 2;
  background: var(--panel); color: var(--honey2);
  border: 1px solid var(--line);
  width: 54px; height: 54px; border-radius: 50%;
  font-size: 26px; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.lb-close { position: absolute; top: 22px; right: 26px; font-size: 20px; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: var(--honey); color: var(--ink); transform: scale(1.08);
}

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 1;
  text-align: center; padding: 60px 20px 46px;
  border-top: 1px solid var(--line);
  margin-top: 50px;
  letter-spacing: 1px;
}
.footer b { color: var(--honey); }
.footer-dim { color: var(--dim); font-size: 12px; margin-top: 8px; letter-spacing: 2px; }

@media (max-width: 640px) {
  .topbar-links { display: none; }
  .hero-stats { gap: 20px; }
  .grid-shorts { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
  .lb-prev, .lb-next { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bee, .card, .brand-hex, .hero-hex-a, .hero-hex-b { animation: none !important; }
  .card { opacity: 1; }
}
