/* ═══════════════════════════════════════════════════════════
   Black Polar — Portfolio App · index.css
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --bg:      #080808;
  --bg2:     #0d0d0d;
  --bg3:     #111111;
  --surface: #161616;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --white:   #F4F2EE;
  --dim:     rgba(244,242,238,0.5);
  --muted:   rgba(244,242,238,0.24);
  --green:   #4ade80;
  --green-d: rgba(74,222,128,0.1);
  --yellow:  #facc15;
  --font-d:  'Bebas Neue', sans-serif;
  --font-b:  'DM Sans', sans-serif;
  --font-m:  'Space Mono', monospace;
  --ease:    0.2s ease;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-b);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Noise ────────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ── Scanlines ────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 8999;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.025) 2px, rgba(0,0,0,0.025) 4px);
}

/* ══════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════ */
.mono-label {
  font-family: var(--font-m);
  font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted);
}
.sec-rule { height: 1px; background: var(--border); }
.container { max-width: 1280px; margin: 0 auto; }
.section-pad    { padding: 88px 48px; }
.section-pad-sm { padding: 56px 48px; }
.section-dark   { background: var(--bg2); }

.section-head {
  display: flex; flex-direction: column;
  gap: 0; margin-bottom: 48px;
}
.section-title {
  font-family: var(--font-d);
  font-size: clamp(2.8rem, 6vw, 5rem);
  letter-spacing: 0.03em; color: var(--white);
  margin-top: 8px;
}
.section-sub {
  font-family: var(--font-b);
  font-weight: 300; font-size: 0.9rem;
  color: var(--dim); max-width: 340px; line-height: 1.75;
  margin-top: 12px;
}

/* Reveal */
.rv { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.rv.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.26s; }
.d4 { transition-delay: 0.36s; }

/* Status dot */
.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
  animation: blink 2.4s ease-in-out infinite;
  flex-shrink: 0; display: inline-block;
}

/* ══════════════════════════════════════════════════════════
   MOBILE NAV
══════════════════════════════════════════════════════════ */
#mob-nav {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 600;
  flex-direction: column; align-items: center; justify-content: center; gap: 32px;
}
#mob-nav.open { display: flex; }
#mob-nav a {
  font-family: var(--font-d);
  font-size: 2.2rem; letter-spacing: 0.08em;
  color: var(--white); text-decoration: none;
  opacity: 0.75; transition: opacity var(--ease);
}
#mob-nav a:hover { opacity: 1; }
#mob-nav .mob-home {
  font-family: var(--font-m);
  font-size: 0.7rem; letter-spacing: 0.2em;
  color: var(--muted); margin-top: 8px;
}
#mob-close {
  position: absolute; top: 20px; right: 20px;
  background: none; border: none; cursor: pointer;
  color: var(--white); opacity: 0.5; transition: opacity var(--ease);
}
#mob-close:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════ */
#hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  transition: background var(--ease), border-color var(--ease);
  border-bottom: 1px solid transparent;
}
#hdr.scrolled {
  background: rgba(8,8,8,0.93);
  border-color: var(--border);
  backdrop-filter: blur(14px);
}
.hdr-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 18px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hdr-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.hdr-logo-sq {
  width: 24px; height: 24px;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.hdr-logo-sq span {
  display: block; width: 9px; height: 9px; background: var(--bg);
}
.hdr-logo-name {
  font-family: var(--font-m); font-size: 0.68rem;
  letter-spacing: 0.18em; color: var(--white);
}
.hdr-center {
  display: flex; align-items: center; gap: 8px;
}
.hdr-nav {
  display: flex; align-items: center; gap: 28px;
}
.nav-link {
  text-decoration: none; transition: color var(--ease);
}
.nav-link:hover { color: var(--white) !important; }
.nav-home {
  padding: 6px 14px;
  border: 1px solid var(--border);
  transition: border-color var(--ease);
}
.nav-home:hover { border-color: var(--border2); }
.hdr-burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hdr-burger span {
  display: block; height: 1px; background: var(--white); width: 20px;
}

/* ══════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════ */
.hero-section {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 96px 48px 64px;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 80px 80px; opacity: 0.4;
}
.hero-content { max-width: 1280px; margin: 0 auto; width: 100%; position: relative; z-index: 10; }

.hero-eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--font-d);
  font-size: clamp(5rem, 14vw, 14rem);
  line-height: 0.88; letter-spacing: 0.01em; color: var(--white);
  overflow: hidden;
}
.hero-title-outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(244,242,238,0.22);
}

