/* =============================================
   R-X02 PORTFOLIO — Rahul Kumar
   Palette: deep black / charcoal / off-white / deep blue / red
   Font: Playwrite NZ
   ============================================= */

/* ---- Variables ---- */
:root {
  --bg: #0a0a0b;
  --bg-2: #111114;
  --fg: #ececec;
  --fg-dim: #9a9a9e;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #c9202a;
  --deep-blue: #0e1d3a;
  --off-white: #efeae1;
  --radius: 2px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --header-h: 64px;
}

[data-theme="light"] {
  --bg: #efeae1;
  --bg-2: #e4ddd1;
  --fg: #0a0a0b;
  --fg-dim: #4a4a52;
  --line: rgba(0, 0, 0, 0.10);
  --accent: #b21a23;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: "Playwrite NZ", "Times New Roman", serif;
  font-weight: 200;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}


/* ================================================
   LOADER
   ================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .8s var(--ease), visibility .8s var(--ease);
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner {
  text-align: center;
}

.loader__text {
  font-size: 2rem;
  letter-spacing: .3em;
  color: var(--fg);
  display: block;
  margin-bottom: 1.2rem;
}

.loader__bar {
  width: 220px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
  margin: 0 auto;
}

.loader__fill {
  width: 0;
  height: 100%;
  background: var(--accent);
  animation: loadbar 1.6s var(--ease) forwards;
}

@keyframes loadbar {
  to {
    width: 100%;
  }
}


/* ================================================
   HEADER & NAV
   ================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  height: var(--header-h);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  border-bottom: 1px solid var(--line);
  transition: padding .4s var(--ease), background .4s var(--ease), box-shadow .4s;
}

/* Scrolled — slightly slimmer */
.site-header.scrolled {
  padding: .7rem 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}

.logo img {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
  transition: opacity .3s;
}

.logo:hover img {
  opacity: .75;
}

[data-theme="light"] .logo img {
  filter: invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, .1));
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: lowercase;
  color: var(--fg-dim);
  position: relative;
  padding: .25rem 0;
  transition: color .3s;
}

.nav a:hover,
.nav a.active {
  color: var(--fg);
}

.nav a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: border-color .3s, transform .3s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: rotate(20deg);
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* Burger */
.burger {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.burger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--fg);
  transition: transform .35s var(--ease), opacity .25s;
  transform-origin: center;
}

/* X state when open */
.burger.open span:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger.open span:last-child {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav */
@media (max-width: 760px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 70%;
    max-width: 280px;
    background: var(--bg-2);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform .5s var(--ease);
    border-left: 1px solid var(--line);
    z-index: 49;
  }

  .nav.open {
    transform: translateX(0);
  }

  .nav a {
    font-size: 1.2rem;
  }

  .burger {
    display: flex;
  }
}


/* ================================================
   HERO (index.html)
   ================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(.4) brightness(.45) contrast(1.15);
  transform: scale(1.05);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at center, transparent 0%, var(--bg) 90%),
    linear-gradient(180deg, transparent 50%, var(--bg) 100%);
}

.hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 900px;
}

.hero__eyebrow {
  font-size: .8rem;
  letter-spacing: .3em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero__title {
  font-size: clamp(3.5rem, 14vw, 11rem);
  font-weight: 200;
  line-height: .95;
  letter-spacing: -.02em;
  display: flex;
  justify-content: center;
  gap: .02em;
}

.hero__title .accent {
  color: var(--accent);
}

.hero__sub {
  margin: 2rem auto 2.5rem;
  max-width: 480px;
  color: var(--fg-dim);
  font-size: 1rem;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 1px;
  height: 50px;
  background: var(--line);
  overflow: hidden;
}

.scroll-hint span {
  display: block;
  width: 100%;
  height: 50%;
  background: var(--accent);
  animation: scrolldown 1.8s var(--ease) infinite;
}

@keyframes scrolldown {
  0% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(200%);
  }
}


/* ================================================
   BUTTONS
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.6rem;
  border: 1px solid var(--line);
  font-size: .85rem;
  letter-spacing: .15em;
  text-transform: lowercase;
  color: var(--fg);
  transition: border-color .35s var(--ease), color .35s var(--ease), transform .35s var(--ease);
  border-radius: var(--radius);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
}

.btn--wa {
  background: var(--deep-blue);
  color: var(--off-white);
  border-color: transparent;
}

.btn--wa:hover {
  background: var(--accent);
  color: var(--off-white);
  transform: translateY(-2px);
}


/* ================================================
   INTRO (index.html)
   ================================================ */
.intro {
  padding: 8rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.intro__lead {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.45;
  max-width: 780px;
  margin-bottom: 5rem;
}

.intro__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 3rem;
}

