/* ============================================================
   Rahul Bisht — Portfolio
   Tokens (dark default + light theme)
   ============================================================ */
:root {
  --pf-bg: #171717;
  --pf-card: #212121;
  --pf-chip: #242424;
  --pf-heading: #FFFFFF;
  --pf-body: rgba(255, 255, 255, 0.7);
  --pf-muted: rgba(255, 255, 255, 0.5);
  --pf-outline: rgba(255, 255, 255, 0.08);
  --pf-outline-strong: rgba(255, 255, 255, 0.12);
  --pf-hairline: rgba(255, 255, 255, 0.05);
  --pf-btn-bg: #FFFFFF;
  --pf-btn-fg: #171717;
  --pf-btn2-bg: #242424;
  --pf-btn2-fg: rgba(255, 255, 255, 0.7);
  --pf-accent: #FF813D;
  --pf-card-hover: #272727;
  --pf-hover-glow: rgba(0, 0, 0, 0.45);
  --font-serif: 'Roboto Serif', ui-serif, Georgia, serif;
  --font-sans: Figtree, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

html[data-theme="light"] {
  --pf-bg: #F4F3F1;
  --pf-card: #FFFFFF;
  --pf-chip: #ECEBE8;
  --pf-heading: #171717;
  --pf-body: rgba(23, 23, 23, 0.72);
  --pf-muted: rgba(23, 23, 23, 0.5);
  --pf-outline: rgba(23, 23, 23, 0.08);
  --pf-outline-strong: rgba(23, 23, 23, 0.14);
  --pf-hairline: rgba(23, 23, 23, 0.07);
  --pf-btn-bg: #171717;
  --pf-btn-fg: #FFFFFF;
  --pf-btn2-bg: #E9E8E5;
  --pf-btn2-fg: rgba(23, 23, 23, 0.72);
  --pf-card-hover: #FFFFFF;
  --pf-hover-glow: rgba(23, 23, 23, 0.10);
  color-scheme: light;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--pf-bg);
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--pf-body);
  transition: background-color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: none;
  vertical-align: -0.125em;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--pf-accent); color: #171717; }

/* ============================================================
   Edge glows — watery gradient clusters pinned to each side.
   Blobs morph on their own clocks; hue shifts with scroll via
   --glow-scroll (0..1, set in js/main.js).
   ============================================================ */
.glow {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 420px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  filter: saturate(1.15) hue-rotate(calc(var(--glow-scroll, 0) * 280deg));
}
.glow-left { left: -160px; }
.glow-right {
  right: -160px;
  filter: saturate(1.15) hue-rotate(calc(var(--glow-scroll, 0) * -220deg));
}
html[data-theme="light"] .glow { opacity: 0.45; }

.glow i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(44px);
  will-change: transform, translate, scale;
  scale: 1;
  transition: translate 1s cubic-bezier(0.22, 0.61, 0.36, 1), scale 1s ease;
}

/* Click burst: the blob collapses while four droplets (spans created
   in js/main.js) scatter in different directions, then reassemble. */
.glow i .d {
  position: absolute;
  width: 34%;
  height: 34%;
  top: 33%;
  left: 33%;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  transform: translate(0, 0) scale(0.4);
  transition: transform 0.7s cubic-bezier(0.16, 0.8, 0.3, 1), opacity 0.5s ease;
}
.glow i.is-burst { scale: 0.45; }
.glow i.is-burst .d { opacity: 1; }
.glow i.is-burst .d1 { transform: translate(-110px, -130px) scale(1); }
.glow i.is-burst .d2 { transform: translate(120px, -90px) scale(0.9); }
.glow i.is-burst .d3 { transform: translate(-95px, 115px) scale(0.85); }
.glow i.is-burst .d4 { transform: translate(105px, 125px) scale(1.05); }
.glow .g1 {
  width: 380px;
  height: 460px;
  top: 6%;
  left: 0;
  background: radial-gradient(closest-side, rgba(124, 140, 250, 0.85), transparent 72%);
  animation: glow-drift-a 18s ease-in-out infinite alternate;
}
.glow .g2 {
  width: 320px;
  height: 380px;
  top: 38%;
  left: 40px;
  background: radial-gradient(closest-side, rgba(227, 107, 240, 0.75), transparent 72%);
  animation: glow-drift-b 23s ease-in-out infinite alternate;
}
.glow .g3 {
  width: 300px;
  height: 340px;
  top: 66%;
  left: -20px;
  background: radial-gradient(closest-side, rgba(243, 217, 160, 0.7), transparent 72%);
  animation: glow-drift-c 15s ease-in-out infinite alternate;
}
/* Right side gets its own geometry, palette (teal/coral/rose/sky vs
   the left's periwinkle/magenta/cream), a fourth blob, and separate
   drift paths so the two sides never read as mirrors. */
