/* =========================================================
   S1lent.dev — modern studio theme
   ========================================================= */
:root {
  --bg: #07080c;
  --bg-soft: #0b0d13;
  --surface: rgba(255, 255, 255, 0.024);
  --surface-2: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f3f5fa;
  --text-dim: #9aa3ba;
  --text-faint: #5f6880;

  --c1: #22d3ee; /* cyan   */
  --c2: #6366f1; /* indigo */
  --c3: #a855f7; /* violet */
  --grad: linear-gradient(115deg, var(--c1), var(--c2) 55%, var(--c3));

  --maxw: 1120px;
  --radius: 18px;
  --ease: cubic-bezier(.22, .68, 0, 1);
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Sora', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

::selection { background: rgba(99, 102, 241, 0.4); color: #fff; }

/* ===== Background layers ===== */
.bg-aurora, .bg-grid, .bg-grain { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.bg-aurora { overflow: hidden; }
.blob {
  position: absolute;
  width: 46vw; height: 46vw;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.5;
  will-change: transform;
}
.blob.b1 { top: -16vw; left: -8vw;  background: radial-gradient(circle, #0e7490, transparent 68%); animation: drift1 26s ease-in-out infinite; }
.blob.b2 { top: -6vw;  right: -12vw; background: radial-gradient(circle, #4338ca, transparent 68%); animation: drift2 32s ease-in-out infinite; }
.blob.b3 { top: 38vw;  left: 28vw;   background: radial-gradient(circle, #7e22ce, transparent 70%); opacity: 0.35; animation: drift3 38s ease-in-out infinite; }

.bg-grid {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% -5%, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% -5%, #000 35%, transparent 78%);
  opacity: 0.55;
}

.bg-grain {
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--grad);
  z-index: 200;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
}

/* ===== Nav ===== */
.nav-wrap {
  position: sticky;
  top: 16px;
  z-index: 100;
  padding: 0 20px;
  display: flex;
  justify-content: center;
}
.nav {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.65rem 0.7rem 0.65rem 1.1rem;
  background: rgba(11, 13, 19, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.nav.scrolled {
  background: rgba(9, 11, 16, 0.82);
  border-color: var(--border-strong);
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--border);
  transition: transform 0.45s var(--ease);
}
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.06); }
.brand-logo.sm { width: 28px; height: 28px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.02em; }

.nav-links { display: flex; gap: 0.2rem; margin-left: auto; }
.nav-link {
  position: relative;
  font-size: 0.92rem;
  font-weight: 450;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); }
.nav-link.active::before {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--c1); transform: translateX(-50%);
  box-shadow: 0 0 8px var(--c1);
}

.nav-right { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.nav-links + .nav-right { margin-left: 0; }

.status-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
  color: var(--text-dim); text-decoration: none;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.status-pill:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2.4s infinite;
}

.burger {
  display: none;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--border);
  border-radius: 11px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.burger span { width: 17px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s, opacity 0.2s; }
.burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===== Layout ===== */
main { position: relative; z-index: 2; }
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5.5rem 20px 0;
}

/* ===== Hero ===== */
.hero {
  position: relative; z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 20px 1rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
  color: var(--text-dim);
  padding: 0.42rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 1.8rem;
}
.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 1.4rem;
}
.grad {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerText 8s linear infinite;
}
.hero-sub {
  max-width: 36rem;
  margin: 0 auto 2.2rem;
  color: var(--text-dim);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.7;
}
.hero-cta { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 3rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font); font-weight: 600; font-size: 0.96rem;
  text-decoration: none; cursor: pointer;
  padding: 0.82rem 1.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.3s, background 0.3s, border-color 0.3s, color 0.2s;
}
.btn i { font-size: 0.9em; }
.btn-primary {
  color: #05080d;
  background: linear-gradient(115deg, #67e8f9, #818cf8);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.32);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(99, 102, 241, 0.5); }
.btn-primary .fa-arrow-right { transition: transform 0.25s var(--ease); }
.btn-primary:hover .fa-arrow-right { transform: translateX(4px); }
.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn-ghost:hover { transform: translateY(-3px); background: var(--surface-2); border-color: rgba(129, 140, 248, 0.5); }

.hero-stats {
  display: inline-flex; align-items: center; gap: 1.6rem;
  padding: 1rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 2.6rem;
}
.hstat { display: flex; flex-direction: column; align-items: center; }
.hstat-num { font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1; }
.hstat-num .unit { font-size: 1rem; color: var(--text-dim); }
.hstat-label { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.35rem; letter-spacing: 0.02em; }
.hstat-sep { width: 1px; height: 30px; background: var(--border); }

/* tech marquee */
.marquee {
  position: relative;
  max-width: 640px; margin: 0 auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; gap: 1.1rem; width: max-content;
  font-family: var(--mono); font-size: 0.86rem; color: var(--text-faint);
  animation: marquee 26s linear infinite;
}
.marquee-track span { white-space: nowrap; }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ===== Section heads ===== */
.sec-head { max-width: 640px; margin-bottom: 2.6rem; }
.sec-kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
  color: var(--c1); letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kdot { width: 6px; height: 6px; border-radius: 50%; background: var(--c1); box-shadow: 0 0 8px var(--c1); }
.sec-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  letter-spacing: -0.025em;
  margin: 0.7rem 0 0.6rem;
}
.sec-lead { color: var(--text-dim); font-size: 1.05rem; margin: 0; }

/* ===== Bento ===== */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.1rem; }
.bento-card {
  position: relative; overflow: hidden;
  grid-column: span 3;
  padding: 1.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.4s var(--ease), border-color 0.4s, background 0.4s;
}
.bento-card.span-2 { grid-column: span 2; }
.bento-card.span-3 { grid-column: span 3; }
.bento-card.span-4 { grid-column: span 4; }
.bento-card:hover { transform: translateY(-5px); border-color: var(--border-strong); background: var(--surface-2); }
.bento-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 13px;
  font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid var(--border);
  margin-bottom: 1.2rem;
}
.bento-card h3 { font-family: var(--display); font-size: 1.22rem; font-weight: 600; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.bento-card p { color: var(--text-dim); font-size: 0.98rem; margin: 0; line-height: 1.6; }
.bento-card.wide { display: flex; flex-direction: column; }
.inline-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 1.1rem;
  font-family: var(--mono); font-size: 0.85rem; font-weight: 500;
  color: var(--c1); text-decoration: none;
  transition: gap 0.25s var(--ease), color 0.2s;
}
.inline-link:hover { gap: 0.7rem; color: #67e8f9; }

/* spotlight hover */
.spot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, -100%) var(--my, -100%), rgba(129, 140, 248, 0.14), transparent 42%);
  opacity: 0; transition: opacity 0.4s;
}
.spot:hover::after { opacity: 1; }