.intro__cell {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.intro__cell .num {
  display: block;
  color: var(--accent);
  font-size: .85rem;
  letter-spacing: .2em;
  margin-bottom: 1rem;
}

.intro__cell h3 {
  font-weight: 200;
  font-size: 1.4rem;
  margin-bottom: .75rem;
}

.intro__cell p {
  color: var(--fg-dim);
  font-size: .95rem;
  line-height: 1.6;
}


/* ================================================
   MARQUEE (index.html)
   ================================================ */
.marquee {
  overflow: hidden;
  padding: 2rem 0;
  border-block: 1px solid var(--line);
  background: var(--bg-2);
}

.marquee__track {
  display: flex;
  white-space: nowrap;
  animation: scroll-x 36s linear infinite;
}

.marquee__track span {
  font-size: clamp(2rem, 6vw, 4.5rem);
  color: var(--fg);
  opacity: .85;
  padding-right: 2rem;
}

@keyframes scroll-x {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}


/* ================================================
   CTA (index.html)
   ================================================ */
.cta {
  text-align: center;
  padding: 10rem 2rem;
}

.cta h2 {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 200;
  margin-bottom: 2.5rem;
  line-height: 1.05;
}


/* ================================================
   ABOUT
   ================================================ */
.about {
  padding: 10rem 2rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
}

.about__hero {
  margin-bottom: 5rem;
}

.about__title {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 200;
  line-height: 1;
  margin-bottom: 1rem;
}

.about__kicker {
  color: var(--fg-dim);
  letter-spacing: .15em;
}

.about__body {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
}

.about__photo {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.about__photo img {
  width: 100%;
  border-radius: var(--radius);
  filter: grayscale(.3) contrast(1.05);
  transition: filter .5s;
}

.about__photo:hover img {
  filter: grayscale(0) contrast(1);
}

.about__photo figcaption {
  margin-top: .8rem;
  color: var(--fg-dim);
  font-size: .85rem;
  letter-spacing: .15em;
}

.about__text p {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  color: var(--fg);
}

.about__text em {
  color: var(--fg-dim);
}

.about__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

@media (max-width: 800px) {
  .about__body {
    grid-template-columns: 1fr;
  }

  .about__photo {
    position: static;
  }
}


/* ================================================
   LIGHTBOX
   ================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 7, .96);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.lightbox.open {
  display: flex;
  animation: fadein .35s var(--ease);
}

@keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lb-stage {
  max-width: 78vw;
  max-height: 82vh;
  text-align: center;
}

.lb-stage img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid var(--line);
  transition: opacity .25s ease;
}

.lb-stage figcaption {
  margin-top: 1rem;
  color: var(--fg-dim);
  letter-spacing: .2em;
  font-size: .8rem;
  text-transform: uppercase;
}

.lb-close {
  position: absolute;
  top: 1.4rem;
  right: 1.8rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--off-white);
  transition: color .3s, transform .3s;
}

.lb-close:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

.lb-nav {
  padding: .8rem 1.4rem;
  border: 1px solid var(--line);
  color: var(--off-white);
  letter-spacing: .15em;
  font-size: .85rem;
  text-transform: lowercase;
  transition: border-color .35s var(--ease), color .35s var(--ease);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .02);
}

.lb-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lb-prev {
  margin-right: 1.5rem;
}

.lb-next {
  margin-left: 1.5rem;
}

@media (max-width: 700px) {
  .lightbox {
    padding: 1rem;
    flex-wrap: wrap;
  }

  .lb-prev,
  .lb-next {
    position: fixed;
    bottom: 1.5rem;
    margin: 0;
  }

  .lb-prev {
    left: 1rem;
  }

  .lb-next {
    right: 1rem;
  }

  .lb-stage {
    max-width: 100%;
  }
}


/* ================================================
   CONTACT
   ================================================ */
.contact {
  padding: 10rem 2rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
}

.contact__hero {
  margin-bottom: 5rem;
}

.contact__hero h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 200;
  line-height: 1;
  margin-bottom: 1rem;
}

.contact__hero p {
  color: var(--fg-dim);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact__form label {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.contact__form label span {
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.contact__form input,
.contact__form textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: .7rem 0;
  color: var(--fg);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .3s;
}

.contact__form input::placeholder,
.contact__form textarea::placeholder {
  color: var(--fg-dim);
  opacity: .5;
}

.contact__form input:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact__form textarea {
  resize: vertical;
}

.contact__form .btn {
  align-self: flex-start;
  margin-top: 1rem;
}

.form-note {
  font-size: .8rem;
  color: var(--fg-dim);
}

.form-note strong {
  color: var(--fg);
}

.contact__side {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-top: .5rem;
}

.contact__block .label {
  display: block;
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: .6rem;
}

.contact__block a {
  font-size: 1.1rem;
}

@media (max-width: 800px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
}


/* ================================================
   FOOTER
   ================================================ */
.site-footer {
  /* relative positioning anchors .foot-line below */
  position: relative;
  padding: 2.5rem 2rem 1.8rem;
  border-top: 1px solid var(--line);
}

.foot-line {
  position: absolute;
  top: -1px;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--accent);
  animation: linegrow 2.4s var(--ease) .3s forwards;
}

@keyframes linegrow {
  to {
    width: 100%;
  }
}

.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}

.foot-copy {
  font-size: .8rem;
  letter-spacing: .12em;
  color: var(--fg-dim);
  text-transform: lowercase;
}

.foot-text {
  font-size: .8rem;
  letter-spacing: .35em;
  color: var(--fg-dim);
  text-transform: lowercase;
}


/* ================================================
   SCROLL REVEAL UTILITIES
   ================================================ */
.reveal,
.reveal-up {
  opacity: 0;
}

.reveal {
  transform: translateY(20px);
}

.reveal-up {
  transform: translateY(40px);
}

.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}


/* ================================================
   SELECTION
   ================================================ */
::selection {
  background: var(--accent);
  color: var(--off-white);
}


/* ================================================
   ACCESSIBILITY — reduced motion
   ================================================ */
@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-up {
    opacity: 1;
    transform: none;
  }
}