.hero-sub-row {
  display: flex; flex-wrap: wrap;
  align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-top: 28px;
}
.hero-sub-text {
  font-family: var(--font-b); font-weight: 300;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  color: var(--dim); max-width: 480px; line-height: 1.75;
}
.hero-counters {
  display: flex; align-items: center; gap: 20px; flex-shrink: 0;
}
.hero-counter-item { text-align: right; }
.hero-counter-item .count-up {
  font-family: var(--font-d); font-size: 2.5rem; line-height: 1;
}
.hero-counter-div {
  width: 1px; height: 48px; background: var(--border);
}

.hero-terminal { margin-top: 40px; max-width: 520px; }
.hero-scroll {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero-scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--dim), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}

/* ── Terminal ─────────────────────────────────────────────── */
.terminal {
  background: #060606;
  border: 1px solid var(--border);
  font-family: var(--font-m); font-size: 0.72rem; line-height: 1.9;
  padding: 22px 26px;
}
.term-line { display: flex; gap: 10px; }
.term-prompt { color: var(--green); user-select: none; }
.term-cmd    { color: rgba(244,242,238,0.72); }
.term-out    { color: var(--muted); padding-left: 18px; }
.term-hl     { color: var(--white); }
.term-ok     { color: var(--green); }

/* ── Hero element animation ───────────────────────────────── */
.hero-el {
  opacity: 0; transform: translateY(22px);
  animation: heroIn 0.85s ease forwards;
}
@keyframes heroIn { to { opacity: 1; transform: none; } }

/* ── Grid cross decoration ────────────────────────────────── */
.grid-cross {
  position: absolute; width: 12px; height: 12px; pointer-events: none;
}
.grid-cross::before, .grid-cross::after {
  content: ''; position: absolute; background: rgba(255,255,255,0.1);
}
.grid-cross::before { width: 1px; height: 100%; left: 50%; }
.grid-cross::after  { height: 1px; width: 100%; top: 50%; }

/* ══════════════════════════════════════════════════════════
   STATS ROW
══════════════════════════════════════════════════════════ */
.stats-row { background: var(--bg2); }
.stats-row-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.stat-box {
  padding: 28px 24px; position: relative; overflow: hidden;
  border-right: 1px solid var(--border);
}
.stat-box:last-child { border-right: none; }
.stat-box::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, rgba(244,242,238,0.12), transparent);
}
.stat-box-label { margin-bottom: 10px; }
.stat-box-val {
  font-family: var(--font-d);
  font-size: clamp(2.2rem, 4vw, 3.2rem); color: var(--white); line-height: 1;
}
.stat-box-sub { margin-top: 6px; }

/* ══════════════════════════════════════════════════════════
   PROJECTS
══════════════════════════════════════════════════════════ */
.section-head {
  display: flex; flex-direction: column;
  gap: 0; margin-bottom: 40px;
}
/* Override for horizontal layout in larger sections */
.section-head-row {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-tab {
  font-family: var(--font-m); font-size: 0.6rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border);
  padding: 6px 14px; background: transparent; cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.filter-tab:hover, .filter-tab.active {
  color: var(--bg); background: var(--white); border-color: var(--white);
}

.proj-col-header {
  display: grid; grid-template-columns: 3rem 1fr auto;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px; margin-bottom: 2px;
}
.proj-col-header .mono-label { padding: 0; }

.proj-row {
  border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 3rem 1fr auto;
  align-items: center; transition: background var(--ease); cursor: default;
}
.proj-row:hover { background: rgba(255,255,255,0.024); }
.proj-row:hover .proj-arrow { opacity: 1; transform: translateX(0); }
.proj-row:hover .proj-num, .proj-row:hover .proj-title { color: var(--white); }

.proj-num {
  font-family: var(--font-m); font-size: 0.58rem;
  color: var(--muted); padding: 0 20px; transition: color var(--ease);
}
.proj-inner {
  padding: 22px 16px 22px 0;
  display: flex; flex-direction: column; gap: 7px;
}
.proj-title {
  font-family: var(--font-b); font-size: 1rem; font-weight: 400;
  color: rgba(244,242,238,0.82); transition: color var(--ease); line-height: 1.3;
}
.proj-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proj-tag {
  font-family: var(--font-m); font-size: 0.55rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); padding: 2px 7px;
}
.proj-year { font-family: var(--font-m); font-size: 0.58rem; color: var(--muted); }

