/* Extra styles for the deck-based case pages. Loaded after style.css; reuses its tokens. */

/* ---------- Shared: small source / confidentiality note in a figure caption ---------- */

.figure__caption .figure__note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Next-Gen Digital Cluster: two cluster themes stacked in one panel ---------- */

.figure__media--stack {
  gap: clamp(16px, 2.5vw, 32px);
}

/* ---------- Square shots cropped to 5:4 so a filled column stays under a screen tall ---------- */

.figure__media--crop img {
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

/* ---------- LG Signature: circle display screens on a black panel ---------- */

.sig-screens {
  display: grid;
  gap: clamp(40px, 5vw, 72px);
  margin: clamp(56px, 7vw, 112px) var(--gutter) 0;
  padding: clamp(28px, 5vw, 72px);
  border-radius: 4px;
  background: #000;
  color: #fff;
}

.sig-screens__title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.sig-screens__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 16px;
  margin-top: 20px;
  list-style: none;
}

@media (min-width: 700px) {
  .sig-screens__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

.sig-screens__grid img {
  display: block;
  width: 100%;
  height: auto;
}

.sig-screens__grid span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- UIX Design System ---------- */

.uix-subtitle {
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.uix-card-text {
  margin-top: 12px;
  font-size: 15px;
  color: #3a3a37;
}

/* Three deliverables released together, tied by one version line. */
.uix-system {
  margin-top: 40px;
}

.uix-system__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 700px) {
  .uix-system__list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.uix-system__item {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 4px;
  background: var(--paper-tint);
}

.uix-system__meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.uix-system__name {
  margin-top: 28px;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.uix-system__role {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--purple);
}

.uix-system__desc {
  margin-top: 16px;
  font-size: 15px;
  color: #3a3a37;
}

.uix-system__sync {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, var(--orange) 0%, var(--magenta) 50%, var(--purple) 100%);
}

.uix-system__sync span {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

/* Small label lists: foundation items, pattern categories. */
.uix-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.uix-chips li {
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

.uix-chips--soft li {
  border-color: var(--line);
  background: var(--paper-tint);
}

/* Raw value → Base token → Semantic token */
.token-flow {
  margin-top: 32px;
  border-top: 1px solid var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.token-flow__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.token-flow__row span {
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}

.token-flow__row span + span::before {
  content: "→";
  flex: none;
  color: var(--muted);
}

.token-flow__row--head {
  display: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

@media (min-width: 700px) {
  .token-flow__row,
  .token-flow__row--head {
    display: grid;
    grid-template-columns: 0.8fr 1.3fr 1.1fr;
    gap: 16px;
  }

  .token-flow__row span + span::before {
    margin-left: -4px;
  }

  .token-flow__row--head span::before {
    content: none !important;
  }
}

.token-flow__swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* Transition demo: dots travel the track with the system's duration and easing. */
.motion-demo {
  display: grid;
  gap: 20px;
  margin-top: 32px;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 4px;
  background: var(--paper-tint);
}

.motion-demo__label {
  font-size: 14px;
  color: #3a3a37;
}

.motion-demo__label strong {
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.motion-demo__track {
  position: relative;
  height: 16px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.06);
}

.motion-demo__dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--purple);
  transition: left var(--d) var(--e);
}

.motion-demo.is-playing .motion-demo__dot {
  left: calc(100% - 14px);
}

.motion-demo__play {
  justify-self: start;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.motion-demo__play:hover,
.motion-demo__play:focus-visible {
  color: var(--paper);
  background: var(--ink);
}

/* Component inventory */
.inventory {
  display: grid;
  gap: 28px;
  margin-top: 40px;
}

.inventory__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.inventory__badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0b6b3a;
  background: #d6f2e2;
}

.inventory__badge--dev {
  color: #1f4fc2;
  background: #dce6fb;
}

.inventory__group {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.inventory__title {
  font-size: 15px;
  font-weight: 600;
}

.inventory__title span {
  margin-left: 4px;
  font-weight: 500;
  color: var(--muted);
}

.inventory__group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.inventory__group li {
  padding: 4px 10px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--paper-tint);
}

/* How-to-use steps */
.uix-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 32px;
}

@media (min-width: 700px) {
  .uix-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

.uix-steps li {
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}

.uix-steps__num {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.uix-steps__title {
  margin-top: 20px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.uix-steps p:not(.uix-steps__title) {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}

.uix-steps + .card-grid {
  margin-top: 56px;
}

@media (min-width: 900px) {
  .uix-steps--four { grid-template-columns: repeat(4, 1fr); }
}

/* Rollout photos: two side by side, full gutter width. */
.rollout-photos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: clamp(48px, 6vw, 88px) var(--gutter) 0;
}

@media (min-width: 700px) {
  .rollout-photos { grid-template-columns: repeat(2, 1fr); }
}

.rollout-photos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px;
}

/* Pattern wall: six pattern screens, full gutter width. */
.pattern-wall {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px 16px;
  margin: clamp(48px, 6vw, 88px) var(--gutter) 0;
  padding: clamp(16px, 3vw, 40px);
  border-radius: 4px;
  background:
    radial-gradient(90% 70% at 85% 110%, rgba(249, 186, 140, 0.7) 0%, transparent 60%),
    radial-gradient(70% 60% at 5% 115%, rgba(125, 87, 171, 0.45) 0%, transparent 55%),
    linear-gradient(180deg, #e0e0dd 0%, #ece4da 100%);
}

@media (min-width: 600px) {
  .pattern-wall { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .pattern-wall { grid-template-columns: repeat(3, 1fr); }
}

.pattern-wall img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 50px -28px rgba(40, 30, 60, 0.45);
}

.pattern-wall span {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #3a3a37;
}

/* DO / DO NOT: rebuilt in HTML so the buttons stay sharp. */
.dodont {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 40px;
}

@media (min-width: 700px) {
  .dodont { grid-template-columns: repeat(2, 1fr); }
}

.dodont__panel {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 4px;
  background: #fff;
}

.dodont__verdict {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dodont__verdict::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dodont__verdict--do { color: #0b6b3a; }
.dodont__verdict--do::before { background: #22b35e; }
.dodont__verdict--dont { color: #c0262d; }
.dodont__verdict--dont::before { background: #ee3f3f; }

.dodont__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 0;
}

.dodont__note {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.ux-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.ux-btn--solid { color: #fff; background: #333436; }
.ux-btn--ghost { color: #333436; background: #f2f3f5; }
.ux-btn--outline { color: #333436; background: #fff; border: 1px solid #d6d8dc; }
.ux-btn--icon { width: 32px; padding: 0; }
.ux-btn--text { height: auto; padding: 0; color: #376cf2; }
.ux-btn--danger { color: #fff; background: #f04646; }

.ux-btn.is-off-gradient { background: linear-gradient(90deg, #1f5cff, #8a3cc8); }
.ux-btn.is-off-border { border-color: #1f4fc2; box-shadow: inset 0 0 0 1px #1f4fc2; }
.ux-btn.is-off-color { color: #3cb84a; }
.ux-btn.is-off-shadow { background: linear-gradient(180deg, #f04646, #d61f1f); box-shadow: 0 4px 10px rgba(214, 31, 31, 0.35); }

.ux-icon {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 10px;
}

.ux-icon--lines {
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
}

.ux-icon--warn {
  width: 14px;
  height: 12px;
  background: #f5b400;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* Multi-theme: semantic token values per product mode. */
.theme-demo {
  margin-top: 40px;
  padding: clamp(12px, 2vw, 24px) clamp(16px, 3vw, 32px);
  border-radius: 4px;
  background: #fff;
}

/* A plain image placed in a case-section column (Figma-drawn diagrams). */
.uix-figure-img {
  width: 100%;
  height: auto;
  margin-top: 40px;
  border-radius: 4px;
}

.theme-table {
  overflow-x: auto;
  font-size: 13px;
}

.theme-table__row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(120px, 1fr));
  min-width: 560px;
  border-bottom: 1px solid var(--line);
}

.theme-table__row > span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-table__row--head > span {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.theme-table i {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.12);
}

/* Typography scale */
.type-scale {
  margin-top: 40px;
}

.type-scale__group + .type-scale__group {
  margin-top: 32px;
}

.type-scale__role {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.type-scale__role span {
  margin-left: 8px;
  font-weight: 400;
  color: var(--muted);
}

.type-scale__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 700px) {
  .type-scale__row {
    grid-template-columns: 96px 1fr auto;
    gap: 16px;
  }
}

.type-scale__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.type-scale__sample {
  font-size: min(var(--fs), 9vw);
  line-height: var(--lh);
  letter-spacing: var(--ls, 0);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-scale__spec {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
}

.type-scale__weights {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
}

.type-scale__weights span {
  font-size: 20px;
  color: var(--ink);
}

/* Space tokens */
.space-table {
  margin-top: 40px;
  font-size: 14px;
}

.space-table__row {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.space-table__row--head {
  border-bottom-color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.space-table__usage {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (min-width: 700px) {
  .space-table__row {
    grid-template-columns: 1fr 0.6fr 1fr 2fr;
  }

  .space-table__usage {
    grid-column: auto;
  }
}

.space-table code {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12.5px;
  color: #5b3fa0;
  background: #e8e0f7;
}

.space-table i {
  display: inline-block;
  width: var(--w);
  height: 16px;
  margin-right: 10px;
  vertical-align: -3px;
  background: #c9b8f0;
}

/* Component cards drifting upward in columns; each column loops its own list. */
.comp-marquee {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  height: clamp(520px, 62vw, 720px);
  margin: clamp(48px, 6vw, 88px) var(--gutter) 0;
  padding: 0 clamp(16px, 3vw, 40px);
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(90% 70% at 85% 110%, rgba(249, 186, 140, 0.7) 0%, transparent 60%),
    radial-gradient(70% 60% at 5% 115%, rgba(125, 87, 171, 0.45) 0%, transparent 55%),
    linear-gradient(180deg, #e0e0dd 0%, #ece4da 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
}

@media (min-width: 700px) {
  .comp-marquee { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
  .comp-marquee { grid-template-columns: repeat(4, 1fr); }
}

.comp-marquee__col:nth-child(3) { display: none; }
.comp-marquee__col:nth-child(4) { display: none; }

@media (min-width: 700px) {
  .comp-marquee__col:nth-child(3) { display: block; }
}

@media (min-width: 1100px) {
  .comp-marquee__col:nth-child(4) { display: block; }
}

.comp-marquee__track {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
  animation: comp-rise var(--dur, 80s) linear infinite;
}

.comp-marquee__col:nth-child(even) .comp-marquee__track {
  animation-delay: calc(var(--dur, 80s) * -0.5);
}

@keyframes comp-rise {
  from { transform: translateY(0); }
  to { transform: translateY(calc(-50% - 8px)); }
}

.comp-card {
  overflow: hidden;
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px -28px rgba(40, 30, 60, 0.35);
}

.comp-card img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--line);
}

.comp-card__body {
  padding: 14px 12px 16px;
  text-align: center;
}

.comp-card__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.comp-card__desc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.comp-card__status {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.comp-card__status span {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: #16c36a;
}

@media (prefers-reduced-motion: reduce) {
  .comp-marquee__track { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-demo__dot {
    transition: none;
  }
}

/* ---------- INHR+: deck slides flowing sideways ---------- */

/* Without JS (or with reduced motion) the row scrolls by hand. With JS, main.js
   doubles the slides and the track drifts left by half its width, so it loops. */
.deck-reel {
  margin: clamp(48px, 6vw, 88px) var(--gutter) 0;
  padding: clamp(24px, 3.5vw, 56px) 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 4px;
  background:
    radial-gradient(90% 70% at 85% 110%, rgba(249, 186, 140, 0.7) 0%, transparent 60%),
    radial-gradient(70% 60% at 5% 115%, rgba(125, 87, 171, 0.45) 0%, transparent 55%),
    linear-gradient(180deg, #e0e0dd 0%, #ece4da 100%);
}

.deck-reel::-webkit-scrollbar {
  display: none;
}

.deck-reel__track {
  display: flex;
  width: max-content;
  padding-left: clamp(16px, 3vw, 40px);
}

.deck-reel__track li {
  flex: none;
  margin-right: clamp(12px, 1.6vw, 24px);
  scroll-snap-align: center;
}

.deck-reel img {
  display: block;
  height: clamp(200px, 30vw, 440px);
  width: auto;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  box-shadow: 0 24px 50px -28px rgba(40, 30, 60, 0.45);
}

.deck-reel.is-looping {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.deck-reel.is-looping .deck-reel__track {
  padding-left: 0;
  animation: deck-reel var(--reel-duration, 200s) linear infinite;
}

.deck-reel.is-looping:hover .deck-reel__track {
  animation-play-state: paused;
}

@keyframes deck-reel {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .deck-reel.is-looping .deck-reel__track {
    animation: none;
  }
}

/* ---------- Cutout screens: transparent PNGs that carry their own device and shadow ---------- */

.figure__media--cutout img {
  border-radius: 0;
  box-shadow: none;
}

/* Cut off at the bottom in the source: sit flush on the panel's bottom edge. */
.figure__media--floor {
  padding-bottom: 0;
  place-items: end center;
}

/* Cut off at the top and the bottom: run edge to edge vertically. */
.figure__media--fill {
  padding-top: 0;
  padding-bottom: 0;
}
