/* ============================================================
   CodeTuhin — Cinematic Portfolio Layer (v2)
   Futuristic · Glass · Circuit · Cyan/Purple · Performance-aware
   ============================================================ */

:root {
  --bg: #02040a;
  --bg-2: #060b16;
  --bg-3: #0a1222;
  --card: rgba(12, 20, 36, 0.72);
  --card-solid: #0c1424;
  --line: rgba(34, 211, 238, 0.14);
  --line-strong: rgba(34, 211, 238, 0.35);
  --text: #eaf0f8;
  --muted: #8fa3bf;
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --cyan-dim: #0e7490;
  --purple: #a78bfa;
  --purple-dim: #7c3aed;
  --gold: #f5c451;
  --ok: #34d399;
  --radius: 18px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glass: rgba(8, 14, 28, 0.65);
  --glow-cyan: 0 0 40px rgba(34, 211, 238, 0.15);
  --glow-purple: 0 0 40px rgba(167, 139, 250, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans Bengali", sans-serif;
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(34, 211, 238, 0.28); color: #fff; }
a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--cyan-bright); }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 3.2vw, 1.85rem); }
h3 { font-size: 1.12rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* Particle canvas behind everything */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
body > *:not(#particle-canvas) { position: relative; z-index: 1; }

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 0.45rem;
  text-decoration: none !important;
  transition: transform 0.25s var(--ease);
}
.wordmark:hover { transform: translateY(-1px); }
.wm-bracket {
  color: var(--cyan); font-weight: 800; font-size: 1.4rem;
  text-shadow: 0 0 16px rgba(34,211,238,.9), 0 0 36px rgba(34,211,238,.4);
}
.wm-text { font-size: 1.32rem; font-weight: 800; letter-spacing: -0.3px; }
.wm-code { color: var(--cyan); }
.wm-tuhin { color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(2, 4, 10, 0.78);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0.7rem 1.15rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 62px;
}
.nav-toggle {
  background: var(--card-solid); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.4rem 0.75rem; font-size: 1.15rem; cursor: pointer;
}
.main-nav { display: none; flex-direction: column; gap: 0.12rem; }
.main-nav.open { display: flex; animation: slideDown 0.28s var(--ease); }
.main-nav a {
  color: var(--text); padding: 0.5rem 0.85rem; border-radius: 9px;
  font-weight: 600; font-size: 0.93rem; transition: background 0.2s, color 0.2s;
}
.main-nav a:hover { background: rgba(34,211,238,0.08); color: var(--cyan-bright); }
.main-nav a.active { color: var(--cyan); background: rgba(34,211,238,0.1); }
.main-nav .nav-cta {
  background: linear-gradient(135deg, var(--gold), #ffd97a);
  color: #1a1405 !important; text-align: center; margin-top: 0.45rem;
  font-weight: 700; box-shadow: 0 4px 18px rgba(245,196,81,0.25);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 960px) {
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(6,11,22,0.97); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line); padding: 0.85rem 1.15rem 1.15rem;
  }
}
@media (min-width: 961px) {
  .nav-toggle { display: none; }
  .main-nav { display: flex; flex-direction: row; align-items: center; gap: 0.15rem; }
  .main-nav .nav-cta { margin-top: 0; margin-left: 0.55rem; padding: 0.48rem 1.05rem; }
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.15rem 3.5rem; }
.section { padding: 3rem 0 1rem; }
.section-head { margin-bottom: 1.6rem; }
.section-head .kicker {
  color: var(--cyan); text-transform: uppercase; letter-spacing: 2.8px;
  font-size: 0.7rem; font-weight: 700; margin-bottom: 0.35rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.section-head .kicker::before {
  content: ""; width: 18px; height: 2px; background: linear-gradient(90deg, var(--cyan), transparent);
}
.section-head h2 { margin-bottom: 0.4rem; }
.section-head .muted { max-width: 540px; }
.grid { display: grid; gap: 1.15rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Cinematic Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 4.5rem 1.15rem 3.5rem;
  min-height: min(78vh, 720px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34,211,238,0.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(167,139,250,0.08), transparent 55%),
    radial-gradient(ellipse 40% 30% at 15% 70%, rgba(34,211,238,0.05), transparent 50%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.hero-circuit {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image:
    linear-gradient(rgba(34,211,238,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}
.hero-mark {
  font-size: clamp(2.8rem, 7vw, 4rem);
  font-weight: 800; color: var(--cyan);
  text-shadow: 0 0 30px rgba(34,211,238,.8), 0 0 80px rgba(34,211,238,.35);
  margin-bottom: 0.25rem;
  animation: heroGlow 4s ease-in-out infinite;
}
@keyframes heroGlow {
  0%,100% { text-shadow: 0 0 30px rgba(34,211,238,.8), 0 0 80px rgba(34,211,238,.35); }
  50% { text-shadow: 0 0 40px rgba(34,211,238,1), 0 0 100px rgba(34,211,238,.5); }
}
.hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  margin: 0.15rem 0 0.5rem;
  letter-spacing: -0.035em;
}
.hero .slogan {
  color: var(--gold); letter-spacing: 3.5px; font-weight: 700;
  font-size: 0.8rem; text-transform: uppercase;
}
.hero .hero-sub {
  color: var(--muted); max-width: 560px; margin: 1.2rem auto 1.8rem;
  font-size: 1.08rem; line-height: 1.7;
}
.hero-roles {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
  margin-bottom: 1.6rem;
}
.hero-roles span {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.8px;
  padding: 0.28rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--cyan);
  background: rgba(34,211,238,0.06); text-transform: uppercase;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.75rem 1.45rem; border-radius: 12px; font-weight: 700; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.2s, box-shadow 0.25s;
  text-decoration: none !important; line-height: 1.3;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #ffd97a); color: #1a1405;
  box-shadow: 0 4px 20px rgba(245,196,81,0.28);
}
.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-bright)); color: #04222b;
  box-shadow: 0 4px 20px rgba(34,211,238,0.3);
}
.btn-ghost {
  background: transparent; border-color: var(--line-strong); color: var(--cyan);
}
.btn-ghost:hover { background: rgba(34,211,238,0.08); }
.btn-wa { background: #22c55e; color: #04150a; box-shadow: 0 4px 16px rgba(34,197,94,0.3); }
.btn-tg { background: #229ed9; color: #fff; box-shadow: 0 4px 16px rgba(34,158,217,0.3); }

/* ---------- Glass Cards ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.45rem;
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
  position: relative; overflow: hidden;
  transform-style: preserve-3d;
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(34,211,238,0.05), transparent 50%);
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-5px);
  box-shadow: var(--glow-cyan), 0 16px 48px rgba(0,0,0,0.4);
}
.card:hover::before { opacity: 1; }
.card .icon { font-size: 1.8rem; margin-bottom: 0.1rem; }
.card .price { color: var(--gold); font-weight: 800; font-size: 1.18rem; }
.card .meta { color: var(--muted); font-size: 0.88rem; }
.card .spacer { flex: 1; min-height: 0.4rem; }
.card h3 { font-size: 1.08rem; }
.card p.muted { font-size: 0.92rem; line-height: 1.55; }

.tag {
  display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.7px;
  padding: 0.18rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--cyan-dim); color: var(--cyan);
  text-transform: uppercase; align-self: flex-start;
  background: rgba(34,211,238,0.07);
}
.tag.gold { border-color: #b8860b; color: var(--gold); background: rgba(245,196,81,0.07); }
.tag.purple { border-color: var(--purple-dim); color: var(--purple); background: rgba(167,139,250,0.08); }
.sev-critical { border-color: #7f1d1d; color: #fca5a5; background: rgba(248,113,113,0.08); }
.sev-high { border-color: #b8860b; color: var(--gold); background: rgba(245,196,81,0.08); }
.sev-medium { border-color: var(--cyan-dim); color: var(--cyan); }
.sev-info { border-color: var(--line); color: var(--muted); }

/* ---------- Skills / Stack ---------- */
.skill-cloud {
  display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center;
}
.skill-pill {
  padding: 0.45rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(12,20,36,0.8);
  font-weight: 600; font-size: 0.88rem; color: var(--text);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.skill-pill:hover {
  border-color: var(--cyan); color: var(--cyan-bright);
  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(34,211,238,0.12);
}
.skill-pill.accent { border-color: rgba(167,139,250,0.4); color: var(--purple); }

/* ---------- About strip ---------- */
.about-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .about-grid { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
.about-panel {
  background: var(--card); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; position: relative; overflow: hidden;
}
.about-panel::after {
  content: ""; position: absolute; top: 0; right: 0; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(34,211,238,0.12), transparent 70%);
  pointer-events: none;
}
.stat-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; margin-top: 1.2rem;
}
.stat {
  background: rgba(2,4,10,0.5); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.9rem 1rem; text-align: center;
}
.stat .num { font-size: 1.5rem; font-weight: 800; color: var(--cyan); letter-spacing: -0.02em; }
.stat .lbl { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; text-transform: uppercase; letter-spacing: 0.6px; }

/* ---------- Filters ---------- */
.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.4rem; }
.filter-row a {
  padding: 0.4rem 0.95rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); font-weight: 600; font-size: 0.88rem; transition: all 0.2s;
}
.filter-row a.active, .filter-row a:hover {
  border-color: var(--cyan); color: var(--cyan); background: rgba(34,211,238,0.08);
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--card); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; max-width: 640px; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
label { display: block; font-weight: 600; margin: 0.9rem 0 0.35rem; font-size: 0.92rem; }
input, select, textarea {
  width: 100%; padding: 0.7rem 0.9rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-size: 1rem; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.notice {
  border: 1px solid #b8860b; background: rgba(245,196,81,0.08); color: var(--gold);
  padding: 0.9rem 1.1rem; border-radius: 11px; margin-bottom: 1.1rem; font-size: 0.95rem;
}
.notice.error { border-color: #7f1d1d; background: rgba(248,113,113,0.08); color: #fca5a5; }
.notice.ok { border-color: #065f46; background: rgba(52,211,153,0.08); color: var(--ok); }
.pay-box {
  border: 1px dashed rgba(34,211,238,0.35); border-radius: 12px;
  padding: 1.15rem; margin: 1.1rem 0; background: rgba(34,211,238,0.04);
}
.pay-box .num { font-size: 1.3rem; font-weight: 800; letter-spacing: 1.5px; color: var(--gold); }
.copy-btn {
  background: var(--card-solid); color: var(--cyan); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.3rem 0.75rem; cursor: pointer; font-weight: 700;
  margin-left: 0.5rem; font-size: 0.85rem;
}

/* ---------- Detail ---------- */
.detail-head { margin-bottom: 1.2rem; }
.prose p { color: #c5d2e6; }
.two-col { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 2fr 1fr; } }
.side-box {
  background: var(--card); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem; height: fit-content;
}
.social-grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .social-grid { grid-template-columns: repeat(2, 1fr); } }
.social-grid a {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.95rem 1.1rem; color: var(--text); font-weight: 700;
  transition: border-color 0.25s, transform 0.2s;
}
.social-grid a:hover { border-color: var(--cyan); transform: translateY(-2px); }
.social-grid a span { display: block; color: var(--muted); font-weight: 400; font-size: 0.85rem; margin-top: 0.15rem; word-break: break-all; }

.feature-list { list-style: none; margin: 0.5rem 0 0.9rem; }
.feature-list li {
  padding: 0.28rem 0 0.28rem 1.5rem; position: relative; color: var(--muted); font-size: 0.95rem;
}
.feature-list li::before { content: "✓"; color: var(--ok); position: absolute; left: 0; font-weight: 800; }

.why-list { display: grid; gap: 1.15rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .why-list { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 2.5rem;
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 2.4rem 1.15rem;
  display: grid; gap: 1.8rem; grid-template-columns: 1fr;
}
@media (min-width: 760px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer-slogan {
  color: var(--gold); letter-spacing: 2.5px; font-size: 0.75rem;
  font-weight: 700; margin-top: 0.55rem; text-transform: uppercase;
}
.footer-note { color: var(--muted); font-size: 0.92rem; margin-top: 0.5rem; max-width: 340px; }
.footer-col h4 { margin-bottom: 0.7rem; color: var(--cyan); font-size: 0.95rem; }
.footer-col a {
  display: block; color: var(--muted); padding: 0.22rem 0; font-size: 0.93rem;
  transition: color 0.2s, padding-left 0.2s;
}
.footer-col a:hover { color: var(--cyan); padding-left: 4px; }
.footer-bottom {
  border-top: 1px solid var(--line); padding: 1.15rem;
  text-align: center; color: #6b7f99; font-size: 0.86rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.footer-bn { color: var(--muted); font-size: 0.88rem; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.spacer { flex: 1; }


/* ============================================================
   CodeTuhin 3D World container
   ============================================================ */
.ct3-stage {
  position: relative;
  width: 100%;
  height: min(72vh, 640px);
  min-height: 360px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(34,211,238,0.08), transparent 65%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
#ct3-world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#ct3-world.ct3-fallback {
  display: none;
}
.ct3-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem 1rem 2rem;
  background: linear-gradient(to top, rgba(2,4,10,0.75) 0%, transparent 45%);
  z-index: 2;
}
.ct3-overlay .hero-content {
  pointer-events: auto;
  text-align: center;
  max-width: 640px;
}
.ct3-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8,14,28,0.85);
  color: var(--cyan);
  display: none;
  align-items: center;
  gap: 0.4rem;
}
.ct3-home-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(8,14,28,0.85);
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
}
.ct3-home-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
@media (max-width: 640px) {
  .ct3-stage { height: min(58vh, 480px); min-height: 300px; }
}

/* When 3D is active, classic hero is compact under stage or hidden */
.hero-classic { display: none; }
.ct3-fallback ~ .hero-classic,
body:not(.ct3-active) .hero-classic { display: block; }
