/*
  Shared styles for the portal tree (/portal/index.html and every
  applications/development sub-page). One file so the look stays
  consistent as the tree grows — edit here, not per-page.
*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --tb-blue: #1a7ab0;
  --tb-blue-light: #2B9BD6;
  --tb-blue-dim: rgba(26,122,176,0.10);
  --tb-blue-dim-hover: rgba(26,122,176,0.18);
  --bg-page: #dfe1e4;
  --bg-card: #f4f5f6;
  --bg-card-hover: #ffffff;
  --border: rgba(0,0,0,0.10);
  --border-hover: rgba(26,122,176,0.50);
  --stripe: rgba(0,0,0,0.035);
  --text-primary: #1a1d22;
  --text-secondary: #4a5260;
  --text-muted: #8c95a0;
}
html, body {
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2.5rem 1.5rem;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--stripe) 1px, transparent 1px),
    linear-gradient(90deg, var(--stripe) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a7ab0 0%, #2B9BD6 50%, #1a7ab0 100%);
  z-index: 10;
}

/* ── Back button — every level below the top page shows one, pointing
   one level up the tree. ── */
.back-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  transition: background .16s, border-color .16s, color .16s;
}
.back-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--tb-blue);
}

.portal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}
.logo-img {
  height: 110px;
  width: auto;
  display: block;
}
.portal-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  width: 100%;
  text-align: center;
}
h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.app-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, transform 0.14s;
  cursor: pointer;
}
.app-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(26,122,176,0.10);
  transform: translateY(-2px);
}
.app-card.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.app-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--tb-blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-card:hover .app-card-icon {
  background: var(--tb-blue-dim-hover);
}
.app-card-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--tb-blue);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-card-icon.gray { background: rgba(0,0,0,0.05); }
.app-card-icon.gray svg { stroke: var(--text-muted); }
.app-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.app-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}
.app-card-status {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
}
.status-live { background: rgba(26,122,176,0.12); color: var(--tb-blue); }
.status-dev  { background: rgba(0,0,0,0.06); color: var(--text-muted); }
.status-soon { background: rgba(0,0,0,0.06); color: var(--text-muted); }

footer {
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-align: center;
}
@media (max-width: 480px) {
  .logo-img { height: 80px; }
  .app-grid { grid-template-columns: 1fr; }
}
