/* =============================================================
   YOGENDRA LUNA — style.css
   Core design system: tokens, layout, components.
   Atmospheric / animation rules live in animations.css.
   Breakpoint overrides live in responsive.css.
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* palette (monochrome) */
  --bg:        #050505;
  --bg-soft:   #0b0b0c;
  --ink:       #ededeb;   /* off-white */
  --ink-dim:   #9a9a96;
  --ink-faint: #5a5a57;
  --line:      #232323;
  --line-soft: #161616;
  --accent:    #f3f3ef;   /* monochrome "highlight" */

  /* type */
  --font-pixel: "Press Start 2P", monospace;
  --font-mono:  "Space Mono", ui-monospace, "Courier New", monospace;

  /* spacing scale */
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section-pad: clamp(4rem, 10vw, 9rem);

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.6s;

  --maxw: 1440px;
}

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

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* clip full-bleed atmosphere overlays */
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  cursor: none; /* replaced by custom cursor on desktop; restored on touch */
}

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; }
em { font-style: normal; color: var(--ink); border-bottom: 1px solid var(--line); }

::selection { background: var(--ink); color: var(--bg); }

/* ---------- Accessibility ---------- */
/* Visible keyboard focus on every interactive element. Pointer users
   keep the clean look (no outline on :focus, only :focus-visible). */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Skip link — hidden until focused, then pinned top-left */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10000;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Layout helpers ---------- */
.nav,
.hero__inner,
.featured,
.footer {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* =============================================================
   NAVIGATION
   ============================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  margin-inline: auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: clamp(1rem, 2.5vw, 1.75rem);
  mix-blend-mode: difference; /* keeps nav legible over portrait */
}

.nav__brand {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.nav__brand-mark {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.nav__status {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.nav__status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.nav__about {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  border: 1px solid var(--line);
  padding: 0.7rem 1rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav__about:hover { background: var(--ink); color: var(--bg); }

/* =============================================================
   HERO
   ============================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: clamp(7rem, 14vh, 11rem) var(--section-pad);
  border-bottom: 1px solid var(--line);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  width: 100%;
}

/* ---- hero left ---- */
.hero__label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--ink-dim);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-family: var(--font-pixel);
  font-weight: 400;
  line-height: 1.05;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  letter-spacing: 0.01em;
  margin-bottom: 1.75rem;
}
.hero__title-line { display: block; }
.hero__title-line--outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  text-stroke: 1.5px var(--ink);
}

.hero__intro {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--ink-dim);
  max-width: 34ch;
  margin-bottom: 2.25rem;
}

/* CTA button */
.btn {
  --pad: 1rem 1.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--pad);
  border: 1px solid var(--ink);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  overflow: hidden;
  transition: color var(--dur) var(--ease);
  isolation: isolate;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform var(--dur) var(--ease);
  z-index: -1;
}
.btn:hover { color: var(--bg); }
.btn:hover::before { transform: translateY(0); }
.btn__arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* hero meta */
.hero__meta {
  margin-top: 2.5rem;
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
  font-size: 0.72rem;
  color: var(--ink-dim);
}
.hero__meta-key {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
}

/* ---- hero right / portrait ---- */
.hero__right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: visible;   /* never clip the spilling glow */
}

/* ---------------------------------------------------------------
   PORTRAIT — fully fused into the page. No card, no frame.
   Rules that guarantee zero perceptible boundary:
   (a) the wrapper IS the page black (--bg = #050505), identical to
       <body>, so the masked-away areas are indistinguishable.
   (b) overflow:visible so the glow is never clipped to a rectangle.
   (c) the image is dissolved by an aggressive radial mask AND any
       residual tone is repainted to the EXACT same #050505 by a
       pseudo-element vignette.
   --------------------------------------------------------------- */
.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: visible;
  background: var(--bg);   /* SAME black as the body — key fix */
  isolation: isolate;
  will-change: transform;
}

/* Moon / volumetric light. Bigger than the wrapper, screen-blended,
   radial falloff to fully transparent → softly disappears into black
   with no edge of its own. */
.portrait__moon {
  position: absolute;
  top: 28%;
  left: 50%;
  z-index: 1;
  width: 120%;            /* spills well beyond the wrapper */
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(240,240,235,0.90) 0%,
    rgba(200,200,196,0.50) 26%,
    rgba(120,120,116,0.18) 46%,
    rgba(40,40,38,0.05) 62%,
    transparent 70%);
  filter: blur(8px);
  mix-blend-mode: screen;   /* pure additive light, never a panel */
  pointer-events: none;
}

/* The portrait itself — monochrome, high contrast, blacks crushed to
   match the page. Aggressive radial mask dissolves every edge so the
   figure reads like smoke emerging from the dark. */
