/*
 * Portal tile styling, shared by the landing page grid and the admin UI's live
 * preview (both render through /static/tile.js).
 *
 * Every accent-coloured surface reads from the --accent* custom properties that
 * tile.js sets per card from the registry's tileColor. That indirection is what
 * lets an administrator pick any colour without touching CSS; the values on
 * .portal-card are the fallback for an unstyled card.
 */

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 72px;
}

@media (max-width: 720px) {
  .portal-grid { grid-template-columns: 1fr; }
}

/* Registry states (empty registry / failed load) */
.grid-notice {
  grid-column: 1 / -1;
  border: 1px dashed var(--border-mid);
  border-radius: 18px;
  padding: 48px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.grid-notice a { color: var(--gold); text-decoration: none; }
.grid-notice a:hover { text-decoration: underline; }

/* ─── PORTAL CARD ─── */
.portal-card {
  --accent: #3B82F6;
  --accent-rgb: 59, 130, 246;
  --accent-dark: #2563EB;
  --accent-fg: #ffffff;

  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease,
    border-color 0.3s ease;
  opacity: 0;
  transform: translateY(32px);
}

/* Tiles fade in on scroll; the preview card is shown immediately. */
.portal-card.reveal {
  animation: cardIn 0.7s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

.portal-card.static {
  opacity: 1;
  transform: none;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.975); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.portal-card:hover {
  transform: translateY(-7px) scale(1.008);
  box-shadow: 0 24px 64px rgba(var(--accent-rgb), 0.16), 0 6px 24px rgba(0,0,0,0.5);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.portal-card.static:hover { transform: none; }

/* Accent top stripe */
.card-stripe {
  height: 3px;
  width: 100%;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
}

/* ─── CARD HEADER ─── */
.card-header {
  padding: 26px 26px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

.card-icon-box svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #10B981;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 100px;
  padding: 5px 10px 4px;
}

.live-pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10B981;
  animation: pip 2.2s ease-in-out infinite;
}

@keyframes pip {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ─── CARD BODY ─── */
.card-body {
  padding: 0 26px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-tag {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: rgba(var(--accent-rgb), 0.8);
}

.card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 14px;
}

.card-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 22px;
}

/* Capabilities list */
.cap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 26px;
  flex: 1;
}

.cap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #8B9BB4;
}

.cap-mark {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(var(--accent-rgb), 0.12);
}

.cap-mark svg {
  width: 9px;
  height: 9px;
  color: var(--accent);
}

/* Enter portal button */
.enter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-radius: 11px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-fg);
}

.portal-card:hover .enter-btn { filter: brightness(1.1); }

.btn-arrow {
  display: flex;
  align-items: center;
  gap: 3px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-card:hover .btn-arrow { transform: translateX(5px); }

/* ─── CORNER DECORATION ─── */
.card-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.08) 0%, transparent 65%);
}

.portal-card:hover .card-corner { opacity: 1; }