.glow-right .g1 {
  width: 300px;
  height: 560px;
  top: -4%;
  left: 70px;
  background: radial-gradient(closest-side, rgba(94, 216, 190, 0.75), transparent 72%);
  animation: glow-drift-d 21s ease-in-out -7s infinite alternate;
}
.glow-right .g2 {
  width: 420px;
  height: 290px;
  top: 40%;
  left: -30px;
  background: radial-gradient(closest-side, rgba(255, 138, 101, 0.65), transparent 72%);
  animation: glow-drift-e 17s ease-in-out -4s infinite alternate;
}
.glow-right .g3 {
  width: 250px;
  height: 250px;
  top: 58%;
  left: 90px;
  background: radial-gradient(closest-side, rgba(244, 114, 182, 0.7), transparent 72%);
  animation: glow-drift-f 26s ease-in-out -11s infinite alternate;
}
.glow-right .g4 {
  width: 280px;
  height: 310px;
  top: 78%;
  left: 20px;
  background: radial-gradient(closest-side, rgba(125, 211, 252, 0.7), transparent 72%);
  animation: glow-drift-b 19s ease-in-out -9s infinite alternate;
}

@keyframes glow-drift-a {
  0% { transform: translate(0, 0) scale(1, 1); }
  50% { transform: translate(46px, -70px) scale(1.18, 0.92); }
  100% { transform: translate(-24px, 60px) scale(0.9, 1.12); }
}
@keyframes glow-drift-b {
  0% { transform: translate(0, 0) scale(1, 1); }
  50% { transform: translate(-40px, 56px) scale(0.88, 1.15); }
  100% { transform: translate(36px, -48px) scale(1.15, 0.9); }
}
@keyframes glow-drift-c {
  0% { transform: translate(0, 0) scale(1, 1); }
  50% { transform: translate(30px, 64px) scale(1.12, 1.04); }
  100% { transform: translate(-36px, -52px) scale(0.86, 0.94); }
}
@keyframes glow-drift-d {
  0% { transform: translate(0, 0) rotate(0deg) scale(1, 1); }
  50% { transform: translate(-34px, 70px) rotate(14deg) scale(0.92, 1.14); }
  100% { transform: translate(28px, -56px) rotate(-10deg) scale(1.12, 0.9); }
}
@keyframes glow-drift-e {
  0% { transform: translate(0, 0) rotate(0deg) scale(1, 1); }
  50% { transform: translate(44px, -40px) rotate(-16deg) scale(1.16, 0.88); }
  100% { transform: translate(-30px, 48px) rotate(9deg) scale(0.9, 1.1); }
}
@keyframes glow-drift-f {
  0% { transform: translate(0, 0) scale(1, 1); }
  50% { transform: translate(-26px, -58px) scale(1.22, 1.06); }
  100% { transform: translate(38px, 44px) scale(0.84, 0.92); }
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--pf-bg);
  transition: background-color 0.35s ease;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--pf-outline-strong);
}
.brand-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
  color: var(--pf-heading);
  transition: color 0.3s;
  white-space: nowrap;
}
.brand-tag {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--pf-muted);
  transition: color 0.3s;
}
.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.site-nav > a {
  font-size: 14px;
  line-height: 1.3;
  padding: 8px 0;
  color: var(--pf-body);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav > a:hover { color: var(--pf-heading); }

.theme-toggle {
  height: 30px;
  width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--pf-btn2-bg);
  color: var(--pf-btn2-fg);
  font-size: 16px;
  padding: 0;
  transition: background-color 0.3s, color 0.3s, opacity 0.2s;
}
.theme-toggle:hover { opacity: 0.85; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* ============================================================
   Shared section shell & typography
   ============================================================ */
.hero,
.section,
.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 170px 32px 0;
}
.section { scroll-margin-top: 24px; }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--pf-muted);
  transition: color 0.25s;
}
.eyebrow .slash { color: var(--pf-accent); }
.eyebrow-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow-icon .icon { font-size: 16px; }

