/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 300;
  background: #0f0f0f;
  /* Subtle warm atmospheric center — gives depth without adding color */
  background-image: radial-gradient(ellipse 85% 65% at 50% 46%, #181410 0%, #0f0f0f 68%);
  color: #e3e3db;
  overflow: hidden;
  height: 100dvh;
  -webkit-font-smoothing: antialiased;
  animation: pagein 0.7s ease both;
}

@keyframes pagein { from { opacity: 0; } to { opacity: 1; } }

img { display: block; width: 100%; height: auto; user-select: none; pointer-events: none; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }

/* ── Film grain ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── Intro flash ── */
.intro-flash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.intro-flash.out { opacity: 0; }

@keyframes logo-reveal {
  0%   { opacity: 0;   filter: brightness(0) invert(1) blur(20px); transform: scale(1.1); }
  18%  { opacity: 0.6; filter: brightness(0) invert(1) blur(6px);  transform: scale(1.03); }
  28%  { opacity: 0.1; filter: brightness(0) invert(1) blur(14px); transform: scale(1.06); }
  55%  { opacity: 1;   filter: brightness(0) invert(1) blur(0px);  transform: scale(1); }
  100% { opacity: 1;   filter: brightness(0) invert(1) blur(0px);  transform: scale(1); }
}

.intro-logo {
  width: clamp(70px, 9vw, 110px);
  opacity: 0;
}