.portrait__img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  /* brightness<1 + high contrast crushes image-black toward #050505 */
  filter: grayscale(1) contrast(1.32) brightness(0.88);
  -webkit-mask-image: radial-gradient(ellipse 56% 62% at 50% 36%,
    rgba(0,0,0,1) 22%,
    rgba(0,0,0,0.92) 40%,
    rgba(0,0,0,0.4) 54%,
    transparent 66%);
  mask-image: radial-gradient(ellipse 56% 62% at 50% 36%,
    rgba(0,0,0,1) 22%,
    rgba(0,0,0,0.92) 40%,
    rgba(0,0,0,0.4) 54%,
    transparent 66%);
}

/* Inner glow lift — soft light behind the head, screen-blended so it
   only ever adds light and shares no edge with anything. */
.portrait::before {
  content: "";
  position: absolute;
  inset: -15%;            /* extends past the wrapper */
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 45% 45% at 50% 34%,
    rgba(255,255,255,0.10) 0%, transparent 60%);
  mix-blend-mode: screen;
}

/* Edge-kill vignette: transparent in the centre, resolving to the
   EXACT page black outward. Anything the mask left behind — including
   on huge monitors — is repainted to #050505 and merges seamlessly. */
.portrait::after {
  content: "";
  position: absolute;
  inset: -2%;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse 54% 60% at 50% 36%,
    transparent 36%,
    rgba(5,5,5,0.7) 52%,
    var(--bg) 64%);
}

/* tiny UI label (no box) */
.portrait__caption {
  position: absolute;
  z-index: 5;
  left: 0;
  bottom: 0.25rem;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}

/* hero index list under portrait */
.hero__index {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.hero__index li { display: flex; flex-direction: column; gap: 0.35rem; }
.hero__index span { color: var(--ink-faint); font-size: 0.5rem; }

/* socials bottom-right */
.socials {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  display: flex;
  gap: 0.5rem;
  z-index: 20;
}
.socials a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.socials a:hover { background: var(--ink); color: var(--bg); }

/* scroll cue */
.scroll-cue {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
}
.scroll-cue__bar {
  width: 48px; height: 1px;
  background: var(--ink-faint);
  position: relative;
  overflow: hidden;
}

/* corner decorations (reused on hero) */
.corner {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--ink-faint);
  z-index: 5;
}
.corner--tl { top: 1rem; left: 1rem; border-right: 0; border-bottom: 0; }
.corner--tr { top: 1rem; right: 1rem; border-left: 0; border-bottom: 0; }
.corner--bl { bottom: 1rem; left: 1rem; border-right: 0; border-top: 0; }
.corner--br { bottom: 1rem; right: 1rem; border-left: 0; border-top: 0; }

/* =============================================================
   FEATURED PROJECT (single)
   ============================================================= */
.featured {
  padding-block: var(--section-pad);
  border-top: 1px solid var(--line);
}
.featured__label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--ink-dim);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

/* the single project card — thin interface frame, cinematic spacing.
   The frame reads as a "viewport"; the artwork inside it is borderless
   and dissolves into the same black, so no image rectangle appears. */
.feature {
  border: 1px solid var(--line);
  background: var(--bg);          /* identical black to the page + image */
  transition: border-color var(--dur) var(--ease);
}
.feature:hover { border-color: var(--ink-faint); }

.feature__link {
  display: grid;
  grid-template-columns: 1.25fr 1fr;   /* artwork dominates */
  align-items: stretch;
  min-height: clamp(320px, 44vw, 480px);
}

/* ---- RESEARCH-TERMINAL VIEWPORT (Gaussian Splat point cloud) ---- */
.feature__thumb {
  position: relative;
  overflow: hidden;
  background: var(--bg);          /* same #050505 as page + image black */
  isolation: isolate;
}

/* ambient glow behind the reconstruction (additive, no edge) */
.feature__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 48% 46% at 50% 50%,
    rgba(220,220,214,0.10) 0%, rgba(120,120,116,0.03) 42%, transparent 68%);
  mix-blend-mode: screen;
  transition: opacity var(--dur) var(--ease);
  opacity: 0.85;
}

/* viewport wrapper — carries the subtle continuous FLOAT so it never
   collides with the JS parallax transform on the image itself. */
.feature__viewport {
  position: absolute;
  inset: 0;
  z-index: 1;
  animation: vp-float 9s ease-in-out infinite;
}
@keyframes vp-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* the point-cloud render itself.
   Source is already light-on-black → mix-blend-mode:screen makes the
   black areas contribute nothing (they show the page through), so the
   image fuses into #050505 with no rectangle. A soft radial mask adds
   cinematic falloff / breathing room at the edges. */
