/* ============================================================
   links-presentation-grid.css
   Shared styles for presentation & grammar link grids
   (TOEIC L&R, TOEIC 4-Skills, TOEFL iBT)
   ============================================================ */

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

body, html {
  margin: 0; padding: 0;
  width: 100%; min-height: 100%;
  font-family: 'Inter','Inter-fallback',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  background-color: #f0f4f8;
  overflow-x: hidden;
}

canvas.webgl {
  position: fixed;
  inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
}

/* ── GRID WRAPPER ──────────────────────────────────────────── */
.pres-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1100px;
  width: 90%;
  margin: 32px auto 16px;
  padding: 28px;
  border-radius: 24px;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 8px 32px rgba(0,0,0,0.09);
  position: relative;
  z-index: 10;
}

/* ── CARD ──────────────────────────────────────────────────── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.pres-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 16px 16px;
  border-radius: 20px;
  text-decoration: none;
  min-height: 210px;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid transparent;
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  animation: cardIn 0.45s ease both;
  transition:
    transform  0.3s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.pres-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 18px 40px rgba(0,0,0,0.16);
}

/* staggered delays */
.pres-card:nth-child(1)  { animation-delay: 0.04s; }
.pres-card:nth-child(2)  { animation-delay: 0.08s; }
.pres-card:nth-child(3)  { animation-delay: 0.12s; }
.pres-card:nth-child(4)  { animation-delay: 0.16s; }
.pres-card:nth-child(5)  { animation-delay: 0.20s; }
.pres-card:nth-child(6)  { animation-delay: 0.24s; }
.pres-card:nth-child(7)  { animation-delay: 0.28s; }
.pres-card:nth-child(8)  { animation-delay: 0.32s; }
.pres-card:nth-child(9)  { animation-delay: 0.36s; }
.pres-card:nth-child(10) { animation-delay: 0.40s; }
.pres-card:nth-child(11) { animation-delay: 0.44s; }
.pres-card:nth-child(12) { animation-delay: 0.48s; }
.pres-card:nth-child(13) { animation-delay: 0.52s; }
.pres-card:nth-child(14) { animation-delay: 0.56s; }
.pres-card:nth-child(15) { animation-delay: 0.60s; }
.pres-card:nth-child(16) { animation-delay: 0.64s; }
.pres-card:nth-child(17) { animation-delay: 0.68s; }
.pres-card:nth-child(18) { animation-delay: 0.72s; }
.pres-card:nth-child(19) { animation-delay: 0.76s; }
.pres-card:nth-child(20) { animation-delay: 0.80s; }

/* ── SVG ICON ──────────────────────────────────────────────── */
.pres-card svg.card-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 64px; height: 64px;
  opacity: 0.18;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 0;
  color: currentColor;
}
.pres-card:hover svg.card-icon {
  opacity: 0.32;
  transform: scale(1.12) rotate(-6deg);
}

/* ── CARD NUMBER ───────────────────────────────────────────── */
.card-number {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
  transition: opacity 0.3s ease;
}
.pres-card:hover .card-number { opacity: 0.85; }

/* ── CARD TITLE ────────────────────────────────────────────── */
.card-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 8px 0;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 2;
  transition: letter-spacing 0.3s ease;
}
.pres-card:hover .card-title { letter-spacing: 0.04em; }

/* ── CARD DESCRIPTION ──────────────────────────────────────── */
.card-description {
  font-size: 0.72rem;
  line-height: 1.5;
  opacity: 0.7;
  margin: 0;
  position: relative;
  z-index: 2;
  transition: opacity 0.3s ease;
}
.pres-card:hover .card-description { opacity: 1; }

/* ── SHIMMER ───────────────────────────────────────────────── */
.pres-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at top left, rgba(255,255,255,0.28) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* ── COLOUR PALETTES ───────────────────────────────────────── */