/* ===== Team ===== */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.team-card {
  position: relative; overflow: hidden;
  text-align: center;
  padding: 2rem 1.4rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.4s var(--ease), border-color 0.4s, background 0.4s;
}
.team-card:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--surface-2); }
.avatar-ring {
  width: 86px; height: 86px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  padding: 3px;
  background: var(--grad);
  background-size: 200% 200%;
  animation: shimmerText 6s linear infinite;
  transition: transform 0.4s var(--ease);
}
.team-card:hover .avatar-ring { transform: scale(1.06) rotate(3deg); }
.team-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  border: 3px solid var(--bg);
}
.team-name { font-family: var(--display); font-size: 1.2rem; font-weight: 600; margin: 0 0 0.2rem; }
.team-name a { text-decoration: none; transition: color 0.2s; }
.team-name a:hover { color: var(--c1); }
.team-role {
  display: inline-block;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--text-faint);
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.team-socials { display: flex; justify-content: center; gap: 0.7rem; }
.team-socials a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--text-dim); font-size: 1.05rem;
  background: var(--surface); border: 1px solid var(--border);
  transition: color 0.2s, transform 0.25s var(--ease), border-color 0.2s, background 0.2s;
}
.team-socials a:hover { color: #fff; transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface-2); }

/* ===== Projects ===== */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.project-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 0.6rem;
  min-height: 158px;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.4s var(--ease), border-color 0.4s, background 0.4s;
}
.project-card:not(.skeleton):hover { transform: translateY(-5px); border-color: var(--border-strong); background: var(--surface-2); }
.project-top { display: flex; align-items: center; gap: 0.6rem; }
.project-folder { color: var(--c2); font-size: 1.05rem; }
.project-title { font-family: var(--mono); font-size: 1.04rem; font-weight: 600; color: var(--text); }
.project-desc { color: var(--text-dim); font-size: 0.95rem; line-height: 1.55; flex-grow: 1; }
.project-meta {
  display: flex; flex-wrap: wrap; gap: 1rem;
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint);
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}
.project-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.lang-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c1); }
.project-card .stretch { position: absolute; inset: 0; }

.project-card.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.projects-foot { margin-top: 1.6rem; text-align: center; }

/* ===== Contact ===== */
#contact { padding-bottom: 1rem; }
.contact-card {
  position: relative; overflow: hidden;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
}
.contact-glow {
  position: absolute; top: -50%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22), transparent 65%);
  pointer-events: none;
}
.contact-card .sec-kicker { justify-content: center; }
.contact-title { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.025em; margin: 0.8rem 0 0.6rem; }
.contact-lead { color: var(--text-dim); font-size: 1.08rem; max-width: 30rem; margin: 0 auto 2rem; }
.contact-actions { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; position: relative; z-index: 1; }

/* ===== Footer ===== */
.footer {
  position: relative; z-index: 2;
  margin-top: 6rem;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2rem 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.footer-copy { color: var(--text-faint); font-size: 0.9rem; }
.footer-copy .fa-heart { color: #f43f5e; }
.footer-socials { display: flex; gap: 0.6rem; }
.footer-socials a {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; color: var(--text-dim);
  border: 1px solid var(--border); background: var(--surface);
  transition: color 0.2s, transform 0.25s var(--ease), border-color 0.2s;
}
.footer-socials a:hover { color: #fff; transform: translateY(-3px); border-color: var(--border-strong); }

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease) var(--d, 0s), transform 0.7s var(--ease) var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Keyframes ===== */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes shimmerText { to { background-position: 200% center; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes drift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vw, 4vw) scale(1.1); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-5vw, 5vw) scale(1.08); } }
@keyframes drift3 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(4vw, -6vw) scale(1.12); } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .bento-card, .bento-card.span-2, .bento-card.span-3, .bento-card.span-4 { grid-column: span 6; }
  .team-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: calc(100% + 12px); left: 0; right: 0;
    flex-direction: column; gap: 0.2rem;
    padding: 0.6rem;
    background: rgba(9, 11, 16, 0.96);
    border: 1px solid var(--border);
    border-radius: 18px;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; }
  .nav-link { padding: 0.8rem 1rem; text-align: center; }
  .nav-link.active::before { display: none; }
  .nav-right { margin-left: auto; }
  .burger { display: flex; }
  .status-pill { display: none; }

  .projects-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
  .hero-stats { gap: 1rem; padding: 0.9rem 1.1rem; }
  .hero-stats .hstat-num { font-size: 1.4rem; }
  .section { padding-top: 4.5rem; }
}

@media (max-width: 420px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hstat-sep { height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
