/* ============================================================
   portal.css — Professional portfolio landing page styles
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg:          #0d0f14;
  --bg-card:     #13161e;
  --bg-card-h:   #181c27;
  --border:      #1e2333;
  --border-h:    #6366f1;
  --text:        #e8eaf0;
  --text-muted:  #7b82a0;
  --text-faint:  #3d4460;
  --accent:      #6366f1;
  --accent-2:    #818cf8;
  --accent-glow: rgba(99,102,241,.22);
  --success:     #10b981;
  --tag-bg:      #1a1f30;
  --tag-text:    #8b93b8;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 4px 32px rgba(0,0,0,.45);
  --transition:  .22s cubic-bezier(.4,0,.2,1);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'Fira Code', 'Cascadia Code', monospace;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---------- Noise / grid overlay ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,.12) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 0h40v40H0z' fill='none'/%3E%3Cpath d='M0 40V0h1v40H0zm40 0V0h1v40h-1z' fill='%236366f1' fill-opacity='.025'/%3E%3Cpath d='M0 0h40v1H0zm0 40h40v1H0z' fill='%236366f1' fill-opacity='.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ---------- Layout shell ---------- */
#portal-root {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top nav ---------- */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: rgba(13,15,20,.75);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .01em;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent-2);
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 28px;
  letter-spacing: .05em;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero h1 .name-highlight {
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ---------- Section header ---------- */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.section-title span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1rem;
  margin-left: 10px;
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(99,102,241,.08);
}

/* ---------- Projects grid ---------- */
#projects {
  padding: 0 0 96px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* ---------- Project card ---------- */
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: default;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.project-card:hover {
  border-color: var(--border-h);
  background: var(--bg-card-h);
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent) inset;
}

.project-card:hover::before { opacity: 1; }

/* Badge ribbon */
.card-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  color: #fff;
}

/* Card icon */
.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(167,139,250,.12));
  border: 1px solid rgba(99,102,241,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 10px;
  line-height: 1.3;
}

.card-desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 22px;
}

/* Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.tag {
  font-size: .73rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border);
  letter-spacing: .02em;
}

/* Launch button */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
}

.btn-launch:hover {
  background: var(--accent-2);
  box-shadow: 0 0 20px rgba(99,102,241,.4);
  transform: translateX(2px);
}

.btn-launch svg {
  transition: transform var(--transition);
}

.btn-launch:hover svg { transform: translateX(3px); }

.card-id {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-faint);
}

/* ---------- No results ---------- */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 0;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
.portal-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: .8rem;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: .8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent-2); }

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 30%, var(--border) 70%, transparent);
  margin: 0 0 64px;
}

/* ---------- Scroll-in animation ---------- */
.card-animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}

.card-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero { padding: 64px 0 48px; }
  .projects-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .hero-stats { gap: 24px; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
