/* ==========================================================
   style.css — the look of the site
   The colours live in "variables" at the top. Dark and light
   mode just swap these variables, so everything else follows.
   ========================================================== */

:root {
  --font: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  --radius: 22px;
  --ease: cubic-bezier(.22, .8, .24, 1);   /* smooth "Apple-like" easing */
  --crimson: #c8102e;
  --gold: #f5a623;
}

/* DARK mode colours */
[data-theme="dark"] {
  --bg: #07090f;
  --bg-2: #0d111b;
  --text: #f2f4f8;
  --muted: #9aa3b5;
  --line: rgba(255, 255, 255, .09);
  --glass: rgba(255, 255, 255, .045);
  --glass-strong: rgba(14, 18, 28, .72);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* LIGHT mode colours */
[data-theme="light"] {
  --bg: #f5f6f9;
  --bg-2: #ffffff;
  --text: #0b0f19;
  --muted: #5b6475;
  --line: rgba(10, 20, 40, .1);
  --glass: rgba(255, 255, 255, .7);
  --glass-strong: rgba(255, 255, 255, .78);
  --shadow: 0 30px 70px -35px rgba(20, 30, 60, .35);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* smooth colour fade when switching theme */
  transition: background-color .5s var(--ease), color .5s var(--ease);
  animation: pageIn .8s var(--ease) both;   /* page fades in on load */
}
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* Nepali text needs a little more line height */
html[lang="ne"] body { line-height: 1.75; }

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* Language crossfade: text fades out, changes, fades back in */
[data-i18n], .projects { transition: opacity .25s var(--ease); }
.lang-switching [data-i18n], .lang-switching .projects { opacity: 0; }

/* ---------- Glass card (blur behind) ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

/* ---------- MENU BAR ---------- */
.nav {
  position: fixed; inset: 14px 14px auto; z-index: 50;
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
}
/* after scrolling a bit, the bar becomes glass */
.nav.scrolled {
  background: var(--glass-strong);
  border-color: var(--line);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.brand { font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--crimson); }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  text-decoration: none; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-size: .95rem; font-weight: 500;
  transition: color .25s, background .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--glass); }

.nav-tools { display: flex; align-items: center; gap: 6px; }

.lang { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.lang button { padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); transition: all .25s; }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  transition: background .25s;
}
.icon-btn:hover { background: var(--glass); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .moon { fill: currentColor; stroke: none; }
/* show the moon in light mode, the sun in dark mode */
[data-theme="dark"] .moon, [data-theme="light"] .sun { display: none; }

.menu-btn { display: none; position: relative; }
.menu-btn span {
  position: absolute; left: 11px; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor; transition: transform .35s var(--ease);
}
.menu-btn span:first-child { transform: translateY(-4px); }
.menu-btn span:last-child { transform: translateY(4px); }
.menu-open .menu-btn span:first-child { transform: rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 120px 20px 80px; overflow: hidden;
}
#hero3d { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }
[data-theme="light"] #hero3d { opacity: .55; }
/* soft shade behind the text so it always reads clearly */
.hero-content::before {
  content: ""; position: absolute; inset: -40px -60px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 55%, transparent 100%);
  opacity: .85; pointer-events: none;
}
/* soft glow used if 3D cannot run */
.hero-fallback {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(40% 35% at 50% 45%, rgba(200, 16, 46, .28), transparent 70%),
    radial-gradient(35% 30% at 60% 55%, rgba(245, 166, 35, .18), transparent 70%);
}
.hero-content { position: relative; z-index: 1; max-width: 760px; isolation: isolate; }

.avatar {
  width: 112px; height: 112px; margin: 0 auto 22px;
  border-radius: 50%; padding: 3px;
  background: conic-gradient(from 200deg, var(--crimson), var(--gold), #3e8bff, var(--crimson));
  box-shadow: 0 20px 60px -15px rgba(200, 16, 46, .5);
}
.avatar img, .avatar span {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center;
  background: var(--bg-2); font-size: 2.6rem; font-weight: 800;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 1.05;
  letter-spacing: -.035em; font-weight: 800;
}
html[lang="ne"] h1 { letter-spacing: 0; line-height: 1.25; }
.tagline {
  margin-top: 14px; font-size: clamp(1rem, 2.2vw, 1.3rem); font-weight: 600;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro { margin: 14px auto 0; max-width: 560px; color: var(--muted); font-size: 1.05rem; }

.hero-buttons { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s, background .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--text); color: var(--bg); box-shadow: 0 12px 30px -12px rgba(200, 16, 46, .55); }
.btn.ghost { border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; translate: -50% 0;
  width: 24px; height: 38px; border: 2px solid var(--line); border-radius: 14px;
}
.scroll-hint span {
  position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--muted); animation: wheel 1.8s infinite var(--ease);
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- SECTIONS ---------- */
.section { max-width: 1100px; margin: 0 auto; padding: 110px 20px 40px; }
.section-head { text-align: center; margin-bottom: 48px; }
h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -.03em; font-weight: 800; }
html[lang="ne"] h2 { letter-spacing: 0; }
.section-head p { color: var(--muted); margin-top: 6px; }