.section-title {
  margin: 16px 0 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.3;
  color: var(--pf-heading);
  transition: color 0.3s;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 20px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s, opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary {
  background: var(--pf-btn-bg);
  color: var(--pf-btn-fg);
  font-weight: 700;
}
.btn-secondary {
  background: var(--pf-btn2-bg);
  color: var(--pf-btn2-fg);
  font-weight: 500;
}
.btn .icon { font-size: 16px; }

.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--pf-btn2-bg);
  color: var(--pf-btn2-fg);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s, opacity 0.2s;
}
.btn-chip:hover { opacity: 0.85; }
.btn-chip .icon { font-size: 14px; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 120px 32px 0; }

.hero-id {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-title {
  margin: 28px 0 0;
  max-width: 860px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--pf-heading);
  transition: color 0.3s;
  text-wrap: pretty;
}
.hero-lede {
  margin: 24px 0 0;
  max-width: 620px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--pf-body);
  transition: color 0.3s;
}
.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

@keyframes pf-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.hero-in { animation: pf-in 0.7s ease both; }
.hero-in-1 { animation-delay: 0.05s; }
.hero-in-2 { animation-delay: 0.15s; }
.hero-in-3 { animation-delay: 0.25s; }
.hero-in-4 { animation-delay: 0.35s; }

/* ============================================================
   Scroll reveals (JS adds .is-visible; no-JS shows everything)
   ============================================================ */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
[data-reveal] {
  transition: opacity 0.7s ease, transform 0.7s ease, background-color 0.35s ease, box-shadow 0.3s;
}

/* ============================================================
   Work
   ============================================================ */
.work-card {
  margin-top: 48px;
  background: var(--pf-card);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--pf-hairline), 0 16px 48px 0 transparent;
  padding: 44px 48px;
}
.work-card:hover {
  background: var(--pf-card-hover);
  box-shadow: inset 0 0 0 1px var(--pf-outline-strong), 0 16px 48px 0 var(--pf-hover-glow);
}
.work-card:hover .work-eyebrow { color: var(--pf-accent); }

.work-top {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}
.work-title {
  margin: 14px 0 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.3;
  color: var(--pf-heading);
  transition: color 0.3s;
}
.work-link {
  display: inline-flex;
  margin-left: 6px;
  font-size: 18px;
  color: var(--pf-muted);
  vertical-align: 2px;
  transition: color 0.2s;
}
.work-link:hover { color: var(--pf-accent); }
.work-desc {
  margin: 10px 0 0;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--pf-body);
  transition: color 0.3s;
}

.work-meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}
.work-meta dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--pf-muted);
}
.work-meta dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--pf-heading);
  transition: color 0.3s;
}

.work-shot {
  display: block;
  width: 100%;
  height: 600px;
  object-fit: cover;
  object-position: center top;
  margin-top: 36px;
  border-radius: 12px;
}
.work-shot.pos-center { object-position: center; }

.work-gallery {
  display: grid;
  gap: 24px;
  margin-top: 36px;
}
.work-gallery .work-shot { margin-top: 0; }
.work-gallery.cols-2 { grid-template-columns: 1fr 1fr; }
.work-gallery.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ============================================================
   Impact
   ============================================================ */
