/* ============================================================
   Anish Shrestha — Portfolio
   Fonts: Pixelify Sans (display) + Inter (body)
   ============================================================ */

:root {
  --bg:        #0e0e0e;
  --bg-soft:   #161616;
  --card:      #1a1a1a;
  --text:      #f5f5f5;
  --muted:     #9a9a9a;
  --line:      #2a2a2a;
  --accent:    #a6e22e;
  --accent-dim:#7fae22;
  --maxw:      1200px;
  --pad:       clamp(20px, 5vw, 64px);
  --radius:    14px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.display {
  font-family: "Pixelify Sans", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.05;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

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

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  background: rgba(14,14,14,0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .logo { font-family: "Pixelify Sans", sans-serif; font-size: 20px; font-weight: 700; }
.nav .logo .accent { color: var(--accent); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 14px; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.btn { color: var(--bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent); color: var(--bg);
  font-weight: 600; font-size: 14px;
  padding: 11px 20px; border-radius: 100px;
  transition: transform .15s ease, background .2s;
}
.btn:hover { transform: translateY(-2px); background: #b6f23e; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: clamp(70px, 12vw, 150px) 0 clamp(50px, 8vw, 90px); position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero::before {
  content: ""; position: absolute; top: -10%; left: 50%;
  width: 80vw; height: 80vw; max-width: 820px; max-height: 820px;
  background: radial-gradient(circle, rgba(166,226,46,0.16), transparent 62%);
  z-index: 0; pointer-events: none;
  animation: floatGlow 10s ease-in-out infinite alternate;
}
@keyframes floatGlow {
  from { transform: translate(-58%, -4%) scale(1); }
  to   { transform: translate(-44%, 6%) scale(1.18); }
}
.hero .eyebrow {
  font-family: "Pixelify Sans", sans-serif;
  color: var(--accent); font-size: 15px; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 22px;
}
/* Rotating circular typography on the right of the hero (bleeds off the edge) */
.hero-curve {
  position: absolute; top: 50%; right: -22%;
  width: min(64vw, 720px); aspect-ratio: 1; height: auto;
  transform: translateY(-50%);
  z-index: 0; pointer-events: none; opacity: 0.9;
}
.hero-curve text {
  font-family: "Pixelify Sans", sans-serif; font-weight: 600;
  font-size: 35px; letter-spacing: 0; fill: var(--text);
}
.hero-curve .star { fill: var(--accent); }
@media (max-width: 900px) { .hero-curve { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero-curve { display: none; } }
.hero h1 {
  font-size: clamp(44px, 9vw, 110px);
  margin-bottom: 26px;
}
.hero .sub {
  font-size: clamp(17px, 2.2vw, 22px);
  color: var(--muted); max-width: 620px; margin-bottom: 36px;
}
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero .loc {
  margin-top: 34px; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.hero .loc::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}

/* ---------- Typography marquee ---------- */
.marquee {
  overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-soft); padding: 24px 0;
}
.marquee-track {
  display: inline-flex; white-space: nowrap;
  will-change: transform;
  animation: marquee 30s linear infinite;
}
.marquee-group {
  font-size: clamp(26px, 5vw, 54px);
  letter-spacing: 2px; color: var(--text);
  padding-right: 0;
}
.marquee-group .accent { color: var(--accent); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Section headers ---------- */
.section { padding: clamp(50px, 8vw, 100px) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 44px; flex-wrap: wrap; gap: 12px; }
.section-head h2 { font-size: clamp(28px, 5vw, 52px); }
.section-head .count { color: var(--muted); font-size: 14px; font-family: "Pixelify Sans", sans-serif; }

/* ---------- Work grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.work-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transform-style: preserve-3d; will-change: transform;
  transition: transform .18s ease, border-color .25s, box-shadow .35s;
}
.work-card:hover {
  transform: translateY(-6px); border-color: var(--accent);
  box-shadow: 0 22px 55px rgba(0,0,0,0.55), 0 0 42px rgba(166,226,46,0.18);
}
.work-card .thumb { aspect-ratio: 16 / 11; overflow: hidden; background: var(--bg-soft); }
.work-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.work-card:hover .thumb img { transform: scale(1.1); }
/* Thumbnails that need a tighter crop */
.work-card .thumb img.zoomed { transform: scale(1.4); }
.work-card:hover .thumb img.zoomed { transform: scale(1.48); }
.work-card .meta { padding: 20px 22px 24px; }
.work-card .meta .cat { color: var(--accent); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; font-family: "Pixelify Sans", sans-serif; transition: letter-spacing .3s ease, text-shadow .3s; }
.work-card:hover .meta .cat { letter-spacing: 3px; text-shadow: 0 0 14px rgba(166,226,46,0.6); }
.work-card .meta h3 { font-size: 23px; margin-top: 7px; }
.work-card .meta .arrow { color: var(--muted); font-size: 14px; margin-top: 12px; transition: transform .25s ease, color .25s; }
.work-card:hover .meta .arrow { color: var(--accent); transform: translateX(8px); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about p { color: var(--muted); margin-bottom: 18px; }
.about p strong { color: var(--text); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.tag {
  font-family: "Pixelify Sans", sans-serif; font-size: 12px;
  border: 1px solid var(--line); color: var(--muted);
  padding: 7px 14px; border-radius: 100px;
}
.about h4 { font-family:"Pixelify Sans",sans-serif; font-size: 14px; color: var(--accent); letter-spacing:1px; text-transform: uppercase; margin: 26px 0 14px; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 26px;
  transition: border-color .25s, transform .25s;
}
.service:hover { border-color: var(--accent); transform: translateY(-4px); }
.service .num { font-family:"Pixelify Sans",sans-serif; color: var(--accent); font-size: 26px; }
.service h3 { font-size: 21px; margin: 14px 0 10px; }
.service p { color: var(--muted); font-size: 15px; }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; padding: clamp(70px,10vw,130px) 0; border-top: 1px solid var(--line); }
.contact h2 { font-size: clamp(32px, 7vw, 76px); margin-bottom: 22px; }
.contact .email { display:inline-block; font-size: clamp(18px,3vw,26px); color: var(--accent); margin-bottom: 36px; border-bottom: 2px solid transparent; transition: border-color .2s; }
.contact .email:hover { border-color: var(--accent); }
/* ----- Contact form ----- */
.contact-lead { color: var(--muted); max-width: 480px; margin: 0 auto 34px; }
.contact-form { max-width: 560px; margin: 0 auto; text-align: center; }
.contact-form .field { margin-bottom: 14px; }
.contact-form input, .contact-form textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-family: inherit; font-size: 16px;
  padding: 14px 16px; border-radius: 12px; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); }
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(166,226,46,0.16);
}
.contact-form .btn { cursor: pointer; border: none; font-family: inherit; margin-top: 6px; }
.contact-form .btn:disabled { opacity: .7; cursor: default; transform: none; }
.hidden-field { display: none; }
.form-status { margin-top: 16px; font-size: 15px; }
.form-status.ok  { color: var(--accent); }
.form-status.err { color: #ff6b6b; }
.contact-or { color: var(--muted); font-size: 14px; margin: 28px 0 32px; }
.contact-or .email-inline { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s; }
.contact-or .email-inline:hover { border-color: var(--accent); }

.socials { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; }
.socials a { color: var(--muted); font-size: 14px; transition: color .2s; }
.socials a:hover { color: var(--text); }
.footer-bottom { text-align: center; padding: 30px var(--pad); color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* ---------- Project / gallery pages ---------- */
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 36px 0 0; transition: color .2s; }
.back:hover { color: var(--accent); }
.proj-hero { padding: 40px 0 30px; }
.proj-hero .cat { font-family:"Pixelify Sans",sans-serif; color: var(--accent); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.proj-hero h1 { font-size: clamp(38px, 8vw, 84px); margin: 16px 0 22px; }
.proj-hero .intro { color: var(--muted); max-width: 680px; font-size: 18px; }
.proj-hero .role { margin-top: 22px; color: var(--muted); font-size: 14px; }
.proj-hero .role span { color: var(--text); }

.stack { display: flex; flex-direction: column; gap: 22px; padding: 30px 0 10px; }
.stack figure { background: var(--card); border:1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stack figure img { width: 100%; }
.stack figcaption { padding: 14px 20px; color: var(--muted); font-size: 14px; }

.gallery { columns: 3; column-gap: 20px; padding: 20px 0; }
.gallery img { width: 100%; margin-bottom: 20px; border-radius: 10px; border: 1px solid var(--line); break-inside: avoid; }

/* Vertical looping motion wall (illustrations) */
.motion-wall {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  height: 210vh; min-height: 1200px; overflow: hidden; padding: 24px 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
}
.mw-col { overflow: hidden; }
.mw-track {
  display: flex; flex-direction: column; gap: 16px;
  animation: mwUp 60s linear infinite; will-change: transform;
}
.mw-track.reverse { animation-name: mwDown; animation-duration: 72s; }
.mw-track img {
  width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line);
  transition: transform .4s, box-shadow .4s;
}
.mw-track img:hover { transform: scale(1.03); box-shadow: 0 16px 44px rgba(0,0,0,0.55); }
.motion-wall:hover .mw-track { animation-play-state: paused; }
@keyframes mwUp   { from { transform: translateY(0); }     to { transform: translateY(-50%); } }
@keyframes mwDown { from { transform: translateY(-50%); }  to { transform: translateY(0); } }
@media (max-width: 820px) { .motion-wall { grid-template-columns: repeat(2, 1fr); height: 180vh; min-height: 900px; } }
@media (max-width: 480px) { .motion-wall { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .mw-track { animation: none; }
  .motion-wall { height: auto; overflow: visible; -webkit-mask-image: none; mask-image: none; }
}

/* Single-column vertical stack — flush, no gaps, no rounded corners */
.gallery-vertical { display: flex; flex-direction: column; gap: 0; padding: 20px 0; }
.gallery-vertical img, .gallery-vertical video { width: 100%; display: block; border-radius: 0; border: 0; margin: 0; }

/* Motion card placeholder thumbnail (until a real cover image / video is added) */
.thumb-motion {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 30% 28%, rgba(166,226,46,0.20), transparent 58%),
    linear-gradient(135deg, #1d1d1d, #0e0e0e);
}
.thumb-motion .motion-badge {
  font-family: "Pixelify Sans", sans-serif; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 100px;
  padding: 9px 18px; font-size: 13px; letter-spacing: 1px;
  background: rgba(14,14,14,0.4);
}

/* Motion video collage — masonry wall of looping clips */
.video-collage { columns: 3; column-gap: 16px; padding: 20px 0; }
.video-collage video {
  width: 100%; margin-bottom: 16px; display: block; background: #000;
  border-radius: 12px; border: 1px solid var(--line); break-inside: avoid;
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s, border-color .3s;
}
.video-collage video:hover {
  transform: scale(1.03); border-color: var(--accent);
  box-shadow: 0 20px 55px rgba(0,0,0,0.6), 0 0 38px rgba(166,226,46,0.15);
  position: relative; z-index: 3;
}
@media (max-width: 820px) { .video-collage { columns: 2; } }
@media (max-width: 480px) { .video-collage { columns: 1; } }

/* ----- In-gallery hover motion (per work category) ----- */
/* Collage images: zoom + lift out of the grid */
.gallery img { transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .4s, filter .4s; }
.gallery img:hover { transform: scale(1.05); box-shadow: 0 20px 55px rgba(0,0,0,0.6); position: relative; z-index: 3; }
/* Vertical flush gallery: subtle pop + brighten (no overlap chaos) */
.gallery-vertical img { transition: transform .55s cubic-bezier(.2,.7,.2,1), filter .4s; position: relative; }
.gallery-vertical img:hover { transform: scale(1.015); filter: brightness(1.07) saturate(1.05); z-index: 3; }
/* Stack figures (e.g. Tony's Dawg): lift + accent glow */
.stack figure { transition: transform .35s ease, border-color .3s, box-shadow .4s; }
.stack figure:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 20px 55px rgba(0,0,0,0.5), 0 0 38px rgba(166,226,46,0.15); }

.placeholder {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 50px 24px; text-align: center; color: var(--muted);
  background: var(--bg-soft);
}
.placeholder .display { color: var(--text); font-size: 20px; margin-bottom: 8px; display:block; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Motion ---------- */

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), #d6ff6b);
  box-shadow: 0 0 12px var(--accent);
  z-index: 100; pointer-events: none;
}

/* Hero staggered entrance on load */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}
.hero .eyebrow, .hero h1, .hero .sub, .hero .actions, .hero .loc {
  opacity: 0; animation: riseIn .85s cubic-bezier(.2,.7,.2,1) forwards;
}
.hero .eyebrow { animation-delay: .05s; }
.hero h1       { animation-delay: .18s; }
.hero .sub     { animation-delay: .34s; }
.hero .actions { animation-delay: .48s; }
.hero .loc     { animation-delay: .60s; }

/* Nav link underline wipe */
.nav-links a:not(.btn) { position: relative; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s ease;
}
.nav-links a:not(.btn):hover::after { width: 100%; }

/* Nav gains depth once scrolled */
.nav { transition: background .3s, box-shadow .3s, padding .3s; }
.nav.scrolled { background: rgba(14,14,14,0.9); box-shadow: 0 8px 30px rgba(0,0,0,0.4); padding-top: 12px; padding-bottom: 12px; }

/* Tag hover pop */
.tag { transition: border-color .2s, color .2s, transform .2s; }
.tag:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero .eyebrow, .hero h1, .hero .sub, .hero .actions, .hero .loc { opacity: 1; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .work-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .services { grid-template-columns: 1fr; }
  .gallery { columns: 2; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 480px) {
  .gallery { columns: 1; }
}
