/* ===========================================
   CarrotCraft — Blocky Ember Forge Aesthetic
   =========================================== */

:root {
  --bg: #080808;
  --bg-card: #111;
  --bg-surface: #161616;
  --border: #1e1e1e;
  --border-hover: #2e2e2e;
  --accent: #ff8c00;
  --accent-light: #ffab40;
  --accent-dim: rgba(255, 140, 0, 0.07);
  --accent-glow: rgba(255, 140, 0, 0.15);
  --text: #e8e8e8;
  --text-dim: #777;
  --text-muted: #444;
  --discord: #5865F2;
  --discord-shadow: #4752c4;
  --youtube: #ff0033;
  --youtube-shadow: #cc0029;
  --radius: 10px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: 'Lexend', sans-serif;
  font-weight: 400;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}


/* ---- Navbar ---- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 24px rgba(255, 140, 0, 0.04);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-logo {
  height: 34px;
  width: auto;
}

.nav-title {
  font-family: 'Bungee', cursive;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.nav-links a {
  position: relative;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.25s, background-color 0.25s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s, left 0.3s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 60%;
  left: 20%;
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  width: 60%;
  left: 20%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ---- Hero ---- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 140, 0, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 140, 0, 0.018) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 85%, rgba(255, 140, 0, 0.07) 0%, transparent 55%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%;
}

.hero-title {
  font-family: 'Bungee', cursive;
  font-size: 5rem;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #ff8c00 0%, #ffb347 50%, #ff8c00 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 40px rgba(255, 140, 0, 0.18));
  animation: hero-enter 0.9s ease both, gradient-drift 8s ease-in-out infinite;
  animation-delay: 0.15s, 0.15s;
}

.hero-tagline {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--text-dim);
  max-width: 520px;
  margin-bottom: 2.5rem;
  animation: hero-enter 0.9s ease both;
  animation-delay: 0.35s;
}

.hero-buttons {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: hero-enter 0.9s ease both;
  animation-delay: 0.55s;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  animation: hero-enter 0.9s ease both, hint-bob 2.5s ease-in-out infinite;
  animation-delay: 1.2s, 2.1s;
  transition: opacity 0.3s;
}

.scroll-hint-text {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.scroll-hint svg {
  width: 14px;
  height: 14px;
}

/* Particles */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-particles span {
  position: absolute;
  bottom: -8px;
  display: block;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0;
  animation: ember-rise linear infinite;
}

.hero-particles span:nth-child(1) { width: 3px; height: 3px; left: 12%; animation-duration: 9s; animation-delay: 0s; }
.hero-particles span:nth-child(2) { width: 2px; height: 2px; left: 28%; animation-duration: 11s; animation-delay: 2s; }
.hero-particles span:nth-child(3) { width: 4px; height: 4px; left: 45%; animation-duration: 8s; animation-delay: 1s; }
.hero-particles span:nth-child(4) { width: 2px; height: 2px; left: 62%; animation-duration: 12s; animation-delay: 3.5s; }
.hero-particles span:nth-child(5) { width: 3px; height: 3px; left: 75%; animation-duration: 10s; animation-delay: 0.5s; }
.hero-particles span:nth-child(6) { width: 2px; height: 2px; left: 88%; animation-duration: 9s; animation-delay: 4s; }
.hero-particles span:nth-child(7) { width: 3px; height: 3px; left: 35%; animation-duration: 13s; animation-delay: 6s; }
.hero-particles span:nth-child(8) { width: 2px; height: 2px; left: 55%; animation-duration: 10s; animation-delay: 2.5s; }


/* ---- Buttons ---- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 8px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 2px 0 #b36200;
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 3px 0 #b36200;
}

.btn-primary:active {
  box-shadow: 0 1px 0 #b36200;
}

.btn-secondary {
  background: var(--border-hover);
  color: var(--text);
  box-shadow: 0 2px 0 #111;
}

.btn-secondary:hover {
  background: #383838;
  box-shadow: 0 3px 0 #111;
}

.btn-discord {
  background: var(--discord);
  color: #fff;
  box-shadow: 0 2px 0 var(--discord-shadow);
}

.btn-discord:hover {
  background: #6b76f5;
  box-shadow: 0 3px 0 var(--discord-shadow);
}

.btn-discord:active {
  box-shadow: 0 1px 0 var(--discord-shadow);
}

.btn-youtube {
  background: var(--youtube);
  color: #fff;
  box-shadow: 0 2px 0 var(--youtube-shadow);
}

.btn-youtube:hover {
  background: #ff3355;
  box-shadow: 0 3px 0 var(--youtube-shadow);
}

.btn-youtube:active {
  box-shadow: 0 1px 0 var(--youtube-shadow);
}


/* ---- Sections ---- */