.intro-flash.logo-in .intro-logo {
  animation: logo-reveal 1.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* ── Page exit ── */
@keyframes pageout { to { opacity: 0; } }
body.page-exit { animation: pageout 0.35s ease forwards; pointer-events: none; }

/* ── Header ── */
.site-header {
  position: fixed;
  top: clamp(8px, 2vh, 16px);
  left: 0;
  right: 0;
  z-index: 99;
  pointer-events: none;
}

.header-center {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(16px, 4vw, 40px);
  pointer-events: auto;
}

.nav-item-logo img {
  width: clamp(85px, 10vw, 120px);
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.info-text {
  color: #fff;
  letter-spacing: 1px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.menu-container {
  position: fixed;
  top: clamp(16px, 2.5vh, 24px);
  right: clamp(16px, 4vw, 40px);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.menu-text {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
}

.circle-btn {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 0.5px solid #fff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
}

.menu-container:hover .circle-btn {
  background-color: #fff;
  transform: scale(0.7);
}

body.menu-open .info-text,
body.menu-open .menu-text { color: #fff; }
body.menu-open .circle-btn { border-color: #fff; }
body.menu-open .menu-container:hover .circle-btn { background-color: #fff; }

/* ── Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

/* ── Overlay menu ── */
.overlay-menu {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 80px;
  color: #fff;
  z-index: 9;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay-menu.active { opacity: 1; visibility: visible; }

.menu-item {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: filter 0.3s, opacity 0.3s;
}

.menu-item.blurred { filter: blur(3px); opacity: 0.3; }

.menu-item-name { display: flex; align-items: center; }

.menu-item-name p {
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.menu-main-link { color: #fff; display: block; }
.menu-main-link p { transition: opacity 0.2s; }
.menu-main-link:hover p { opacity: 0.6; }

/* ── Submenu ── */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  width: 220px;
  pointer-events: none;
}

.menu-item-name:hover + .submenu,
.submenu:hover,
.menu-item.expanded .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.submenu-item {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.5px;
  padding: 6px 0;
  transition: opacity 0.25s;
}

.submenu-item:hover { opacity: 0.6; }

/* ── Overlay menu footer ── */
.menu-footer {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  color: #fff;
  font-size: 11px;
  z-index: 10;
}

.menu-footer::before {
  content: "";
  position: absolute;
  bottom: 48px;
  left: 60px; right: 60px;
  height: 1px;
  background: rgba(255,255,255,0.3);
}

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: calc(100% - 120px);
  margin: 0 auto;
}

.footer-links { display: flex; gap: 16px; justify-self: start; }
.social-icons { display: flex; gap: 22px; align-items: center; justify-self: center; }
.social-icons a { display: flex; align-items: center; color: rgba(255,255,255,0.85); transition: opacity 0.3s; }
.social-icons a:hover { opacity: 0.7; }
.social-icons svg { width: 16px; height: 16px; }
.menu-footer .copyright { color: rgba(255,255,255,0.7); justify-self: end; font-size: 0.775rem; }

/* ═══════════════════════════════
   CHALLENGE PAGE LAYOUT
   ═══════════════════════════════ */

/* Corner crop marks */
.crop {
  position: fixed;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 3;
}
.crop-tl { top: 22px; left: 22px; border-top: 2px solid rgba(255,255,255,0.22); border-left: 2px solid rgba(255,255,255,0.22); }
.crop-tr { top: 22px; right: 22px; border-top: 2px solid rgba(255,255,255,0.22); border-right: 2px solid rgba(255,255,255,0.22); }
.crop-bl { bottom: 22px; left: 22px; border-bottom: 2px solid rgba(255,255,255,0.22); border-left: 2px solid rgba(255,255,255,0.22); }
.crop-br { bottom: 22px; right: 22px; border-bottom: 2px solid rgba(255,255,255,0.22); border-right: 2px solid rgba(255,255,255,0.22); }

/* Full-viewport centered layout */
.challenge-main {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 5vw, 60px);
}

/* Faint day number — bleeds off bottom-right */
.challenge-main::before {
  content: attr(data-day);
  position: fixed;
  bottom: -0.12em;
  right: -0.04em;
  font-size: 34vw;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.025);
  pointer-events: none;
  line-height: 1;
  letter-spacing: -0.05em;
  user-select: none;
  z-index: 0;
}

/* Centered content block */
.challenge-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Meta row */
.brief-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.28em;
  font-weight: 500;
  color: rgba(227, 227, 219, 0.48);
  margin-bottom: clamp(20px, 3.5vh, 38px);
}

.meta-sep {
  color: rgba(227, 227, 219, 0.2);
}

/* Theme word — the whole page */
.theme-word {
  font-size: clamp(3.8rem, 13vw, 13rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.88;
  color: #ffffff;
  text-shadow:
    0 0 60px rgba(255, 248, 230, 0.24),
    0 0 160px rgba(255, 240, 200, 0.1);
  word-break: break-word;
  text-align: center;
  margin-bottom: clamp(28px, 4vh, 48px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.theme-word.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

/* Divider between word and description */
.brief-divider {
  display: block;
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  margin-bottom: clamp(22px, 3.5vh, 38px);
}

/* Description */
.theme-desc {
  font-size: clamp(0.84rem, 1.15vw, 0.95rem);
  font-weight: 300;
  color: rgba(227, 227, 219, 0.75);
  line-height: 1.8;
  max-width: 420px;
  text-align: center;
  margin-bottom: 14px;
  transition: opacity 0.25s ease;
}

.theme-desc.fade-out { opacity: 0; }

.challenge-rule {
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 400;
  color: rgba(227, 227, 219, 0.32);
  margin-bottom: clamp(24px, 4vh, 44px);
}

/* Actions */
.brief-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* ── Accept button — liquid glass ── */
.accept-btn {
  font-size: 10px;
  letter-spacing: 0.25em;
  font-weight: 500;
  padding: 15px 40px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.accept-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
}

@keyframes accepted-reveal {
  from { letter-spacing: 0.5em; opacity: 0.5; }
  to   { letter-spacing: 0.25em; opacity: 1; }
}

.accept-btn.accepted {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.88);
  cursor: default;
  animation: accepted-reveal 0.4s ease both;
}

/* ── Opt-in counter ── */
.opt-in-count {
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 400;
  color: rgba(227, 227, 219, 0.45);
}

/* ── Share link — secondary button ── */
.share-link {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.2em;
  font-weight: 500;
  padding: 13px 36px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}

.share-link:hover {
  border-color: rgba(255, 255, 255, 0.38);
  color: rgba(255, 255, 255, 0.92);
}

/* ── Mobile ── */
@media (max-width: 1000px) {
  body.menu-open { overflow: hidden; position: fixed; width: 100%; }

  .overlay-menu {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 50px 0 0 7px;
    overflow-y: auto;
    gap: 0;
    height: 100%;
  }

  .menu-item { width: 100%; }

  .menu-item-name {
    display: flex;
    padding: clamp(16px, 3vh, 20px) 10px;
    align-items: center;
    position: relative;
    width: 100%;
    min-height: 60px;
  }

  .menu-item-name a.menu-main-link {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding-left: 10px;
    z-index: 10;
  }

  .menu-item-name p { font-size: clamp(18px, 6vw, 27px); pointer-events: none; z-index: 1; }

  .submenu {
    position: static !important;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: max-height 0.35s ease;
    padding: 0;
    pointer-events: none;
  }

  .submenu.active {
    max-height: 200px;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
  }

  .submenu-item { padding: 12px 24px 12px 2rem; font-size: 14px; }

  .menu-footer {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 20px 24px 10px;
    margin-bottom: calc(-6rem + env(safe-area-inset-bottom));
  }

  .menu-footer::before { display: none; }
  .footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 0 4px; width: 100%; }
  .footer-links { display: none !important; }
  .social-icons { gap: 16px; }
  .social-icons svg { width: 24px; height: 24px; }

  body { overflow: auto; height: auto; }

  .challenge-main {
    position: relative;
    min-height: 100dvh;
    padding: clamp(48px, 8vh, 72px) 28px clamp(48px, 8vh, 72px);
  }

  .crop { display: none; }

  .brief-meta { font-size: 9px; gap: 7px; flex-wrap: wrap; justify-content: center; }

  .theme-word { font-size: clamp(3.5rem, 16vw, 6rem); }
}

@media (max-width: 600px) {
  .challenge-main::before { font-size: 52vw; }
  .theme-word { font-size: clamp(3rem, 18vw, 5rem); }
}
