/* logo-gallery.css: "One mark, ten motions" section and its stage view
   (docs/LOGO-STYLES-DESIGN.md section 1). Tokens come from css/site.css. */

/* ------------------------------------------------------------ section */
.lg { position: relative; padding: clamp(96px, 14vh, 160px) var(--gutter); }
.lg-head { max-width: 720px; }
.lg-head .label { margin: 0; }
.lg-title { margin: 20px 0 0; font-size: clamp(34px, 4.4vw, 64px); font-weight: 700; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.lg-intro { margin: 14px 0 0; font-size: clamp(18px, 1.6vw, 22px); font-weight: 500; letter-spacing: -.01em; line-height: 1.35; max-width: 44ch; color: var(--ink); }
.lg-hint { margin: 14px 0 0; font-size: 14px; line-height: 1.55; max-width: 52ch; color: var(--ink-faint); }
.lg-note { margin-top: 28px; }

/* ------------------------------------------------------------ grid (desktop) */
.lg-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
  max-width: 1600px; margin-top: clamp(40px, 6vh, 72px);
}
.lg-grid[hidden] { display: none; }
.lg-cell { min-width: 0; }
.lg-count { display: none; }

/* ------------------------------------------------------------ tile */
.lg-tile {
  all: unset; display: block; width: 100%; cursor: pointer; box-sizing: border-box;
  transition: transform var(--t-ui) var(--ease-soft);
}
.lg-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-lg); }
.lg-media {
  aspect-ratio: 1; display: block; position: relative; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--t-ui) var(--ease-soft);
  touch-action: pan-x pan-y;
}
.lg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (hover: hover) {
  .lg-tile:hover { transform: translateY(-2px); }
  .lg-tile:hover .lg-media { border-color: color-mix(in srgb, var(--tf-light) 42%, transparent); }
}
.lg-tile.is-scrubbing { cursor: ew-resize; }
.lg-tile.is-scrubbing .lg-media { cursor: ew-resize; }
.lg-tile.is-scrubbing .lg-media::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px;
  width: calc(var(--lg-t, 0) * 100%); background: var(--tf-light); pointer-events: none;
}

.lg-cap { display: block; padding-top: 12px; }
.lg-tag {
  display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; line-height: 1.2;
  color: var(--ink);
}
.lg-tile[data-kind="3d"] .lg-tag,
.lg-tag[data-kind="3d"] { border-color: color-mix(in srgb, var(--tf-light) 40%, transparent); color: var(--tf-light); }
.lg-name { display: block; margin-top: 10px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; color: var(--ink); }
.lg-line {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px; font-size: 14px; font-weight: 400; line-height: 1.45; color: var(--ink-dim);
}
/* the description is shown on hover and focus only (SPEC.md B.3); its two lines keep their room,
   so nothing below moves when it appears */
.lg-tile .lg-line { opacity: 0; transform: translateY(4px); transition: opacity var(--t-ui) var(--ease-soft), transform var(--t-ui) var(--ease-out); }
.lg-tile:hover .lg-line, .lg-tile:focus-visible .lg-line { opacity: 1; transform: none; }
@media (max-width: 1180px) { .lg-cell.is-focus .lg-line { opacity: 1; transform: none; } }   /* row layout: the tile in front */
@media (prefers-reduced-motion: reduce) { .lg-tile .lg-line { transition: none; transform: none; } }

/* ------------------------------------------------------------ row layout (tablet and mobile) */
@media (max-width: 1180px) {
  .lg-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
    padding: 0 var(--gutter) 8px; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter));
    gap: 12px; scrollbar-width: none; overscroll-behavior-x: contain; max-width: none;
  }
  .lg-grid::-webkit-scrollbar { display: none; }
  .lg-cell {
    flex: 0 0 auto; scroll-snap-align: start; width: clamp(300px, 40vw, 420px);
    opacity: .7; transform: scale(.96);
    transition: opacity var(--t-ui) var(--ease-soft), transform var(--t-ui) var(--ease-soft);
  }
  .lg-cell.is-focus { opacity: 1; transform: none; }
  .lg-count { display: block; margin: 14px 0 0; color: var(--ink-faint); }
}
@media (max-width: 820px) {
  .lg-cell { width: calc(100vw - 56px); }
}

/* ------------------------------------------------------------ stage dialog */
.lg-stage {
  padding: 0; border: 0; background: transparent; color: var(--ink);
  max-width: none; max-height: none; overflow: visible;
}
.lg-stage::backdrop { background: rgba(11, 13, 18, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lg-stage-panel {
  position: relative; box-sizing: border-box;
  width: min(1180px, calc(100vw - 2 * var(--gutter)));
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; padding: 28px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg);
  font-family: Poppins, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.lg-stage-media {
  position: relative; width: min(72vh, 100%); aspect-ratio: 1; justify-self: center;
  background: var(--bg-2); border-radius: var(--r-lg); overflow: hidden;
  cursor: ew-resize; touch-action: pan-y;
}
.lg-stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lg-stage-side { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; padding-top: 4px; }
.lg-stage-count { margin: 0 0 18px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.lg-stage-name { margin: 14px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.lg-stage-line { margin: 10px 0 0; font-size: 16px; line-height: 1.45; color: var(--ink); }
.lg-stage-how { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-dim); }

.lg-stage-time { width: 100%; margin-top: 24px; }
.lg-scrub {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 20px; margin: 0;
  background: transparent; cursor: pointer; --lg-p: 0%;
}
.lg-scrub:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.lg-scrub::-webkit-slider-runnable-track {
  height: 2px; border-radius: 2px;
  background: linear-gradient(to right, var(--tf-light) 0, var(--tf-light) var(--lg-p), var(--line) var(--lg-p), var(--line) 100%);
}
.lg-scrub::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -6px;
  border-radius: 50%; background: var(--ink); border: 0;
}
.lg-scrub::-moz-range-track { height: 2px; border-radius: 2px; background: var(--line); }
.lg-scrub::-moz-range-progress { height: 2px; border-radius: 2px; background: var(--tf-light); }
.lg-scrub::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 0; }
.lg-phases { display: flex; margin-top: 6px; font-size: 11px; letter-spacing: .08em; line-height: 1.3; color: var(--ink-faint); }
.lg-phases span { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: clip; transition: color var(--t-micro) var(--ease-soft); }
.lg-phases span.is-on { color: var(--ink); }

.lg-stage-ctrl, .lg-stage-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.lg-stage-hint { margin-top: 12px; }
.lg-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--ink);
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; line-height: 1.2;
  cursor: pointer; transition: border-color var(--t-micro) var(--ease-soft);
}
.lg-btn:hover { border-color: var(--ink-dim); }
.lg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lg-btn-ghost { color: var(--ink-dim); }
.lg-close {
  position: absolute; top: 12px; right: 12px; min-width: 44px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg); color: var(--ink);
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
}
.lg-close:hover { border-color: var(--ink-dim); }
.lg-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lg-stage-side { padding-right: 40px; }

@media (max-width: 820px) {
  .lg-stage { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  .lg-stage-panel {
    width: 100vw; min-height: 100dvh; max-height: 100dvh; overflow-y: auto; grid-template-columns: minmax(0, 1fr);
    gap: 20px; padding: 16px; padding-top: 68px; border: 0; border-radius: 0;
  }
  .lg-stage-media { width: calc(100vw - 32px); }
  .lg-stage-side { padding-right: 0; }
  .lg-stage-name { font-size: 24px; }
}

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lg-tile, .lg-media, .lg-cell, .lg-btn, .lg-phases span { transition: none; }
  .lg-tile:hover { transform: none; }
}
