/* ============================================================
   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-ring: #171717;
  --pf-glow: rgba(255, 255, 255, 0.04);
  --pf-rail-a: rgba(255, 255, 255, 0.4);
  --pf-rail-b: #FFFFFF;
  --pf-rail-c: rgba(255, 255, 255, 0.2);
  --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-ring: #EDECEA;
  --pf-glow: rgba(23, 23, 23, 0.05);
  --pf-rail-a: rgba(23, 23, 23, 0.25);
  --pf-rail-b: rgba(23, 23, 23, 0.6);
  --pf-rail-c: rgba(23, 23, 23, 0.1);
  --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; }

/* ============================================================
   Hairline rails
   ============================================================ */
/* Shown only on wide viewports (see media query below) where the
   1200px content column leaves real gutter room for them. */
.rails {
  position: fixed;
  top: 0;
  bottom: 0;
  display: none;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  pointer-events: none;
  z-index: 0;
}
@media (min-width: 1440px) {
  .rails { display: flex; }
}
.rails-left { left: -40px; }
.rails-right { right: -40px; }
.rails i {
  width: 1px;
  height: 100vh;
  opacity: 0.2;
  background: linear-gradient(180deg, var(--pf-rail-a) 0%, var(--pf-rail-b) 60%, var(--pf-rail-c) 100%);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--pf-bg);
  box-shadow: inset 0 -1px 0 var(--pf-outline);
  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-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-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--pf-outline-strong);
}
.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-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;
  box-shadow: 0 0 0 1px var(--pf-outline-strong), 0 4px 164px 0 var(--pf-glow);
}
.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) {
  .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; }
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