.stats-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
.stat {
  border-top: 1px solid var(--pf-outline-strong);
  padding-top: 24px;
}
.stat-num {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 54px;
  line-height: 1.1;
  color: var(--pf-heading);
  transition: color 0.3s;
}
.stat-label {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--pf-body);
}

/* ============================================================
   Beyond
   ============================================================ */
.beyond-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.beyond-card {
  background: var(--pf-card);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--pf-hairline);
  padding: 40px;
}
.beyond-card-flex {
  display: flex;
  flex-direction: column;
}
.beyond-title {
  margin: 14px 0 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.3;
  color: var(--pf-heading);
  transition: color 0.3s;
}
.beyond-desc {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--pf-body);
  transition: color 0.3s;
  text-wrap: pretty;
}
.inline-link {
  color: var(--pf-heading);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.inline-link:hover { color: var(--pf-accent); }
.icon-ext {
  font-size: 13px;
  margin-left: 3px;
  vertical-align: -1px;
}
.beyond-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
}
.beyond-stats > div {
  border-top: 1px solid var(--pf-outline);
  padding-top: 16px;
}
.beyond-num {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--pf-heading);
  transition: color 0.3s;
}
.beyond-label {
  margin-top: 4px;
  font-size: 13px;
  color: var(--pf-muted);
}
.beyond-accent {
  margin: 28px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--pf-accent);
}
.beyond-foot {
  margin-top: auto;
  padding-top: 28px;
}
.beyond-note {
  border-top: 1px solid var(--pf-outline);
  padding-top: 16px;
  font-size: 13px;
  color: var(--pf-muted);
}

/* ============================================================
   Contact
   ============================================================ */
.contact-card {
  background: var(--pf-card);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--pf-hairline);
  padding: 72px 64px;
  text-align: center;
}
.contact-title {
  margin: 20px 0 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.25;
  color: var(--pf-heading);
  transition: color 0.3s;
}
.contact-lede {
  margin: 16px auto 0;
  max-width: 480px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--pf-body);
  transition: color 0.3s;
}
.contact-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 140px 32px 72px;
  text-align: center;
}
.fin {
  display: inline-block;
  cursor: default;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 64px;
  line-height: 1.2;
  color: var(--pf-heading);
  transition: color 0.3s;
  user-select: none;
}
.colophon {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--pf-muted);
}
.footer-actions { margin-top: 28px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero,
  .section { padding: 110px 24px 0; }
  .hero { padding-top: 96px; }
  .site-footer { padding: 100px 24px 56px; }

  .hero-title { font-size: clamp(34px, 6vw, 46px); }

  .work-card { padding: 32px 28px; }
  .work-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .work-shot { height: 440px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px 28px;
  }
  .stat-num { font-size: clamp(38px, 7vw, 54px); }

  .beyond-grid { grid-template-columns: 1fr; }

  .contact-card { padding: 56px 32px; }
  .contact-title { font-size: 34px; }
}

@media (max-width: 700px) {
  .glow { width: 300px; opacity: 0.25; }
  .glow-left { left: -180px; }
  .glow-right { right: -180px; }

  .header-inner {
    padding: 8px 16px;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .brand-tag { display: none; }
  .site-nav { gap: 12px; }
  .site-nav > a { font-size: 13px; }

  .hero,
  .section { padding-left: 20px; padding-right: 20px; }
  .site-footer { padding-left: 20px; padding-right: 20px; }

  .work-card { padding: 24px 20px; }
  .work-meta { gap: 16px 20px; }
  .work-shot { height: 320px; }
  .work-gallery.cols-2,
  .work-gallery.cols-3 { grid-template-columns: 1fr; }
  .work-gallery .work-shot { height: 380px; }

  .hero-cta { flex-wrap: wrap; }
  .contact-cta { flex-wrap: wrap; }

  .beyond-card { padding: 28px 24px; }
  .fin { font-size: 48px; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-in { animation: none; }
  .glow i { animation: none; }
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