.proj-right {
  padding: 22px 24px; display: flex; align-items: center; gap: 14px;
}
.proj-arrow {
  opacity: 0; transform: translateX(-6px);
  transition: opacity var(--ease), transform var(--ease); color: var(--dim);
}
.proj-status {
  font-family: var(--font-m); font-size: 0.55rem;
  letter-spacing: 0.15em; text-transform: uppercase; padding: 3px 9px; border: 1px solid;
}
.status-delivered {
  color: var(--green); border-color: rgba(74,222,128,0.25); background: var(--green-d);
}
.status-ongoing {
  color: var(--yellow); border-color: rgba(250,204,21,0.25); background: rgba(250,204,21,0.08);
}

.proj-footer {
  margin-top: 24px; display: flex; align-items: center; justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════════
   TEAM
══════════════════════════════════════════════════════════ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  max-width: 900px; /* 3 cards centered */
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.25s, transform 0.25s;
  position: relative; overflow: hidden;
}
.team-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(to right, transparent, rgba(244,242,238,0.3), transparent);
  transform: scaleX(0); transition: transform 0.4s ease;
}
.team-card:hover { border-color: var(--border2); transform: translateY(-3px); }
.team-card:hover::before { transform: scaleX(1); }

/* Avatar placeholder */
.team-avatar {
  width: 100%; aspect-ratio: 3/2;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.team-avatar-icon {
  opacity: 0.18;
}

.team-info {
  padding: 20px 22px;
}
.team-id {
  font-family: var(--font-m); font-size: 0.52rem;
  color: var(--muted); letter-spacing: 0.15em; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.team-name {
  font-family: var(--font-b); font-weight: 500;
  font-size: 1rem; color: var(--white); line-height: 1.3;
}
.team-role {
  font-family: var(--font-m); font-size: 0.56rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-top: 5px;
}

/* ══════════════════════════════════════════════════════════
   CLIENTS / SHOWCASE PLACEHOLDERS
══════════════════════════════════════════════════════════ */
.clients-placeholder,
.showcase-placeholder {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); padding: 32px 28px;
  background: rgba(255,255,255,0.02);
}

/* ══════════════════════════════════════════════════════════
   TECH STACK
══════════════════════════════════════════════════════════ */
.stack-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
}
.stack-col { background: var(--bg); padding: 22px 26px; }
.stack-col-title { margin-bottom: 14px; }
.badge-group { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-badge {
  font-family: var(--font-m); font-size: 0.58rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border);
  padding: 4px 10px; background: var(--surface);
  transition: color var(--ease), border-color var(--ease);
}
.tech-badge:hover { color: var(--white); border-color: var(--border2); }

/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 32px 48px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-copy { color: var(--muted); }

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════════ */
@keyframes blink      { 0%,100%{opacity:1;} 50%{opacity:0.3;} }
@keyframes scrollPulse{
  0%,100%{opacity:0.6; transform:scaleY(1);}
  50%{opacity:0.15; transform:scaleY(0.55);}
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hdr-inner { padding: 16px 32px; }
  .section-pad { padding: 72px 32px; }
  .section-pad-sm { padding: 48px 32px; }
  .hero-section { padding: 80px 32px 56px; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-box { border-bottom: 1px solid var(--border); }
  .team-grid { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
}

@media (max-width: 768px) {
  .hdr-inner { padding: 14px 20px; }
  .hdr-center { display: none; }
  .hdr-nav { display: none; }
  .hdr-burger { display: flex !important; }
  .section-pad { padding: 56px 20px; }
  .section-pad-sm { padding: 40px 20px; }
  .hero-section { padding: 72px 20px 48px; }
  .hero-sub-row { flex-direction: column; align-items: flex-start; }
  .proj-row { grid-template-columns: 2.5rem 1fr; }
  .proj-right { display: none; }
  .proj-num { padding: 0 12px; }
  .team-grid { grid-template-columns: 1fr; max-width: 420px; }
  .site-footer { padding: 28px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (max-width: 480px) {
  .hdr-inner { padding: 12px 16px; }
  .section-pad { padding: 44px 16px; }
  .hero-section { padding: 60px 16px 40px; }
  .section-title { font-size: clamp(2rem, 8vw, 3.5rem); }
  .stack-grid { grid-template-columns: 1fr; }
  .stats-row-inner { grid-template-columns: repeat(2, 1fr); }
}
