/* ═══════════════════════════════════════════════════════
   Avalon Docs Hub — Alabast Design System
   Glass morphism · Layered shadows · Organic motion
   ═══════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Design Tokens ── */
:root {
  --primary: #6b8e7f;
  --primary-rgb: 107, 142, 127;
  --primary-light: rgba(107, 142, 127, 0.12);
  --primary-dark: #567368;

  --background: #060a08;
  --card-bg: rgba(15, 30, 22, 0.55);
  --surface: rgba(20, 38, 28, 0.4);

  --text-main: #f1f5f3;
  --text-muted: #8a9b94;

  --border: rgba(255, 255, 255, 0.07);
  --border-light: rgba(255, 255, 255, 0.04);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 40px -4px rgba(0, 0, 0, 0.35);

  --shadow-glass:
    0 20px 60px -10px rgba(0, 0, 0, 0.3),
    0 8px 24px -5px rgba(0, 0, 0, 0.15),
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.05),
    inset -1px -1px 2px 0 rgba(0, 0, 0, 0.1);

  --shadow-glass-hover:
    0 24px 48px -10px rgba(0, 0, 0, 0.4),
    0 12px 28px -5px rgba(0, 0, 0, 0.2),
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.08),
    inset -1px -1px 2px 0 rgba(0, 0, 0, 0.12);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 24px;

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-elastic: cubic-bezier(0.25, 1.05, 0.5, 1);
}

/* ── Base ── */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Libre Franklin', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Ambient background (parallax via JS custom props) ── */
:root {
  --grad-x1: 15%;
  --grad-y1: 45%;
  --grad-x2: 85%;
  --grad-y2: 75%;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at var(--grad-x1) var(--grad-y1), rgba(107, 142, 127, 0.13) 0%, transparent 55%),
    radial-gradient(ellipse at var(--grad-x2) var(--grad-y2), rgba(107, 142, 127, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, 0.02) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.6s ease;
}

/* ── Container ── */
.container {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
  padding: 2.5rem;
  gap: 3rem;
}

/* ═══════ LEFT — Presentation ═══════ */
.presentation {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeIn 0.7s var(--ease-standard) forwards;
}

.logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.logo span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.presentation h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.15;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.7s var(--ease-standard) 0.15s forwards;
}

.divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent);
  margin: 1.5rem 0;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  animation: scaleIn 0.6s var(--ease-standard) 0.35s forwards;
}

.presentation p {
  font-family: 'Libre Franklin', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 340px;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeInUp 0.6s var(--ease-standard) 0.45s forwards;
}

/* ═══════ RIGHT — Bento Grid ═══════ */
.hub {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  height: 100%;
  max-height: 460px;
}

/* ── Module Card (Glass Premium) ── */
.module-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-glass);
  transition:
    transform 0.3s var(--ease-standard),
    box-shadow 0.3s var(--ease-standard),
    border-color 0.3s var(--ease-standard),
    background 0.3s var(--ease-standard);

  /* Staggered entrance — delay set per card via style attr */
  opacity: 0;
  transform: translateY(30px);
  animation: cardEnter 0.6s var(--ease-bounce) forwards;
}

/* Cursor-following glow overlay */
.module-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    300px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(var(--primary-rgb), 0.12) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease-standard);
  border-radius: inherit;
  pointer-events: none;
}

/* Hover */
.module-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glass-hover);
  border-color: rgba(var(--primary-rgb), 0.25);
  background: rgba(15, 30, 22, 0.7);
}

.module-card:hover::before {
  opacity: 1;
}

/* Focus ring */
.module-card:focus-visible {
  outline: none;
  box-shadow: var(--shadow-glass), 0 0 0 3px rgba(var(--primary-rgb), 0.35);
}

/* ── Icon Box ── */
.icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: auto;
  transition: border-radius 0.35s var(--ease-standard);
  flex-shrink: 0;
}

/* Hover morph: square → circle */
.module-card:hover .icon-box {
  border-radius: 50%;
}

/* Icon color categories */
.icon-box--orange  { background: rgba(255, 140, 66, 0.12);  color: #FF8C42; }
.icon-box--teal    { background: rgba(78, 205, 196, 0.12);  color: #4ECDC4; }
.icon-box--purple  { background: rgba(139, 92, 246, 0.12);  color: #8b5cf6; }
.icon-box--pink    { background: rgba(255, 107, 107, 0.12); color: #FF6B6B; }
.icon-box--blue    { background: rgba(59, 130, 246, 0.12);  color: #3B82F6; }
.icon-box--green   { background: rgba(107, 142, 127, 0.15); color: #6b8e7f; }


/* ── Card text ── */
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
}


.card-desc {
  font-family: 'Libre Franklin', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}


/* ── Arrow ── */
.arrow {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 18px;
  height: 18px;
  opacity: 0.2;
  transition:
    opacity 0.3s var(--ease-standard),
    transform 0.3s var(--ease-standard);
}

.module-card:hover .arrow {
  opacity: 0.7;
  transform: translate(3px, -3px);
}

/* ═══════ Footer ═══════ */
.footer {
  position: fixed;
  bottom: 1.5rem;
  left: 2.5rem;
  font-family: 'Libre Franklin', sans-serif;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  opacity: 0;
  animation: fadeIn 0.5s var(--ease-standard) 1s forwards;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.15s;
}

.footer a:hover {
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .container {
    padding: 2rem;
    gap: 2rem;
  }

  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .presentation {
    text-align: center;
    align-items: center;
    padding: 1rem 1rem 0;
  }

  .logo {
    align-items: center;
  }

  .presentation h1 {
    font-size: 1.7rem;
    letter-spacing: 0.08em;
  }

  .presentation p {
    max-width: 100%;
    font-size: 0.82rem;
  }

  .divider {
    margin: 1rem auto;
    transform-origin: center;
  }

  .bento-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto);
    max-height: none;
    gap: 0.75rem;
  }

  .module-card {
    padding: 1.25rem;
    min-height: 120px;
    border-radius: var(--radius-xl);
  }

  .card-title {
    font-size: 0.92rem;
  }

  .card-desc {
    font-size: 0.68rem;
  }

  .icon-box {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .footer {
    position: relative;
    bottom: auto;
    left: auto;
    text-align: center;
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
    gap: 1rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, auto);
    gap: 0.6rem;
  }

  .module-card {
    min-height: 100px;
    padding: 1.1rem;
    border-radius: var(--radius-lg);
  }

  .presentation h1 {
    font-size: 1.4rem;
  }

  .logo {
    margin-bottom: 1.5rem;
  }
}

/* ═══════ Accessibility ═══════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .module-card:hover {
    transform: none;
  }
}
