/* =================================
   PARIAH'S POST
   ================================= */

:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --bg: #050505;

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);

  --accent-1: #ec4899;
  --accent-2: #f97316;
  --accent-3: #fbbf24;

  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(139, 92, 246, 0.4);

  --radius: 24px;
  --radius-sm: 16px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Gradient Background */
.board {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Ambient gradient blobs */
.board::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(249, 115, 22, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 40% 60% at 60% 10%, rgba(251, 191, 36, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Noise texture overlay */
.board::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: -1;
}

/* Header */
.board-header {
  text-align: center;
  padding: 1.5rem 0 2.5rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 1rem;
  background: linear-gradient(
    135deg,
    #ec4899 0%,
    #f97316 40%,
    #fbbf24 70%,
    #ffffff 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 8s ease infinite;
}

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

.site-tagline {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-secondary);
}

/* Notices Container */
.notices {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  width: 100%;
  padding: 1rem 0;
}

/* Section */
.notices-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-left: 0.25rem;
}

/* Card Grid */
.notices-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* Glass Card */
.notice {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  min-height: 110px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Gradient border on hover - using pseudo element */
.notice::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.notice:hover::before {
  background: linear-gradient(
    135deg,
    var(--accent-1) 0%,
    var(--accent-2) 50%,
    var(--accent-3) 100%
  );
  opacity: 1;
}

/* Glow effect */
.notice::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    135deg,
    var(--accent-1) 0%,
    var(--accent-2) 50%,
    var(--accent-3) 100%
  );
  opacity: 0;
  filter: blur(25px);
  z-index: -1;
  transition: opacity 0.4s ease;
}

.notice:hover::after {
  opacity: 0.25;
}

.notice:hover {
  transform: translateY(-4px) scale(1.02);
  background: rgba(255, 255, 255, 0.05);
  border-color: transparent;
}

.notice:focus {
  outline: none;
}

.notice:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* Card Content */
.notice-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
  transition: color 0.3s ease;
}

.notice:hover .notice-title {
  background: linear-gradient(135deg, #fff 0%, var(--accent-1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.notice-tagline {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.notice:hover .notice-tagline {
  color: var(--text-secondary);
}

/* Card Icons */
.notice-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.notice-icon svg {
  width: 100%;
  height: 100%;
}

/* Image-based icons */
.notice-icon-img img {
  width: 100%;
  height: 100%;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.notice:hover .notice-icon-img img {
  opacity: 0.8;
}

.notice:hover .notice-icon {
  color: var(--text-secondary);
}

/* Category Tags */
.category-tags {
  display: flex;
  gap: 0.375rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.category-tag {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: opacity 0.3s ease;
}

.category-tag--gdkp {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-2);
}

.category-tag--guild {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.category-tag--personal {
  background: rgba(236, 72, 153, 0.15);
  color: var(--accent-1);
}

/* Stagger Animation */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notice {
  opacity: 0;
  animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.section-title {
  opacity: 0;
  animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Clickable Quote */
.site-tagline {
  cursor: pointer;
  transition: opacity 0.3s ease, color 0.3s ease;
  display: inline-block;
}

.site-tagline:hover {
  color: var(--text-primary);
}

.site-tagline.fade-out {
  opacity: 0;
}

/* Cursor Glow */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle,
    rgba(236, 72, 153, 0.08) 0%,
    rgba(249, 115, 22, 0.04) 30%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.cursor-glow.active {
  opacity: 1;
}

/* Rainbow Mode (Konami) */
@keyframes rainbow-border {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.rainbow-mode .notice::before,
.rainbow-mode .notice::after {
  opacity: 1 !important;
  animation: rainbow-border 2s linear infinite;
}

.rainbow-mode .site-title {
  animation: gradient-shift 1s ease infinite, rainbow-border 2s linear infinite;
}

/* Footer */
.board-footer {
  margin-top: auto;
  padding: 2rem 0 1rem;
  text-align: center;
}

.board-footer p {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* =================
   MODAL
   ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1rem;
}

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

.modal {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-right: 2rem;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-subtitle {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.modal-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.modal-links li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-links a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.modal-links a:hover {
  color: var(--accent-3);
  text-decoration: underline;
}

.modal-link-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}

/* =================
   RESPONSIVE
   ================= */

@media (max-width: 1100px) {
  .notices-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .board {
    padding: 2rem 1rem;
  }

  .board-header {
    padding: 1rem 0 2rem;
  }

  .notices {
    gap: 2rem;
  }

  .notices-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .notice {
    min-height: 120px;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
  }

  .notice::before,
  .notice::after {
    border-radius: var(--radius-sm);
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .site-title,
  .section-title {
    animation: none;
  }

  .notice,
  .section-title {
    animation: none;
    opacity: 1;
  }

  .notice,
  .notice::before,
  .notice::after,
  .notice-title,
  .notice-tagline,
  .notice-icon,
  .site-tagline,
  .cursor-glow,
  .category-tag {
    transition: none;
  }

  .rainbow-mode .notice::before,
  .rainbow-mode .notice::after,
  .rainbow-mode .site-title {
    animation: none;
  }
}
