/* ============================================================
   CARDS.CSS
   Section layout, the carousel (Disciplines / More), the static
   pair row (Lab & Hobbies), and all card visual states.
   The carousel's *behavior* (drag, loop, click-to-select) is in
   js/carousel.js — this file is purely visual/positional.
   ============================================================ */

/* ---------- section wrapper ---------- */
section.rail-section {
  padding: clamp(12px, 2.6vh, 26px) 0;
  opacity: 0.3; transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
section.rail-section.in-view { opacity: 1; transform: none; }

.section-head { margin-bottom: 14px; }
.section-head h2 { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; }

/* ---------- carousel container ---------- */
.carousel {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
  touch-action: pan-y;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.carousel.dragging { cursor: grabbing; }
.carousel-lg { height: clamp(360px, 50vh, 420px); }
.carousel-md { height: clamp(260px, 38vh, 300px); }

/* each card in the carousel is wrapped in a .slide, which the JS
   positions via transform (translateX + scale) based on distance
   from the active/centered card */
.slide {
  position: absolute; left: 50%; top: 50%;
  transition: transform 0.5s cubic-bezier(.22,.9,.32,1), opacity 0.5s ease, filter 0.5s ease;
  will-change: transform, opacity;
}
.carousel.dragging .slide { transition: none; }

/* ---------- pair row: Lab & Hobbies (only 2 items, no carousel) ---------- */
.pair-row {
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
  padding: 8px 32px 12px;
}

/* ---------- card ---------- */
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 26px;
  transform: perspective(700px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));
  transition: border-color 0.3s ease, box-shadow 0.35s ease, background 0.3s ease, transform 0.25s ease;
  -webkit-user-drag: none; user-drag: none;
}
.card * { -webkit-user-drag: none; user-drag: none; }

/* cursor-follow spotlight glow — --mx/--my set by js/card-effects.js */
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx,50%) var(--my,50%), var(--accent-glow), transparent 62%);
  opacity: 0; transition: opacity 0.4s ease;
}
.card:hover::before { opacity: 1; }
.card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  box-shadow: 0 18px 40px -26px rgba(166,108,255,0.45);
  transform: perspective(700px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-6px);
}
/* inactive-but-selectable cards inside a carousel: quieter "pick me" glow, no lift */
.slide:not(.is-active) .card:hover {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 1px rgba(166,108,255,0.3), 0 12px 28px -20px rgba(166,108,255,0.35);
  transform: perspective(700px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));
}
.slide:not(.is-active) .card { cursor: pointer; }
.card:active { transform: scale(0.97); transition-duration: 0.12s; }

.card.card-lg { width: 300px; min-height: 320px; }
.card.card-md { width: 260px; min-height: 200px; }

.card-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: auto; padding-bottom: 22px; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 20px; margin-bottom: 8px; letter-spacing: -0.01em; }
.card h3 small { display: block; font-size: 12px; font-weight: 500; color: var(--text-dim); margin-top: 2px; }
.card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; max-width: 26ch; }
.card-foot { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.card-arrow { font-size: 13px; color: var(--text-dim); font-weight: 500; transition: transform 0.2s ease, color 0.2s ease; }
.card:hover .card-arrow { color: var(--accent-bright); transform: translateX(4px); }

/* line-art icon cards (AR, Game Dev): skip the 3D tilt entirely — continuously
   re-projecting fine SVG line detail in 3D is what caused a hover blur.
   Keep the lift + spotlight only. See icons.css for the icons themselves. */
.card.mesh-card { transform: none; }
.card.mesh-card:hover {
  transform: translateY(-6px);
}

/* ---------- dots (draggable position scrubber under each carousel) ---------- */
.dots-wrap { display: flex; justify-content: center; margin-top: 10px; }
.dots { display: flex; gap: 8px; padding: 12px 16px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.dots.dragging { cursor: grabbing; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-hover); padding: 0; transition: background 0.25s ease, width 0.25s ease, border-radius 0.25s ease; pointer-events: none; }
.dot.active { background: var(--accent); width: 18px; border-radius: 4px; }
