/* ============================================================
   transmissions — view: card
   The axis card showcase. A physical holographic object:
   3D tilt (fx/holo drives --holo-* custom properties), tap to
   flip, print-grade micro-detailing, export + share actions.
   Layers on base.css; only card-view styles live here.
   ============================================================ */

.card-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-5);
  padding-top: var(--s-4);
}

/* ---------------------------------------------------------- */
/* Scene + card object                                         */
/* ---------------------------------------------------------- */

.card-scene {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1400px;
}

.axis-card {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1080 / 1688;
  border-radius: var(--r-xl);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transform-style: preserve-3d;
  /* holo writes the vars (data-holo-props); the view composes the transform */
  transform: rotateX(var(--holo-rx, 0deg)) rotateY(var(--holo-ry, 0deg));
  outline-offset: 6px;
}

/* the foil layer holo injects sits above both faces in 3D space */
.axis-card > .txh-foil {
  transform: translateZ(6px);
}

.ac-flip {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-style: preserve-3d;
  transition: transform 0.72s var(--ease-glide);
}

.axis-card.is-flipped .ac-flip {
  transform: rotateY(180deg);
}

.ac-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 16px 38px;
  border-radius: inherit;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(120% 70% at 20% 0%, rgba(196, 181, 253, 0.075), transparent 55%),
    linear-gradient(160deg, #14141b 0%, #0a0a0f 52%, #0e0e15 100%);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--glass-shadow);
}

/* registration frame: the print-grade inner hairline */
.ac-face::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(245, 245, 247, 0.055);
  border-radius: calc(var(--r-xl) - 9px);
  pointer-events: none;
}

.ac-back {
  transform: rotateY(180deg);
}

/* serial rail: mono microtype running along the card edge */
.ac-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.34em;
  /* no text-transform: rail text carries its own case so the
     brand words stay lowercase (root CLAUDE.md §1, BRAND-LOCK §4) */
  font-variant-numeric: tabular-nums;
  color: var(--fg-ghost);
  white-space: nowrap;
  pointer-events: none;
}

/* ---------------------------------------------------------- */
/* Face header                                                 */
/* ---------------------------------------------------------- */

.ac-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: 12px;
}

.ac-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.ac-no {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--fg-faint);
}

.ac-no b {
  font-weight: 600;
  color: var(--accent-70);
}

/* ---------------------------------------------------------- */
/* Front: portrait + identity                                  */
/* ---------------------------------------------------------- */

.ac-portrait {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-l);
  overflow: hidden;
  background: radial-gradient(130% 110% at 30% 18%, #191922, #0b0b10);
  border: 1px solid var(--hairline);
}

.ac-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ac-star-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.ac-star-ph svg {
  width: 30%;
  height: 44%;
  color: var(--accent-45);
  filter: drop-shadow(0 0 18px rgba(196, 181, 253, 0.3));
}

.ac-founding {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(10, 10, 14, 0.72);
  border: 1px solid var(--accent-28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.ac-founding svg {
  width: 7px;
  height: 10px;
  flex: none;
}

.ac-id {
  margin-top: 13px;
  min-width: 0;
}

.ac-name {
  font-size: clamp(21px, 6.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-handle {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--accent-70);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: 10px;
}

.ac-foot .tier {
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-foot-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.ac-foot-brand svg {
  width: 13px;
  height: 19px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(196, 181, 253, 0.5));
}

.ac-foot-brand span {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  /* wordmark stays lowercase, never uppercased */
  text-transform: none;
  color: var(--fg-faint);
}

/* ---------------------------------------------------------- */
/* Back: the transmission record                               */
/* ---------------------------------------------------------- */

.ac-back .ac-head {
  margin-bottom: 8px;
}

.ac-stats {
  display: flex;
  flex-direction: column;
}

.ac-srow {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5.5px 0;
  border-bottom: 1px dashed rgba(245, 245, 247, 0.07);
}

.ac-slabel {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.ac-sleader {
  flex: 1;
}

.ac-sval {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--fg);
}

.ac-srow.is-pull {
  border-bottom: 0;
  padding-top: 10px;
  align-items: center;
}

.ac-srow.is-pull .ac-sval {
  font-size: 19px;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(196, 181, 253, 0.35);
}

.ac-duo {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.ac-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(245, 245, 247, 0.04);
  border: 1px solid var(--hairline);
}

.ac-cell .ac-sval {
  font-size: 13px;
}

/* scan block: QR tile + barcode strip */
.ac-scan {
  margin-top: auto;
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding-top: 12px;
}

.ac-qr {
  flex: none;
  width: 92px;
  height: 92px;
  padding: 7px;
  border-radius: 14px;
  background: #f5f5f7;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
}

.ac-qr canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.ac-scan-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.ac-barcode {
  width: 100%;
  height: 30px;
  opacity: 0.85;
}

.ac-scan-code {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--fg-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-since {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* export shutter flash */
.card-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateZ(8px);
}

/* ---------------------------------------------------------- */
/* Below the card: hint + actions                              */
/* ---------------------------------------------------------- */

.card-hint {
  margin-top: var(--s-4);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg-faint);
  text-align: center;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 440px;
}

.card-station-row {
  display: flex;
  justify-content: center;
}

/* ---------------------------------------------------------- */
/* Skeleton + error                                            */
/* ---------------------------------------------------------- */

.card-skel {
  width: min(100%, 340px);
  aspect-ratio: 1080 / 1688;
  border-radius: var(--r-xl);
}

.card-skel-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: var(--s-5);
}

.card-skel-btn {
  width: 112px;
  height: 34px;
  border-radius: 11px;
}

/* ---------------------------------------------------------- */
/* Desktop refinements                                         */
/* ---------------------------------------------------------- */

@media (min-width: 720px) {
  .axis-card,
  .card-skel {
    width: 380px;
  }

  .ac-face {
    padding: 24px 22px 20px 42px;
  }

  .ac-name {
    font-size: 28px;
  }

  .ac-qr {
    width: 104px;
    height: 104px;
  }
}
