/* ═══════════════════════════════════════════
   CSS CUSTOM PROPERTIES & THEMING
   ═══════════════════════════════════════════ */
:root {
  --coral: #E07A5F;
  --coral-glow: rgba(224, 122, 95, 0.4);
  --coral-subtle: rgba(224, 122, 95, 0.08);
  --coral-border: rgba(224, 122, 95, 0.15);
  --gradient-start: #E8876D;
  --gradient-end: #C45A3A;
  --sage: #8BAF9A;
  --sage-subtle: rgba(139, 175, 154, 0.12);
  --sage-border: rgba(139, 175, 154, 0.3);
  --amber: #D4A574;
  --lavender: #B8A5C8;
  --bg: #FAF8F5;
  --text: #2D2D2D;
  --text-secondary: #6B6B6B;
  --text-tertiary: #9A9A9A;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(0, 0, 0, 0.04);
  --card-shadow: rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(250, 248, 245, 0.85);
  --divider: rgba(0, 0, 0, 0.06);

  /* Mesh blob opacities */
  --blob-1: 0.15;
  --blob-2: 0.12;
  --blob-3: 0.12;
  --blob-4: 0.10;
  --blob-5: 0.18;
}

[data-theme="dark"] {
  --coral: #EB8C6E;
  --sage: #A0C8AF;
  --bg: #161418;
  --text: #EBE9E6;
  --text-secondary: #A8A5A0;
  --text-tertiary: #6B6866;
  --card-bg: rgba(30, 27, 34, 0.8);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-shadow: rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(22, 20, 24, 0.9);
  --divider: rgba(255, 255, 255, 0.06);
  --coral-subtle: rgba(235, 140, 110, 0.06);
  --coral-border: rgba(235, 140, 110, 0.15);
  --sage-subtle: rgba(160, 200, 175, 0.12);
  --sage-border: rgba(160, 200, 175, 0.3);

  --blob-1: 0.06;
  --blob-2: 0.04;
  --blob-3: 0.04;
  --blob-4: 0.04;
  --blob-5: 0.07;
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.4s ease;
}

/* ═══════════════════════════════════════════
   MESH BACKGROUND
   ═══════════════════════════════════════════ */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}

.mesh-blob:nth-child(1) {
  width: 600px; height: 600px;
  background: var(--coral);
  opacity: var(--blob-1);
  top: -10%; right: -5%;
  animation: drift1 25s ease-in-out infinite alternate;
}
.mesh-blob:nth-child(2) {
  width: 500px; height: 500px;
  background: var(--sage);
  opacity: var(--blob-2);
  top: 30%; left: -10%;
  animation: drift2 30s ease-in-out infinite alternate;
}
.mesh-blob:nth-child(3) {
  width: 450px; height: 450px;
  background: var(--amber);
  opacity: var(--blob-3);
  top: 55%; right: 10%;
  animation: drift3 28s ease-in-out infinite alternate;
}
.mesh-blob:nth-child(4) {
  width: 400px; height: 400px;
  background: var(--lavender);
  opacity: var(--blob-4);
  bottom: 10%; left: 20%;
  animation: drift4 22s ease-in-out infinite alternate;
}
.mesh-blob:nth-child(5) {
  width: 550px; height: 550px;
  background: var(--coral);
  opacity: var(--blob-5);
  top: 75%; right: -15%;
  animation: drift5 26s ease-in-out infinite alternate;
}

@keyframes drift1 { to { transform: translate(-80px, 60px) scale(1.1); } }
@keyframes drift2 { to { transform: translate(60px, -40px) scale(0.9); } }
@keyframes drift3 { to { transform: translate(-50px, 70px) scale(1.05); } }
@keyframes drift4 { to { transform: translate(70px, -50px) scale(1.1); } }
@keyframes drift5 { to { transform: translate(-60px, -80px) scale(0.95); } }

/* ═══════════════════════════════════════════
   NOISE TEXTURE OVERLAY
   ═══════════════════════════════════════════ */
.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ═══════════════════════════════════════════
   LAYOUT UTILITY
   ═══════════════════════════════════════════ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--divider);
  transition: background 0.4s ease;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-brand img {
  width: 34px; height: 34px;
  border-radius: 8px;
}

.nav-brand span {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.3px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--divider);
  background: var(--card-bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  color: var(--text);
}
.theme-toggle:hover {
  background: var(--coral-subtle);
  border-color: var(--coral);
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--divider);
  padding: 40px 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-brand img {
  width: 24px; height: 24px;
  border-radius: 6px;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a,
.footer-links .footer-link-button {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-links .footer-link-button:hover {
  color: var(--coral);
}

.footer-link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ═══════════════════════════════════════════
   FEEDBACK MODAL
   ═══════════════════════════════════════════ */
.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.feedback-modal.open {
  display: flex;
  animation: feedback-fade-in 0.2s ease;
}

@keyframes feedback-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.feedback-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px var(--card-shadow);
  padding: 28px 28px 24px;
  animation: feedback-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes feedback-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.feedback-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.feedback-close:hover {
  background: var(--coral-subtle);
  color: var(--coral);
}

.feedback-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 6px;
}

.feedback-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.feedback-form { display: flex; flex-direction: column; gap: 14px; }

.feedback-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.feedback-categories {
  border: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-categories .feedback-label { width: 100%; margin-bottom: 4px; }

.feedback-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: var(--card-bg);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.feedback-chip:hover { border-color: var(--coral-border); color: var(--text); }
.feedback-chip input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-chip:has(input:checked) {
  background: var(--coral-subtle);
  border-color: var(--coral);
  color: var(--coral);
  font-weight: 600;
}

.feedback-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--divider);
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-subtle);
}

.feedback-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 12px;
  min-height: 18px;
}
.feedback-counter { color: var(--text-tertiary); }
.feedback-status { color: var(--text-tertiary); text-align: right; }
.feedback-status--ok  { color: var(--sage); font-weight: 600; }
.feedback-status--err { color: #C45A3A; font-weight: 600; }

.feedback-submit {
  margin-top: 4px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--coral-glow);
  transition: transform 0.15s ease, box-shadow 0.2s, opacity 0.2s;
}
.feedback-submit:hover:not(:disabled) { transform: translateY(-1px); }
.feedback-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

@media (max-width: 480px) {
  .feedback-card { padding: 22px 20px 20px; border-radius: 16px; }
  .feedback-title { font-size: 20px; }
}