/* ---------- PROJECT CARDS ---------- */
.projects { display: grid; gap: 28px; }
.project {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 34px;
  padding: 34px; position: relative; overflow: hidden;
  transition: transform .5s var(--ease), border-color .4s;
}
.project::before {             /* soft coloured glow in the corner */
  content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: var(--accent); opacity: .13; filter: blur(80px);
  top: -140px; right: -120px; pointer-events: none;
}
.project:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.p-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.p-icon {
  width: 64px; height: 64px; border-radius: 18px; flex: none; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; color: #fff;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #000));
  box-shadow: 0 14px 30px -12px var(--accent);
}
.p-icon img { width: 100%; height: 100%; object-fit: cover; }
.p-head h3 { font-size: 1.6rem; letter-spacing: -.02em; }
.p-tagline { color: var(--accent); font-weight: 600; font-size: .95rem; }
.badge {
  display: inline-block; margin-left: 8px; padding: 2px 10px; vertical-align: middle;
  font-size: .72rem; font-weight: 600; border-radius: 999px;
  color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
}
.p-desc { color: var(--muted); }
.p-features { list-style: none; margin: 20px 0 24px; display: grid; gap: 9px; }
.p-features li { display: flex; gap: 10px; align-items: flex-start; }
.p-features li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, transparent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.p-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
html[lang="ne"] .p-label { text-transform: none; letter-spacing: 0; }

.p-links { display: flex; flex-wrap: wrap; gap: 10px; }
.p-link {
  padding: 9px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--line); background: var(--glass);
  transition: background .25s, transform .25s var(--ease);
}
a.p-link:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.p-link.soon { opacity: .55; cursor: default; }
.p-link small { font-weight: 500; opacity: .75; margin-left: 4px; }

/* Namaste Facts: one platform with NE / EN channels */
.p-platform { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); font-size: .9rem; font-weight: 600; }
.p-platform .chip { padding: 4px 10px; border-radius: 999px; font-size: .75rem; text-decoration: none; background: var(--bg-2); border: 1px solid var(--line); }
.p-platform a.chip:hover { background: var(--accent); color: #111; }
.p-platform span.chip { opacity: .5; }

/* screenshot gallery: swipe sideways on phone */
.gallery {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 8px; align-self: center; scrollbar-width: thin;
}
.gallery button, .shot-empty {
  flex: none; width: 200px; aspect-ratio: 9 / 19; border-radius: 20px; overflow: hidden;
  scroll-snap-align: start; border: 1px solid var(--line);
}
.gallery button img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery button:hover img { transform: scale(1.04); }
.shot-empty {
  display: grid; place-items: center; text-align: center; padding: 16px;
  color: var(--muted); font-size: .85rem;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--glass);
}
.shot-empty.logo { aspect-ratio: 1; width: 260px; }
.shot-empty.logo img { width: 70%; margin: 0 auto 10px; }

/* ---------- ABOUT & CONTACT ---------- */
.about, .contact { padding: 44px; max-width: 760px; margin: 0 auto; }
.bio { margin-top: 14px; font-size: 1.1rem; }
.from { margin-top: 10px; color: var(--muted); }
.about h3 { margin: 30px 0 12px; font-size: 1rem; }
.social { display: flex; flex-wrap: wrap; gap: 10px; }
.social a {
  padding: 10px 18px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--line); background: var(--glass);
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.social a:hover { background: var(--text); color: var(--bg); transform: translateY(-2px); }

.contact > p { color: var(--muted); margin-top: 6px; }
form { margin-top: 26px; display: grid; gap: 16px; }
label span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
input, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 15px; transition: border-color .25s, box-shadow .25s; resize: vertical;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 20%, transparent); }
.invalid { border-color: var(--crimson); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
form .btn { justify-self: start; }
form .btn[disabled] { opacity: .6; cursor: wait; }
.form-status { min-height: 1.6em; font-weight: 500; }
.form-status.ok { color: #2fbf71; }
.form-status.err { color: var(--crimson); }

.footer { text-align: center; color: var(--muted); padding: 60px 20px 40px; font-size: .9rem; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 30px;
  background: rgba(0, 0, 0, .82); backdrop-filter: blur(10px);
  animation: fadeIn .3s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 88vh; border-radius: 18px; animation: zoomIn .4s var(--ease); }
.lb-close { position: absolute; top: 18px; right: 18px; color: #fff; font-size: 1.2rem; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes zoomIn { from { transform: scale(.92); opacity: 0; } }

/* ---------- SCROLL REVEAL (things glide in) ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

.noscript { text-align: center; padding: 20px; }

/* ---------- PHONE & TABLET ---------- */
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; padding: 26px; }
  .gallery button, .shot-empty { width: 170px; }
}
@media (max-width: 720px) {
  .menu-btn { display: grid; }
  .nav { padding: 8px 8px 8px 18px; }
  /* phone menu slides down from the bar */
  .nav-links {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    flex-direction: column; padding: 10px; border-radius: 24px;
    background: var(--glass-strong); border: 1px solid var(--line);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    opacity: 0; transform: translateY(-10px) scale(.98); pointer-events: none;
    transition: opacity .35s var(--ease), transform .35s var(--ease);
  }
  .nav-links a { padding: 14px 18px; font-size: 1.05rem; }
  .menu-open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .menu-open .nav { background: var(--glass-strong); border-color: var(--line); }
  .about, .contact { padding: 28px 22px; }
  .section { padding-top: 90px; }
}

/* People who ask their device for less motion get no animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