.section {
  padding: 6rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-alt {
  max-width: none;
  background: var(--bg-surface);
}

.section-alt > * {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.section-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  margin: 0.6rem auto 0;
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-weight: 300;
  margin-bottom: 2.5rem;
  margin-top: 0.75rem;
}


/* ---- Grid ---- */

.grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}


/* ---- Cards ---- */

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.35s, border-color 0.35s;
}

/* Top accent bar — scales in on hover */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(255, 140, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card:hover::before {
  transform: scaleX(1);
}

.section-alt .card {
  background: var(--bg-card);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 1.65rem;
  background: var(--accent-dim);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.card-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.55;
  font-weight: 300;
}

/* Stagger animation for cards (enabled via JS) */
.has-js .fade-in .card,
.has-js .fade-in .address-item {
  opacity: 0;
  transform: translateY(16px);
}

.card-visible {
  animation: card-enter 0.55s cubic-bezier(0.2, 0, 0, 1) forwards;
}


/* ---- Connect ---- */

.connect-addresses {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 520px;
  margin: 2rem auto;
}

.address-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background-color 0.3s;
}

.address-item:hover {
  border-color: var(--accent);
  background: rgba(255, 140, 0, 0.02);
}

.address-item.copied {
  animation: copy-flash 0.5s ease;
}

.address-item.disabled {
  opacity: 0.4;
  cursor: default;
  border-left-color: var(--border);
}

.address-item.disabled:hover {
  border-color: var(--border);
  background: var(--bg-card);
}

.address-label {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  min-width: 105px;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}

.address-value {
  font-family: 'Lexend', sans-serif;
  font-weight: 500;
  color: var(--accent);
  font-size: 0.9rem;
  background: none;
}

.copy-feedback {
  position: absolute;
  right: 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.25s;
}

.copy-feedback.show {
  opacity: 1;
}

.connect-links {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}


/* ---- Announcements ---- */

.announcements-loading {
  text-align: center;
  color: var(--text-dim);
}

.announcement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.announcement-card.pinned {
  border-color: rgba(255, 140, 0, 0.3);
  box-shadow: 0 0 24px rgba(255, 140, 0, 0.04);
}

.announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.announcement-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.announcement-pin {
  font-size: 0.7rem;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  background: var(--accent);
  color: var(--bg);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.announcement-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 300;
}

.announcement-content {
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.65;
}


/* ---- Footer ---- */

.footer {
  position: relative;
  background: var(--bg-surface);
  padding: 2.5rem 2rem;
  text-align: center;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.footer-brand {
  font-family: 'Bungee', cursive;
  font-size: 1.1rem;
  color: var(--accent);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.4rem 0;
  font-weight: 300;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}


/* ---- Scroll-triggered section fade ---- */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0, 0, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ---- Keyframes ---- */

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradient-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@keyframes ember-rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  8% {
    opacity: 0.5;
  }
  70% {
    opacity: 0.35;
  }
  100% {
    transform: translateY(-105vh) scale(0.4);
    opacity: 0;
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes copy-flash {
  0% { background-color: var(--bg-card); }
  40% { background-color: rgba(255, 140, 0, 0.08); }
  100% { background-color: var(--bg-card); }
}


/* ---- Responsive ---- */

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(8, 8, 8, 0.98);
    backdrop-filter: blur(12px);
    padding: 1rem 2rem 1.25rem;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.6rem 0.75rem;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 4rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.4rem;
  }

  .hero-tagline {
    font-size: 0.95rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 260px;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }

  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .address-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .copy-feedback {
    position: static;
    opacity: 0;
  }

  .connect-links {
    flex-direction: column;
    align-items: center;
  }

  .connect-links .btn {
    width: 100%;
    max-width: 260px;
    text-align: center;
  }
}
