/* ==========================================================================
   Prakhya Bhageria — portfolio
   Dark, image-first layout in the spirit of ArtStation.
   ========================================================================== */

:root {
  --bg: #0a0a0c;
  --bg-2: #101013;
  --surface: #151518;
  --surface-2: #1c1c21;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ecebe8;
  --text-2: #b4b3ae;
  --muted: #7f7f88;
  --accent: #e9a64b;
  --accent-2: #ffc477;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1480px;
  --gutter: clamp(16px, 4vw, 56px);
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, iframe { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #111; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }
em { font-style: normal; color: var(--text); }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container.narrow { max-width: 1140px; }
.page-head { padding-bottom: 0 !important; }
.page-head .section-title { margin-top: 10px; }
.section-grid { padding: clamp(32px, 4vw, 48px) 0 clamp(64px, 9vw, 128px); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #111; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}
.section-title { font-size: clamp(28px, 3.4vw, 44px); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 36px; }
.section-head .eyebrow { margin-bottom: 10px; }
.section { padding-block: clamp(64px, 9vw, 128px); }
.section + .section { border-top: 1px solid var(--line); }

/* --- Nav -------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand small { font-family: var(--font-body); font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; display: none; }
@media (min-width: 800px) { .brand small { display: inline; } }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2); transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-links a.btn { margin-left: 8px; }
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 8px; align-items: center; justify-content: center; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); position: relative; transition: transform .25s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--text); transition: transform .25s, top .25s; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
.nav.open .nav-toggle span { background: transparent; }
.nav.open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav.open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }
@media (max-width: 720px) {
  .nav-inner { height: auto; flex-wrap: wrap; padding: 14px 0 10px; gap: 6px 0; }
  .brand { flex: 1 1 100%; font-size: 16px; }
  .nav-links { flex: 1 1 100%; gap: 2px; margin-left: -10px; }
  .nav-links a { padding: 8px 10px; font-size: 14px; }
  .nav-links a.btn { margin-left: auto; padding: 7px 12px; }
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px;
  font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid var(--line-2); color: var(--text);
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.28); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #141210; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn svg { width: 16px; height: 16px; }
.nav-links a.btn { padding: 8px 14px; font-size: 13px; color: var(--text); }

/* --- Hero + reel (home) ---------------------------------------------- */
.hero { position: relative; padding: clamp(48px, 7vw, 104px) 0 clamp(48px, 6vw, 88px); overflow: hidden; isolation: isolate; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background: url("../img/palace-of-solitude/cover.webp") center 35% / cover no-repeat;
  filter: blur(28px) saturate(1.1); transform: scale(1.15); opacity: 0.32;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
}
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(10,10,12,0.35), rgba(10,10,12,0) 40%, var(--bg) 100%); pointer-events: none; }
.hero-inner { text-align: center; margin-bottom: clamp(24px, 3vw, 40px); }
.hero h1 { font-size: clamp(38px, 6.4vw, 92px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; margin: 12px 0 18px; text-shadow: 0 2px 30px rgba(0,0,0,0.5); }
.hero-sub { font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-2); }
.reel-wrap { margin-inline: auto; }

.reel-wrap { max-width: 1120px; }
.reel-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: #000; border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 50px 120px -30px rgba(0,0,0,0.9), 0 0 0 1px rgba(0,0,0,0.6);
}
.reel-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel-actions { display: flex; justify-content: center; margin-top: clamp(28px, 4vw, 44px); }

/* --- Work grid -------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.5vw, 36px) clamp(14px, 2vw, 28px); align-items: start; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .grid { grid-template-columns: 1fr; } }
.card { display: block; position: relative; }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #0c0c0f; border: 1px solid var(--line); transition: border-color .25s, box-shadow .25s; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }   /* thumbs are pre-cut to exact 16:9 (build/make_thumbs.py), so no browser cropping */
.card:hover .card-media, .card:focus-visible .card-media { border-color: rgba(233,166,75,0.55); box-shadow: 0 12px 40px -12px rgba(0,0,0,0.8); }
.card-body { padding: 14px 4px 0; }
.card-body h3 { font-size: 17px; font-weight: 600; transition: color .2s; }
.card:hover .card-body h3 { color: var(--accent-2); }
.card-body p { font-size: 13px; color: var(--muted); white-space: nowrap; }
.card-body .sub { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; font-weight: 400; font-family: var(--font-body); letter-spacing: 0; }