/* -- Presentation colours (cool blues / teals) -- */
.pres-p-1  { background: linear-gradient(145deg,#e0f2fe,#bae6fd); color:#0c4a6e; }
.pres-p-1:hover  { border-color:#38bdf8; }
.pres-p-2  { background: linear-gradient(145deg,#dbeafe,#bfdbfe); color:#1e3a8a; }
.pres-p-2:hover  { border-color:#60a5fa; }
.pres-p-3  { background: linear-gradient(145deg,#ede9fe,#ddd6fe); color:#4c1d95; }
.pres-p-3:hover  { border-color:#a78bfa; }
.pres-p-4  { background: linear-gradient(145deg,#fce7f3,#fbcfe8); color:#831843; }
.pres-p-4:hover  { border-color:#f472b6; }
.pres-p-5  { background: linear-gradient(145deg,#ccfbf1,#99f6e4); color:#134e4a; }
.pres-p-5:hover  { border-color:#2dd4bf; }

/* -- Grammar colours (warm ambers / greens — 20 items) -- */
.pres-g-1  { background: linear-gradient(145deg,#fef9c3,#fef08a); color:#713f12; }
.pres-g-1:hover  { border-color:#facc15; }
.pres-g-2  { background: linear-gradient(145deg,#ffedd5,#fed7aa); color:#7c2d12; }
.pres-g-2:hover  { border-color:#fb923c; }
.pres-g-3  { background: linear-gradient(145deg,#dcfce7,#bbf7d0); color:#14532d; }
.pres-g-3:hover  { border-color:#4ade80; }
.pres-g-4  { background: linear-gradient(145deg,#d1fae5,#a7f3d0); color:#064e3b; }
.pres-g-4:hover  { border-color:#34d399; }
.pres-g-5  { background: linear-gradient(145deg,#e0f2fe,#bae6fd); color:#0c4a6e; }
.pres-g-5:hover  { border-color:#38bdf8; }
.pres-g-6  { background: linear-gradient(145deg,#dbeafe,#bfdbfe); color:#1e3a8a; }
.pres-g-6:hover  { border-color:#60a5fa; }
.pres-g-7  { background: linear-gradient(145deg,#ede9fe,#ddd6fe); color:#4c1d95; }
.pres-g-7:hover  { border-color:#a78bfa; }
.pres-g-8  { background: linear-gradient(145deg,#fce7f3,#fbcfe8); color:#831843; }
.pres-g-8:hover  { border-color:#f472b6; }
.pres-g-9  { background: linear-gradient(145deg,#fee2e2,#fecaca); color:#7f1d1d; }
.pres-g-9:hover  { border-color:#f87171; }
.pres-g-10 { background: linear-gradient(145deg,#ccfbf1,#99f6e4); color:#134e4a; }
.pres-g-10:hover { border-color:#2dd4bf; }
.pres-g-11 { background: linear-gradient(145deg,#fef9c3,#fef08a); color:#713f12; }
.pres-g-11:hover { border-color:#facc15; }
.pres-g-12 { background: linear-gradient(145deg,#ffedd5,#fed7aa); color:#7c2d12; }
.pres-g-12:hover { border-color:#fb923c; }
.pres-g-13 { background: linear-gradient(145deg,#dcfce7,#bbf7d0); color:#14532d; }
.pres-g-13:hover { border-color:#4ade80; }
.pres-g-14 { background: linear-gradient(145deg,#d1fae5,#a7f3d0); color:#064e3b; }
.pres-g-14:hover { border-color:#34d399; }
.pres-g-15 { background: linear-gradient(145deg,#e0f2fe,#bae6fd); color:#0c4a6e; }
.pres-g-15:hover { border-color:#38bdf8; }
.pres-g-16 { background: linear-gradient(145deg,#dbeafe,#bfdbfe); color:#1e3a8a; }
.pres-g-16:hover { border-color:#60a5fa; }
.pres-g-17 { background: linear-gradient(145deg,#ede9fe,#ddd6fe); color:#4c1d95; }
.pres-g-17:hover { border-color:#a78bfa; }
.pres-g-18 { background: linear-gradient(145deg,#fce7f3,#fbcfe8); color:#831843; }
.pres-g-18:hover { border-color:#f472b6; }
.pres-g-19 { background: linear-gradient(145deg,#fee2e2,#fecaca); color:#7f1d1d; }
.pres-g-19:hover { border-color:#f87171; }
.pres-g-20 { background: linear-gradient(145deg,#ccfbf1,#99f6e4); color:#134e4a; }
.pres-g-20:hover { border-color:#2dd4bf; }

/* ── DISCLAIMER ─────────────────────────────────────────────── */
.disclaimer {
  font-size: 0.85rem;
  color: #777;
  text-align: center;
  font-style: italic;
  max-width: 700px;
  margin: 12px auto 8px;
  padding: 0 12px;
  position: relative;
  z-index: 10;
}

/* ── BTN ─────────────────────────────────────────────────────── */
.btn-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 10;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  background: #1f7cff;
  border: 2px solid #1f7cff;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover {
  background: #fff;
  color: #1f7cff;
  box-shadow: 0 4px 12px rgba(31,124,255,0.25);
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pres-grid-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    padding: 18px;
    width: 95%;
  }
  .pres-card { min-height: 180px; }
  .pres-card svg.card-icon { width: 52px; height: 52px; }
}

@media (max-width: 480px) {
  .pres-grid-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
    padding: 14px;
  }
  .pres-card { min-height: 160px; padding: 14px 12px 12px; }
  .pres-card svg.card-icon { width: 44px; height: 44px; }
  .card-title { font-size: 0.85rem; }
  .card-description { font-size: 0.66rem; }
}
