/* ============================================
   Portal — Landing Page Styles
   Scope: index.html only
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-deep: #06080c;
  --bg: #0b0e14;
  --surface: #111720;
  --surface-raised: #171d28;
  --border: #1e2736;
  --border-light: #2a3a52;
  --cyan: #22d3ee;
  --cyan-dim: #0e7490;
  --cyan-glow: rgba(34, 211, 238, 0.12);
  --gold: #e8a838;
  --gold-dim: #c4882a;
  --gold-glow: rgba(232, 168, 56, 0.12);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #4b5b73;
  --font-display: 'Noto Serif SC', serif;
  --font-body: 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ===== Light theme overrides ===== */
[data-theme='light'] {
  --bg-deep: #f1f5f9;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --cyan: #0891b2;
  --cyan-dim: #0e7490;
  --cyan-glow: rgba(8, 145, 178, 0.08);
  --gold: #b45309;
  --gold-dim: #92400e;
  --gold-glow: rgba(180, 83, 9, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.85;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Grid background */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, var(--cyan-glow) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 100%, var(--gold-glow) 0%, transparent 45%);
  opacity: 0.6;
}

/* ===== Portal container ===== */
.portal {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Hero ===== */
.hero {
  padding: 100px 0 56px;
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--cyan-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero-accent {
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ===== Card grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 64px;
  flex: 1;
}

/* ===== Article cards ===== */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.6s ease both;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }

.article-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-cyan::before { background: linear-gradient(90deg, var(--cyan), transparent); }
.card-gold::before { background: linear-gradient(90deg, var(--gold), transparent); }

.article-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 70% 30%, transparent 60%, var(--bg-deep) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
}

.card-cyan:hover {
  border-color: var(--cyan-dim);
  box-shadow: 0 8px 40px rgba(34, 211, 238, 0.08);
}
.card-cyan:hover::before { opacity: 1; }

.card-gold:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 8px 40px rgba(232, 168, 56, 0.08);
}
.card-gold:hover::before { opacity: 1; }

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-cyan .card-icon {
  background: var(--cyan-glow);
  color: var(--cyan);
}

.card-gold .card-icon {
  background: var(--gold-glow);
  color: var(--gold);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Card title */
.card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 14px;
  color: var(--text-primary);
}

/* Card desc */
.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
  flex: 1;
}

/* Card meta */
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Card enter */
.card-enter {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: gap 0.3s ease;
  display: flex;
  align-items: center;
}

.card-cyan .card-enter { color: var(--cyan); }
.card-gold .card-enter { color: var(--gold); }

/* ===== Footer ===== */
.portal-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.portal-footer p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .portal { padding: 0 20px; }
  .hero { padding: 64px 0 40px; }
  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .article-card { padding: 24px 22px; }
  .card-title { font-size: 1.15rem; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-desc { font-size: 0.92rem; }
  .article-card { padding: 20px 18px; }
  .card-header { margin-bottom: 18px; }
  .card-icon { width: 40px; height: 40px; }
  .card-icon svg { width: 20px; height: 20px; }
  .card-title { font-size: 1.05rem; }
  .card-desc { font-size: 0.85rem; }
  .portal-footer { padding: 24px 0; }
}