/* --- Links ------------------------------------------------------------ */
.links-hero { min-height: calc(100vh - 68px); display: flex; flex-direction: column; justify-content: center; padding-top: clamp(40px, 6vw, 80px); }
.links-bg { background-image: url("../img/dream-short-film/cover.webp"); background-position: center 60%; }
.link-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); max-width: 1120px; margin-inline: auto; }
@media (max-width: 860px) { .link-cards { grid-template-columns: 1fr; max-width: 520px; } }
.link-card {
  position: relative; display: grid; gap: 6px; padding: clamp(24px, 3vw, 36px);
  border-radius: 16px; background: rgba(21,21,24,0.72); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .35s var(--ease), border-color .25s, background .25s, box-shadow .35s;
}
.link-card:hover, .link-card:focus-visible { transform: translateY(-4px); border-color: rgba(233,166,75,0.6); background: rgba(28,28,33,0.85); box-shadow: 0 30px 60px -30px rgba(0,0,0,0.9), 0 0 0 1px rgba(233,166,75,0.15); }
.link-card .icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(233,166,75,0.1); border: 1px solid rgba(233,166,75,0.25); color: var(--accent); margin-bottom: 18px; transition: background .25s, color .25s; }
.link-card .icon svg { width: 24px; height: 24px; }
.link-card:hover .icon { background: var(--accent); color: #141210; }
.link-card .label { font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.link-card .value { font-family: var(--font-display); font-size: clamp(17px, 1.5vw, 21px); font-weight: 600; letter-spacing: -0.01em; word-break: break-word; transition: color .2s; }
.link-card:hover .value { color: var(--accent-2); }
.link-card .go { position: absolute; top: 22px; right: 22px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--muted); transition: all .25s; }
.link-card .go svg { width: 16px; height: 16px; }
.link-card:hover .go { color: #141210; background: var(--accent); border-color: var(--accent); }

.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer a:hover { color: var(--text); }

/* --- Project page ----------------------------------------------------- */
.project-head { padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 36px; transition: color .2s; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; }
.project-head h1 { font-size: clamp(38px, 6vw, 84px); letter-spacing: -0.03em; margin: 14px 0 28px; max-width: 16ch; }
.intro { font-size: clamp(17px, 1.35vw, 20px); color: var(--text-2); line-height: 1.65; max-width: 70ch; }

.project-body { display: flex; flex-direction: column; gap: clamp(16px, 2vw, 24px); padding-bottom: clamp(48px, 7vw, 96px); }

/* Rows mirror the original Elementor layout: every item in a row is the SAME HEIGHT and its width
   comes from its own aspect ratio (flex-grow = ratio, flex-basis = 0). Nothing is cropped or stretched. */
.media-row { display: flex; align-items: flex-start; gap: clamp(12px, 1.8vw, 24px); }
.media-row .media-item { flex: var(--ar, 1.7778) 1 0; min-width: 0; margin: 0; }
.media-item img, .media-item video, .media-item .embed { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.media-item img { cursor: zoom-in; transition: border-color .3s; }
.media-item img:hover { border-color: var(--line-2); }
.media-item video { background: #000; }
.media-item .embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.media-item .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-item .video-link { position: relative; display: block; border-radius: var(--radius); overflow: hidden; }
.media-item .video-link img { cursor: pointer; border: 1px solid var(--line); }
.media-item .video-link .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px 12px 16px; border-radius: 999px; background: rgba(10,10,12,0.72); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.25); font-family: var(--font-display); font-weight: 600; font-size: 14px; color: #fff; transition: background .2s, transform .2s var(--ease); }
.media-item .video-link .play svg { width: 22px; height: 22px; color: var(--accent); }
.media-item .video-link:hover .play { background: rgba(233,166,75,0.9); color: #141210; transform: translate(-50%, -50%) scale(1.04); }
.media-item .video-link:hover .play svg { color: #141210; }
.media-item figcaption { color: var(--text-2); font-size: 15px; line-height: 1.55; padding: 10px 2px 0; }
@media (max-width: 640px) { .media-row { flex-direction: column; } .media-row .media-item { flex: none; width: 100%; } }

.caption { color: var(--text-2); font-size: 16px; line-height: 1.6; max-width: 70ch; padding: 0 2px; margin-top: -2px; }
.caption + .media-item, .caption + .media-video, .caption + .vimeo { margin-top: clamp(16px, 3vw, 40px); }

.project-nav { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.project-nav a { padding: 36px var(--gutter); display: flex; flex-direction: column; gap: 6px; transition: background .25s; }
.project-nav a:hover { background: var(--bg-2); }
.project-nav a + a { border-left: 1px solid var(--line); text-align: right; align-items: flex-end; }
.project-nav .label { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.project-nav .title { font-family: var(--font-display); font-size: clamp(18px, 2.2vw, 28px); font-weight: 600; }
.project-nav .title span { color: var(--accent); }
@media (max-width: 640px) { .project-nav { grid-template-columns: 1fr; } .project-nav a + a { border-left: 0; border-top: 1px solid var(--line); } }

/* --- Lightbox --------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(6,6,8,0.94); display: none; align-items: center; justify-content: center; padding: 56px 16px 48px; }
.lightbox.open { display: flex; }
.lightbox img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); animation: lb-in .25s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.lightbox button { position: absolute; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.06); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--text); transition: background .2s; }
.lightbox button:hover { background: rgba(255,255,255,0.14); }
.lightbox button svg { width: 20px; height: 20px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-caption { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: var(--text-2); font-size: 13px; max-width: 80%; text-align: center; }
.lb-count { position: absolute; top: 28px; left: 24px; color: var(--muted); font-size: 13px; font-family: var(--font-display); }
@media (max-width: 640px) { .lb-prev, .lb-next { display: none; } }

/* --- Reveal ----------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