.feature__thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  filter: grayscale(1) contrast(1.12) brightness(1.06);
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 70% 66% at 50% 48%,
    #000 46%, rgba(0,0,0,0.6) 70%, transparent 90%);
  mask-image: radial-gradient(ellipse 70% 66% at 50% 48%,
    #000 46%, rgba(0,0,0,0.6) 70%, transparent 90%);
  transform: scale(1.02);          /* soft zoom */
  transition: transform 0.8s var(--ease), filter var(--dur) var(--ease);
  will-change: transform;
}

/* faint technical grid lines over the viewport (masked, never a box) */
.feature__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(237,237,235,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237,237,235,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 66% 62% at 50% 48%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 66% 62% at 50% 48%, #000 20%, transparent 80%);
}

/* faint scanlines */
.feature__thumb-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(255,255,255,0.03) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
  opacity: 0.6;
}

/* drifting CRT grain (subtle shimmer), boosted slightly on hover */
.feature__thumb-noise {
  position: absolute;
  inset: -20%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 130px 130px;
  mix-blend-mode: overlay;
  animation: grain-shift 0.5s steps(3) infinite;
  transition: opacity var(--dur) var(--ease);
}

/* edge-kill vignette → repaints residual tone to exact page-black */
.feature__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse 66% 62% at 50% 48%,
    transparent 56%, rgba(5,5,5,0.6) 76%, var(--bg) 92%);
}

/* hover: soft zoom + brightness response (parallax handled in JS) */
.feature__link:hover .feature__thumb-img {
  transform: scale(1.035);
  filter: grayscale(1) contrast(1.16) brightness(1.14);
}
.feature__link:hover .feature__thumb::before { opacity: 1; }
.feature__link:hover .feature__thumb-noise { opacity: 0.14; }

/* ---- viewport corner markers ---- */
.vp-corner {
  position: absolute;
  width: 14px; height: 14px;
  z-index: 4;
  border: 1px solid var(--ink-faint);
  opacity: 0.7;
  transition: opacity var(--dur) var(--ease);
}
.feature__link:hover .vp-corner { opacity: 1; }
.vp-corner--tl { top: 0.85rem; left: 0.85rem; border-right: 0; border-bottom: 0; }
.vp-corner--tr { top: 0.85rem; right: 0.85rem; border-left: 0; border-bottom: 0; }
.vp-corner--bl { bottom: 0.85rem; left: 0.85rem; border-right: 0; border-top: 0; }
.vp-corner--br { bottom: 0.85rem; right: 0.85rem; border-left: 0; border-top: 0; }

/* ---- terminal labels ---- */
.vp-label {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  pointer-events: none;
}
.vp-label--tl { top: 1.4rem; left: 1.6rem; }
.vp-label--tr { top: 1.4rem; right: 1.6rem; }
.vp-label--bl { bottom: 1.4rem; left: 1.6rem; }
.vp-label--br { bottom: 1.4rem; right: 1.6rem; color: var(--ink-faint); }

/* blinking indicators */
.feature__thumb-rec,
.vp-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.feature__thumb-rec { animation: rec-blink 1.6s steps(1) infinite; }
.vp-dot { background: var(--ink-dim); animation: rec-blink 2.2s steps(1) infinite; }
@keyframes rec-blink { 0%,60% { opacity: 1; } 61%,100% { opacity: 0.15; } }

/* project meta */
.feature__body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.feature__no {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--ink-dim);
}
.feature__title {
  font-family: var(--font-pixel);
  font-size: clamp(1.2rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  margin-top: auto;
}
.feature__desc {
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  color: var(--ink-dim);
  max-width: 38ch;
}
.feature__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.feature__tags span {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  padding: 0.2rem 0.45rem;
}
.feature__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}
.feature__cta-label { position: relative; }
.feature__cta-label::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.feature__link:hover .feature__cta-label::after { transform: scaleX(1); }
.feature__cta span:last-child { transition: transform var(--dur) var(--ease); }
.feature__link:hover .feature__cta span:last-child { transform: translateX(5px); }

/* =============================================================
   FOOTER
   ============================================================= */
.footer { padding-block: var(--section-pad) 2.5rem; }
.footer__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
  margin-bottom: 1.5rem;
}
.footer__big {
  font-family: var(--font-pixel);
  font-size: clamp(1.8rem, 8vw, 5rem);
  letter-spacing: 0.02em;
}
.footer__mail {
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  border-bottom: 1px solid var(--line);
  transition: border-color var(--dur) var(--ease);
}
.footer__mail:hover { border-color: var(--ink); }

.footer__meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}
