/* ============================================================
   Sutharsha — personal site
   Sleek dark theme, gradient accents, glass cards.
   ============================================================ */

:root {
  --bg: #08080c;
  --bg-soft: #0e0e15;
  --panel: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f7;
  --muted: #9a9aae;
  --faint: #63637a;

  --a1: #7c5cff; /* violet */
  --a2: #22d3ee; /* cyan   */
  --a3: #ff7ac6; /* pink   */
  --grad: linear-gradient(110deg, var(--a1), var(--a2) 55%, var(--a3));

  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Ambient background layers ------------------------------------ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  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.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.glow {
  position: fixed;
  z-index: 0;
  width: 620px;
  height: 620px;
  left: 50%;
  top: -120px;
  transform: translate(-50%, 0);
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(124, 92, 255, 0.28), transparent 62%);
  filter: blur(30px);
  animation: drift 16s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: translate(-62%, -10px) scale(1); }
  to   { transform: translate(-38%, 40px) scale(1.15); }
}

/* Cursor-follow spotlight (set via JS) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 20%),
              rgba(34, 211, 238, 0.06), transparent 70%);
  transition: background 0.2s linear;
}

main, .nav, .footer { position: relative; z-index: 1; }

/* Layout helpers ---------------------------------------------- */
section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(60px, 11vw, 140px) 24px;
  scroll-margin-top: 88px; /* clear the sticky nav on anchor jumps */
}
.section-label {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 26px;
}

/* Nav --------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 44px);
  backdrop-filter: blur(14px);
  background: rgba(8, 8, 12, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); background: rgba(8, 8, 12, 0.8); }
.nav__brand {
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
  font-size: 17px;
}
.nav__mark { color: var(--a2); }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 3vw, 32px); }
.nav__links a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav__links a:hover { color: var(--text); }
/* Active (scroll-spy) state for the plain link — gradient underline. */
.nav__links a:not(.nav__cta).is-active { color: var(--text); }
.nav__links a:not(.nav__cta).is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}
.nav__cta {
  border: 1px solid var(--border-strong);
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--text) !important;
}
.nav__cta:hover { background: var(--panel); border-color: var(--a1); }
.nav__cta.is-active { background: var(--panel); border-color: var(--a1); }

/* Hero -------------------------------------------------------- */
.hero { padding-top: clamp(70px, 12vw, 130px); text-align: left; }
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--a2);
  margin-bottom: 22px;
}
.hero__title {
  font-size: clamp(42px, 8.5vw, 92px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
.hero__title em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  max-width: 560px;
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--muted);
  margin-bottom: 38px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 64px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn--primary {
  color: #0a0a0f;
  background: var(--grad);
  background-size: 160% 160%;
  box-shadow: 0 8px 30px rgba(124, 92, 255, 0.28);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(124, 92, 255, 0.4); }
.btn--ghost {
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: var(--panel);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--a2); }

.hero__stats { display: flex; flex-wrap: wrap; gap: clamp(28px, 6vw, 64px); }
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats b {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__stats span {
  font-size: 13px;
  color: var(--faint);
  font-family: "JetBrains Mono", monospace;
}

/* About ------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(30px, 6vw, 70px);
  align-items: start;
}
.about__lead {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.about__lead strong { font-weight: 400; font-style: italic; color: var(--a2); }
.about__body p { color: var(--muted); margin-bottom: 18px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.chips li {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  transition: border-color 0.2s, color 0.2s;
}
.chips li:hover { border-color: var(--a1); color: var(--text); }

/* Work -------------------------------------------------------- */
.work__title {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 44px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.card {
  --rx: 0deg; --ry: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.18s var(--ease), border-color 0.3s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s;
}
.card:hover { border-color: transparent; }
.card:hover::before { opacity: 1; }
.card--feature { grid-column: 1 / -1; }
.card--feature .card__desc { max-width: 620px; }

.card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.card__kind {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--a2);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.07);
}
.card__kind--game {
  color: var(--a3);
  border-color: rgba(255, 122, 198, 0.3);
  background: rgba(255, 122, 198, 0.07);
}
.card__arrow {
  font-size: 20px;
  color: var(--faint);
  transition: transform 0.3s var(--ease), color 0.3s;
}
.card:hover .card__arrow { transform: translate(4px, -4px); color: var(--text); }
.card__name {
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.card__desc { color: var(--muted); font-size: 15.5px; margin-bottom: 24px; flex: 1; }
.card__meta {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--faint);
}
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

/* Outro ------------------------------------------------------- */
.outro { text-align: center; padding-top: clamp(40px, 7vw, 80px); }
.outro__line {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(26px, 4.5vw, 44px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 620px;
  margin: 0 auto;
}

/* Footer ------------------------------------------------------ */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 24px 50px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--faint);
}

/* Reveal on scroll -------------------------------------------- */
/* Only hide when JS is present — no-JS still shows everything. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Responsive -------------------------------------------------- */
@media (max-width: 760px) {
  .about__grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .card { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
