/* ══════════════════════════════════════════
   MichyHub Dashboard — style.css
   ══════════════════════════════════════════ */

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

:root {
  --cream:        #fdf8f0;
  --warm-white:   #fffcf7;
  --amber:        #e8813a;
  --amber-light:  #f5a361;
  --amber-dark:   #c4621d;
  --brown:        #3d2b1f;
  --brown-light:  #6b4a36;
  --sage:         #7a9e7e;
  --rose:         #d4837a;
  --slate:        #5c6e7a;
  --gold:         #c9a84c;
  --shadow:       0 4px 24px rgba(61,43,31,0.10);
  --shadow-hover: 0 12px 40px rgba(61,43,31,0.18);
}

body {
  background-color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  color: var(--brown);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 10% 0%,  rgba(232,129,58,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(201,168,76,0.10) 0%, transparent 55%);
}

/* ── Dashboard view ── */
#dashboard-view { display: block; }

/* ── Viewer view ── */
#viewer-view {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#viewer-view.active { display: flex; }
#dashboard-view.hidden { display: none; }

/* ── Back bar ── */
.back-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--warm-white);
  border-bottom: 1.5px solid rgba(61,43,31,0.08);
  box-shadow: 0 2px 12px rgba(61,43,31,0.07);
  flex-shrink: 0;
  z-index: 10;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--amber), var(--gold));
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 9px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 3px 12px rgba(232,129,58,0.35);
  white-space: nowrap;
}
.back-btn:hover {
  transform: translateX(-3px);
  box-shadow: 0 6px 20px rgba(232,129,58,0.45);
}
.back-btn svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
}

.back-bar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Iframe ── */
#tool-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ── Header ── */
header {
  text-align: center;
  padding: 52px 24px 32px;
}
.header-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--amber), var(--gold));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 100px;
  margin-bottom: 18px;
}
header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--brown);
  letter-spacing: -1px;
}
header h1 span { color: var(--amber); }
header p {
  margin-top: 12px;
  color: var(--brown-light);
  font-size: 1rem;
  opacity: 0.8;
}
.header-divider {
  width: 64px;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--gold));
  border-radius: 4px;
  margin: 20px auto 0;
}

/* ── Grid wrapper ── */
.grid-wrapper {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px 64px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 20px;
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(232,129,58,0.35), transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

/* ── Cards ── */
.card {
  background: var(--warm-white);
  border-radius: 18px;
  padding: 28px 22px 24px;
  border: 1.5px solid rgba(61,43,31,0.07);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s both;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--gold));
  opacity: 0;
  transition: opacity 0.22s;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: rgba(232,129,58,0.30);
}
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-2px) scale(1.01); }

.card-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.card-body { width: 100%; }
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 4px;
  line-height: 1.2;
}
.card-desc {
  font-size: 0.78rem;
  color: var(--brown-light);
  opacity: 0.75;
  line-height: 1.45;
}
.card-cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.5px;
  transition: gap 0.2s;
}
.card:hover .card-cta { gap: 9px; }
.card-cta svg { width: 13px; height: 13px; }

/* ── Icon colour themes ── */
.ic-amber { background: rgba(232,129,58,0.12); }
.ic-gold  { background: rgba(201,168,76,0.13); }
.ic-sage  { background: rgba(122,158,126,0.13); }
.ic-rose  { background: rgba(212,131,122,0.13); }
.ic-slate { background: rgba(92,110,122,0.13); }
.ic-plum  { background: rgba(130,90,140,0.13); }
.ic-teal  { background: rgba(60,150,140,0.13); }
.ic-brown { background: rgba(107,74,54,0.13); }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.78rem;
  color: var(--brown-light);
  opacity: 0.55;
  letter-spacing: 0.5px;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1)  { animation-delay: 0.04s; }
.card:nth-child(2)  { animation-delay: 0.08s; }
.card:nth-child(3)  { animation-delay: 0.12s; }
.card:nth-child(4)  { animation-delay: 0.16s; }
.card:nth-child(5)  { animation-delay: 0.20s; }
.card:nth-child(6)  { animation-delay: 0.24s; }
.card:nth-child(7)  { animation-delay: 0.28s; }
.card:nth-child(8)  { animation-delay: 0.32s; }
.card:nth-child(9)  { animation-delay: 0.36s; }
.card:nth-child(10) { animation-delay: 0.40s; }
.card:nth-child(11) { animation-delay: 0.44s; }
.card:nth-child(12) { animation-delay: 0.48s; }
.card:nth-child(13) { animation-delay: 0.52s; }
.card:nth-child(14) { animation-delay: 0.56s; }
.card:nth-child(15) { animation-delay: 0.60s; }
.card:nth-child(16) { animation-delay: 0.64s; }
.card:nth-child(17) { animation-delay: 0.68s; }
.card:nth-child(18) { animation-delay: 0.72s; }
.card:nth-child(19) { animation-delay: 0.76s; }

/* ── Responsive ── */
@media (max-width: 520px) {
  header { padding: 36px 16px 24px; }
  .grid  { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card  { padding: 20px 16px 18px; }
  .back-bar-title { display: none; }
}
